in the name of zero

November 28, 2005

idiots embracing genocide

Filed under: random rants

i recieved this text message 10 seconds ago.

“because you opened this, you will be kissed on friday by your love. don’t break the chain! your crush will ask you out. tommorrow will be the best day of your life. if you don’t send this to 20 people before 12 midnight, bad luck in your love life will come.”

and guess what, college night happens to be tommorrow. what does new technology have that makes people lose all their sense of reason?

November 26, 2005

the fiesta faery

Filed under: life and school

stephanie. the one and only reason why a boy like me, would _even_ think about going to the ateneo de zamboanga university fiesta 2005.

. . . and she was there. wearing her eyeglasses that multiply her beauty ten fold. and the signature pink t-shirt that i have come to revere so much.

November 22, 2005

my head actually hurts!

Filed under: hermetic studies

ascii codes are mandatory in bf programing, so to guide me in making my first program i coded a helper function in c like so:

ascii.c
/** char to ascii code converter
 * brainf*ck helper program i wrote for fun.
 */
#include
#include
	
void t(char *stepy) {
        while (*stepy) {
                printf("%c : %d\n",*stepy, *stepy);
                stepy++;
        }
}
	
int main()
{
        char *stepy;
	
        stepy = strdup("I Love You Steph!\n");
        t(stepy);
	
        free(stepy);
        return 0;
}

when compiled and run, ascii.c will print out the string and its ascii code, character by character.

ok so the easy part is done. i now had to convert those encodings to something that bf can understand. the finished product? here it is. took me roughly 10 minutes to complete this!

steph.bf
++++++++++[>+++++++<-]>+++.>+++[>++++++++++<-]>++.
>++++++++++++[>++++++>+++++++++>+++++++++>++++++++<<<<-]
>++++.>+++.>++++++++++.>+++++.>+++[>++++++++++<-]>++.
>++++++++++[>+++++++++>+++++++++++>++++++++++++<<<-]>-.
>+.>---.>+++[>++++++++++<-]>++.>++++++++++[>++++++++
>++++++++++++>++++++++++>+++++++++++>++++++++++
>+++<<<<<<-]>+++.>----.>+.>++.>++++.>+++.>++++++++++.

time waster for sure. but i had a good time. oh well, goodnight and sweet dreams.

something is wrong with me

new look
because i wanted girls to notice me, i had my locks trimmed down to the shortest length i’ll _possibly_ ever wear in my entire life. 3.5 centimeters. so far, the feedbacks i’m getting are rather positive. (from males and females alike) though i’m more concerned with what the girls have to say.

here’s a typical scenario:

i apply gel to my hair, style it to spiked perfection and prance around the campus. i meet a girl acquaintance along the way…

me: “hello there.” ~ i smile shyly ~

startled female friend number 1: “wow! new look! cute!”

me: “shucks. thanks.” ~ i glance down embarrased. ~

startled female friend number 1 : “finally. you look like a human being.”

me: (or my mind rather) “can we have sex now?”

~ i continue to walk while glancing at her curves ~

after a few steps, i meet another girl acquaintance…

startled female friend number 2 : “wow! new look! cute!”

me: “yeah i know” ~ then i contract my lips a little ~

startled female friend number 2 : “you look much much better!”

me: (or my mind rather) “thanks.. i love you too! let’s have sex now shall we?”

~ i continue to walk while glancing at her curves ~

at least i look more presentable now. that’s what matters.

new language
recently, i’ve been quite busy practicing some more gtk2 concepts which includes GList, gmodule, gthreads gtktreestore and gtkliststore. unfortunately, juggling with all of these concepts really does get difficult sometimes. the working portion of my brain gets too overloaded with information. usually, with volatile logic that randomly pops up in my head when i think about how to implement a particular function.

“Quidquid latine dictum sit, altum sonatur.”
- Whatever is said in Latin sounds profound. -

enter brainfuck. the brainchild of urban muller. i’m having loads of fun learning how to write in it. let the codes speak for themselves.

hello world in c

int main()
{
	printf("hello world\n");
	return 0;
}

hello world in brainfuck (from the english wikipedia)

++++++++++[>+++++++>++++++++++>+++>+< <<<-]>++.
>+.+++++++..+++.>++.< <+++++++++++++++.>.+++.——.——–.>+.>.

more on this in suceeding posts.

new category
yeah. life ain’t always about learning and doing stuffs that other people won’t ever give a shit about. like any normal girlfriendless guy out there, i also watch movies and listen to music. so let me introduce my new category,

