now maybe i will get some peace! blooming soccer fans! i have no idea what makes soccer so captivating. it really does dey logic. my borther - who's a Man Utd fan - didn't eat until the match was finally over. i guess he realized that whatever happened, the players still don't realize his existence. and that's my problem with Nigerian supporters of foreign teams. don't they realize that for the most part, the players don't know they exist, nor care if they are cheered on by some people they'll never meet? and yet the madness continues. men who are never alive as far as their families are concerned suddenly come alive when there's a meet between "their team" and "the enemy". ridiculous. that's why i insist that football is demonic. the Bank PHB ad about La Liga really puts it in context.
Thursday, May 22, 2008
Java vs Ruby? Ruby wins...
if for no other reason than the fact that there are much fewer books to confuse you. and here's why
Monday, May 19, 2008
Creating a Windows service in .NET
much as i would like to, this isn't a real tutorial about creating a Windows service in .NET. there are lots of excellent tutorials in that regard. this is just to highlight some problems i had recently when i created a service. usually, the service sits in the background, waiting for "something to happen", maybe a client connects, a timeout goes off, and all that. my service is a time-based service that performs certain actions when a timer goes off.
to get my service doing some "real" work, i used the System.Timers.Timer class, which has the Elapsed event, which calls a callback method when the timer fires. here's a caveat: the callback for the Elapsed event suppresses all exceptions in .Net 2.0 and lower (i can't categorically say that the behaviour isn't the same in higher versions). forget processing unexpected exceptions in your callback - they'll get supressed. and you may end up like me: after putting in a full day at work, spending the night there, and putting in another full day, you're at the client's and the service runs but doesn't do anything.
my fix? in my callback, i start a separate thread. the thread takes responsibility for doing the processing that was in my callback, and i once again can see what exceptions occur in my processing. by the way, design your tables so none of your fields are allowed the NULL value in .Net. use sensible defaults instead of NULL, becaue you never know when you'll get a System.DBNull object that isn't automatically converted to null. later, then!
Edit: when services run - irrespective of where the executable actually is - the working directory is always C:\WINDOWS\System32. that can be a problem if you access to files residing in the same location as the executable, especially if you don't know where the service executable is (if you think that is strange, think again: you - or someone else - could create an installer that allows the user customize the location of the install). if you need to get access to the executable's location, you can do:
string basepath = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
System.IO.Path.GetDirectoryName(basepath);
file:///C:/..., so you'll need to trim off the beginning of the string returned.
i used SharpDevelop for creating my service, as creating the service from scratch (Visual C# 2008 Express) or tusing an application template (Visual Studio 2008) gave me problems when trying to install the service using installutil. SharpDevelop integrates with FxCop, a code analysis tool developed by Microsoft. running FxCop on my executable showed me some things i'd never really noticed before, such as using string.IsNullOrEmpty(variable) instead of if ((variable == string.Empty) || (variable == null)) to check if a string was empty or null.
Fun and nonsense in Freenode's ##csharp
from time to time i hang out in ##csharp on Freenode. the guys there are great (mostly) - they've helped me out with quite a number of problems. and it's just plain fun to hang out with them. here's a excerpt from the conversation there this morning:
[11:39] <scruz> i don't ever want to be you - link managed and unmanaged code
[11:40] *** Mathius joined
[11:40] * scruz shivers at the thought of interop_madness' pain
[11:40] <Mathius> hi
[11:40] <interop_madness> you you don't want to be on the same planet as me
[11:40] <scruz> what planet is that?
[11:41] <+smellyhippy> Mathius: ello
[11:41] *** SDragon quit (Read error: 104 (Connection reset by peer))
[11:41] *** SDr joined
[11:41] <interop_madness> dunno, but it certainly has no sun shining
[11:41] <scruz> yello Mathius
[11:41] <Mathius> O_o
[11:41] <Mathius> hey hey
[11:41] <scruz> from Earth import Sun
[11:42] <Mathius> >_>
[11:42] <scruz> Sun.shine()
[11:42] <Mathius> public sealed class Earth : INoLight
[11:42] *** gregzx joined
[11:42] <scruz> lol
[11:42] <pandzilla> haha
[11:43] <Mathius> CSC Error: You cannot look for light in an instance of type 'Earth'.
Sunday, May 18, 2008
Multiple IEs on your WinXP machine
if you're like me, you like to use the latest software. that includes browsers. unfortunately, the latest browsers are a really bad idea if you're into web design - specifically standards-based design. because you need to workaround features not supported in older browsers. i made a really big mistake when designing a client's website - i designed it using the latest Firefox, Opera and IE7. it was okay in those browsers. imagine my shock when i viewed it in IE6 and it was fugly. and that was after deployment.
to avoid my mistake, you want to design using IE6. unfortunately, even i don't encourage you to use IE6. so how can you get IE6 for testing your web pages? well, i originally thought of using VirtualBox to create a WinXP disc image on my system - but that's a waste of about 2GB just to test web sites. so i went googling. and i came up with Multiple IEs. at first i thought it was just snake oil, especially when i ran IE6 and went to Help -> About. however, when i tested it, i got IE6's signature crappy rendering - and it was different from IE7's, so i'm quite happy advertising it. thanks to the guys over at TredoSoft!
Cleaning out my C:(loset)
i'm not sure why, but more and more, software installations tend to assume you have just one partition on your machine - that, or you absolutely don't mind it getting filled up with things you don't really know.
lost? let me explain: i'm in the habit of breaking up my harddisk into partitions. i used to leave 5GB on C: for OS files, taking into account that some software will always install some things on C: even if you tell the setup wizard to install on some other partition. that was enough about 4 years back. i upped it to 7.5GB sometime back, and finally to 10GB. now it seems even that isn't enough. i installed Visual Studio 2008 recently, and my free space on C: has plummeted down to less than 2.5GB - without enabling hibernate. i dread what would happen if i installed Adobe products - at least another 400MB would go should i install CS3 Design. yet i have over 14 GB lying fallow on a partition i reserved for installing application software. even with CCleaner installed, i can't free up any space. granted, a heavier-duty application can help with that, but i don't have much hope in that direction.
darn shame what they do to my disk space.
Friday, May 16, 2008
What happened to the Adobe-Yahoo collabo?
i just downloaded Shockwave Player 11 to install on my computer (yes, right now it seems nobody uses Shockwave anymore - Flash seems to have effectively killed Director) and i was surprised - no, shocked - to find the installer prompted me to install the Google toolbar. Google? what happened to Yahoo-integrated search in Adobe Reader? must be because i'm so tired...i'll check again when i do not feel so sleepy ;)
Thursday, May 15, 2008
long time!
haven't been here in a long time. stuff's happening, and sometimes it seems hazy, but i'm sure i'll win. things are looking up now, so i'll be here more often. later!
Thursday, April 24, 2008
been so long!
wow! it's really been quite a while since i was here. anybody miss me? guess not, judging from how silent my phone was before now. anyhow, i'm currently back in school. to clear up any issues with my results. and find out if i made the final cut. for service, that is. however, i got in kinda late and so all processing is going to have to wait till today. on my way here, i saw a sign advertising a church's programmes and containing the word 'enlargement'. users of Google mail may tell you that one recurring theme in their spam relates to penile enlargement. considering it's been so long since i've seen the word 'enlargement' in any other context, you can imagine what reading it on that sign initially did to me. maybe i really do have a dirty mind. later!
Thursday, April 03, 2008
Microsoft is weird!
seriously. everyone who has programmed in a real programming language knows that numerically-idexed arrays begin at index 0 (sorry, Basic fanboys). however if you're using the Microsoft SQL Server 2005 driver for PHP and you use sqlsrv_fetch_array() with SQLSRV_FETCH_NUMERIC, the array is indexed starting from 1! it's quite easy to miss this - i know i did. all the same, it's great to see Microsoft being so 'benevolent'. Don't tell me: it's just a ploy to migrate Windows developers to SQL Server!
Saturday, March 29, 2008
jus' chillin'
yo. long time, no see. man, the last one week has been - wow. Rental Magica is over - and i really do hope they begin a season 2. i really love that anime. and to think the twins almost made me not watch it! Bleach is on hiatus till April 9 - guess the anime has pretty much caught up with the manga now, and they don't want to introduce fillers at this point. yes, Dami was wrong - the producers chose to stop the anime rather than introduce fillers, or so it seems right now. what else? oh, yeah - i knew Castlevania: Aria of Sorrow was one of the coolest games ever! i saw Konami released it for mobile phones. yes, i love that game. even though i've completed it a number of times, it has awesome replay value...should i start playing it again soon? and it's cool that if you play the game cheat-free, it's very unlikely you'll get a complete soul set. for instance, the Zombie soul is one of the most annoying souls to get - and it can come in very useful in fighting a number of bosses (Manticore and Headhunter, anyone?).
as usual, i didn't prepare for the KMA test today...hope my score turns out good. it's hard to believe - even though the Bible shows precedent for it - but even in a school of ministry, there are people who'll do anything to pass. the test was over and the principal collected the sheets - but since he was tied up in preparing and presenting the video seminar, he didn't take the sheets in. there were people - remember, this is Bible school - that took back their scripts and kept writing even after everyone else had submitted. being smart? i don't like to think so. i think it's a basic lack of integrity coupled with fear of failure that makes people do things like that.
so what's my point? my point is: even if i haven't done that specifically, i have done things like that, showing my integrity can be questioned. for instance, if i flirt with a lady i have no intention of going out with, i'm not walking in integrity, because my thoughts, words and deeds don't add up. anyway, i have to go - power's off and i'm powering this EVDO card with my laptop battery...
Sunday, March 23, 2008
Software gripes
i sometimes play with 3D, though the time to do so is getting smaller and smaller recently...and anyway, i have a number of software packages installed, including Wings3D, Blender, Softimage|XSI Mod Tool, and an old version of Amapi. i've also had some experience with Autodesk 3ds max and Maya (very little this one).
the thing is: when i got a video tutorial showing how to model in Softimage|XSI and was using it with the Mod Tool, a recurring thought was: this would have been soooo much easier in Wings or Blender. i can model a mug in Wings in less than 5 minutes flat, including subdivisions. trying to reproduce the same thing in XSI would probably take me over 10 minutes. one reason may be because i'm new to XSI and have the Wings/Blender UI mostly down; another might just be because it really is easier in Wings or Blender. for instance, in the default Wings or Blender interaction mode, rotating your viewport is a matter of clicking (or dragging) your middle mouse button. the same in XSI is press O on the keyboard, then left-click for free rotation; middle or right for axis-constrained rotation (hint to Wings and Blender developers: mouse-controlled axis-constrained rotation isn't a bad idea). selecting polygons in XSI is annoying unless you're using raycasting - you need to lasso (with the risk of selecting something you don't want); in Blender, right-click, in Wings, left-click. so far, i'm trying to convince myself that XSI users aren't idiots (they really aren't).
by a similar token, while i'm now more used to the GIMP, i'd still rather use Paint.NET or Photoshop - simply because i find them easier to use. i'm loving Inkscape though, and Expression 3.3 is nice - but i haven't got the hang of it yet. my point: anyone fanatic about software simply because it's free or it cost them money needs a head check. at the end of the day, it's productivity - which is a relative of ease of use - that matters. 'nuff said.
Wednesday, March 19, 2008
i saw you
i saw you last night, you know. i saw - and heard - you. you were at the bus stop. carrying a baby on your back. and you asked me for help. i wanted to, you know. i really did. but it was to 8 at night. and it was just Dad and i at home. i had to do the dinner. i had to return Pastor's flash disk. and i had to rush for a bus. plus i was dead tired. so i ignored your plea. not that i wanted to. because my heart ached for you. i don't know why. but i was sad. so i did what i usually do. i put on my mask. like Ichigo, i changed myself with the mask. unlike Ichigo, i didn't get any stronger. but i kept the sadness to myself. and i got through the night. i remember you now. and though i never helped you last night, i pray you find help. i pray the One who watches over the orphan helps you. and i pray if i ever see anyone like you, i will not be too caught up with life to stop and help them.
Friday, March 07, 2008
Thursday, March 06, 2008
the spam Google mail accounts attract...and bloody Hellsing
just wondering why the most common spam i get in two Google mail accounts is penile enlargement. must be pretty popular these days. on a far more interesting note, i've seen Hellsing Ultimate episode IV. as bloody and gruesome as the previous three - maybe even more so, with a scene in which Alucard pushes Rip Van Winkle's gun through her (yes, Rip is a girl...for some reason i always pegged her as a very feminine guy...) and start lapping up the blood on the floor of the ship...if you already read the manga, this won't be a spoiler for you...now where did i put that Hellsing manga again...?
Flock 1.1 out - with webmail support
Thursday, February 28, 2008
my boss better not be reading this!
Monday, February 25, 2008
xkcd strikes again - this time with fruity goodness!
f**k grapefruit. by the way, if you read xkcd, check the image properties. sometimes he puts the really funny stuff in the image title.
Blogged with Flock
On Creativity (but mostly a rant about Lifehacker)
as with email, subscribing to a feed, especially a very frequently updated blog like Lifehacker is a mixed blessing. you can get lots of 'spam' when you subscribe to such a feed ('spam' meaning things you're not interested in). or you can get some really cool stuff, like this article on creativity. personally, i think Lifehacker is really cool - but there's so much there, i have to train myself to ignore things or i'll never get anything done. that said, Gina and the Lifehacker crew do a great job. but when do they actually get round to doing anything else? :D
Blogged with Flock
Saturday, February 23, 2008
As a man thinketh
Got this in my mail recently. Thanks to cable-t-y. PLS GET TO THE END of it! There are two nuns. One of them is known as Sister Mathematical (SM) and the other one is known as Sister Logical (SL). It is getting dark and they are still far away from the convent. SM: Have you noticed that a man has been following us for the past thirty-eight and a half minutes? I wonder what he wants. SL: It's logical. He wants to rape us. SM: Oh, no! At this rate he will reach us in 15 minutes at the most. What can we do? SL: The only logical thing to do of course is to walk faster. SM: It's not working SL: Of course it's not working. The man did the only logical thing. He started to walk faster too. SM: So, what shall we do? At this rate he will reach us in one minute. SL: The only logical thing we can do is split. You go that way and I'll go this way. He cannot follow us both. So the man decided to follow Sister Logical. Sister Mathematical arrives at the convent and is worried what has happened to Sister Logical. Then Sister Logical arrives. SM: Sister Logical! Thank God you are here! Tell me what happened! SL: The only logical thing happened. The man couldn't follow us both, so he followed me. SM: Yes, yes! But what happened then? SL: The only logical thing happened. I started to run as fast as I could and he started to run as fast as he could. SM: And? SL: The only logical thing happened. He reached me. SM: What did you do? SL: The only logical thing to do. I lifted my dress up. SM: Oh, Sister! What did the man do? SL: The only logical thing to do. He pulled down his pants. SM: Oh, no! What happened then? SL: Isn't it logical, Sister? A nun with her dress up can run faster than a man with his pants down............ And those of you who thought the ending would be dirty pray for forgiveness!
Blogged with Flock