Archive for the ‘Programming’ Category

Boost::python str to std::string

As with everything in Boost::Python, it might not always be obvious how to best extract certain types to C++ One thing to remember is that most (if not all) C++ types are supported by boost::python::extract So, to extract a std::string object from python, it’s best to use the extract function again: std::string tmp; tmp = [...]

Read the rest of this entry »

Simple cron init.d status checker

Simple cron script to check the status of some init.d daemon/script and restart it if necessary, shown in the example with postgresql, but should work with about any init.d script. #!/bin/sh SCRIPT=postgresql /etc/init.d/$SCRIPT status if [ "$?" != "0" ]; then /etc/init.d/$SCRIPT start fi

Read the rest of this entry »

boost::python iterating over dictionaries

When working with boost::python, it’s quickly noticeable the lack of documentation involved in integrating Python in a C++ application, however using boost::python is a lot easier then using the normal Python/C API so it’s recommended to whomever considers using Python in a C++ application. Tricky The downside of it is the lack of examples, and [...]

Read the rest of this entry »

Howto: Hide flash

When using flash and lightbox (and lookalikes) it’s a common issue that the flash movie which should be under the lightbox pops out of there (often in weird places and not 100%) So, an elegant way to solve this in Javascript would be to have the flash moved or disappeared. Hide it (display none) Using [...]

Read the rest of this entry »

PHP – dynamic vars in classes

As I’m all about python, and pythonic is the way I speak any coding language, I had a challenge in finding a way to dynamically implement new variables in a class. Unlike python, in which this is very simply done by: class MyClass: def __init__(self): self.newvar = ‘value’ self.newvar2 = ‘bla’ It’s quite the challenge [...]

Read the rest of this entry »

MySQLdb insert queries not working?

So, you’re here on some quest to solve an issue where you do any amount of insert queries through MySQLdb but it doesn’t appear in the database? Well, I had exactly that issue. Took me ages to figure out why after moving an app to another server (with by design the same database, except for [...]

Read the rest of this entry »

[Android] Netbeans plugin in the make

Sorry for the late idleness, I’ve been quite busy elsewhere. Nonetheless, there’s some nice work going on with the android platform, again. This time someone has published his current work status in creating a Netbeans plugin to emulate the Android OS. Screenshots are found here: http://picasaweb.google.com/joerg.ruethschilling/AndroidPluginForNetbeans I’m definitely using that one when it’s out there, [...]

Read the rest of this entry »

[DroidDraw] A guide to android widgets

The creator of DroidDraw is certainly busy, for he published another tutorial concerning how-to in certain graphical aspects of Android. This time, it’s about how Android widgets work. Be sure to read it, it’s literally a 2 minute read to knowing the deal with Android widgets, great summary.

Read the rest of this entry »

DroidDraw – tutorial

I’ve mentioned droiddraw earlier in this blog. Since then, the developer of the only gui building program for android at the moment has been quite busy, and been following “Release early, release often” cycles. He’s also made a tutorial on how to use the gui builder, certainly worth your time! I’m expecting a great deal [...]

Read the rest of this entry »

Android for blind users?

Today I saw a post concerning about the seeing impaired people who could use android for the best, if only there was some sort of screen reader software running on Android. Something was said about not being able to implement that because of certain security reasons, but that probably referred to independent software reading what [...]

Read the rest of this entry »