Tuesday, October 21, 2008

Installing Silverlight 2.0 Developer Tools

as you might know, Silverlight 2.0 has been released. as i am wont to do, i went over to the site and downloaded myself the Silverlight 2.0 Developer Tools, which updates Visual Studio 2008 SP 1 and/or Visual Web Developer 2008 Express SP1 to work with the new release. unfortunately, the setup does not include Silverlight 2.0 Developer Runtime, and always attempts to download it (when i tried it on my computer, even when i'd downloaded the Developer Runtime and installed it separately, the install wizard still downloaded the Developer Runtime setup). to forestall this, download them both, unpack the Developer Tools setup into a folder (it's just a self-extracting package - almost any decent archiving utility on Windows can do this, i recommend 7-zip - WinRAR, ZipGenius and TugZip also can - i can't tell if WinZip does), and copy the Developer Runtime setup executable to the same folder. it won't download anything. well, work calls. later!

Monday, October 20, 2008

back at work...

got back to work today. late. it almost took me 2 hours to get to the office this morning. it only took 20 minutes yesterday!

crazy item of the hour: Exception occurred: OutOfMemor (thanks to edcba)

Wednesday, October 15, 2008

4x4=16

Biyi told me this joke a few days back, and i thought i should share it. there was this guy who bought a jeep with '4x4' on it, and was seeing a lady in a certain area. around there lived a not-so-balanced boy who saw the jeep everyday. one day, he took a stone and scratched '=16' after the '4x4'. later on, the owner came and saw his vehicle defaced. he got it fixed, but the same thing repeated twice. the owner then decided to add the '=16' after the '4x4' himself, and asked the body shop to do it for him. the next time the schoolboy passed the jeep, he saw the new 'equation'. he then took a stone and scratched 'VERY GOOD' and a tick on the jeep.

Fixed-position footer

i've been working (more accurately trying to work) on the TOS Funerals website design so it works well in older browsers, because it degrades horribly in them. for this to work, i needed a technique to force a footer to stay at the bottom of the window whether or not the content filled the window. the first technique i tried was from Boagworld. it worked like a charm - but only in newer browsers (Chrome, Firefox 3, Flock 1.2, IE 7, Opera 9.6, Safari 3/Win). it completely failed in IE 5.5 and 6 (quite unlike the advertisement. my guess is IE 5.5 and 6 don't understand the conditional comments).

so i got my rubber gloves on and tried getting a new technique - once again a Javascript-free method of getting about it. from yesterday's tests, this technique from Dave Woods' blog worked in IE 5.5 and 6, as well as the newer browsers. guess that's what i'll be using for now.

Update: the fault was with me. the Boagworld technique works. quite well, in fact. and it's smaller in both markup and styling.

here it is in Chrome:

Firefox 3:

Internet Explorer 5.5:

Internet Explorer 6:

Internet Explorer 7:

Opera 9.6:

and Safari 3/Win:

Monday, September 29, 2008

Code Geass is over!

i never really wanted to watch Code Geass: Lelouch of the Rebellion, because i read about it and found out Lelouch killed his sister. at any rate, someone got me watching it and i have to admit it has an extremely gripping story.

on Saturday, a friend came over and it suddenly struck me that Lelouch was planning his death, and i mentioned as much. there was only one episode of the second season left and it was to be shown yesterday (Sunday). the name "Zero Requiem" had been tossed around and i realized that a requiem is a song for the dead. it was brilliant how Lelouch executed his death. i kind of was hoping for a happy ending, or some romance, but it was not to be. ah well. i guess he really did make everyone happy. in that, he and Suzaku were heroes, but he was the unsung one. great story. hopefully now the twins will give themselves some peace...

Wednesday, September 24, 2008

bringing you up to date...