stuff i watch and stuff i listen to
and if i’m feeling extremely romantic.. who knows, maybe write a few poetry. but i guess that deserves a category of it’s own.

chicks don’t exactly throw their panties at me when i send them love letters.

November 18, 2005

happily, at her service

it’s amazing!! i helped miss ace with a minor annoyance she was having a while ago and now, i feel like i’m gonna explode with happiness.

in the words of henry ward beecher, “I never knew how to worship until I knew how to love.”

November 13, 2005

the best job in the world

united states of america air force fighter pilot

real gamers play mud

Filed under: life and school

screenshot of my fluxbox workspace running an achaea mud session on aterm.

The sheer, unadulterated simplicity and elegance of that brings a tear to my eye.

for the neophyte, mud means multi-user dungeon.

November 11, 2005

dynamic linkage, mixed emotions

Filed under: hermetic studies

i’ve been quite busy recently trying to learn dynamic linkage and so far, things are going quite smoothly. last night, i breathed my first breath of accomplishment when i was finally able to make notation load a module depending on user input. my first useful implementation apart from the usual “hello world”.

my breath of accomplishment was shortlived. for i found these out later. eikke’s blog and this. glib’s gmodule documentation page.

neat! just neat! i guess i have to patch this up now.

static void load_module(const gchar *module_name)
{
	void *module;
	void (*module_function)();
	
	module = dlopen(module_name, RTLD_LAZY);
	if (!module) {
		g_printf(\"dlerror: %s\n\", dlerror());
		return ;
	}
	
	module_function = dlsym(module, \"module_init\");
	if (!module_function) {
		g_printf(\"cannot find entry: module_init()\n\");
		return;
	}
	
	(*module_function)();
	
	dlclose(module);
	return ;
}

November 4, 2005

i’m just a kid

as the dust settles on the enrollment rush at school and people are getting prept for another week of add/drop slot fight, i treated myself to a hearty bowl of maggi and started doing some hermetic studies i realized, i should have done years ago.

yesterday, i finally understood the meaning of the terminologies “trunk”, “branch” and “tag”. used in source code management systems like cvs and svn to name a few. (don’t know if the same ideas apply to git though) anyway, i kept documents and source codes in cvs once. but i used cvs only superficially. to me, it was just a means of keeping files in an orderly fashion, in a central location. not to track changes and do other _important_ stuffs like generating diffs from different revisions. i missed out on it’s true purpose… but i know that was mental inadequacy on my part. mental inadequacy is something i can’t get rid of. trying out svn as of this time of writing.

oh well, on other past thoughts….

a few days ago, i asked a friend in a sort of trivialistic fashion, “what would happen if we free() an already de-allocated memory block?” my gut told me that’s something bad… but we both can’t put our finger on what really happens . so i planned a little experiment to satisy my soul.

today, i wrote a small program that malloc()s an int and free()s it afterwards, to find out answers and not just rely on some texts or someone explaining this or that. i compiled the program then ran it through valgrind.

foo.c
#include <stdlib.h>
	
int main ()
{
	int *pt;
	
	pt = malloc (sizeof(int));
	
	if (pt == NULL) {
		printf (”memory request failed.\n”);
		return 1;
	}
	
	free (pt);
	
	return 0;
}

below is the output. lines of importance are in bold.

amerei@heaven ~ $ valgrind --tool=memcheck --leak-check=yes foo
==12323== Memcheck, a memory error detector for x86-linux.
==12323== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==12323== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==12323== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==12323== For more details, rerun with: -v
==12323==
==12323==
==12323== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 10 from 1)
==12323== malloc/free: in use at exit: 0 bytes in 0 blocks.
==12323== malloc/free: 1 allocs, 1 frees, 4 bytes allocated.
==12323== For counts of detected errors, rerun with: -v
==12323== No malloc’d blocks — no leaks are possible.

ok. so the program runs cool. now what if i free() two times? valgrind tells me..

amerei@heaven ~ $ valgrind --tool=memcheck --leak-check=yes foo
==12364== Memcheck, a memory error detector for x86-linux.
==12364== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==12364== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==12364== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==12364== For more details, rerun with: -v
==12364==
==12364== Invalid free() / delete / delete[]
==12364==    at 0x1B90298D: free (vg_replace_malloc.c:153)
==12364==    by 0x804842A: main (in /home/amerei/foo)
==12364==  Address 0x1B906028 is 0 bytes inside a block of size 4 free’d
==12364==    at 0x1B90298D: free (vg_replace_malloc.c:153)
==12364==    by 0x804841F: main (in /home/amerei/foo)
==12364==
==12364== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 10 from 1)
==12364== malloc/free: in use at exit: 0 bytes in 0 blocks.
==12364== malloc/free: 1 allocs, 2 frees, 4 bytes allocated.
==12364== For counts of detected errors, rerun with: -v
==12364== No malloc’d blocks — no leaks are possible.

i kinda got carried away so i tried something else … “what happens if i don’t free()?” again, i humble myself before the almighty valgrind.

amerei@heaven ~ $ valgrind --tool=memcheck --leak-check=yes foo
==12411== Memcheck, a memory error detector for x86-linux.
==12411== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==12411== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==12411== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==12411== For more details, rerun with: -v
==12411==
==12411==
==12411== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 10 from 1)
==12411== malloc/free: in use at exit: 4 bytes in 1 blocks.
==12411== malloc/free: 1 allocs, 0 frees, 4 bytes allocated.
==12411== For counts of detected errors, rerun with: -v
==12411== searching for pointers to 1 not-freed blocks.
==12411== checked 1264544 bytes.
==12411==
==12411== 4 bytes in 1 blocks are definitely lost in loss record 1 of 1
==12411==    at 0x1B90236C: malloc (vg_replace_malloc.c:131)
==12411==    by 0x80483CF: main (in /home/amerei/foo)
==12411==
==12411== LEAK SUMMARY:
==12411==    definitely lost: 4 bytes in 1 blocks.
==12411==    possibly lost:   0 bytes in 0 blocks.
==12411==    still reachable: 0 bytes in 0 blocks.
==12411==         suppressed: 0 bytes in 0 blocks.
==12411== Reachable blocks (those to which a pointer was found) are not shown.
==12411== To see them, rerun with: –show-reachable=yes

