While dealing with time conversions functions of various languages / technologies, e.g. Windows API or Java, you might come across the magic constant 116444736000000000. You can also find it in several code snippets on the web - however it never nearly explained where it comes from... This I wanna change, here and now!
A time value is simply a counter of ticks since an defined start of time, called epoch. Not only the "epoch date" differs between various systems, but also the counter resolution, that is how often it is updated.
Windows uses in most functions the FILETIME structure, which represents the actual time as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
Other platforms like Java/Android or some Unix functions represent a time value as the number of seconds elapsed since 00:00:00 January 1, 1970.
To convert between both worlds, you need an offset factor and that is... 116444736000000000. This value used as a FILETIME value, meaning 100ns intervals since 01-01-1601, represents exactly the data 01-01-1970!
Proof?
We know that 1ms = 1000000 ns = 10000 * 100 ns.
So 116444736000000000*1/100 ns = 11644473600000 ms = 11644473600 s.
Between 01-01-1601 and 01-01-1970, there are exactly 134774 days.
134774 * 24 (hours per day) * 3600 (seconds per hour) = 11644473600 s.
Tuesday, August 12, 2014
Tuesday, April 01, 2014
How many walls/borders has a nxn grid?
While implementing an algorithm for a hobby project, I came across the question how many walls (or borders) has a nxn grid?
Here I present the solutions of my line of thought: the first one is quite complicated, but was also the first which came into my mind. After convinced of the correctness of this one, a much easier idea occured... :-)
Lets start: A 1x1 grid has 4 walls which is easy to see:
_
|_| = 1 cells --> 4 walls
Lets have a look at a 2x2 grid:
_ _
|_|_|
|_|_| = 2 cells --> 12 walls (feel free to count it :-)
So my idea to get the equation of a nxn grid is based on following image / procedure:
1 2 ... n
_ _ _
1 |_|_|...|_|
2 |_|_|_|_|_|
. _| .
_ _| .
n |_|_|... _|
1. Start with the (orange) cell in the topleft corner which has 4 walls: 4
2. Lets move in the top row further to the right (cyan). For each of the remaining n-1 cells in this row, there are 3 walls per cell left: (n-1) * 3
3. The same applies if we go down in the first column step by step until the red cell. So for each cell there are also 3 walls left: (n-1) * 3
4. Then there is (n-1) x (n-1) grid left. However if we go there row by row and column by column, it turns out that for each cell only two more walls come along (the wall at the bottom and at the right), because the left and top wall were then already taken into account. So (n-1) * (n-1) * 2 walls are left.
So in total we have come up with following equation for an nxn grid:
x = 4 + (n-1)*3 + (n-1)*3 + (n-1)*(n-1)*2
= 4 + 3n - 3 + 3n - 3 + (n^2 -2n +1)*2
= 4 + 6n - 6 + 2n^2 - 4n + 2
= 2n^2 + 2n
= 2n (n+1)
Manually checking of the cases n=3 and n=4 turned out to be correct, so I guess it's ok.
However, afterwards a more simple solution came into my mind by just looking at the vertical walls only and at the horizontal walls separately:
1 2 ... n
_ _ _
1 |_|_| |_|
2 |_|_| |_|
.
_ _ _
n |_|_|...|_|
1. If just looking at the vertical walls (red), we see that there are n rows, each having n+1 walls: n * (n+1) walls in total.
2. The same applies for the horizontal walls (cyan): n columns * (n+1) walls.
This is in total:
y = n * (n+1) + n * (n+1)
= n^2 + n * n^2 + n
= 2n^2 + 2n
= 2n (n+1)
= x
That's it :-)
Lets start: A 1x1 grid has 4 walls which is easy to see:
_
|_| = 1 cells --> 4 walls
Lets have a look at a 2x2 grid:
_ _
|_|_|
|_|_| = 2 cells --> 12 walls (feel free to count it :-)
So my idea to get the equation of a nxn grid is based on following image / procedure:
1 2 ... n
_ _ _
1 |_|_|...|_|
2 |_|_|_|_|_|
. _| .
_ _| .
n |_|_|... _|
1. Start with the (orange) cell in the topleft corner which has 4 walls: 4
2. Lets move in the top row further to the right (cyan). For each of the remaining n-1 cells in this row, there are 3 walls per cell left: (n-1) * 3
3. The same applies if we go down in the first column step by step until the red cell. So for each cell there are also 3 walls left: (n-1) * 3
4. Then there is (n-1) x (n-1) grid left. However if we go there row by row and column by column, it turns out that for each cell only two more walls come along (the wall at the bottom and at the right), because the left and top wall were then already taken into account. So (n-1) * (n-1) * 2 walls are left.
So in total we have come up with following equation for an nxn grid:
x = 4 + (n-1)*3 + (n-1)*3 + (n-1)*(n-1)*2
= 4 + 3n - 3 + 3n - 3 + (n^2 -2n +1)*2
= 4 + 6n - 6 + 2n^2 - 4n + 2
= 2n^2 + 2n
= 2n (n+1)
Manually checking of the cases n=3 and n=4 turned out to be correct, so I guess it's ok.
However, afterwards a more simple solution came into my mind by just looking at the vertical walls only and at the horizontal walls separately:
1 2 ... n
_ _ _
1 |_|_| |_|
2 |_|_| |_|
.
_ _ _
n |_|_|...|_|
1. If just looking at the vertical walls (red), we see that there are n rows, each having n+1 walls: n * (n+1) walls in total.
2. The same applies for the horizontal walls (cyan): n columns * (n+1) walls.
This is in total:
y = n * (n+1) + n * (n+1)
= n^2 + n * n^2 + n
= 2n^2 + 2n
= 2n (n+1)
= x
That's it :-)
Monday, February 10, 2014
My Book Word Edition + Twonky Server: How to access the root folder of the NAS
I own a Western Digital 'My Book World Edition' (that's a simple NAS) for some years now, mostly as backup and central data access point.
After having purchased a smart TV, finally I was motivated to activate the TwonkyMedia server to stream media via DNLA.
Everthing went fine, however only the media files in the \public folder of the NAS were indexed by Twonky and I did not manage to get access to the whole NAS via the Twonky browser. Pretty bad as I was used to my private well-known folder structure and not willing to change it.
I did not manage to fix the problem for some time, and for some reason I did not find anything useful on the net, until I came across this topic on WD community forum:
http://community.wd.com/t5/Other-Network-Drives/USB-Media-Share-TwonkyMedia-Server/td-p/28117
Here the main information with the single command to adjust the start location, thanks to user garyg:
where <nas> is the name or IP address of the My Book. This command is entered into your web browser's address bar. The browser will respond with a page that says "/shares".
After having purchased a smart TV, finally I was motivated to activate the TwonkyMedia server to stream media via DNLA.
Everthing went fine, however only the media files in the \public folder of the NAS were indexed by Twonky and I did not manage to get access to the whole NAS via the Twonky browser. Pretty bad as I was used to my private well-known folder structure and not willing to change it.
I did not manage to fix the problem for some time, and for some reason I did not find anything useful on the net, until I came across this topic on WD community forum:
http://community.wd.com/t5/Other-Network-Drives/USB-Media-Share-TwonkyMedia-Server/td-p/28117
Here the main information with the single command to adjust the start location, thanks to user garyg:
This is because the shares start at /DataVolume/Public. If you change the default start location to /shares, or maybe it's /Shares, you will be able to access anything which has been defined as a share on the MyBook.
The command to fix the USB sharing problem is:
http://<nas>:9000/rpc/set_option?contentbase=/shares
where <nas> is the name or IP address of the My Book. This command is entered into your web browser's address bar. The browser will respond with a page that says "/shares".
Thursday, November 15, 2012
My alternative to HTML frames
Maybe some of you have noticed that I have updated my homepage. Well, the content remained more or less the same but the layout was finetuned.
Furthermore, the previous pages were created using a WYSIWYG tool which resulted in pretty ugly, overbloated HTML. Of course it was also hard to maintain and lacked of HTML validity.
The new pages were manually written (hm okay.. copy-pasted). The biggest difference is the fact that they are not frame-based anymore but solely CSS-based (I avoided to use tables for solely layout purposes as much as I could).
But when searching the net for alternatives to frames, my plan turned out to be more difficult than expected. Using I-Frames was no choice. PHP is not supported by my webspace and I was not willing to pay more just for some 'include' directives.
On the other hand, each change of the main layout (header at the top, meu at the left border) would have meant to manually adapt each html file... this is unacceptable.
So what to do?
Actually I came out with my own solution:
1. I started by coding a main layout template file which contains the general layout without any content:
2. This template was then used as base for every html page of my site. Well, so far no advantage. But in each file I put some markers to identify which parts of the html source belongs to the template and which parts contain the actual new content. These markers are just pre-defined HTML comments like:
3. Then I programmed a fancy tool which compares all files belonging to my site to the latest template. The markers help to identify the regions which belong to the template file and which are individual content. When the template changes, my tool can update the page files in a way that only the template regions are updated but the actual content is not touched. Here a screenshot of my tool:
A single button click will then update all sites :-)
What do you think of this solution?
Well, I must admit it took some time to code it and get it correctly working, but it was fun to write it and it works like a charm.
.. I love my own-invented solution!
Furthermore, the previous pages were created using a WYSIWYG tool which resulted in pretty ugly, overbloated HTML. Of course it was also hard to maintain and lacked of HTML validity.
The new pages were manually written (hm okay.. copy-pasted). The biggest difference is the fact that they are not frame-based anymore but solely CSS-based (I avoided to use tables for solely layout purposes as much as I could).
But when searching the net for alternatives to frames, my plan turned out to be more difficult than expected. Using I-Frames was no choice. PHP is not supported by my webspace and I was not willing to pay more just for some 'include' directives.
On the other hand, each change of the main layout (header at the top, meu at the left border) would have meant to manually adapt each html file... this is unacceptable.
So what to do?
Actually I came out with my own solution:
1. I started by coding a main layout template file which contains the general layout without any content:
2. This template was then used as base for every html page of my site. Well, so far no advantage. But in each file I put some markers to identify which parts of the html source belongs to the template and which parts contain the actual new content. These markers are just pre-defined HTML comments like:
here comes may cool individual HTML content
3. Then I programmed a fancy tool which compares all files belonging to my site to the latest template. The markers help to identify the regions which belong to the template file and which are individual content. When the template changes, my tool can update the page files in a way that only the template regions are updated but the actual content is not touched. Here a screenshot of my tool:
A single button click will then update all sites :-)
What do you think of this solution?
Well, I must admit it took some time to code it and get it correctly working, but it was fun to write it and it works like a charm.
.. I love my own-invented solution!
Saturday, December 03, 2011
Reason for homogeneous (4D) coordinates in computer graphics
Homogeneous coordinates are used computer graphics - you can read this statement in every 3D computer graphics related book or article. If you ever asked yourself why this is the case, then you are at the right place...
The reason for this is to handle rotation, scaling and translation in a common way. While you can handle rotation and scaling using 3x3 matrices and vectors with 3 components, translation cannot be processed - unfortunately this is normally not further explained although it is quite easy to see:
Suppose we have a point p with coordinate (x, y, z) and we want to translate it by a distance defined by the translation vector t=(tx, ty, tz).
Of course, what you need to do to get new position p' of point p after translation is to add t to p:
p' = p + t, which means
p'.x = p.x + tx
p'.y = p.y + ty
p'.z = p.z + tz
If you try to create a 3x3 matrix M to perform this operation by p' = M * p, you get into trouble. What we require is:
Looking at equation (1) we directly see that a = 1 and we are left with tx = by + cz. But the translation in x-direction must be indepent of y and z coordinates, so b and c must be zero.
Using homogeneous coordinates, that is to add a forth component w = 1 to each point, we can derive a 4x4 matrix for translation without any problems.
That's it :-)
The reason for this is to handle rotation, scaling and translation in a common way. While you can handle rotation and scaling using 3x3 matrices and vectors with 3 components, translation cannot be processed - unfortunately this is normally not further explained although it is quite easy to see:
Suppose we have a point p with coordinate (x, y, z) and we want to translate it by a distance defined by the translation vector t=(tx, ty, tz).
Of course, what you need to do to get new position p' of point p after translation is to add t to p:
p' = p + t, which means
p'.x = p.x + tx
p'.y = p.y + ty
p'.z = p.z + tz
If you try to create a 3x3 matrix M to perform this operation by p' = M * p, you get into trouble. What we require is:
x' x + tx |a b c| |x|
y' = y + ty = |d e f| * |y|
z' z + tz |g h i| |z|
z' z + tz |g h i| |z|
x + tx = ax + by + cz (1)
y + ty = dx + ey + fz
z + tz = gx + hy + iz
Looking at equation (1) we directly see that a = 1 and we are left with tx = by + cz. But the translation in x-direction must be indepent of y and z coordinates, so b and c must be zero.
x + tx = 1*x + 0*y + c*z = x => tx = 0
So only the primitive translation by zero is possible. The same applies for the equations for y and z. Using homogeneous coordinates, that is to add a forth component w = 1 to each point, we can derive a 4x4 matrix for translation without any problems.
x + tx |a b c d| |x|
y + ty = |e f g h| * |y|
z + tz |i j k l| |z|
z + tz |i j k l| |z|
1 |m n o p| |1|
we get e.g. for x-coordinate:
x + tx = ax + by + cz + d,
so a = 1 and d = tx which leads us to the final translation matrix:
|1 0 0 tx|
M = |0 1 0 ty|
|0 0 1 tz|
|0 0 0 1 |
Sunday, January 09, 2011
Browsing old reversing sites - the good old times
I just browsed through an old backup folder called "Reversing favourites" ... man this contains really OLD urls of reversing sites: groups, tutorials and so on!
Of course, I clicked several of them, full of hope, just to get disappointed that ca. 90% of the urls do not exist anymore. But some of the linked site still exist, but of course not updated for several years - just lying dead on some server.
I engrossed the thoughts what really cool sites existed at that time, now approximately 10 years ago. Here are some that are still online but out-of-date - maybe some of you want also fall in some nostalgy.
So here are my three top sites that are still online available:
Of course, I clicked several of them, full of hope, just to get disappointed that ca. 90% of the urls do not exist anymore. But some of the linked site still exist, but of course not updated for several years - just lying dead on some server.
I engrossed the thoughts what really cool sites existed at that time, now approximately 10 years ago. Here are some that are still online but out-of-date - maybe some of you want also fall in some nostalgy.
So here are my three top sites that are still online available:
- Immortal Descendants - this is one of my all-time favourite reversing sites. The tutorials and the code snippets were outstanding at that time, at least for me. I linked a working archived version of the site, the original URL was http://www.immortaldescendants.org.
- BIW Reversing - not that old but still no update in the last two years
- Crackstore - one of the first reversing sites I have ever visited
Friday, September 24, 2010
Injecting a dll to explorer.exe under windows 7 - FAILED
Today I tried to get an old self-coded tool to work under windows 7 64bit... I'm talking about my Desktop Symbol Utility I coded for and under windows XP.
In fact, I really do not require it because I managed to deactivate the dropshadow of the icon texts on the desktop while keeping the transpareny under windows 7 - without the help of an external tool! :-) Wow, finally Microsoft got it working... after how many years?
Howsoever, I found this tool accidentally again on my harddrive while searching for something else and tried to run it under my windows 7. As I had already expected, injecting the dll into explorer process did not work. So I extracted the code and had a look into it. I expected some typical error as it was programmed under a 32bit system and maybe the is some incompatible/wrong use of data types? Well, unfortunately not. It turned out that the CreateRemoteThread() call failed. My first assumption that the way the process ID is obtained is no longer valid under win7 was wrong - a simple compare with the PID in Process Explorer showed it. Also the other functions (VirtualAlloc etc.) succeeded.
Maybe it something to do with protected processes? (-> Link to article from Microsoft).
Well, I don't know... so if there is someone out there who got this tool working under Win7-64, please drop me some lines how you managed it - would be really great!
In fact, I really do not require it because I managed to deactivate the dropshadow of the icon texts on the desktop while keeping the transpareny under windows 7 - without the help of an external tool! :-) Wow, finally Microsoft got it working... after how many years?
Howsoever, I found this tool accidentally again on my harddrive while searching for something else and tried to run it under my windows 7. As I had already expected, injecting the dll into explorer process did not work. So I extracted the code and had a look into it. I expected some typical error as it was programmed under a 32bit system and maybe the is some incompatible/wrong use of data types? Well, unfortunately not. It turned out that the CreateRemoteThread() call failed. My first assumption that the way the process ID is obtained is no longer valid under win7 was wrong - a simple compare with the PID in Process Explorer showed it. Also the other functions (VirtualAlloc etc.) succeeded.
Maybe it something to do with protected processes? (-> Link to article from Microsoft).
Well, I don't know... so if there is someone out there who got this tool working under Win7-64, please drop me some lines how you managed it - would be really great!
Thursday, April 22, 2010
Fading windows in and out
Well, finally a new (though short) post :-)
For personal needs, I coded the functionality to fade in a window when my application starts and fade it smoothly out when the user quits the application. So below you can download the result - just add the fade.h and fade.cpp to your project, call InitFadeEngine() to initialize the fade engine with your window and then simply use FadeIn() or FadeOut() function. Have a look in the header file to get information about the required parameters and I also suggest to look at the source of the demo application that is also in the archive below - there you see how to use it. It's coded in plain C using the WinAPI function SetLayeredWindowAttributes() that is called repeatedly in its own thread. Have fun!
For personal needs, I coded the functionality to fade in a window when my application starts and fade it smoothly out when the user quits the application. So below you can download the result - just add the fade.h and fade.cpp to your project, call InitFadeEngine() to initialize the fade engine with your window and then simply use FadeIn() or FadeOut() function. Have a look in the header file to get information about the required parameters and I also suggest to look at the source of the demo application that is also in the archive below - there you see how to use it. It's coded in plain C using the WinAPI function SetLayeredWindowAttributes() that is called repeatedly in its own thread. Have fun!
Friday, September 18, 2009
So what kind of interesting things happened the last weeks?
So first of all, I am very proud to announce to I received the FZI (Forschungszentrum für Informatik) Prize for the best diploma thesis in computer science at the University of Karlsruhe in the Year 08/09 for my diploma thesis "Development of a Power-Aware Rate Controller for the H.264 Video Encoder". There were more than 160 graduates in this year- so I think my work is really not that bad ;-) And it was endowed with 1000€ *g*.
Here a (unfortunately bad-quality) picture of this day:

