Showing posts with label software development. Show all posts
Showing posts with label software development. Show all posts

2014-02-08

An AI engine for letterpress in golang

I just open sourced a thing I experimented with in golang few months ago.
Letterpress is a letter game on iOS and has a clone named Spell Strike on Android.
This is an AI engine that plays ... well way too well.
Don't spoil the fun: Enjoy responsibly !
You can find the repo here

2013-03-30

Python support for the Lego WeDo kit

I started playing with my son on his Lego WeDo kit using the Scratch language on his Rasberry pi.

It felt a little bit limited on that and found some basic python code on github from Ian Daniher to drive it.

and, I could not help it ... I debugged it, pythonized it, documented it and published it properly on Pypi !

To install it:
pip install wedo
To initialize it if you have a single device:
>>> from wedo import WeDo
>>> wd = WeDo()
Activating the first motor full forward:
>>> wd.motor_a = 100

Activating the second motor half speed/force backward:
>>> wd.motor_b = -50

Current value of the tilt sensor, you can find the matching constants FLAT, TILT_BACK, TILT_FORWARD, TILT_LEFT, TILT_RIGHT in the wedo package:
>>> wd.tilt
3

Current distance value in meters of the distance sensor:
>>> wd.distance
0.21

Feel free to contribute to the project on github. Enjoy !

2012-07-08

Why do I love to break my system ?

Beeing on the linux gentoo beta (~amd64) for my desktop machines is often seen by people as a pure "loss of productivity" as a software developer.

Yes it brakes sometimes... But for me those breakages (most of the time) worth it, it keeps me aware of the inner workings of my system.

When would I look for how the bluetooth system is related to udev if my BT mouse did not work this morning after the udev upgrade ?

This kind of system knowledge gives you as a software engineer some depth, it makes you see a larger picture than just the logic of your code. It makes you a better developer.

Once I helped a medior developer to solve a performance issue in his Java code he could not solve :
The classic trap of the database round tripping. Retreiving a list of ids then going to the database for each one of them. His answer when I finger pointed it was : "but Java is optimizing that !!".
The guy had no clue about system, networking, database drivers, database optimization engine, disk accesses.. For him he is just working on a "magical" system that applies his logic the most efficient way.

As a general attitude, I really recommend to my fellow engineers : break your systems ! hack your kernel, tinker with compilation options, try out new stuff like wayland or any other experimental systems... Push back the limits, learn what your code is calling, then what this code is calling then again and again until you find yourself reading about how a CPU uses his caches lines and optimize branch predictions...

At the end of the day it will make you a better software engineer, perhaps you will loose some immediate productivity but at the end of the day you will produce better code and be able to solve problems that are way more complex than simple logic flaws in your code path.