so what's been happening in recent times is i got into some serious trouble i had to take care of, so i've only been to work once this month. heheh...you can imagine what that means about blogging — it had to take a back seat. plus i fell ill for over a week. the one good thing about it is i confirmed i'm not fat, since i hardly ate throughout the period and i didn't lose weight :D. no, i'm not back to work, nor am i at home. you can just keep guessing — maybe i got someone pregnant? or killed someone? just keep guessing!

down to what Neo calls geek-stuff: why, oh why must programs install on C:? and why is the install procedure for Microsoft SQL Server 2008 Express so involved and such a pain in the butt? i don't have Visual Studio Service Pack 1 — so what? SQL Server 2005 Express was about 240MB, 2008 Express is over twice that - and still without Books Online. why would you give me a product that large and not add documentation? i am not always online! arrgh! at the very least, give me a choice of the packages i want to download if you're really interested in helping me conserve bandwidth. i've stopped ranting about Microsoft alone by now, but every company that will supply software over the internet. Thanks if it's free (whichever way), but there are parts of the world where it sometimes seems God turned off the internet. help the people in those areas too...it might be a pain implementing, but if we can choose before we begin the download, it might help some of us who don't know everything about everything...

anyway, i should soon be back home and i can at least update my antivirus program again. later then!

Saturday, September 06, 2008

Waiting for God to turn off the internet...

...but while i'm waiting, i'll say hello - it's been a while since i updated this blog last. hiya doing? hope you and all your important people are doing well

now to today's business. i'm writing this post from Google Chrome, which i must admit, looks pretty good, especially for a beta product. however, it's spellchecker doesn't recognize the words "spellchecker", "plugins" or "google" (specifically in lowercase). and i don't know how it will do with plugins like Flash. and even though it's still early days - why can't i customize where the install goes to? huh?

dude, web design isn't for the fainthearted. seriously. i've been working on a redesign of the TOS Funerals website, and it's not exactly been a walk in the park getting the design to work cross-browser. i swear Internet Explorer has some beef with me. first, the content area isn't set off properly as it is in other browsers (even in IE 7 standards mode!), and i've been unable to fix that so far. something else i got fixed was the fact that IE kept drawing a border around my horizontal rule. i had to do two-step hacking: add extra markup and styling. grrrrrrrrrrrr! i've some idea how to go about it now, but i still think it bears mentioning since i haven't actually fixed it: forcing a page to be at least as high is the browser window so the footer "sticks" to the bottom of the window, irrespective of how much content is actually in the page. my own solution saw the footer somewhere in the middle of a long page in IE (again). many thanks to the guys in #css on Freenode for steering me aright - this dude is much obliged. the testsuite for the new design is available at http://www.tosfunerals.com/newsite/testsuite.html (creating this post revealed that Chrome's text selection drag and drop always moves text, irrespective of whether or not you hold down the Control key...sigh!)

Sunday, August 10, 2008

Grouse with Facebook