memory leak. nuff said.

conclusions:
having studied c++ for my first and second years in ateneo, i came to the realization that some of the thoughts i’ve made about programming are conditioned to a some extent. (i switched to c immediately though) common sense told me that i must have a matching free() for every malloc() i call, no more no less. but then if i haven’t done this little experiment, i wouldn’t have known the reason behind the malloc()-free() pairs. staring at other people’s code e.g. /usr/src/linux has given me insights i could never have learned at school. there are still lots to be learned. and hopefully, if i remain perseverant, i would eventually talk c as good as these people one day. some, if not all give terrible, insulting comments, you’d almost feel like committing suicide. but then girls do to, and i’m still alive. i guess i’ll go study more about valgrind now. never a dull day with gentoo.

lastly, miss che is so cute!!!

November 1, 2005

miss che is cute. miss che is cute.

inspiration can be anything. recently, it came in the cute girly form that is miss che leong

ipv6 in ipv4 tunnel and routing

for my very first ipv6 experiment, i registered and obtained a tunnel from btexact. unfortunately, i’m on a dial up, hence dynamic ip addressing. turns out, in order to _update_ my tunnel, i need to login via the web interface, download a new script generated from my _new_ ip add, and run it to enjoy tunneling goodness. that my friends, spell manual redundancy.

luckily, there’s freenet6 dot net.

some notes about net-misc/freenet6:

1) the templates fail to work on my gentoo box. much to my dismay. i fixed it by modifying /etc/freenet6/template/linux.sh script to create a sit0 ipv6-in-ipv4 tunnel to freenet6 and routing thru sit1.

2) also recieved a siogifindex error when i try to create a sit1 tunnel instead of sit0.

3) /etc/init.d/tspc seriously needs some love and care. for now though, i’m using my dumb-ass init script. but i’ll try the bugs dot gentoo dot org solutions.

heaven amerei # ping6 www.kame.net
PING www.kame.net(orange.kame.net) 56 data bytes
64 bytes from orange.kame.net: icmp_seq=1 ttl=49 time=972 ms
64 bytes from orange.kame.net: icmp_seq=2 ttl=49 time=955 ms
64 bytes from orange.kame.net: icmp_seq=3 ttl=49 time=929 ms
	
--- www.kame.net ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3002ms
rtt min/avg/max/mdev = 929.859/952.733/972.489/17.560 ms

divine! so now i tried some ipv6 irc chatting…

--- Looking up irc.ipv6.eu.freenode.net..
--- Connecting to calkins.freenode.net (2001:1418:13:1::25) port 6667..
--- Connected. Now logging in..
--- *** Looking up your hostname...
--- *** Checking ident
--- *** Couldn't look up your hostname
-- snip --


this guy’s shot at eclecticism is way beyond sour, even for my taste. don’t try too hard bob.

then again, it’s all saints day.

Get free blog up and running in minutes with Blogsome | Theme designs available here