Sunday, May 06, 2007

Guys only: what does running water do to you?

i subscribed to the theory that when some other guy is taking a leak, you'll be motivated to take one too. however, i never did believe that running water makes you want to take a leak - until rather recently when i noticed it. i thought it was just coincidence until i took a leak, stepped into the shower right after, and wanted to take another leak while in the shower. that said, nobody bother threatening me with tales about water!

Saturday, May 05, 2007

Sunday, April 29, 2007

Updating AVG Free antivirus

i've been using AVG Free antivirus for quite a while now, and i quite like it. i have a habit of updating it online instead of downloading the updates and applying them manually, so when anyone asked me if i had updates i always answered that i didn't.
recently, however, i needed to do something in my registry, and saw something related to AVG updates there. i didn't pay it too much attention until i wanted to update a fresh install of AVG Free on two computers (my brother's, which rarely goes online, and mine).
i was going to update mine online then manually download the updates, when i realized: the updates had to go somewhere before they were applied, so i started searching. i found the update files at C:\Documents and Settings\All Users\Application Data\Grisoft\Avg7Data\upd7bin. Best of all, the update files weren't deleted when they were applied (note: some people will see this as an annoyance), so i could use them for my brother's computer!
Guess we learn something new everyday.

Saturday, April 28, 2007

IBPP...again!

i found that i didn't list all the changes i made to the IBPP source file _ibpp.cpp in my last post. plus, i'd only been using it for release build of my projects in Visual C++ 2005 Express edition - until today when i started a project in debug mode - and found i got some compile errors. so, here's the comprehensive list of changes i made to the original source file to compile with a Unicode character set, without further ado. i really should upload the file, but since i have no place to put it...

  • Line 44: from #define REG_KEY_ROOT_INSTANCES "SOFTWARE\\Firebird Project\\Firebird Server\\Instances" to #define REG_KEY_ROOT_INSTANCES TEXT("SOFTWARE\\Firebird Project\\Firebird Server\\Instances")
  • Line 45: from #define FB_DEFAULT_INSTANCE "DefaultInstance" to #define FB_DEFAULT_INSTANCE TEXT("DefaultInstance")
  • Line 87: from ::OutputDebugString(("IBPP: " + p->str() + "\n").c_str()); to ::OutputDebugString((const TCHAR *) ("IBPP: " + p->str() + "\n").c_str());
all other changes remain the same as in my previous post - did you really think i'd want to duplicate effort? Note: as in my previous post, you may want to use a safer way of getting things done than a cast on line 87.

a word of note here: i finally looked through the sources for Flamerobin 0.7.6 sources and there were no changes to the IBPP source. i have no idea how they managed to get it to build under Windows/Unicode. i haven't tried building it myself, nor am i likely to (according to Larry Wall, the creator of Perl, programmers are inordinately lazy. and i intend becoming an excellent programmer).

Journeys

there's a classic saying: "A journey of a thousand miles begins with one step". it's old, but good wisdom, especially for young people today. we usually think of it as meaning that you need to at least begin something to have a final accomplishment, but we (or at least i) don't usually think of it in the negative, as in: if you don't want to swim with the sharks, don't even go near the beach. so if you start a journey on the road to Rome ("all roads lead to Rome"), you'll eventually get there, so don't start if you don't want the natural result.

far too often, we toy with decisions and actions, ignoring their natural outcomes, maybe subconsciously thinking we can get away with it. think again - you can't sidestep the natural outcomes of your actions forever. sooner or later, the results will come home to roost. and postponing decisions belongs here too - you cannot sit on the fence forever - eventually, the fence itself will probably give up under the influence of your weight. in our ultra-relativistic generation, maybe facing the fact that absolutes do exist may just be our salvation.

Wednesday, April 25, 2007

stuff n nonsense