morning. been a while since i last visited. well, i went to Ife and was offline almost all the time i was there. have you noticed that if you make a mistake signing in to Facebook, you hit Escape/stop the page, then try signing in again without refreshing, you can't sign in anymore? why are the Facebook developers using Ajax for the login page? wouldn't a simple submit form have sufficed? and if the Ajax was completely necessary (for instance, some webmail providers encrypt the password at the client's end before the login form even leaves the client), it shouldn't put the page in a state that the page is unusable if the user cancels it. not good, in my opinion.

Tuesday, July 29, 2008

O/RM and templating

i have a problem. i'm sending text messages to people based on data in a table. but people being who they are, they want to change the message structure at will. and the structure is currently hardcoded. so if i want to make the structure dynamic, i need a template system. i also need to map specific table fields to those template variables, then make the template changeable at runtime. that requires O/RM, so i can map table fields (relational) to objects i create in my code, and all the SQL is generated on my behalf by the O/RM engine. so far, i'm going with ActiveRecord and NVelocity from the Castle Project. i've used NVelocity, so i hope i'll get the same level of success from ActiveRecord (so many dependencies though :)

IQ tests are warped

Warning: shameless plug coming up! i added the IQ test application in Facebook. later on, the Advanced IQ test was recommended, so i added it and took the test. when i completed it, i found out of 15 questions, i only answered 13 and only got 6 right. yet when my IQ was calculated, it was rated over 100 (no, i am not telling you my computed IQ), which is not bad. in fact, it was higher than what was calculated using the regular test. hence my think they are warped. oh, 70 is idiot territory, so i guess i'm okay

Saturday, July 26, 2008

Avatar is over!

finally, i've watched all the episodes of Avatar: The Last Airbender. i have to say that all in all, the series was good. yes, there were some parts that really could have been cut out (like Season 3 Episode 17, The Ember Island Players) or modified, in my opinion, but then that's just my two cents.

stepping into Subversion

i've been joined by two other developers at work, so i needed to give them access to the code i'd written. i saw it as a great opportunity to try out version control, so i gave one of them the task of learning Subversion. he hadn't gone very far with actual implementation, and then my boss put him on something else, so i thought to myself, "what the heck" and started reading about subversion myself tonight. i installed the Collab.Net Subversion server, then TortoiseSVN and began scanning through the book (what? you expect me to actually read it? maybe on your time, not mine. it's past 2am here, for crying out loud).

i set up a repository, checked out, added a new file, tried to commit, then boom! authorization error! now the subversion book didn't say anything about this. so i downloaded HydraIRC, connected to Freenode, and joined #svn and ##csharp and asked. after some time with no answer, i went googling and found that a default repository allows anonymous reads and no writes, especially if you're connecting using svnserve. later on, someone gave me the same answer i got while googling. also got some useful tips, from the channels and the TortoiseSVN manual. in short, if you're going to use Subversion using the svn:// protocol (using svnserve, that is), you're going to need to configure your repository correctly. since it's in the TortoiseSVN manual, i'll refer you Windows users to it. please read Chapter 3, Section 2: Svnserve Based Server. everyone else, please look here for a few tips on configuring your repository for read/write access.

Saturday, July 19, 2008

i didn't go with .NET configuration files...and would like your input

i've been working on an application that needs to get some configuration parameters at runtime. at first, i thought of using configuration files, but then i realized that i would need to create another application that would be used to change the config. usually, an application config file is "tied" to the specific executable that it is created for, so - not being comfortable with XML in .NET - and having a tight schedule, i looked into other options. one was the registry and another was a custom config file. right now, i'm using SQLite as my storage medium, with the advantage that i can use the relational model if i need it. obviously, it has some drawbacks, but so far, i've got used to it. let me know what you think - assuming you do think anything.

Rant: why is Opera taking a long time to open Blogger - with no activity whatsoever? it's happened twice already...

Friday, July 18, 2008

The past week in review

hiya. been almost a week since my last post here. ah well. just wanted to bring you up to date with what's going on here, "here" being my life. grrrr. my neighbours decided today to have a party (an all-nighter by the sound of it), meaning there's going to be quite a bit of noise around.

in case i didn't mention it, i was in school last week. saw a couple of the guys, stayed over at Biyi's place while i was there. he seems to be getting along with his final year project and other stuff in his life. i'm happy for him. anyway, while there, i got some anime and have started watching Black Lagoon and Katekyo Hitman Reborn. i've also started Monochrome Factor and almost completed Hayate The Combat Butler. however, the anime series that currently has occupied my time is Code Geass. i started on Saturday and have almost completed season 1. i don't think i'd want someone like Lelouch as my opponent. my current fantasy revolves around a showdown battle of wits between Light Yagami (of Death Note) and Lelouch Lamperouge. sadly, this just reminds me of just how far behind i am with anime. Bleach, Eyeshield 21 and D.Gray-Man are all examples of abandoned anime projects. maybe you now understand one of the reasons i hate my job.

