Arduino Sketch upload issue – avrdude: stk500_recv(): programmer is not responding

I had this problem with a Crowduino, running the Arduino IDE on OS X. The solution for me was to switch on verbose output during upload (in the Arduino IDE preferences pane). Then, when uploading, you can see AVRDUDE sending three packets avrdude: Send: 0 [30] [20] (with corresponding RX flashes on the board) right before the avrdude: ser_recv(): programmer is … Read more

ValueError: invalid literal for int() with base 10: ”

I am creating a program that reads a file and if the first line of the file is not blank, it reads the next four lines. Calculations are performed on those lines and then the next line is read. If that line is not empty it continues. However, I am getting this error: ValueError: invalid … Read more

Why do we need virtual functions in C++?

Here is how I understood not just what virtual functions are, but why they’re required: Let’s say you have these two classes: In your main function: So far so good, right? Animals eat generic food, cats eat rats, all without virtual. Let’s change it a little now so that eat() is called via an intermediate function (a trivial function just … Read more

Static methods in Python?

Yep, using the staticmethod decorator Note that some code might use the old method of defining a static method, using staticmethod as a function rather than a decorator. This should only be used if you have to support ancient versions of Python (2.2 and 2.3) This is entirely identical to the first example (using @staticmethod), just not using the nice … Read more

bash: pip: command not found

Why not just do sudo easy_install pip or if this is for python 2.6 sudo easy_install-2.6 pip? This installs pip using the default python package installer system and saves you the hassle of manual set-up all at the same time. This will allow you to then run the pip command for python package installation as it will be installed with … Read more