Apart from that, life runs its normal way. I have just too less time for private coding - or I'm just too lazy. But I pulled myself together and I dived into JavaFX.
What the hell is JavaFx you aks yourself? Answer: It's a product family (let's say some kind of enhancement of Java) made by Sun Microsystems. Its main purpose is to help developers to produce easier and faster Rich Internet Applications (RIAs) with media and content across a wide variety of platforms and devices.
There some tutorials in the net but I suggest a book like "Essential JavaFx" or "Pro JavaFX Platform". If you are a Java coder (maybe just as hobby like me) and you wish an better way to design cooler Java applets, then go for JavaFX. Download the newest (really cool but god-damn sluggish) NetBeans Environment including the JavaFX plugins/SDK and have a look.
But don't be shocked - it differs heavily from plain Java - it's some kind of mixture of Java and a script language. You specify the layout hierarchical as a tree of nodes, but you can have also classes and even access classes written in plain Java. But is has some really cool featurs like binding, Animations and Effects.
For my personal learning purposes, I am (still) coding a little applet for calculting the resistance of a physical resistor which I will release soon on my homepage with sources - so stay tuned!
Here a screenshot:
So first of all, I am very proud to announce to I received the FZI (Forschungszentrum für Informatik) Prize for the best diploma thesis in computer science at the University of Karlsruhe in the Year 08/09 for my diploma thesis "Development of a Power-Aware Rate Controller for the H.264 Video Encoder". There were more than 160 graduates in this year- so I think my work is really not that bad ;-) And it was endowed with 1000€ *g*.
Here a (unfortunately bad-quality) picture of this day:
Apart from that, life runs its normal way. I have just too less time for private coding - or I'm just too lazy. But I pulled myself together and I dived into JavaFX.
What the hell is JavaFx you aks yourself? Answer: It's a product family (let's say some kind of enhancement of Java) made by Sun Microsystems. Its main purpose is to help developers to produce easier and faster Rich Internet Applications (RIAs) with media and content across a wide variety of platforms and devices.
There some tutorials in the net but I suggest a book like "Essential JavaFx" or "Pro JavaFX Platform". If you are a Java coder (maybe just as hobby like me) and you wish an better way to design cooler Java applets, then go for JavaFX. Download the newest (really cool but god-damn sluggish) NetBeans Environment including the JavaFX plugins/SDK and have a look.
But don't be shocked - it differs heavily from plain Java - it's some kind of mixture of Java and a script language. You specify the layout hierarchical as a tree of nodes, but you can have also classes and even access classes written in plain Java. But is has some really cool featurs like binding, Animations and Effects.
For my personal learning purposes, I am (still) coding a little applet for calculting the resistance of a physical resistor which I will release soon on my homepage with sources - so stay tuned!
Here a screenshot:
Saturday, August 01, 2009
Am I a stupid user?
Sometimes I wonder if I am to stupid to use some tools or if the GUI is not like that as it should be. I am using Visual Studio 2005 now for several years and some weeks ago I tried to change the height of the client area of a normal combobox inside resourse editor. The reason was that I added around 20 text items from code and wanted them to be visible all at the same time in the dropdown list. Well in the Properties Window there is no such attribute to set and when I clicked the combobox it looks like this:
But it was only possible to change the width of the combox (blue spots) and not the height (white spots)! I just thought "Oh man what's going on... this cannot be true - I am going nuts!".
My first idea was to change the height from source code using MoveWindow etc. - but in total this required more than 5 lines of code (with variable declaration and nice layout) just to change the height of a dropdown list of a combobox...?! This is not that developer-friendly as I expected it...
Or was I just too stupid to use resourse editor - of course this was the case. But I found the solution only accidently. Instead of clicking directly on the combobox item, I clicked directly on the small button with the arrow downwards at the right side of the textbox, and suddenly it looked like that:
Now it was possible... that easy!
Although I feel some kind ashamed to waste so much time for such a trivial problem, I thought posting my lousy problem may help also some other 'stupid user' facing the same 'challenge' ;-)
But it was only possible to change the width of the combox (blue spots) and not the height (white spots)! I just thought "Oh man what's going on... this cannot be true - I am going nuts!".My first idea was to change the height from source code using MoveWindow etc. - but in total this required more than 5 lines of code (with variable declaration and nice layout) just to change the height of a dropdown list of a combobox...?! This is not that developer-friendly as I expected it...
Or was I just too stupid to use resourse editor - of course this was the case. But I found the solution only accidently. Instead of clicking directly on the combobox item, I clicked directly on the small button with the arrow downwards at the right side of the textbox, and suddenly it looked like that:
Now it was possible... that easy!Although I feel some kind ashamed to waste so much time for such a trivial problem, I thought posting my lousy problem may help also some other 'stupid user' facing the same 'challenge' ;-)
Thursday, May 21, 2009
Hi, my name is Felix...
One day when I came home from work, I heard a cat crying miserably. It sound to be very near when I went on the balcony, but the cat's location was not detectable. So we started searching on the attic, in the garden, we even replaced tiles from the roof as we thought the cat is maybe stucked under the roof. Finally we found him - stucked in the drainpipe of the cullis! Most probably he went over the cullis and fell into the hole where the drainpipe starts towards the ground and as the pipe is quite thin the cat pinned inside the pipe. So we dismantled the drainpipe in order to rescue the undercooled, wet, afraid cat. I suggest he was only 4 weeks old and no mother or brothers/sisters were in sight, so we decided to keep him :-) Say hello to my new lodger:
Tuesday, April 28, 2009
Modifying the S100
Hey out there,
I just bought a T-Online Vision S100. That's a media settop box for streaming movies over the internet directly to the TV. As the service was discontinued here in Germany, many of them are sold @ ebay for around 40€. Here are two pictures:

As you can see, it's quite stylish and gives enough possibilities to 'pimp' it. Some technical facts: Intel Celeron 733Mhz, 128MB Ram, Intel 830M for Graphics, USB, LAN, WLAN, Audio Analog/Digital, SVideo, Scart and also an infrared remote control. As there is no fan, it's runs completely silent.
So it's a perfect target to modify it to a personal mediabox, for watching movies, listen to music, surfing in the net or playing old games, all via TV. There are many fansites and tutorials about modding the S100, just use google.
The first thing I did is to tinker a custom cable for enabling the VGA output on the motherboard, similar to this one (picture is from here):

Attaching a monitor enables you to enter the Bios and disable booting Windows CE from the flash memory. You can either boot from usb or embed a harddisk (preferably a 2,5" notebook harddisk as they are more silent and require less power). I am going to choose the second option but therefore I have to modify the power supply and braze additional connectors. After that, an OS and some cool tools are installed, an LED for harddisk usage will be inserted and maybe the LED frontpanel will be removed, but let's see...
Here is picture of my home activity area:
I just bought a T-Online Vision S100. That's a media settop box for streaming movies over the internet directly to the TV. As the service was discontinued here in Germany, many of them are sold @ ebay for around 40€. Here are two pictures:

As you can see, it's quite stylish and gives enough possibilities to 'pimp' it. Some technical facts: Intel Celeron 733Mhz, 128MB Ram, Intel 830M for Graphics, USB, LAN, WLAN, Audio Analog/Digital, SVideo, Scart and also an infrared remote control. As there is no fan, it's runs completely silent.So it's a perfect target to modify it to a personal mediabox, for watching movies, listen to music, surfing in the net or playing old games, all via TV. There are many fansites and tutorials about modding the S100, just use google.
The first thing I did is to tinker a custom cable for enabling the VGA output on the motherboard, similar to this one (picture is from here):

Attaching a monitor enables you to enter the Bios and disable booting Windows CE from the flash memory. You can either boot from usb or embed a harddisk (preferably a 2,5" notebook harddisk as they are more silent and require less power). I am going to choose the second option but therefore I have to modify the power supply and braze additional connectors. After that, an OS and some cool tools are installed, an LED for harddisk usage will be inserted and maybe the LED frontpanel will be removed, but let's see...
Here is picture of my home activity area:
Sunday, April 19, 2009
What's currently going on..
So folks,
I had last week off as my company has closed for four days due to the financial/economical situation. I used this 'forced spare time' to go on holiday - I went with my girlfriend to Vienna, Austria for some days. This was really nice - it's a really cool city with many, many places worth to visit, so we were the whole day on the move. Additionally we had awesome weather - look at this:
What else I have done in my spare time? Well, I must admit I began to play a video game which I came across in the net. It's a quite old one (dos game) which I own for about ten years but never fetched again from my rack because of lack of time and motivation. Then I saw the screenshots on the net and read that is has been drastically improved by hobby programmers which reversed the whole game and made it open source. Moreover it's now running under Windows (also under linux and mac, just for information!), I tried it again and nearly became addicted again. I'm talking about Transport Tycoon, more precisely Open Transport Tycoon - go and check it out (but you need the game data files from the original game). Here a screenshot:
What's about coding, reversing and your homepage you ask? Damn, a good question. Of course, it's not dead. I have just only little time... But I read about many topics I am interested in and some really cool ideas for projects in my head but everything is taking much time so new coding activities just progress slowly.
But I do my best :-) Let's see...
I had last week off as my company has closed for four days due to the financial/economical situation. I used this 'forced spare time' to go on holiday - I went with my girlfriend to Vienna, Austria for some days. This was really nice - it's a really cool city with many, many places worth to visit, so we were the whole day on the move. Additionally we had awesome weather - look at this:
What else I have done in my spare time? Well, I must admit I began to play a video game which I came across in the net. It's a quite old one (dos game) which I own for about ten years but never fetched again from my rack because of lack of time and motivation. Then I saw the screenshots on the net and read that is has been drastically improved by hobby programmers which reversed the whole game and made it open source. Moreover it's now running under Windows (also under linux and mac, just for information!), I tried it again and nearly became addicted again. I'm talking about Transport Tycoon, more precisely Open Transport Tycoon - go and check it out (but you need the game data files from the original game). Here a screenshot:
What's about coding, reversing and your homepage you ask? Damn, a good question. Of course, it's not dead. I have just only little time... But I read about many topics I am interested in and some really cool ideas for projects in my head but everything is taking much time so new coding activities just progress slowly.But I do my best :-) Let's see...
Thursday, February 26, 2009
Some personal news
So folks,
finally a new post :-) Just to tell that I'm still there and some things have changed in my life...
I have successfully completed my study at University of Karlsruhe and received my diploma in computer science. My diploma thesis about H.264 video coding finished very well and I'm quite proud of it, likewise my mentor and professor so I expect a very good grade :-)
After this, I moved away from Karlsruhe and now live together with my girlfriend in our own flat. That's why I had no internet access for more than one month and was not able to update my blog. Since beginning of February, I am working as a software engineer at Robert Bosch Gmbh in the sector of automotive control units, more precisely called DCU (Domain Control Unit). Everything is quite new so I am excited how things will go on - hopefully fine and successfully.
But yeah, only less time is available for spare time compared to be a student, so I have nearly no time for my personal coding and my website ;-( But no fear, this will change and I will somewhen resume to please the world with my code snippets ;-)
So then, stay tuned!
finally a new post :-) Just to tell that I'm still there and some things have changed in my life...
I have successfully completed my study at University of Karlsruhe and received my diploma in computer science. My diploma thesis about H.264 video coding finished very well and I'm quite proud of it, likewise my mentor and professor so I expect a very good grade :-)
After this, I moved away from Karlsruhe and now live together with my girlfriend in our own flat. That's why I had no internet access for more than one month and was not able to update my blog. Since beginning of February, I am working as a software engineer at Robert Bosch Gmbh in the sector of automotive control units, more precisely called DCU (Domain Control Unit). Everything is quite new so I am excited how things will go on - hopefully fine and successfully.
But yeah, only less time is available for spare time compared to be a student, so I have nearly no time for my personal coding and my website ;-( But no fear, this will change and I will somewhen resume to please the world with my code snippets ;-)
So then, stay tuned!
Thursday, October 30, 2008
Accessing Webcam & pre-process frame
One evening I asked myself how to access my laptop webcam (a noname 1.3MP cam integrated into my HP Pavillon dv6XXX) by code. As I faced a little problem with this, I want to share my experience with you.
A look at msdn/internet revealed the Windows Capture Functions, all starting with the prefix cap. Creating the capture window, connecting to the driver, scaling, enabling preview - all very easy as these are just simple function calls. Cause I wanted to preprocess the frame (in order to implement some algorithms to make nice effects - which is not done yet and will take some more time...) I engaged a frame callback function without problem.
But then a little obstacle occured: how is the frame data stored? Using capGetVideoFormat, I accessed the bitmapinfoheader structure and checked the biBitCount member - 16 Bits. Ok - nice - and started coding immediuately which turned out to be a mistake!
The color members were not stored as specified in the msdn library: least significant five bits blue, followed by five bits each for green and red and the most significant bit is unused.
At first I thought I introduced a bug on my bit operations to extract these bits - but no, works perfectly.
Ok, no big deal - as I wished the data to be 24bit RGB, I wanted to use capSetVideoFormat to change the captued video data to this format. But of course this solution would have been too easy - this function always returned FALSE meaning my webcam driver does not like another format :-(
So what was the problem?
While tracing the program I saw the bitmapheader structure values in the debugging window inside visual studio and the biCompression member caught my eyes: 844715353. Hm such a value is not predefined as e.g. BI_RGB etc. I converted this number to hex = 0x32595559 and searched the internet to find out that this is the fourcc of YUY2! Another search brought my to the great website FourCC.org where this format (and many others) is explained:
a simple 4:2:2 YUV format with byte order Y1 U Y2 V. With this info it's of course easy to preprocess each frame of my webcam as I want.
Of course a better BitmapInfoHeader Page at msdn would have saved me a lot of time... Although interestingly a few days later I found this page at msdn where I found exactly my required information - but just too late.
I hope this will help someone facing the same problem while accessing a webcam!
A look at msdn/internet revealed the Windows Capture Functions, all starting with the prefix cap. Creating the capture window, connecting to the driver, scaling, enabling preview - all very easy as these are just simple function calls. Cause I wanted to preprocess the frame (in order to implement some algorithms to make nice effects - which is not done yet and will take some more time...) I engaged a frame callback function without problem.
But then a little obstacle occured: how is the frame data stored? Using capGetVideoFormat, I accessed the bitmapinfoheader structure and checked the biBitCount member - 16 Bits. Ok - nice - and started coding immediuately which turned out to be a mistake!
The color members were not stored as specified in the msdn library: least significant five bits blue, followed by five bits each for green and red and the most significant bit is unused.
At first I thought I introduced a bug on my bit operations to extract these bits - but no, works perfectly.
Ok, no big deal - as I wished the data to be 24bit RGB, I wanted to use capSetVideoFormat to change the captued video data to this format. But of course this solution would have been too easy - this function always returned FALSE meaning my webcam driver does not like another format :-(
So what was the problem?
While tracing the program I saw the bitmapheader structure values in the debugging window inside visual studio and the biCompression member caught my eyes: 844715353. Hm such a value is not predefined as e.g. BI_RGB etc. I converted this number to hex = 0x32595559 and searched the internet to find out that this is the fourcc of YUY2! Another search brought my to the great website FourCC.org where this format (and many others) is explained:
a simple 4:2:2 YUV format with byte order Y1 U Y2 V. With this info it's of course easy to preprocess each frame of my webcam as I want.
Of course a better BitmapInfoHeader Page at msdn would have saved me a lot of time... Although interestingly a few days later I found this page at msdn where I found exactly my required information - but just too late.
I hope this will help someone facing the same problem while accessing a webcam!
Wednesday, September 17, 2008
A bug hard to find...
During the last evenings, I have been coding a little tool to convert Avi files to 4:2:0 Yuv files. I just wanted it to have more videos to test with my H.264 encoder I work with in my diploma thesis. Well, it was no big deal programming it, just diving into the Video for Windows Api on MSDN to get familar with its interface so it didn't take long till I finished it. It's a console application and I always tested inside Visual Studio, passing the commandline parameters in the project settings. So everything worked fine till I tested it inside a cmd window outside Visual Studio. The converting loop was successful but it freezed after printing "Done!". Looking at the code I was surprised cause that printf("Done!\n") is the very last command!
That's the pseudocode:
for all frames
pData = (BYTE*)AVIStreamGetFrame(pFrame, i-1);
CreateYuvfromFrame(pData);
CloseAviFunctions();
printf("Done\n");
return;
Inside Visual Studio, I found at first no hint what was wrong, even tracing it showed no problem. Than I noticed that it does not freeze when the for-loop is not entered. Again reading in msdn, more specific AviStreamGetFrame, I read following:
Remarks:
The returned frame is valid only until the next call to this function or the AVIStreamGetFrameClose function.
Then I suddenly noticed, I called every necessary Avi-release and Avi-close function except the AviStreamGetFrameClose one. Inserting it just before my program ends and the bug was gone... and I was happy!
So what we learn from this: when using the Video for Windows Api, make sure to call the corresponding close-function for every Avifunction you use, although MSDN does not explicitly state that you have to before your program finishes!
But the open question remains: how to find this bug in a structured straightforward way? Normal debugging did not help and I was not willing the spend all my time to debug internal system calls within Ollydbg.
So if you know a way or you have just a suggestion, feel free to tell it me!
That's the pseudocode:
for all frames
pData = (BYTE*)AVIStreamGetFrame(pFrame, i-1);
CreateYuvfromFrame(pData);
CloseAviFunctions();
printf("Done\n");
return;
Inside Visual Studio, I found at first no hint what was wrong, even tracing it showed no problem. Than I noticed that it does not freeze when the for-loop is not entered. Again reading in msdn, more specific AviStreamGetFrame, I read following:
Remarks:
The returned frame is valid only until the next call to this function or the AVIStreamGetFrameClose function.
Then I suddenly noticed, I called every necessary Avi-release and Avi-close function except the AviStreamGetFrameClose one. Inserting it just before my program ends and the bug was gone... and I was happy!
So what we learn from this: when using the Video for Windows Api, make sure to call the corresponding close-function for every Avifunction you use, although MSDN does not explicitly state that you have to before your program finishes!
But the open question remains: how to find this bug in a structured straightforward way? Normal debugging did not help and I was not willing the spend all my time to debug internal system calls within Ollydbg.
So if you know a way or you have just a suggestion, feel free to tell it me!
Friday, September 05, 2008
Still there
Hi,
currently I'm very busy with my diploma thesis - I just finished a big part concerning mode decision inside the encoder, now I have to implement some algortihms in VHDL and after that I will start with the actual Rate Controller. Things are getting more complicated and I also have to read some papers and books to build a mathematical theoretical background for my model. Well, nearly half of the time is already gone, so only 3 months left = stress.
That's why there is also no real update on my website. Ok I improved my layout as you can see which took already some time - did I ever mentioned that I'm no friend of html/css/all other web scripting languages - they just look ugly compared to a real programming language!
But I have already two cool tools coded concerning planar 4:2:0 yuv-files which just need some commenting and bugfixing before going to be available on my site - so stay tuned.
(Caution: Advertisment) I came across two cool free downloads - maybe you are also interested:
First of all, google published their own browser chrome for free download. My first impression is pretty positive - it's fast, small and easy to use - most of the screen is used for the displayed website, there is no over-blown gui with thousands of menus and statusbars. I like it but I stick to my lovely firefox - I am used to it and the bookmark bar is better and more comfortable to use in my opinion. But you should give chrome a try!
Second, after releasing Command & Conquer 1 as freeware, C&C - Red Alert is now also freely available as download. It's even better than part 1, in fact it is my all-time favourite realtime strategy game ever. I loved it. So go and download the iso images and start playing. For playing it under Windows XP/Vista, choose compatibility mode 'Windows 95' for both, the setup exe file and game exe file, and install also the provided patch - then you have no trouble.
currently I'm very busy with my diploma thesis - I just finished a big part concerning mode decision inside the encoder, now I have to implement some algortihms in VHDL and after that I will start with the actual Rate Controller. Things are getting more complicated and I also have to read some papers and books to build a mathematical theoretical background for my model. Well, nearly half of the time is already gone, so only 3 months left = stress.
That's why there is also no real update on my website. Ok I improved my layout as you can see which took already some time - did I ever mentioned that I'm no friend of html/css/all other web scripting languages - they just look ugly compared to a real programming language!
But I have already two cool tools coded concerning planar 4:2:0 yuv-files which just need some commenting and bugfixing before going to be available on my site - so stay tuned.
(Caution: Advertisment) I came across two cool free downloads - maybe you are also interested:
First of all, google published their own browser chrome for free download. My first impression is pretty positive - it's fast, small and easy to use - most of the screen is used for the displayed website, there is no over-blown gui with thousands of menus and statusbars. I like it but I stick to my lovely firefox - I am used to it and the bookmark bar is better and more comfortable to use in my opinion. But you should give chrome a try!
Second, after releasing Command & Conquer 1 as freeware, C&C - Red Alert is now also freely available as download. It's even better than part 1, in fact it is my all-time favourite realtime strategy game ever. I loved it. So go and download the iso images and start playing. For playing it under Windows XP/Vista, choose compatibility mode 'Windows 95' for both, the setup exe file and game exe file, and install also the provided patch - then you have no trouble.
Thursday, July 03, 2008
Online Calculator and Autocompletion
Finally my online calculator is published here: Online Calculator.
I was tired of using Windows Calculator for evaluating terms when I forget my hand calculator at home. And using other numeric bases like hexadecimal were not possible but I needed this functionality quite often. So I decided to code my own expression evaluator as a java applet and to put it on my homepage. Not bad, isn't it? Perhaps you find it also useful ;-)
It took quite some time at the beginning to get a working little parser engine. At first I wanted to do it the 'right way' -to build a complete parser tree in memory but very soon I noticed that this is too much for this little applet and also too time-consuming/complex to code. So I came up with a really simple but good working recursive parser. Then most of the work was already finished - just my ownerdraw resultlist took me some research on the internet to paint the listitems myself.
Originally I wanted also to implement an 'intellisense-like' autocompletion functionality for the textfield where you enter the term. But it turned out to be more difficult that I expect so I delayed it cause my online calculator has till now less than 15 commands so it's more fun than really necessary. But today I continued the fight and got it working - my main idea was not to extend a frame but just a JPopupMenu with some nice 'keylistener-action'. Till now it's not ownerdrawn and I don't know if I should really insert it into my online calculator. Let's see... but first here a little animation that it really works :-)
I was tired of using Windows Calculator for evaluating terms when I forget my hand calculator at home. And using other numeric bases like hexadecimal were not possible but I needed this functionality quite often. So I decided to code my own expression evaluator as a java applet and to put it on my homepage. Not bad, isn't it? Perhaps you find it also useful ;-)
It took quite some time at the beginning to get a working little parser engine. At first I wanted to do it the 'right way' -to build a complete parser tree in memory but very soon I noticed that this is too much for this little applet and also too time-consuming/complex to code. So I came up with a really simple but good working recursive parser. Then most of the work was already finished - just my ownerdraw resultlist took me some research on the internet to paint the listitems myself.
Originally I wanted also to implement an 'intellisense-like' autocompletion functionality for the textfield where you enter the term. But it turned out to be more difficult that I expect so I delayed it cause my online calculator has till now less than 15 commands so it's more fun than really necessary. But today I continued the fight and got it working - my main idea was not to extend a frame but just a JPopupMenu with some nice 'keylistener-action'. Till now it's not ownerdrawn and I don't know if I should really insert it into my online calculator. Let's see... but first here a little animation that it really works :-)
Thursday, June 26, 2008
Command & Conquer 1 for free!
Hi folks,
in a phase of nostalgia I viewed some videos on youtube of old pc-games I played when I was younger - and the first Command & Conquer part Tiberian Dawn was one of my favourite. Of course the dos version with just 320x200 pixels ;-) But it was the perfect real-time strategy game in those days. But I think everybody knows it so why talking much about it - you can play it now for free. In 2006 it was re-released in the 'The first decade' compilation pack - even the SVGA windows version including a patch to work under XP/Vista. Then in September 2007, EA released these iso images for free downloading on their servers. So what are you waiting for - go and get it!
in a phase of nostalgia I viewed some videos on youtube of old pc-games I played when I was younger - and the first Command & Conquer part Tiberian Dawn was one of my favourite. Of course the dos version with just 320x200 pixels ;-) But it was the perfect real-time strategy game in those days. But I think everybody knows it so why talking much about it - you can play it now for free. In 2006 it was re-released in the 'The first decade' compilation pack - even the SVGA windows version including a patch to work under XP/Vista. Then in September 2007, EA released these iso images for free downloading on their servers. So what are you waiting for - go and get it!
Wednesday, June 18, 2008
Firefox 3 is out!
The final reason of Firefox 3 is out and waiting to be downloaded. I have just installed it and I'm fully happy with it. Looks better, seems to be even more stable than version 2 and alone the new "AwesomeBar" makes it worth to get it. Since Firefox 0.8 it's the only browser I use and I'm really a fan of this (in my opinion) best existing browser. It has also broken a world record by being downloaded more than 7 million times in the first 24 hours!
Download Firefox
Firefox Worldrecord
Download Firefox
Firefox Worldrecord
Subscribe to:
Posts (Atom)