Wednesday: some local government people came around the building where i work and started complaining about the environment. so i don't bore you, they locked me and some other people in the compound. i had to jump over the gate to get out. i heard they later opened the gate - which is good, since almost everyone left in is female. every time i look at my right arm i remember - because i got scratched getting out. fro crying out, it's over 10 years i last did something like that!

Tuesday: i found that Visual Studio's debugger is superior to SharpDevelop's in one respect: if you're debugging applications within the environment, SharpDevelop's only catches uncaught exceptions. So if you're using System.Timers.Timer.Elapsed (for example), you'll never catch any exceptions. Visual Studio's, however, has no such compunctions, and will show exceptions even though the Elapsed event handler suppresses all exceptions. i can tell you that that's what saved my bacon on the current project i'm handling.

Monday: this project is my first experience with Oracle (even though i've had the express edition for almost a year), and if there's one thing i've learnt: always use 4-digit date literals in Oracle, especially if (like me) you're from a MySQL (or other database) background! i spent the whole weekend plus the greater part of Monday wondering what bug in Oracle i uncovered, only to find it wasn't a bug, just an Oracle quirk.

i've a custom class in my application that stores database connection parameters (previously in individual variables) - server, port, username, password and whatnot. since i'm moving to deploying the application solely on SQL Server 2005 Express (maybe PostgreSQL when i have the time to learn it) for now (no thanks to the many quirks of Sybase), i'm now simply hosting a SqlConnectionStringBuilder in the class. you really can't beat KISS.

while i'm still a newbie at regular expressions, i can definitely say they're great when they're used rightly. if i had to write custom code to validate phone numbers, i'd probably have a minimum of 20 lines of code, plus new if clauses (or similar) to write if the networks change. thanks to regexes, i can validate Nigerian GSM numbers - with or without country code - with about 3-4 lines - including creating the System.Text.RegularExpressions.Regex objects i want to use. and if i need a new case, i'll just have to change the pattern string. a pity more Nigerian developers don't seem to know about regexes - unless i'm wrong.

i need sleep! 'nuff said.

Saturday, July 12, 2008

Working with malware

hi. it's been a long time since i was last here. one month, eh? that's pretty bad. anyway, the point of this post is that i was recently in school, and came across some malware - one of which isn't picked up by any antivirus program i know as at now. this worms spread via USB storage (flash drives, external hard disks and so on). each copies itself to a clean device and also creates an autorun.inf entry in the device if it does not already exist (i can't tell what happens if it already exists). the one detected by AVG 8 Free has an executable named asp.net, and the one that isn't detected as at now has an executable named EXPLORER.EXE.

when i got to school, i had the 'privilege' of cleaning out two of my friends' computers. one was infected by the EXPLORER.EXE worm - which is easier to deal with if you don't have any antivirus installed - and the other was infected with the asp.net worm (if you have an antivirus that detects this, this is much easier to clean than without any antivirus, or one that doesn't detect it). let's start with the first.

EXPLORER.EXE worm in Process Monitor normally, a Windows machine has a process called explorer.exe. this process usually serves both as the shell (the program you use to launch applications) and the file manager. the executable for this is located in C:\Windows, has version information that comes from Microsoft, has the 'My Computer' icon and is about 1MB on a Windows XP machine. this worm is about 36kB, has no icon, has the same version information as the legal explorer.exe and runs from C:\Windows\system32. to get rid of this worm, you'll need a couple of applications from Windows Sysinternals, specifically Autoruns and Process Explorer (you can also download the entire suite if you want - it contains both). launch Process Explorer (an excellent task manager for Windows), accept the license agreement if you need to, and kill the EXPLORER.EXE process that doesn't have the My Computer icon and is running from C:\Windows\system32. next, launch Autoruns, allow it finish scanning, then delete the entries containing C:\Windows\system32\EXPLORER.EXE (use Ctrl-F) if you need to search). lastly, get rid of the worm executable itself. open a command prompt, and run attrib -h -r -s C:\Windows\system32\EXPLORER.EXE; del C:\Windows\system32\EXPLORER.EXE. this gets rid of the executable in its default location. your mileage will vary if Windows isn't installed on C:. EXPLORER.EXE worm in Autoruns

