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 :-)

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!

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

Wednesday, June 11, 2008

Diploma Thesis

That's just a quick post to tell what I'm doing now. I found finally an interesting diploma thesis at which I have been working for the last two weeks already. It's official title is "Development of a Power-Aware Rate Controller for H.264 Video Encoder" and it's located at the Chair for Embedded Systems at University Karlsruhe. My mentor seems to be really nice and to be motivated to help me completing my work successfully. I have 6 months to finish it and hopefully this length of time is enough. I was surprised how complex this H.264 Encoding Standard is and how many complicated steps needs to be accomplished to encode a video with good quality and less need for memory. I have read two complete books and several papers during the last weeks and also dived in the C Code of the standard implementation of this encoder but understanding the rate controller process/steps seems to be really hard. I think this will last but let's see...
The good thing is that when I come home I can watch football the whole evening :-) Or I go to a place with public viewing when the German football team plays. The European Soccer Championship is really exciting and I'm curious what will happen... :-)

Saturday, April 26, 2008

Last oral exam done!

Hi everybody,
after 8 weeks of learning and diving into the secrets of nets, pointclouds, bezier and bspline curves, triangulations, many graphical algorithms and much more, I had yesterday my last oral exam - in computer graphics. It went perfectly :-) Fortunately I was very well prepared. My study thesis is also finished so I'm looking currently for an interesting diploma thesis. But now I make holidays for two weeks - very nice cause the summer slowly begins now here in Germany and the weather is great!
So perhaps I'll find some time for coding - have already two things in mind that I'm wanna code, but let's see.
Well, over the last years my interest in computer games constantly decreased. But when I played something (very seldom) then it was of course Trackmania Nations. I did already mentioned it on my site when this game was released two years ago - completely for free! It an really nice, good looking, challanging racing game which you can also play over the net against others. And now, finally, the next part was released - Trackmania Nations Forever - again for free! So if you like racing games, be sure to check it out! Best thing is to check out following very good site - there you find everything you need:
http://tmnforever.tm-exchange.com/

So have fun!
Sunshine

Thursday, March 06, 2008

Maximum subvector problem

So folks,
again a life sign from me. Again I'm busy... Currently I'm writing the paper of my study thesis. This needs more time than I thought but fortunately my monitoring unit works on the fpga. On the side I started to learn for my last oral exam - in computer graphics. That means hard-core diving into bézier and b-spline curves, also in point clouds. That's gonna be difficult and time-consuming.
Nevertheless while surfing, I came across a paper about the so-called maximum subvector problem. I even think that I really had this problem some years ago while coding. Although it's quite simple it's somehow cool to think about solving it. So what it is about?

given : an array[1...n] of (positive and negativ) numeric values
goal: to determine the maximum subvector a[i..j], 1 <= i <= j <= n whose sum of elements is maximum over all subvectors. Well, not that big thing at first - just calculate all possible subvectors and save the maximum one. The straightforward approach could be look like this: MaxSoFar := 0.0
for L := 1 to N do

  for U := L to N do

    Sum := 0.0

    for I := L to U do

      Sum : = Sum + X[I]
      /* Sum now contains the sum of X[L..U] */

      MaxSoFar := max(MaxSoFar, Sum)


This works of course but for even quite small array sizes (e.g. 1000 elements) this lasts quite long. The execution time is proportional to O(n^3)!
This just be motivation enough to search for some better algorithm. Well, after some thinking you might find a O(n^2) algorithm. There is even a divide-and-conquer approach which is in O(nlogn), but it's not that easy to code :-( Ok, nice, they are often hard to implement...
But in fact there is a simple algorithm that works in linear time! Yes, in O(n)! I must admit I had never expected it nor searched for it. And it is so simple!!!
Curious? Ok here it is:

MaxSoFar := 0.0
MaxEndingHere := 0.0
for I := 1 to N do
  MaxEndingHere := max(MaxEndingHere+X[I], 0.0)
  MaxSoFar := max(MaxSoFar, MaxEndingHere)

So if you found this blog entry interesting, then be sure to check out following article, it contains everything I've written here:


Bye

Tuesday, January 29, 2008

Hope dies last

