Wasting my time… Writing on a blog.

My page of ramblings

Java and its wonderful graphics class March 16, 2009

Filed under: Uncategorized — jordoex @ 2:22 pm
Tags: , ,

I could probably implement an entire windowing system using just java Graphics2D primitives.  They’re so useful, probably one of the best things designed right inside a language.

However, word wrap is a fairly annoying thing, but at least I found a code snippet that outlines it better than my original idea here.  It’s kinda ugly, but still not nearly as ugly as what you have to hack with c strings.

Here’s my slightly different implementation; it’s still pretty much the same, and i’m still gonna tweak it a bit more.  I’m just glad it works.
(more…)

 

I still hate C strings February 25, 2009

Filed under: Uncategorized — jordoex @ 10:32 pm
Tags: , ,

I present: substrings

char str_pid[strlen(msg_in.buf)-2];
sprintf(str_pid, “%.*s\n”, strlen(msg_in.buf)-3, &msg_in.buf[3]);

It’s just so ugly, why can’t they at least provide a sane substring class

God bless C++.