Bit hack optimizations

20 05 2008

I came across Sean Eron Anderson’s Bit Twiddling Hacks page today, where all these awkward optimizations are collected that are faster than generated machine code from the compiler for common tasks. Using those was common practice when people were still coding in Assembler and needed to get the most out of their CPUs, and it probably still finds use in programming today when speed is of the essence.

A link on that page went to Paul Hsie’s Assembly Language Lab where you can find fast code for dividing by a constant and multiplying with a constant. The latter page has a warning that because it is over 235K of HTML, browsers may fail to render the page correctly. Very cute. :)





Help with regular expressions

4 05 2008

Mastering regular expressions can quickly become a non-trivial task. While good text editors like e.g. Kate, KWrite or TextPad have good support for regular expressions, it can be difficult to construct complex regexps, and even more so to find out why they don’t work as intended if they fail.

I have found two resources which help with that: first, the Javascript Regular Expression Validator from net shift media, which takes a regular expression from you and provides two input fields for tests which can be matched against the expression – instantly, no need to press any buttons and wait for an answer. This is very handy to find out if there was a typo in your logic somewhere.

If you need more help in debugging your expressions, then Dr. Edmund Weitz’s RegEx Coach might be able to help. This Windows program (there’s an outdated, discountinued Linux version, too) will take you through the evaluation of your regular expression, step by step:

The Regex Coach screenshot





Educational videos on Reverse Engineering

30 10 2007

You have to debug a program. How can this be done? Two very good resources show you how to do it in video:

Lena’s “Reversing for Newbies” shows you how to use the free debugger OllyDbg. Just watching the very first video already teaches you much about using the debugger.

The Reverse Code Engineering Video Website uses the IDA debugger on the same example programs as above, showing how this graph based debugger can help to understand a program. There’s another video on IDA usage on the official website, too.





par2cmdline with Intel Thread Building Blocks

25 10 2007

Somebody took the sources for the par2 software, added multi-threading support for it with Intel’s Threading Building Blocks and promptly received an award for it. The minimal changes to the original code have been documented. Since the recovery blocks can be calculated independently from each other, parallelizing this process was obvious. Nice to see that somebody did this for a software which I love both for its application of mathematics and practical use.





How to recover a lost PPPoE password

10 10 2007

Our DSL provider recently upgraded our internet connection to 6 Mbps. This lead to problems with our DSL modem, though, because it was over 5 years old and wasn’t designed for this. As a result, the modem didn’t sync anymore and we were left without net access for a couple of days until a replacement was shipped to us. The problem: The replacement was DSL modem and router in one, and required configuration, including the original login and password for our DSL service. The documents couldn’t be found and we didn’t want go through the hassle of resetting our account and wait for a new password, so I tried to retrieve it from the old DSL router (a D-Link box) instead. Here’s how:
Read the rest of this entry »





Automating web browsers with Selenium

24 09 2007

I have a new fun toy to play with: Selenium makes it possible for you to automate web tasks. After you start the Selenium server (a java command line program) you can get access to the browsers you have installed (Firefox, MSIE, Opera, Konqueror, you name it) and use the Selenium API to simulate user interaction with the browser in your favorite programming language (Java, Perl, PHP, Python, Ruby or C#). You can even use a Firefox extension to record your actions to rapidly develop these test cases. Read the rest of this entry »





Laser graffiti

19 09 2007

Like many others, as soon as I saw the demo of Philips’ Drag and Draw gadget, I instantly wanted one of those. Now I saw that a group called the Graffiti Research Lab, inventors of the LED Throwies, created an ingenious device which resembles the Drag and Draw gadget, but in a setup which is a whole lot bigger: They created a Laser Tag system which can be used to project light graffiti on a surface, and you can draw in realtime via laser markers. (second half of the movie) What’s more, the source code is open, so people can build their own Laser tag system! Awesome! :D





Ext2 Installable File System For Windows

31 01 2006

Many people don’t know that Microsoft provides an Installable File System (IFS) SDK kit for writing filesystem drivers. This SDK provides necessary info for writing a filesystem driver to manage Linux/OS X drives from Windows 2000, XP or 2003 Server. Stephan Schreiber wrote an Ext2 IFS driver for Windows which supports Ext2 and Ext3 with read/write operations and almost everything else available under Linux except access rights, defraging and some other minor things.

via konfabulieren / osnews





Magick++ in KDevelop

7 12 2005

For my second project in KDevelop I wanted to use the Magick++ image library from the Imagemagick project. If you emerge imagemagick it will be installed for you automatically. Getting it to work with KDevelop requires just a few turns. Read the rest of this entry »





First steps in KDevelop

3 11 2005

KDevelop is being a bit of a bitch right now. All I did is start a new project, used the C++ Hello World template and tried to build it. What I got was the following:
*** [Gentoo] sanity check failed! ***
*** libtool.m4 and ltmain.sh have a version mismatch! ***
*** (libtool.m4 = 1.5.20, ltmain.sh = 1.5a) ***

and a reminder that I should use libtoolize --copy --force and contact the maintainer of the package.

The gentoo devel mailinglist and the KDevelop FAQ don’t offer any more help than that. Do I really have to do this step manually for every new project that I want to create? Isn’t it possible to automate this step?