So, January is nearly over and that's just my first post.
As always, much work to do :-( My study thesis does progress quite slowly unfortunately. The problems are pretty resistent against my tries to solve them ;-)
I managed it that my log entries can be sent from the htx-board to main memory. Therefore I use a linux device driver to allocate a buffer in main memory and send its physical (not virtual, that's why a driver is needed) address to the board. So when my associative memory on the board is full, they are written to this buffer and I can read them with my user-level test application. Of course, some little bugs are still there (not surprisingly, isn't it). Write requests are not correctly logged in contrast to read requests and I f***ing don't find the reason. But I still hope that I can finish it in near future.
I'm slightly sad that I have so little time for my website and coding. I had begun to code my own burrows-wheeler-transformation in the last week of december, but just one day wasn't enough to get it working. The reverse transformation is quite difficult to implement it efficiently - the way I learned to do it by hand is not a good way to implement it. Perhaps when this term is over, I have some spare time and enough motivation to complete it.
Till then, keep cool,
greetz Sunshine

Thursday, December 20, 2007

No time for anything....

So folks,
pretty long no update, I know. But this term is quite stressful - my Informatics I Tutorial needs some time for correcting the exercise sheets, for preparation the material and holding the tutorial and the computer execercise lessons. Then I attend some lectures, all of them about computer graphics. Some of them are quite difficult to follow cause of the complicated mathematics involved. And last but not least the most time-consuming thing in the last time: my study thesis. I did not even managed it to update the study page on my homepage with information about it.
Well I'm working with a Xilinx Fpga Board Virtex4 Fx-100 where a Hypertransport Core is running on (I got it working). My task is to extend the core with a monitoring feature - till now I managed it to log the write and read accesses in an associative memory. But now I have to write these information to the main memory using DMA - and this does not work (damn!). Either the linux kernel panics or the computer just hangs up. I really don't know how to achieve the right behaviour, this drives my crazy. I have no simulator, there is no possibility to 'debug' it and synthesizing my design with ISE and upload it to the board takes every time more than 45min. This is definitely no fun! As soon as I get it working, I will post more detailed information about my study thesis.
Anyhow, I got round to code and publish a nice applet demonstrating the Cohen-Sutherland-Algorithm last week. And guess what? The implementation of the Sutherland-Hodgman-Algorithm is nearly finished and waits to be uploaded on my page :-)
But for now, Christmas is coming soon, I still have to organize some presents and I'm looking forward to some relaxing days. So I wish you all a merry christmas and a happy new year!!!
Greetz Sunshine

Friday, October 26, 2007

My hook doesn't work :-(

A few days ago I rummaged through my old code snippets and sources on my harddisk. I noticed that I coded quite many PE tools, especially with Delphi, but something I have never created - an Api hook!
I read pretty much about it (there are many code snippets in the net about this), but most of them are complicated and badly commented so that it's difficult to undertstand what's going on. So I tried myself and began coding the most simple and clean api hook possible (in c cause it's better to read than asm): a little Messagebox hook which should alter the caption of all messageboxes.
Ok I thought, the most simple approach is to code a loader which starts a target process and loads my selfcoded 'hook dll file' into the address space with the well-known CreateRemoteThread trick. Inside the dll file is all the work: as soon as injected and attached, it travels through the import table of the process, searches for MessageBoxA API from user32.dll and replaces the RVA (called Thunk) with the RVA of my own function I declared in my dll file. Hm... sounds not bad although I know that this works just with exes with a straightforward import table - even loading the MessageBox API with GetProcAddress would bypass my approach. But that's not bad - if it would work.... Damn!
With some targets it works, but in others it corrups the stack!? That's a bit strange to me - either it should work always or never. Of course, I took special care about the arguments and the stack. And debugging with olly is quite boring and not that easy... I think I give up and I put up with the fact that I'm never gonna code a nice Api hook :-(

Moreover, studies suck also -> 'thank god it's friday' and I will relax the whole weekend!

Friday, October 05, 2007

Skyscraper Solver

So folks,
I removed the last bugs and cleaned up the code faster than I thought - so my Skyscraper solver waits to be downloaded from my site :-)
But unfortunately it is pretty timeconsuming to check if a solution is valid so it's quite slower than I thought! For example to go through all possibilities in a 6x6 quest with my backtracking algorithm can take several minutes in the worst case - even on my new laptop! That's bad - but I don't see many places for optimization which would really speed it up.
Of course this makes me thinking about another approach: it is possible and worth the time to solve it with Dancing Links like a Sudoku quest? Well, in fact I don't know and I didn't (and won't) try it. That's not an exercise which could be easily solved in a few hours in my opinion! But if anybody will do it and succeed, mail me please! I would be very interested in it.
So far so good. It's Friday afternoon, I have already done everything I had to do - it's time to relax and waiting for the weekend to begin :-)
Greetz, Sunshine

Monday, October 01, 2007

Again I'm coding...

Hey folks,
well at the moment I have some free time. No exams, the lectures are going to start not until middle of October and there are some problems with my study thesis. I cannot begin cause the HTX-Board (a special board to study the hypertransport bus) is not working properly, so this week seems to be idle too.
But not that bad. I came across a little game similar to sudoku and I decided to code a nice applet to play it. And of course even more: also a solver which gives all solutions to a quest (which is even finished and fully working) and a generator to create new games which has only one valid solution. This in fact is pretty more difficult to code - till now it takes in some cases nearly one minute to generate a quest which is sometimes not even solvable! Ok this tool I hacked in really short time without thinking about a clever algorithm so this is something I have to recode I think. The applet coding comes slowly to an end, here a screenshot from its current state:

As you see, I coded also some kind of lame visualization of the currently game. Well, that's not important for the game. It's more my first try of coding a simple wireframe 3D software rendering engine! Not that easy to code - you find only little information about camera and screen projection, but I succeeded :-) Let's see if I will also implement solid filled polygons...
So keep cool, I'm going to proceed with coding!
Cya