broke my wxWidgets install yesterday when i reconfigured the build. it seems wxWidgets becomes a radically different and undocumented animal when you build it with some settings (such as STL and using std::string) turned on. anyhow, i tried rebuilding it to no avail - it was still broke. so right now i'm uncompressing the wxWidgets 2.8 distribution to rebuild it. kinda sucky, isn't it?

in other news, i found i am unable to build Boost from source with Visualc C++ 2005 Express. the build script (build.bat) is not designed to work with any toolset other than VC++ 7, and it's really annoying that i have to go online and download a prebuilt Jam binary. of course, code that depends on Boost and its build process (like the ASL) also doesn't build. sheesh!

finally, to use IBPP under both ANSI/Unicode in Windows, you're going to have to patch the file _ibpp.cpp. i tried a number of hacks that failed, but i finally got someting working, so here it is for version 2.5:

  • Line 111: change char fbdll[MAX_PATH]; to TCHAR fbdll[MAX_PATH];
  • Line 142: change mHandle = LoadLibrary(path.c_str()); to mHandle = LoadLibrary((const TCHAR *) path.c_str());.
    Note: There has got to be a cleaner way of doing this than just casting. Check MSDN or the Platform SDK for documentation on MultiByteToWideChar() under User Interface, International Text Display, Unicode and Character Sets.
  • Line 167: change char* p = fbdll + len; to TCHAR* p = fbdll + len;
  • Line 170: change lstrcat(fbdll, "\\fbembed.dll"); to lstrcat(fbdll, TEXT("\\fbembed.dll"));
  • Line 175: change lstrcat(fbdll, "\\fbembed.dll"); to lstrcat(fbdll, TEXT("\\fbembed.dll"));
  • Line 194: change lstrcat(fbdll, "bin\\fbembed.dll"); to lstrcat(fbdll, TEXT("bin\\fbembed.dll"));
  • Line 204: change mHandle = LoadLibrary("fbclient.dll"); to mHandle = LoadLibrary(TEXT("fbclient.dll"));
  • Line 209: change mHandle = LoadLibrary("gds32.dll"); to mHandle = LoadLibrary(TEXT("gds32.dll"));
i guess that pretty much covers it. you should go from 12 errors to 0 compiling _ibpp.cpp in Unicode mode with this in Windows. personally, though i don't think this is how the Flamerobin team built the Unicode Windows binary, but i - lacking patience at the time to wade through the code for the Unicode version - just decided to fix my problems myself.

i was finally able to make some headway with learning how to use Crypto++. i'm just a simple guy who wants to hash a password, and i don't want to learn all about cryptography to do that! many thanks to the developers of Hashish for their source code, and to Denis Bider for his Crypto++ User's Guide.

besides my problems with trying to program (and ultimately succeeding), i've been delving into music a bit (at least i know what a chord is now, and can try to play scales other than C major). maybe i'll actually get into digital music someday. oh, yeah, i've also been trying to study so i can be ready for exams when school opens (only God knows when). later!

Friday, April 20, 2007

digital audio stuff

since i got home, i've dabbled into quite a few things, including making my own music and pixel-based graphics. not having the cash to fork out for a program like FL Studio, even the demo download, i've had to set my sights quite a bit lower. i looked in the archives and came up with Psycle and Milkytracker, among others. Psycle is - among other things - a VST host, so you can load up VST instruments and effects into it - some with more success than others, anyway. at any rate, what i really want to say here is that i got an excellent drum machine that never seemed to work for me (JM-1) the way i wanted it to. using soundfonts was also nice, but it was kind of disconcerting to learn the keymap for producing the correct sound. anyway, i was labouring with JM-1 because it had pretty much the same problem as the drum soundfont i had: each key was assigned to a different instrument, except in my case, it was worse because i could not use the snare. and the quality produced by this machine was excellent, relatively realistic. i was almost pulling out my hair when i found out by sending a command to the machine, i could control which instrument's sound it would produce. trying it yielded some results, but i had to turn off the setting i set immediately after, or else the machine wouldn't emit any sound on the next setting. sorry i have no screenshots, but i guess i just wanted you to know what i was up to. hopefully, i won't strike anyone deaf with my twisted idea of what music is...later!

