Sunday, March 29, 2009

I made my first "hit"…I can now retire…(lol)

i've always had an interest in music. not merely as a listener and enjoyer of the audio arts, but i always wanted to make my own tracks. for fun and personal enjoyment. so i have a collection of VST instruments and effects, but i've never really gotten down to making any tracks. same as i've not done any 3D in a while :( anyhow, last night i got to being serious with at least making a 2-instrument track longer than 5 seconds :D so, in all its glory, i present to the world my lastest "hit" and expect those royalties to start coming in anytime soon (but i'm not holding my breath :D)

Get this widget | Track details | eSnips Social DNA

Thursday, March 26, 2009

Flop “Date”

it began with a call: “B's taking us to the movies, but insists O comes with a date, so…”. i'm a pretty solo kinda person. i don't really come into contact with people for the most part of the week. we're less than 10 at the office and only two in my area of it, and then i go home where it's just family — i rarely even see, much less talk to the neighbours. my phone rarely rings or beeps outside work hours. it's a life i'm used to — it sucks, but at least i know it.

but this date thing caught me offguard. even though i prepared for it, told my dad i would be having a sleepover, i was still reluctant to go. O called me on the morning, and thought i didn't have her number cause of the way i spoke. at any rate, i stayed late at the office. after waiting for the ladies to show up, we went to see Watchmen at the Palms. first time i ever went to the movies — and of all the movies to see, i just had to go watch Watchmen. as far as i'm concerned, very bad choice (plus some of my popcorn got lifted).

