Thursday, July 5, 2007

the nite before le voyage

skipping the days of idle emotions sans soucis, without stress... it'll all making me mad, driving me insane. what i really do like is the chasing voyage, the coolness in the corner, when you are trying to sleep, to relax, but you cant! it's nothing more than a big black hole sucking on my mind, getting me out of the last calm street into somethings, called life. guess what, my mind flows, blows up darker with the day into, worlds blowing exploding stars, fears near by the next sound of silence. yessir, i'll know it better tomorrow, when the darks coming in big clouds over everything. i'll know, it'll be ok. so dress up in your best suite and call the names of the forgotten forgiven and jump. what did i see?

Wednesday, July 4, 2007

Generic Programming

First of all the definitive selection-sort:
for i in range(1, n - 1): exchange(t[i], t[rgmin (t, i, n)])
really i cant imagine, why anyone could use library sorting algorithm for testing. everybody could write this one-liner and actually know the behaviour. but this little blog-entry is about generic programming. first of all the motivation: i think, that it is something important to learn, to forget about certain things when programming. this is most of all storage! every assignment should be a pain in your heart, because you have to think about something for nothing. so don't think about it while working on clever solutions.
Item max(Item a, Item b) { return (compare(a, b))? a : b; }
This is the max-algorithm. And works fine in c for every type of data. why? because we don't tell you anything about the data-type, it's just: Item. Okay someday you have to write a cool solution for the item type, because it's c and c let's you do everything.
typedef char* Item;
This is the definition to import for the use of strings. Another thing to do is to tell the machine about
compare()
. we cant compare strings like integers or floats or whatever you want to use. but silly me i've already wrote in my first course about c every compare operation i could imagine, so i wrap it for strings about
strcmp()
bool compare(Item a, Item b){ return (strcmp(a, b) > 0); }
hmmm... ok i hate
string.h
and for real application i would not recommend it just for the sake of my paranoia. if i cant control my applications... okay, and now you can use your smart algorithm for strings, and to change it for integers you just change
typedef int Item;
and here we go. you'll need another procedure to compare:
bool compare(Item a, Item b){ return (a > b); }
and compile. for the full code examples use this. but why all this crazy effort? why not hard code everything? because you are lazy. me i always let have some crazy seconds where i type in items and procedures to call... and then i reuse it and reuse it and... this is crazy, sexy, cool.

Tuesday, July 3, 2007

safari

today i've tried out the new apple safari. not that bad, but me too has to complain 'bout the missing shortcuts. it's a tragedy that i dont want to use this browser for that reason. normally i'm used to the firefox browser and this will stay my favourite cause i work under the gnu system. just sometimes for browsing on other systems i have to use firefox in this ugly outfit and with safari i get a proper font rendering. another thingy i've noticed is the wonderfull status bar for the visualization of the page load.

the first was the most loved...

than he turns into a killer. i'm really happy to have learned about something like functional programming and french at the same time. i noticed that there are not enough sources about this style on the net. after first fights with the other paradigm, it's really the better thing. cause i really do like to proof something to be correct than rather try to test it. another tip is this prof of the university bordeaux 1 who told me about exception-handling in the wonderful c programming language.