22 Mar'15

Programming Arduino Pro Mini with USBasp V2.0

UPD 2016-05-14: Arduino Nano with CH340 ships from Aliexpress for less than $2 – I recommend you buy it instead (unless you know what you’re doing).

Do you really need to pay $25 for an Arduino? Many of my friends have the original Arduino and they work great, but I wanted to see how cheap I can go. Initially, I purchased the SunFounder Starter Kit and it worked 100% as ...

Continue reading

02 Apr'13

Grave accent in C# class names

For generic interfaces, the name parameter is the mangled name, ending with a grave accent (`) and the number of type parameters. This is true for both generic interface definitions and constructed generic interfaces. For example, to find IExample<T> (IExample(Of T) in Visual Basic) or IExample<string> (IExample(Of String) in Visual Basic), search for “IExample`1”.

From Type.GetInterface Method (String) MSDN reference page

Continue reading

05 Mar'13




Introduction to the Design and Analysis of Algorithms (3rd Edition)

Algorithms (4th Edition)

The Algorithm Design Manual

Algorithms in a Nutshell

Continue reading

08 Feb'12

Nonblocking console input in Python

By Nemesis Fixx:

import sys
import select
import tty
import termios
from threading import Thread

program_run = True
input_thread_timeout = 0.005 #seconds
quit_key = '\x1b' # x1b is ESC

#check stdin for input...
def isData():
        return select.select([sys.stdin], [], [], 0) == ([sys.stdin], [], [])

#check n terminate program on terminal condition,
#from a separate thread
class waitOnInput(Thread):
    def run(self):
        old_settings = termios.tcgetattr(sys.stdin)
            global program_run ...

Continue reading

11 Jan'12

PyOpenCl on x64 system

UPD: I found unofficial binary builds here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl, use x86 builds.

Do not forget to install pytools.

I’ve been into some difficulties since i began installing that software, even with help of http://wiki.tiker.net/PyOpenCL/Installation/Windows.

First, easy_install won’t work on x64 systems if installed by executable installer. Instead, use ez_setup.py which will determine the correct version ...

Continue reading