i basically glowered most of the movie, especially after the popcorn was gone. the ladies didn't seem to like it either, since they paid more active attention to me than the movie. i was basically regretting the waste of my time in something i didn't enjoy. i have my own timewasters — but i at least enjoy them. i pushed the feeling that i was the group wet blanket away several times, and did nothing to improve my mood or attitude (yes, i know. sue me — i'm a far more skilled jerk than nice guy). anyhoo, my date complains later that i ignored her. i keep my usual sarcasm in check and basically say nothing. she's basically saying something i already know about me: i suck at relating with humans. odd. because despite my fighting it i remain human.

Wednesday, March 25, 2009

The Middle Wife

my dad sent this to me, and i felt it was too good to pass up. here y'all go:

I've been teaching now for about fifteen years. I have two kids myself, but the best birth story I know is the one I saw in my own second grade classroom a few years back.

When I was a kid, I loved show-and-tell. So I always have a few sessions with my students. It helps them get over shyness and usually, show-and-tell is pretty tame. Kids bring in pet turtles, model airplanes, pictures of fish they catch, stuff like that. And I never, ever place any boundaries or limitations on them. If they want to lug it in to school and talk about it, they're welcome.

Well, one day this little girl, Erica, a very bright, very outgoing kid, takes her turn and waddles up to the front of the class with a pillow stuffed under her sweater. She holds up a snapshot of an infant. 'This is Luke, my baby brother, and I'm going to tell you about his birthday.'

'First, Mom and Dad made him as a symbol of their love, and then Dad put a seed in my Mom's stomach, and Luke grew in there. He ate for nine months through an umbrella cord.' She's standing there with her hands on the pillow, and I'm trying not to laugh and wishing I had my camcorder with me. The kids are watching her in amazement.

'Then, about two Saturdays ago, my Mom starts saying and going, 'Oh, Oh, Oh, Oh!' Erica puts a hand behind her back and groans. 'She walked around the house for, like an hour, 'Oh, oh, oh!' (Now this kid is doing a hysterical duck walk and groaning.)

'My Dad called the middle wife. She delivers babies, but she doesn't have a sign on the car like the Domino's man. They got my Mom to lie down in bed like this.' (Then Erica lies down with her back against the wall.)

'And then, pop! My Mom had this bag of water she kept in there in case he got thirsty, and it just blew up and spilled all over the bed, like psshh heew!' (This kid has her legs spread with her little hands miming water flowing away. It was too much!)

'Then the middle wife starts saying 'push, push,' and 'breathe, breathe. They started counting, but never even got past ten. Then, all of a sudden, out comes my brother. He was covered in yucky stuff that they all said it was from Mom's play-center, (placenta) so there must be a lot of toys inside there. When he got out, the middle wife spanked him for crawling up in there.'

Then Erica stood up, took a big theatrical bow and returned to her seat. I'm sure I applauded the loudest.. Ever since then, when it's show-and-tell day, I bring my camcorder, just in case another 'Middle Wife' comes along.

Now you have two choices...laugh and close this page or pass this along to someone else to spread the laughs.. I know what I did!!!

Monday, March 23, 2009

Provoking a Blessing

today, i was reminded about what it means to provoke a blessing. normally, the word “provoke” is used in a negative context; but i like what the Free Online Dictionary says: “to give rise to, to evoke; to bring about deliberately”. that's what happened today. i was rushing off to work this morning, and somehow dropped my wallet in the bus i took. there wasn't much money in the wallet, but it did contain my ID cards, some business cards and my ATM card. i was tempted to despair — just how deeply, i'll leave you to guess. but i decided that i'd walk in faith about it and remembered telling God that i give the tithe, and so the devourer is rebuked for my sake. i went back home and dropped my laptop off, then started coming over to work.

when i got to work, i found that someone had called my office saying i'd dropped my wallet. i wasn't sure about calling back since he might have called from a business line. when he didn't call most of the day — and i'd confirmed that he did call from a business line, i was tempted again to despair. i decided to keep trusting God's word instead, regardless of how i felt. i left the office not having heard from the finder. on my way home, my colleague sent me a text saying the guy had called from a business line and i should call him back. i set up a meeting, but it still didn't feel like the guy would return my wallet. after getting home, i waited till the meeting time then. i had mixed feelings — joy that i'd be getting my wallet back, and a temptation that it was just a game. to cut the story short, the person who found my wallet showed up. he was a secondary school kid. i gave him what i could, and wanted to clear off, but i didn't feel satisfied. i decided to pray for him there on the street, but i still didn't feel like i'd “hit” it. it's the second time in less than a week i've had this feeling. this first was when my sister came over when we were out and helped us with cooking and me with my laundry.

when i got home, i was still praying for him. i guess i kind of understand how God felt when Solomon offered a thousand burnt offerings to Him. there're just some things you do that make people want to bless you. i experienced God's blessing today, and someone was used by Him, and i felt provoked to share that blessing with him. that's all. except i got my wallet and its contents (complete with the N10 in it :D) without having to go to the police or do any funny stuff. and the wallet came back to me. i couldn't have gone looking for it anyway. coincidence? i think not.

Saturday, March 21, 2009

Refactored code...which is better?

this morning, i was editing some code, and Resharper warned me about a possible System.NullReferenceException. i'd been bitten before by this in the same code, but that was because i didn't understand how XmlReader worked then. here is the original code:


MessageDatabase messageDatabase = null;
MessageTable messageTable = null;

while (configReader.Read())
{
  if (configReader.NodeType == XmlNodeType.Element)
  {
    // ...
    if (configReader.Name == "messagedatabase")
    {
      messageDatabase = new MessageDatabase();
      messageDatabase.Name = 
        configReader.GetAttribute("name");
      MessageDatabases.Add(messageDatabase);
    }
    if (configReader.Name == "messagetable")
    {
       messageTable = new MessageTable();
       messageTable.Name =
        configReader.GetAttribute("name");
       messageDatabase.MessageTables.Add(messageTable);
    }
    if (configReader.Name == "identityfield")
      messageTable.IdentityFieldName =
        configReader.ReadElementString();
    // ...

as you can probably tell, it's supposed to parse an XML file and convert it into a bunch of objects. nothing wrong with that. it takes into account the structure of the XML and makes an assumption based on that, namely, the <messagedatabase> element is always processed before the <messagetable> element, so messageDatabase will be set to an existing MessageDatabase object before any MessageTable instance is created.

a more explicit version of the code is shown below:


while (configReader.Read())
{
  if (configReader.NodeType != XmlNodeType.Element) continue;
  // ...
  if (configReader.Name == "messagedatabase")
  {
    var messageDatabase = new MessageDatabase
    {
      Name = configReader.GetAttribute("name")
    };
    MessageDatabases.Add(messageDatabase);
  }
  if (configReader.Name == "messagetable")
  {
    var index = MessageDatabases.Count - 1;
    var messageTable = new MessageTable
    {
      Name = configReader.GetAttribute("name")
    };
    var currentDb = MessageDatabases[index];
    currentDb.MessageTables.Add(messageTable);
  }
  if (configReader.Name == "identitfyfield")
  {
    var dbIndex = MessageDatabases.Count - 1;
    var currentDb = MessageDatabases[dbIndex];
    var tblIndex = currentDb.MessageTables.Count - 1;
    var currTbl = currentDb.MessageTables[tblIndex];
    currTbl.IdentityField =
      configReader.ReadElementString();
  }

while this is more explicit, the code is simply more. for each property of the MessageTable, i must get the index of the last database and the last table in it, and then set the values accordingly. that plain sucks.

there was one good thing about writing this post: i finally thought about where i could optimize the loop that advances configReader, and added continue statements where they wouldn't cause exceptions. :D

Sunday, March 08, 2009

Done in very cleanly by Opera Mini

i had an emergency, and needed to send someone an email. i'd just installed Opera Mini, and decided to acutally use it instead of my phone's default browser. i logged into GMail, opened the mail i wanted to forward, and began forwarding it. i had to attach a file, so i copied it to my phone's memory card and attached it with no hassles. the problem was that every time i clicked 'Send', GMail would belch up an error concerning an invalid email address, which came to something like “/tmp/<gobbledygook>”. i resent this email thrice, to the same effect. Opera Mini is a great mobile browser. but i'm really shaken, as this is my first time using it, and i had this problem. ah well. since my main internet came up, i no longer needed to send the mail (which incidentally, was saved in my 'Drafts' folder).