Tuesday, September 18, 2007

Disabling HP Quickplay buttons

As I wrote some weeks ago, I got a new laptop - a HP Pavillon dv6XXX. Well, everything works and I have no problems so I'm quite satisfied... but one thing really nerves me . There are some so-called quickplay buttons above the normal keyboard, look here:



The problem is that I often accidentally push it. Well, push it is too much, let's say smoothly touch it. This often occurs while coding and I push F5, F8 etc. to compile, build or test something. Then every time it the dvd programm slowly starts and I have to close it down. If this happens a few times, it really pisses me off so I tried to disable them.

Looking at the taskmanager, I noticed some HP programms running. Interesting sounded QPService.exe ("HP QuickPlay Resident Program") and Qlbctrl.exe ("HP Quick Launch Buttons"). But killing these two processes didn't helped.
The only way to solve our problem is to avoid even loading them, so we have to delete the registry keys in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.
Be sure to make an backup of these keys to be able to re-enable it later! Here you have my 2 reg files: the first one disables QuickPlay by deleting the regkeys while the other one enables it by adding the regkeys.
I think that will be useful for some other nerved HP laptop users :-)
Use at your own risk! If they don't work and damage your system, don't blame me.

--- Download Reg Files ---

Update: It seems that I can't re-enable these buttons! So be careful - I don't take any responsibility.

Greetz, Sunshine

Wednesday, September 12, 2007

Holidays are over :-(

Hm, what a nice time I had in August - 4 weeks free! Three weeks relaxing at home, meeting with friends, shopping, going to parties, relaxing and sleeping... But everything has an end and real life comes back. Next week my last oral exam in my minor subject, then I am going to begin with my study thesis - it will be about examining/monitoring the hypertransport bus system. Let's see how it will be - I hope easy :-)
I noticed that I haven't done anything in reversing for a long time but somehow I currently don't feel motivated to do something concerning this topic. But I dived into bezier curves and coded some nice applets (look in the java section of my site). An applet about b-splines is already finished - some little bugs have to be killed. In a few days I'll release two short articles about polygons with a nice applet so stay tuned and keep coding!

Friday, July 27, 2007

Still there

Hey,

well long time no sign from me. Last time was pretty stressful, as always when the term-time reaches the end. On Monday I have a written exam in 'Communication and Databases' so no time for coding or doing anything else. Then I have 3 weeks holidays which I spent at my parents and one week in Spain; but that also means no updates on my website cause I have no access to the internet the whole August! In fact I have no idea what to code or reverse anyway...
Apropos Internet: I changed from German Telecom to o2 and this caused a lot of problems! In fact I had no telephone and no access to the net for more than two weeks! o2 is completely incompetent - they really suck!
So, I hope all of you reading this enjoy the summer and relax in the sun - exactly as I will do in the next weeks!
bye Sunshine

Thursday, June 28, 2007

'Hexen hexen'

Hey out there,

just updated my website yesterday evening with a page about the game 'Hexen hexen' in the java section. This is a little card game from my childhood which I accidentally recovered. In fact that is already 2 months ago, but I didn't had time for coding. Interestingly I was quite motivated to create the backtracking solver and finished it quite soon but I was too lazy to code the applet. This was somehow less fun and that's why only now everything was finished. Putting the solver online without applet had been stupid cause you wouldn't have known what's all about. So hopefully you tried the game yourself :-) Perhaps you even found both solutions...
What I will do next (concerning my website) is not clear. I noticed that everywhere you come across the CRC32 (like in all packing programs) but I don't know much about it. Perhaps I will try to code it myself. But let's see... Now I have to go to university to attend some lectures...
So keep cool & see you soon.

