Showing posts with label Homepage. Show all posts
Showing posts with label Homepage. Show all posts

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:


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!

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

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

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!

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!

Tuesday, November 14, 2006

Sudoku Solver finished!

So,
I finally get my sudoku solver finished. While the bruteforce-backtracking variant is still not properly working, I completed the (in my opinion) more difficult one:
It's using Algorithm X by Knuth along with it's 'Dancing Links': That's a clever method for handling a spare matrix with a double-linked list, make changes to this matrix and later easily undo these changes. Algorithm X is non-deterministic alogrithm for solving an exact cover problem given in matrix form.
The point is now that: a sudoku puzzle can be transformed into an exact cover problem and therefore be solved with the algorithm X.
It took me really some time to understand how this all works, and even longer to implement it correctly (!), but it's pretty fast (much faster than the bruteforce-backtracking approach)! And once you understand it, it looks so elegant :-)
You can download the source from my site of course.

Apart form that, everything is fine. A lot to do for my study, but it's fun and quite interesting. A very good friend of mine moved into my flat, so now there is even more party in the evening.

And I want to emphasize it again: listen to Flyleaf. Such great music, I listened to them all the time while coding. So give it a try!

Ok, so keep on coding & reversing,
Sunshine

Thursday, June 08, 2006

BAC Calculator in progress...

Hm... finally summer arrives here again in South Germany after two weeks of rain and coldness. Although I chill the most of the time in the sun I find some time for coding... I'm working at a little applet matching perfectly the summer party time: a blood-alcohol-concentration-calculator (hope that's not too wrong and you can understand me). It uses two scientific formula (Watson & Widmark formula) which give a good approximation of the alcohol in your body. Well, it's nearly finished, here a pic of its current stage:


There will also be an English version of it. The data is stored in an xml file so I can easily update it. Nearly all functions work by now, but perhaps I improve the layout a bit....
Well let's see...