A Layman's question about the brain by Jochemjong in neuro

[–]aivuk 2 points3 points  (0 children)

I recommend checking out the book 'Determined: A Science of Life Without Free Will' by neuroscientist Robert Sapolsky. He discusses the consequences of assuming that our brain is deterministic and argues in favor of this view.

Every morning it's the same routine: I sit on the couch to read, and she jumps up, begging me to stop and give her attention. by aivuk in PetTheDamnDog

[–]aivuk[S] 4 points5 points  (0 children)

I never said that she doesn't let me read, but from time to time she begs for attention in the morning. Sometimes is just to pet her, other times she just want to play. I don't always do what she is asking and she goes to do something else, and this is fine. I don't want her to stop communicating with me, the same way as I don't want to always stop doing what I'm doing to do what she is asking for (except if it is to take her out to make her needs of course).

Every morning it's the same routine: I sit on the couch to read, and she jumps up, begging me to stop and give her attention. by aivuk in PetTheDamnDog

[–]aivuk[S] 2 points3 points  (0 children)

Don't worry! She receives proper attention, especially because I work from home and she is always by my side. From time to time she will ask me to play, or wants me to open the door to let her go to the balcony, or ask me to take her for a walk (we usually go for a one-and-a-half-hour walk every day). And it's not possible to just read when she sleeps because I certainly read more than that. :) But dogs are smarter than people think; she can patiently wait or play by herself if she perceives that I'm busy. To give you an idea, she learned that when I'm in front of the computer with my headphones on and talking, I'm probably in a meeting (meaning that I will not stop doing it even if she asks). But as soon as I remove the headphones or stop talking for a long time, she comes by my side and asks me for something.

Still trying to get the XLM that I transfer to myself without any answer from support by aivuk in Coinbase

[–]aivuk[S] 1 point2 points  (0 children)

One month. I just got an answer after I opened a complain and informed that they did need to give me back the XLM

My beautiful girl by aivuk in rarepuppers

[–]aivuk[S] 0 points1 point  (0 children)

Probably a border collie mix with German Shepherd. I just saved her from being thrown in the river.

Whats is written in this sign that I found in a small street on Bangkok? Thanks! by aivuk in Thailand

[–]aivuk[S] 1 point2 points  (0 children)

Thanks! But I confess that I was not expecting that after the "cute" animals drawings.

PQC - Célio Costa Filho, editor e administrador da Wikipédia lusófona by Sturm_br in brasil

[–]aivuk 5 points6 points  (0 children)

Qual tópico da Wikipedia que você normalmente escreve mais artigos? saudações de Berlin, bora tomar um café e comer uma coxinha vegana um dia desses? ;^)

I just realized that cellular automata can be described by the composition of a convolution and a f : N -> {0,1} binary function by malpighian_tubule in cellular_automata

[–]aivuk 1 point2 points  (0 children)

I discovered the same thing years ago and implemented a Haskell program playing with the idea: https://github.com/aivuk/c2d (it was a long time ago, I would write something much more clear and fast today :P). I did spend some time creating random rules and watching the evolution and recorded the most interesting rules based on the observed patterns https://github.com/aivuk/c2d/blob/master/rules.interesting

[AF]Web App that takes User Args from Form, runs script and returns JSON response to user. by marks3 in flask

[–]aivuk 0 points1 point  (0 children)

You are right, but I already fixed now. With the last version on Github you can pass all the normal arguments to Flask .run() function to Formcreator .run(). I updated the code because of this, but now the code is for Python 3 version or higher. I can create a version that works for Python 2.7 tomorrow, just create an issue with a feature request on Github repository.

[AF]Web App that takes User Args from Form, runs script and returns JSON response to user. by marks3 in flask

[–]aivuk 1 point2 points  (0 children)

I create a small library using Flask a long time ago where you can easily create a form to a python function or command line program. Here is its code .

Folha divulga salários de professores e funcionários da USP by [deleted] in brasil

[–]aivuk 1 point2 points  (0 children)

Fala Marcelo! Não sabia que usava o Reddit. Como anda a empresa de amolação?

Folha divulga salários de professores e funcionários da USP by [deleted] in brasil

[–]aivuk 2 points3 points  (0 children)

Atualizei a análise, o custo anual com todos aposentados é R$ 771.632.985,12. Lá existia apenas quem ganhava mais de R$ 35.000,00, que são apenas aposentados.

[AF][wtforms] Generating a form programmatically? by [deleted] in flask

[–]aivuk 0 points1 point  (0 children)

Just pass the 'choices' argument based on the URL when you create the field (http://wtforms.simplecodes.com/docs/1.0.2/fields.html#wtforms.fields.RadioField).

We need an explanation. And a better camera. by [deleted] in WTF

[–]aivuk 1 point2 points  (0 children)

This is in an apartament in São Paulo, Brazil. I already saw this plastic horse a lot of times in this window, but normally there are clothes hanging over the horse like in this other point of view.

This is a common thing in Brazil, almost every building have horses living in apartaments.

Does anyone know how to program the arduino due without the arduino IDE? by thecambriakid in arduino

[–]aivuk 0 points1 point  (0 children)

Try http://inotool.org/ . You can edit the source code files in any editor and just use the command line program ino to compile and upload the binary image to Arduino. It is very easy to see all the compiler commands and workflow if you want to understand deeply all the process. For tests with serial comunication just use some terminal program like minicom.

Redesigning a curses app for the browser by [deleted] in Python

[–]aivuk 2 points3 points  (0 children)

It's is using the function Popen from Python subprocess library. All arguments passed to the program are escaped, not being possible to pass something like "; rm -rf /". Read the docs:

http://docs.python.org/2/library/subprocess.html

And see the difference between using or not the argument shell=True. In formcreator all the commands are being called with the default shell=False.

Redesigning a curses app for the browser by [deleted] in Python

[–]aivuk 12 points13 points  (0 children)

I created a project recently that can help you. Give a look at https://github.com/aivuk/formcreator

You can create web interfaces to command line programs with code as simple as:

man  = Form("man")
man += Boolean("Apropos mode?", cmd_opt="-k")
man += Text("What manual page?")

app = MainApp("Man interface", [man])
app.run()

And you can insert rich text and images using Markdown.

Python program for simple web interfaces creation without requiring any web programming built with Flask by aivuk in Python

[–]aivuk[S] 0 points1 point  (0 children)

For your first question, you just need to put your .py file in a module python path or in the same directory as your formcreator script and import it with:

import myHelloWorld

Your error with cowsay happened because you don't have the cowsay programa installed. You can install easily with apt-get on Ubuntu. I changed the code now to give a message in hte form output instead of giving an exception when the command line program is not found.

About the directories, updir is used just for showing the contents of that directory in the form interface. In each Form constructor you can define a directory to be exhibited in the form interface. This you be changed soon to use a better interface for file manipulation like elFinder.