Saturday, April 14, 2007

Who stole my vote???

i realise it's bad to use 3 question marks to end a question, but i think it's important to show my discontent. what happened to my vote? this rubbish about voting at the same point that you registered is the limit. i registered in school, now that school's closed and i'm in another state, does that mean that i registered for nothing? i can't believe i waited almost 4 hours to hear a 'sorry, but you can't vote here because you never registered here - you might have if the electronic voting system was up...' - especially since all those who registered in school asked and were assured we would be able to vote in the governorship and presidential polls. arrgh!

Friday, March 30, 2007

at home and dulling

power's been bad over here, and now the generator's gone, and its replacement hasn't come yet. in the meantime, i'm yet to finish a really simple project. well, my brother and dad's birthdays are around this time, so i'll just slack off tonight and for another 3 or so days (i wish). nothing really special happening, and since i didn't prepare to get online, i can only post this crud. later, anyway. man, sometimes being home sucks. majorly.

Wednesday, March 14, 2007

at home

made it back home last Friday. i'm using a sucky internet link that varied anywhere between 0.6 and 4.7 kpbs in the last 35 minutes, and since there's no power (i live in lagos, and there are some power problems there), i'm running both the modem and my laptop off the laptop battery, meaning i have to pack this in soon (if the heat doesn't get me first).

i recently installed Apache on my laptop, and everytime it runs, the CPU usage goes up to almost 100%, meaning that my laptop battery doesn't charge when i'm running Apache. it also means that my computer instantly becomes much slower. i'm not sure if it's the antivirus program i use, Comodo antivirus, since i've used it without that antivirus installed, and it doesn't do the same thing...but disabling the antivirus and running the server didn't help...

if you're close to a student of my school, you probably know that after students were vacated (rather) forcibly from school, a part of the Sports Market burnt down. so quick resumption seems to be a dream of the things they pump oil through. ah well

got to pack this in, so later!

Thursday, March 01, 2007

The OAU Standoff: Day 4

you might have heard that my school has been closed indefinitely. but since i haven't blogged in a little over a week, you never heard of it (at least from me). anyhow, from what i've pieced together, here's the story.

school traditionally has a week free of lectures and similar academic activities right before exams begin. as far as i can tell, this isn't a part of the school's constitution, merely a concession on the part of the school's senate (highest academic authority in school). however, this "privilege" (i'm assuming my information is correct) has been often abused in the sense that the SUG has turned into a right to be demanded for whenever it seems threatened. unfortunately, while the former VC, Prof. R. Makanjuola was the kind of person to allow such and still leave the week open, the current VC, Prof. M. Faborode, is not.

my story does not actually start here, but i'll pick a certain point in past history as its starting point. last session, the SUG elections held as usual, and allegedly rigged so that a certain candidate, Akinola Saburi was declared President. his legitmacy was initially questioned, but later things were laid to rest. soon after, though, the school authority declared Saburi's election was invalid, because he was on suspension by a previous administration. Saburi was later expelled by the current administration. this obviously led to a strained relationship between the authority and the SUG, to the point that i heard that concerning the current deadlock, no meetings actually held between the school and the SUG because the SUG allegedly held the stand that if Saburi was not recognised by the authorities, the other members were not going to meet with the school.

exams were to start on Monday the 26th, this was brought to an end rapidly by the SUG when they invaded exam halls and stopped exams from taking place. i'm not quite sure when the authorities hired MOPOLs exactly, but i think it was the same day. history lets us know that students and armed law enforcement are a volatile and explosive mix, one that should not be allowed occur. i have no idea what the authorities were thinking, since the MOPOLs are not examiners/invigilators. that said, the SUG had already set up blockades so that vehicles were not allowed to move freely in and out of campus; it was mostly irrelevant since the largest volume of campus traffic is public transportation. it also seems the banks on campus were "visited" by students and even the ATMs weren't working, if i remember correctly. by Tuesday, incidents involving students, stones, MOPOLs and tear gas took place. in an ironic twist, some students reading in academic areas on Tuesday night were assaulted by other students, who maintained that reading was to be restricted to halls of residence.