the other one is much harder to deal with because it creates a 'non-existent' process, according to Process Explorer. in fact, the process won't even be displayed in the processes list. i had to search for it manually. going through the console to use taskkill with the process id won't work either. so we're going to do it in the reverse flow. first, run Autoruns. search for appearances of asp.net autorunning, and disable, don't delete them. that's because if the worm is still running, it will simply recreate those entries. once you've disabled the entries, you can note the locations of the worm and reboot so you can delete it from all its hiding places (for me it was C:\Windows\system32 and C:\Program Files\Common Files\Microsoft Shared\MSInfo. again, this worm is hidden and probably has a system attribute set, so you need to remove those flags first. i'd personally recommend getting a recent (and decent) virus removal tool to remove this particular nasty, as it not only infects removable drives, but also fixed drives on your computer.

well, hope this is of some use to someone. have fun!

UPDATE: After a couple of days carrying around the EXPLORER.EXE worm on my external hard drive, i found that McAfee picks it up when i connected it to a colleague's computer. as at that time, neither AVG 8 Free nor PC Tools Antivirus was detecting it as a worm.

Wednesday, June 11, 2008

Windows power schemes

you really can learn something new every day. i recently formatted my laptop a couple of times for a number of reasons - one of them being that i found that my processor was constantly operating at its maximum speed and this was running down its battery seriously. after a new install, i noticed once again that the processor had starting running at its maximum speed again without stepping. i'd just installed WiX, and thought that might be the cause - but WiX doesn't update any system components, so i dismissed the idea (also, i'd installed WiX before and the processor was still stepping then). i'd gotten tired of formatting by then, so i just decided to keep using the laptop and its internal "oven".

this morning, i decided to google power schemes. i then found that for a laptop, power schemes really do matter beyond timing for switching on/off hardware like the monitor and hard disks. get this: they also affect the way the operating system uses the processor. for instance, the difference between "Minimal Power Management" and "Max Battery" is only the timing for turning off the monitor, hard disks, and going into standby - but under the hood, the CPU is allowed to toggle its speed based on demand. there's no difference between "Home/Office Desk" and "Minimal Power Management" when the laptop is on battery. for more information, please look up this article on Orthogonal Thought.

Blogged with the Flock Browser

Sunday, June 08, 2008

finally...finished Shounen Onmyouji!

Shounen Onmyouji is an awesome series, in my opinion. the opening song, Egao no Wake is wonderful (here it goes on my phone!), the story was great and flowed very well, and the end is awesome...(mostly). i was wondering what was going to happen in episode 26 when Masahiro kills Touda before the episode goes halfway. somehow, the end is rescued, and we get a believable ending...but why is the ending hinted at? if you - like me - rarely watch the end of an anime episode, you'd never find out that Akiko & Masahiro do go out to see the fireflies. ah well. in all, great series. pity i can't say if there'll be another great season.

Blogged with the Flock Browser

My phones and purpose

as i mentioned, i recently changed phones. i got a Nokia 7500 Prism to replace my 2600. One of the headaches of changing phones is migrating numbers. my SIM was full, and almost the same number of contacts were stored on my 2600. so i looked through my 2600, checking if the number was stored on the phone or on the SIM card, and then recording it in a text file - so i could transfer all my contacts to the new phone. i spent roughly an hour and a half doing this.

i can almost hear you say: fine, but what's this got to do with purpose? please bear with me - i can be a little long-winded when i'm trying to make a point. so i did that, then i put the SIM into my new phone and started using it - but the numbers stored on my old phone were still not on the new one. i went about for a day or so without having access to newer contacts. i then looked through my contacts (after finding out i wanted to contact someone, then seeing i didn't have their contact info), and found my 7500 had a function to move contacts from the SIM to phone memory. i did that, and emptied the SIM. i then checked the 2600 and found it could copy contacts from the phone to the SIM. so i did that too, and then moved all the contacts from the SIM to the 7500. if i'd only read the manual, i'd have saved myself about an hour and a half of typng out names and numbers.

i hope you get my point. some people might have spent another one and a half hours - or more - keying in the numbers into the new phone. but i decided that there was a better way. fortunately for me, i'm not as technically challenged as some folks, so i kind of figured out where to look pretty quickly.

let's imagine the time spent migrating contacts was your life. would you want to spend your life doing unnecessary things just to find out it was all unnecessary at - or after - its end? wouldn't you want your life to count for something? some people spend their whole lives doing things that won't count. there's Someone Who knows - much better than you - what you're meant to be doing. sadly, we usually think we - or worse off, other people - know exactly what we're meant to do. the person who best knows how my 2600 should have been used is its designer. God knows best what you're meant to do with your life. don't waste your life guessing what you're meant to do. ask Him! (James 1:5,6, New Living Translation, paraphrased: If you don't know what God wants you to do, ask Him, and He'll gladly tell you...). i pray you walk this path. life isn't meant to be guesswork.

Thursday, June 05, 2008

i got me a new phone, praise God!

i have no idea how it happened, so don't ask me, but this is what happened: i rarely change phones. i'm a strong believer in KISS, so if it can send/receive calls and text messages, it's a phone. even when MTN was giving out free MMS messages, i just had a faint feeling of loss. you know, the kind you get when you "miss" someone you never really knew. so i use my phones. and i rarely replace them. each phone replacement i've got was because the old one was faulty, got stolen or missing, except for the second. i have no idea why, but my parents decided to get myself and my sister new phones then. even the first phone i got was a hand-me-down (which i eventually handed off to someone else).

anyway, after being through about 5 phones in about as many years, my faithful Nokia 2600 developed a quirk. from time to time, it would stop ringing out (even in General mode), until ringing out at all became a very rare occurrence. i merely complained about the phone and didn't try changing it (i'm sure my pocket also had a great deal to do with this :). i was really shocked one morning when Dad, a friend and i were going out, and my dad asked why i didn't pick up his call. i mentioned my phone didn't ring out (dude, forget vibrating - i rarely notice that when i'm about). he gave me some cash to buy a phone. for maybe 2 weeks or so i kept stalling over the phone, which made no sense, because phones are sold less than 30 meters from my office. yesterday, after having a very interesting day, i just got mad and went to buy the phone. i didn't see something i liked in the display case, so i went to the price list. i saw something costing exactly what my dad gave me (no, it's not that much - but it's a sizable chunk of my monthly salary). i don't know why i felt good about the phone. i requested for it, paid for it without knowing jack about it, and went to test it. when the guy who tested it was closing the box, i asked where the USB cable was. He said it wasn't included and it would cost me an additional NGN 2500. i had that much on me, but i wouldn't be able to get home without visiting the cash machine, so i decided not to buy it. after buying the phone, i began feeling guilty, but i shook off the feeling and went home. getting home, i found i really like the new phone, plus, it uses the same cable as my MP3 player, so i really feel blessed! later!

Blogged with the Flock Browser

Sunday, June 01, 2008

Blender 2.46 out!

it's coming late, but Blender 2.46 is out, and the Big Buck Bunny movie is also out. personally, i downloaded Blender about a week back, but i haven't really don anything with it, since i'm doing a lot more programming than most anything else. and with the new release returns an old problem: i can't render with YafRay (no, not Yaf(a)Ray) as a plugin in the render window without Blender crashing. ah well. so i had to figure out workarounds - render into the 3d window, use YafRay from XML, or not use YafRay at all;)