Monday, June 04, 2007

Huffman finished

Ok, today I finished my implementation of Huffman compression. It works quite stable and fast but the compression ratio sucks. Perhaps I'm gonna improve it a bit, but I'm not sure if and when. But as it was not easy to code, I hope somebody will find the source useful when trying to code it himself.
As always, you find the executable and source on my website (in the C section).
Have fun!

Thursday, May 31, 2007

Huffman Compression

Well, as mentioned above, I spend more time with coding in the last few weeks. I tried myself with my own implementation of Huffman Compression. (see Huffman Compression for more information).
While doing the huffman compression for a sentence with pen&paper is really easy and intuitive, writing a C programm is quite difficult: it took my really some time to build the huffman tree. Ok, I made two stupid typo-errors and linked the child leafes wrong... this resulted in time-consuming debugging. Well, sometimes I'm an idiot ;-)
But the compression itself was really hard! First I printed the huffman codes out as strings to be sure it works... not that big thing. But really save the codes as bits was pretty difficult and time-consuming and needed some fancy 'bit action'. Again, I made a stupid mistake by saving the codes in wrong direction in the compressed file, so decompressing failed for sure.
Finally, it works... but: it's really really slow and the compressed file is bigger than the original file cause of the overhead I save (the huffman tree). This must definitely optimized. But what sucks most is that my little programm hangs if compressing files larger than about 5MB. I fuckin' don't know why! So it will take some time till I will release the source on my site.
Have a nice weekend!

Monday, May 28, 2007

Got a new laptop... and Vista.

So,

a few days ago I started with some coding and reversing after I had done nothing for a long time. I code a little game in Java and also a bruteforcer which can give the solution, but there will be more information about that on my website in a few weeks. I also thought about coding my own implementation of Huffman-Encoding-Algorithm, but I'm not sure if I should do that.
Anyway, one incident stopped me: my laptop finally broke down. I had problems with it for some time: the battery didn't charge anymore, the touchpad didn't react and, most important, the display often flickered and switched itself off. And now the graphic card broke down, more than some purple lines on the display could not be seen.
So I decided to spend my saved money for a new laptop: I decided myself for a HP Pavilion dv6000. Main features: Core 2 Duo, 1GB Ram, 160GB and a lot of additional stuff. Runs very nice, but... oh no... no XP was shipped but Vista!!! Well after 3 days I slowly feel comfortable with this new OS, but I like XP more. Perhaps it will just take some time.
But I needed a patch to start Visual Studio 2005!!! What's that? Up-to-date Microsoft products are not compatible with Vista? They are all stupid...
Fortunately till now I had no further problems, but they will come... Let's see what will be next...

Tuesday, April 24, 2007

Exams are over!

Wow, now I'm feeling relaxed :-)
Had three oral exams during the last seven weeks: in Automotive Mechatronics, Automotive Engineering and the most important one, in Embedded System, which was today.
I'm really fed up of learning... it's too strenous and takes too much time. I had no time for coding or anything else that's why there was no update in this blog and on my website. Hopefully that will change now and I'll get more constructive...

Friday, February 23, 2007

Brainfuck Studio released!

Finally I have managed to finish the first public release of Sunshine's Brainfuck Studio and put it online at my site.
If you don't know: it's a little development environment/interpreter for Brainfuck files written in C#.
This version (0.6) should be to some extent stable ;-) It works quite fine, but syntax colouring and interpreting sources is even slower than I thought... As it's my first c# project, I don't know how to improve the performance, but let's see.
Also many features I am thinking of are not implemented yet. But there are newer versions to come, one day or other...

Enjoy it and keep cool!