yesterday started with Saburi going around informing students to stay in their rooms if they were cowards, and that "traitors" would be treated like Judas Iscariot of the Bible. the MOPOLs, unlike the previous days, did not patrol campus, just stayed at the gate. i heard the SUG gave the school the ultimatum that if exams were not delayed by a week, the school should be closed. and it was. students were told to vacate the halls of residence by 6pm yesterday for their own good. what makes this situation particularly aggravating is that new graduates are in school to receive call-up letters for youth service, so this situation affects them too. so now i'm in school and thinking of what to eat, and how to start reading so i can be ready for exams whenever school opens. later, anyway!

Wednesday, February 21, 2007

Someone help! Google Sketchup driving me up the wall!

Google Sketchup seems to be the new darling of many 3D peeps out there. and as i've found, it is a really cool program. my only problem with it is using it - because, as you may know, i am not online 24/7, and i'd much prefer to be able to download the manual. unfortunately, the manual download link is not resumable, making sure the peeps like me that have psychotic internet connections are basically messed up, since all we can do is try to download the manual. mirroring the HTML using HTTrack didn't work. and having the manual would save me sooo much trouble using Sketchup. someone tell Google to allow resumes for the manual at least. later!

Tuesday, February 20, 2007

hey up!

so i went home over the weekend to attend a friend's wedding, and to give my dad his birthday present in advance. or so i said. when i got to Lagos, i dropped off a package for a friend at Computer Village, Ikeja, and purchased a few DVDs. i was going to my dad's office when i got picked up (or should i say picked on) by a policeman in plains. to cut the story, i was picked up for carrying around a laptop, and the man was just looking for prey, because even after i provided a receipt for it, he went as far as making me call the number on the receipt and asking them to fax something having to do with where and how they get laptops. for crying out loud, what's that got to do with me? at the last, i called my dad, who called my uncle - who in turn got there with an uncle of mine who is himself a policeman. so i got out without paying a dime to anyone, and i'm really grateful for that, since i barely made it back to school, even with a raise from my brother!

that said, there's a variant of the RavMonE.exe worm that isn't picked up by AVG Free Antivirus/Antispyware. quite odd, i must say, since generally Grisoft's security products are actually quite good. the file is not much under 4MB, same executable name, and is also coded in Python.

Sunday, February 11, 2007

something i've begun wishing for

i've recently begun to make some use of Inkscape, and more and more, i wish that i could (more like someone could) write a script/plugin to create a palette of colours used and then allow you to change the palette on the fly, modifying the document. in essence, a bit like CSS for Inkscape. this way, i could create "colour themes" for graphics so that i could quickly see the new colour theme's effect. this would definitely be far more handy than trying to hand-edit that complex gradient. i wanted it for myself, then a client says, "change the colours", and i know i'm in trouble. i don't even want to think about how troublesome that would be...

Wednesday, February 07, 2007

a rose by any other name...

William Shakespeare, genius that he was, penned the immortal lines. quite unfortunately, the converse also holds: a nettle by any other name is still going to sting just as well. this is the weird beginning to todays post on the many wonders of developing on Windows, specifically DLL hell - or at least a problem much like it.

for the uninformed, DLL hell comes about from the process of installing and uninstalling programs, usually resulting in an important shared library (DLL) being replaced with a version that causes other programs to fail. see this Wikipedia article for more information.

