This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import threading | |
class PeriodicThread(object): | |
""" | |
Python periodic Thread using Timer with instant cancellation | |
""" | |
def __init__(self, callback=None, period=1, name=None, *args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cypreess@wierzba:~$ . /usr/local/bin/virtualenvwrapper.sh | |
cypreess@wierzba:~$ mkvirtualenv test1 | |
New python executable in test1/bin/python2.7 | |
Also creating executable in test1/bin/python | |
Installing setuptools............done. | |
Installing pip...............done. | |
(test1)cypreess@wierzba:~$ pip install -e git+https://github.com/agh-glk/plp.git#egg=plp-dev | |
Obtaining plp from git+https://github.com/agh-glk/plp.git#egg=plp-dev | |
Cloning https://github.com/agh-glk/plp.git to ./.virtualenvs/test1/src/plp | |
Unpacking objects: 100% (19/19), done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cypreess@iMac ~ cat f.cc | |
#include <stdio.h> | |
int main(){ | |
unsigned char a = 255; | |
unsigned long int b = (a << 24); | |
unsigned long int c = ((unsigned long int) a << 24); | |
printf("b=%lu\n", b); | |
printf("c=%lu\n", c); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |
NewerOlder