my problem isn't quite DLL hell, but it is related somehow. now, for unmanaged C++ (that is, C++ native code, or code not managed by the .NET Framework, hence the name), you'll most likely require some sort of runtime, as defined by your compiler vendor/settings. with Visual C++ 6.0, you needed msvcrt60.dll and msvcp60.dll for the runtime of non-debug C and C++ runtimes respectively, and for Visual C++ 8.0 (including VC++ 2005 Express, which i use), you have msvcrt80.dll and msvcp80.dll - or something like that. where DLL hell comes in is that if you have the required DLLs for a program to run installed, some program may replace/remove such when you install/uninstall it, breaking other programs needing it. in my case, i've been writing code that had a dependency on msvcp80.dll, and didn't have a problem until i uninstalled something. suddenly previously perfectly working programs i wrote stopped doing so. now Microsoft has these redistributable packages that allow you run programs with that particular runtime dependency. so i got a copy of the Visual C++ 2005 Redistributable package (download page here) and installed it. twice (two different copies, that is). no dice. i finally had to rebuild the application framework library (wxWidgets) so i could statically link in the C/C++ runtime for each application. ah well. i did at least know enough to get round my problem without reinstalling my compiler and its service pack. sayonara!

Saturday, February 03, 2007

Why i switched back to Firefox from SeaMonkey

as you probably already know, the Mozilla Corporation is the new home for Mozilla Firefox and Mozilla Thunderbird, and the original Mozilla suite is more-or-less gone, and is the base for the community project called SeaMonkey. SeaMonkey is really the successor to the Mozilla suite, containing the works - browser, HTML composer, email client, IRC client - with some other things to make the power user pretty happy.

anyhow, i started using SeaMonkey because of some things i'd heard about it: it consumes less resources than Firefox and Thunderbird separately, since with it, it's all the same one application; it has a quickstarter on Windows to allow it start up faster; the Firefox artwork is not open-source, as is the rest of Firefox, which is problematic for users wanting to bundle Firefox with opensourced (notably GPL-licensed software/operating systems. there's been some hullabaloo about it all.

so i installed SeaMonkey, started it up…was almost immediately disappointed. i had the following problems with it:

  • the simple keyboard shortcut for the search bar from Firefox was missing. combining the address and search bars is cool, but i'm just not used to it, and searching when trying to open an address is annoying.
  • the easy choice of search engines in Firefox (two clicks or keyboard buttons once you're in the search bar) is really cool. Google isn't the only useful search engine out there!
  • i can't and/or don't use some of the other features that come with SeaMonkey, such as email/IRC chat. the additional 7MB for the download isn't worth it.
  • address completion shortcuts are soooo missing in SeaMonkey.
  • as at when i use SeaMonkey, only the default themes seemed to be available for use. i love eye candy less than the next guy (i use the Windows classic theme, FYI), but i do appreciate it once in a while. in my opinion, the only SeaMonkey theme worth using is the Modern theme, and even that gets boring after some time.

basically, i've more easily got used to Firefox than SeaMonkey, and making the switch was (to my thinking) unnecessarily hard, since they both use the same codebase. SeaMonkey doesn't need to be a Firefox clone, but there are some really cool things in Firefox that can be adopted in SeaMonkey.

Thursday, February 01, 2007

randomness

some Microsoft bashers have far too much time and money: look here.

and what's with the new (seeming) jollity between Google and Yahoo!? i've noticed that if you run a Google search while logged in to Yahoo!, you see some additional options at the top of your pages...later!

wxWidgets and the Windows SDK

i recently formatted my harddisk and reinstalled Windows, so i started installing applications i normally use. that included VC++ Express, and since i develop applications using it for the Win32 platform, i would normally have installed the Platform SDK. however, i'd recently obtained the Windows SDK, so i used that in lieu of the PSDK. i mean, the WinSDK seems to be the successor to the PSDK, so why use older headers and libs…or so i thought. everything went smooth, and i even integrated the WinSDK with VC++ with a single click (configuring VC++ itself for native Win32 apps was a little more roundabout; see this article for help). so far, so good.

since i was using wxWidgets for an application i was writing before the format, i downloaded it again and started the commandline build, according to the time-honoured instructions in the source archive. i started the build and almost immediately got shock #1: wxWidgets (or specifically, the TIFF library bundled with it) wouldn't build because windows.h was missing. as i'd integrated with VC++, i was surprised, to say the least. i checked the VC++ directory options and found nothing wrong, and windows.h was supposed to be available. checking the INCLUDE environment variable let me know that the WinSDK hadn't set environment variables when installing. after fixing it, i sat back to enjoy my build procedure until i got shock #2: some platform-specific code wasn't building. since i'd already built that version of wxWidgets before without problems, i had to surmise that it was the WinSDK acting up. installing the PSDK and removing the environment variable settings i created for the WinSDK allowed wxWidgets to build without fuss.

i'm not sure if it's the wxWidgets team or Microsoft i should blame, but since Microsoft is the company everyone loves to hate (actually, because the PSDK worked all ways), i'll say Microsoft wasn't on the up-n-up, or why would they change the API so it would break existing code? whatever, anyway. the main point is that wxWidgets 2.8 (and most likely, lower versions) doesn't work unpatched with the WinSDK, as maybe a few people would have found out by now. so version number addict, chill out. today's Win32 apps should still work on Windows Vista, so it's not that big a problem anyway. later.

Saturday, January 27, 2007

wxWidgets 2.8 not working with Windows SDK

i recently formatted my harddisk and reinstalled Windows, so i started installing applications i normally use. that included VC++ Express, and since i develop applications using it for the Win32 platform, i would normally have installed the Platform SDK. however, i'd recently obtained the Windows SDK, so i used that in lieu of the PSDK. i mean, the WinSDK seems to be the successor to the PSDK, so why use older headers and libs? or so i thought. everything went smooth, and i even integrated the WinSDK with VC++ with a single click (configuring VC++ itself for native Win32 apps was a little more roundabout; see this [link]article[/link] for help). so far, so good.

since i was using wxWidgets for an application i was writing before the format, i downloaded it again and started the commandline build, according to the time-honoured instructions in the source archive. i started the build and almost immediately got shock #1: wxWidgets (or specfically, the TIFF library bundled with it) wouldn't build because windows.h was missing. as i'd integrated with VC++, i was surprised, to say the least. i checked the VC++ directory options and found nothing wrong, and windows.h was supposed to be available. checking the INLCUDE environment variable let me know that the WinSDK hadn't set environment variables when installing. after fixing it, i sat back to enjoy my build procdure until i got shock #2: some platform-specific code wasn't building. since i'd already built that version of wxWidgets before without problems, i had to surmise that it was the WinSDK acting up. installing the PSDK and removing the environment variable settings i created for the WinSDK allowed wxWidgets to build without fuss.

i'm not sure if it's the wxWidgets team or Microsoft i should blame, but since Microsoft is the company everyone loves to hate (in this case, more because the PSDK worked previously), i'll say Microsoft wasn't on the up-n-up, or why would they change the API so it would break existing code? whatever, anyway. the main point is that wxWidgets 2.8 (and most likely lower versions) doesn't work unpatched with the WinSDK, as maybe a few people would have found out by now. so version number addict, chill out. today's Win32 apps should still work on Windows Vista, so it's not that big a problem anyway. later.

Wednesday, January 24, 2007

internet annoyances

here in school, the cafe i use is served by the school. recently the school's servers have been messing up. i've been in the situation of a site's favicon being retrieved, and a DNS error page. obviously, the site's domain name was resolved, or was it via magic the favicon showed up? i hadn't bookmarked it anywhere! even Google and Microsoft aren't left out. i'm not sure which is more ridiculous - the former scenario or the one where i can visit the main Microsoft site but i can't download anything from its subdomains. eek!