Thursday, September 10, 2009

Back...for a while, anyway

feels good to be home. and i have been home for two weeks today. unfortunately, i was too lazy, too busy, too tired and too ill (not all at the same time, mind) to log in here and update my own blog. geh. anyhow, i'm breaking that cycle now. i also hope to blog at least once a week when i get back to Zamfara, since my local government of posting is a nice little place that has no internet whatsoever.

Camp had its good sides. i wasn't the only person from school posted to Zamfara — a buddy of mine was posted there too (not that it did much good; we did see quite a number of times, but...life happens, you know. and in case you didn't already know it, i kinda get prickly when i think people get too close. defense mechanism. what can i say?). i got stuck in the most unserious platoon, managed to escape most of the hard stuff, and even got to play a couple of Scrabble™ games with a pretty good player. met some chicks, didn't get into any relationships, didn't get redeployed, and got posted to a nursery and primary school.

before i left home i started developing an application for a friend, and due to time constraints, i was forced to use an ORM for the project. since getting back i've worked more on the project and what i really want to say is: how in the world did i live before NHibernate and Castle ActiveRecord? it's going to be very hard doing any development and still using SQL queries and data connection calls. if you're never used an ORM before and you're a developer, you should invest some time in learning one. i recommend NHibernate for .NET developers, but since i think the XML mappings are a pain (turned me off NHibernate immediately), you can use a framework that leverages NHibernate without the mappings. Examples include Castle ActiveRecord and Fluent NHibernate(please be familiar with C# 3.0 syntax - it'll help. greatly)

in developing the application i mentioned above, i have become even more convinced that UI development is for idiots. it feels so much like cruel and unusual punishment. must be why my pay was that low — i hardly did any UI development while i was working. simply focused on logic. mostly daemons and console apps in my kitty.

apparently i pissed off some demonic mosquitoes for being far too heavy to carry away to roast over their campfire in Zamfara, so they retaliated by injecting me chock full of malaria parasites. slow-acting ones. for more than a week after i got home, i never realized anything was wrong. and the flies must have had something to do with it too. that place is full of flies. apparently they overheard me asking several times if there wasn't any commercial gain to be had from houseflies, and acted as informant to the mosquitoes. ah well.

my leave's almost up, and i haven't done anything i wanted to do for myself, and i have so much to do for other people *sob*. well, i'll be off now. i'm glad Jeff Lew finally made his dream of creating his own movie come true (bu he lived on his savings for 4 years to make it happen!). since the first time i watched Killer Bean 2: The Party, i was impressed by his work. Jeff's an inspiration to us all, so get off your butt! gotta run now — i still need to bare my butt to a lady to get a shot twice today. see y'all.

Sunday, August 16, 2009

Logging in from Zamfara

man, it's been forever, twice that & a half since i last updated this blog. Partly due to each of: pure laziness, internet issues, & my posting for youth service coming up.

Annoying bugs won't let me post this by my phone (12:44am here, with no power) so i'll be going offline till later. Shower time — i can choose to do it in the rain or use my hard-earned water (i know you're green with envy ;)!

Friday, July 24, 2009

Women...are like...code

it's almost 3am local time. i am tired. beat. i want to curl up and let that snooze rip! and i might be forgiven for this post's crazy title.

i've been called a lot of things, but one that seems to fit quite well is geek. i fiddle around with computers. or at least my computer. i live in a world largely of my own making. and sometimes i write code. not programs, necessarily. and the more i think of it, the more it seems to me that an apt description of women is code (i am quite — sometimes painfully, i might add, sometimes — that i don't have one of my own at the moment). my reasons are quite simple (for the analogy. the singleness will take some more thinking about. heh heh heh, ahem).

while i was actively working (and before then) i'd written code. and let's face it programmers: do we suck. our programs rarely do everything we assume they will do. hence we cover our shame in patches, updates and service fixes. and sometimes, we just might have found a better way to do something, so the application eats less resources (a very big dream, this) or somewhat. so this puts you in a position with Old Code and New Code. stay with me, here's where the analogy kicks in

Old Code tends to work in most cases (except the miraculous corner cases that tend to make stutterers out of the most eloquent of developers. i must add at this point that developers are rarely very eloquent). sometimes Old Code has Major Flaws. like security holes. or eating up all the user's available memory and some. or spawning a twisted creature from the depths of hell (that last one might not be as made-up as you might think). or maybe the changes are (largely) cosmetic, usually as a result of the developer learning a better way of doing something, or more likely, his perfectionism kicking in and him just wanting to squeeze a few more clock cycles out of his app. either way, you know Old Code. it's rarely the prettiest thing in sight, but if you released it, it probably works (one software joke goes: it works? ship it!). this is like a relationship you're in and bored with, or an ex. save for those awful corner cases, you 'know' Old Code (in reality, more like you stopped asking questions, but who needs to know these teensy-weensy details?)

New Code is virgin territory. it's never been released — more often than not, it's still just trying to get out of your skull, preferably with a blowtorch. especially if you're like me and have a perfectionist bent. you generally start New Code saying that you (or your boss) don't like the way the Old Code works or something (boring relationship, anyone?) is wrong with Old Code. you promise not to base New Code on Old Code, but we all know with a deadline breathing down your neck, and your boss(es) usually not having a clue to how difficult it might be to crank out New Code, and pure laziness — pick any one or more — we've based New Code on Old Code (relationships that are most likely doomed from the start come to mind?), and the mistakes and bad choices from Old Code come into New Code. if that happens, be ready to repeat the nightmare.

oh, yes! the analogy. perfect timing. i was just about dozing off on my keyboard. New Code is the hot new exotic babe you just want to go out with/never-noticed-until-just-recently/whatever or the new relationship. and Old Code can be clingy like an ex. granted, she looks fat. and her abdomen isn't flat anymore. in my experience though, there's nothing so annoying as Old Code that works (she cooks, cleans and whatnot) when New Code doesn't. that takes the absolute cake. and is the real reason i posted this in the first place.

well, i have to stop here since i've been at this for more than 30 minutes and i think i see sheep trying to count me. so good morning, and maybe i'll be more coherent some other time. later

PS:i dislike Visual Basic in any form. i had to write some code in it this past weekend (i can feel my skin crawl at the thought) — for the .NET 1.1 platform, nonetheless. however, Boo sounds more and more interesting these days. even more than IronPython.

Tuesday, July 21, 2009

I's back!

man, i have to stop watching movies like the last two i watched. there's no way i won't tear up if i keep this up. just to be clear, the last two movies i watched are Fireproof and A Walk to Remember. and i watched them after completing Midori no Hibi — my sentiment meter is now sky high :(

and yeah, i's back. as a friend said, hear me RAWR! apparently, NYSC didn't quite pan out as expected, and i'm still around till August. was in school about 3 weeks back to pick up my posting and all that. i nicknamed the place i was staying 'Australia', cause it was far away from school area (Staff Quarters, Road 24, for those of you in the know). couple that with the fact that school was basically empty due to strike actions by different bodies, and the script for my personal pain and discomfort during my stay is complete. the only ride i could count on getting was Ye Olde Legedez Benz, in pouring rain and burning sun. am i glad to be back home. being in school did have its benefits, like hanging out with some friends i'd not seen in a while.

i know of at least 4 weddings of friends taking place within the next 3 months. gah. i swear i sometimes feel like there's something wrong with me. where's my babe? she is so going to get a talking to when she manifests — why in the world is she keeping me waiting? (knowing women though, she'll probably manage to convince me that it's my fault for not 'declaring'). i reserve to right to not be family at any person's wedding. plenty family clothes to buy if i don't reserve that right.

my stand on football (read: soccer) varies from passive tolerance to active dislike. the last match i watched from beginning to end was the Atlanta '96 football final between Brazil and Nigeria. and i don't remember (or care) who scored and whatnot. but my friend's football-oriented social site, Gamen11 is up. so if you like football, register, spread the word and all that. and away from me, if you please, or i will assume you left your mind in the other room. i like my friend more than i dislike football, but i really don't like football, so there.

well, it's past 4am here and i haven't slept all night, so i'll be suspending everything at this point. except of course for the shout-outs. i got a text from a friend saying that he was grateful that i'd impacted someone's life because the person was now helping him out tremendously. everyone is a product of all the relationships they've had and the information they've obtained, or so i'm told, so i want to shout out to God, for being God and not quitting or going on vacation, my family, friends over the years — if anyone appreciates me, it's because you all were there. so thank you. i really, truly appreciate you. later

Monday, June 29, 2009

Conscience vs ease...ease has a more compelling argument!

recently i decided to go the honest way and install a genuine copy of Microsoft Windows XP Home on my lappie. that wasn't too hard seeing that i already had a copy around — the one that came with the lappie. there was just one problem: the lappie is a German product by a company called Medion. well, i decided to just try it out anyway and see what i could do with it. before plunging in, i'd researched and found out that while Microsoft allows you to localize an English copy of Microsoft Windows to a non-English language, you can't do the reverse. so my German Windows XP remains German.

that notwithstanding, i decided to dive in. the format was last night, and it's not so bad with the OS itself so far (i expect major annoyances down the road). my major annoyances are with keyboard shortcuts (for example, i'd usually do winkey, U, U to shut down. i'm so used to it. no more. it's winkey, C, A now). so i have to use the mouse until i either revert to piracy and install an English version of Windows XP or learn the shortcut. in case you were wondering why i didn't mention buying a copy of Windows XP, it's simply because even that aged operating system plays out of my league. a legal copy of Windows XP would cost approximately a sixth of my monthly paycheck. normally, that might not be a big problem, but i'm currently on a budget causing me to stretch a bit for a while. so unless something extraordinary happens, i won't be in a position to donate some bucks to Microsoft's coffers just yet (if i hear any Linux fanboy say anything …). i've had some other issues like on dialogs i rarely use (for instance, i was relocating the swap file, and had to compare with the office box for what some controls were for; just now i wanted to stop Automatic Updates, and entered net stop "automatic updates" at the console. obviously, i got an error message, as the service is called "automatische updates")

i envisage more problems with software and the web. my touchpad driver and Safari both installed in German. a quick look on Google helped with Safari. internationalized sites (and software) such as Google will default to the OS language, though strangely enough, Internet Explorer still went to the English version of MSN. i haven't installed much yet, but i'm hoping it won't be too much of a hassle for me.

so why am i even talking about this? i want to draw a parallel here. far too many people my age rush into relationships due to one thing or the other, and don't really count the cost, just as i didn't fully comprehend the magnitude of the decision to use a German version of Windows XP. i concur that you can never completely predict the future — i was completely not expecting Safari to be internationalized, but you can get some far-reaching insight to what the future might be. for me, one format can solve the problems i mentioned and hinted at above, with little cost to anyone except me. for a relationship, there's no telling where the fallout will hit. so, in the spirit of my last few posts, please take time to carefully consider prospective future partners. we could all do with less heartache. later

Sunday, June 21, 2009

Straight talk

wow. third spagh meal in < 24 hours. if some spiky stuff starts growing outta my head, y'all heard it here first. right, down to today's business. i'm ticked off because: i got home late from church; i'm unsatisfied with my lunch; i was told in no uncertain terms several times today to get into a relationship, and i have a boatload of stuff to do. if i missed anything, i'll mention it later.

today i'd like to share some thoughts with guys. so this stuff may not be appropriate for ladies (and liberal arts majors). in fact, i reserve all rights to this post. so if you're reading this, it's either because you're a guy or you're a curious wench who has ignored my warnings against reading this long. let's assume you're a guy — just for argument. just note that YOU WERE WARNED. i was going to include the whole ERLA, but laziness prevailed, so i'll just assume you read it and agreed to waive any rights to prosecute me if this post does not appeal to your sense of decency. 'nuff said. moving on:

  • You are responsible. yep, you are. for the Flood, for the sacking of Troy, for Watergate, and probably for the Apocalypse as well. ok, maybe not that. but you are responsible for any state you (or your relationship) are in right now. whether you're single or you mingle, whether your relationship sucks or rocks, you are responsible for the state of your life. so kick off any diapers you might be wearing and assume the position (sorry, responsibility). there is no man so weak as the one that assumes no responsibility. it's mysterious, but taking up responsibility makes a person stronger. and it's all the more truer for men.
  • pretty don't take the cake (aka you can't eat pretty). growing up, i ate some of the ickiest (at least in my opinion at the time) stuff anyone might consider food. i particularly didn't like beans (and it shows now :D), and i always wondered why my mum even bothered. there was so much more interesting stuff like ice cream and chocolate. i still wonder why it is that stuff that's bad for you can easily taste so good, while stuff that's good for you needs quite some work to taste good. what's that got to do with women? you can't eat pretty. pretty doesn't keep a home clean and tidy. pretty doesn't help raise wonderful kids. a good woman (please notice the emphasis) does. i love pretty and beautiful things. i also would never marry a beautiful rug. let her looks be the icing on the (already excellent) cake. you can eat cake without icing, but icing without cake will just make you sick (let's not carry the analogy too far, as too much cake can also make you sick). someone once said a beautiful woman devoid of sense is a gold ring in a pig's snout. i realize you're wired to look for hot chicks with great bodies, but hold on a cotton-pickin' minute. Lewz D. Scruz's Guide to Women tells me that you will always find a more beautiful woman. so, looks can be sacrificed for more important things. what are those more important things? how should i know?
  • sex blinds you unless it's in the right context, so don't feed sexual desires. a wise man from the east told me that a relationship is like a model of a house. the model exists to tell you what the house is like, but you would have to reduce your stature to live in the model. that's an excellent description of what extramarital sex is like. you demean yourself if you're 'getting some' outside legal marriage. i'm not talking based on my Judeo-Christian roots. i'm talking from experience. i once tried to live in a kid's sketch of a house — i'm stretching the above analogy here, not being literal. it wasn't even up to the standard of an architect's first draft. it wasn't worth it. for one thing, you sow seeds of distrust that lay low until later if you eventually decide to 'go steady' with the person. or you might end up comparing one person's performance with another person's. the last thing you want to do is call someone else's name when you've made a commitment to someone (it's happened before). i remember once i was talking to an acquaintance, he spotted a young lady her knew and said i suppose fuck that girl, to which i replied that if she slept with him, there's a really big probability the she was — or would be — sleeping with someone else. there's absolutely nothing anyone can do to convince me that extramarital sex does any good, even without the 'benefit' of 'religious beliefs'. the fact that everyone on the planet seems to be mad is no reason for you to lose your head. a really effective way to keep out of extramarital sex is don't feed lust. don't kiss her. avoid pornography. don't jerk off (or wank, or whatever you decide to call it). in short, be disciplined, even in the area of food. you're wired to go in only one direction from doing most of the things above (i mention food as an example because if you let yourself slide in one way, you're likely to slide in other ways). so don't bother trying to fight nature. being the smart guy you are, you already know you'll lose.
  • on your commitment, set, go! we live in a world that encourages us to be irresponsible. as i write, i've a great deal of laundry to do, and i fell asleep at my computer right after lunch. it's easy to leave things undone, just let them 'slide'. the problem is, because life is like a knitted jersey, tugging on one string can let the whole thing unravel. and a great deal of discipline is sticking to your commitments. i don't care if it's just that you planned to do the dishes or you have someone you're 'dating' (how i dislike that word. it gives me the creeps). as Arkad (The Richest Man in Babylon) said, you should complete each task you set yourself to, or how else will you gain confidence in your ability to do other tasks? i 'fapped' this from a friend who won't mind me using it here: If you don't make a TOTAL COMMITMENT to whatever you are doing, then you start looking to bailout the first time the boat starts leaking. It's tough enough getting the boat to the shore with everybody rowing, let alone when a guy stands up and starts putting his life jacket on. so take off the life jacket, and start rowing. if you burn your bridges/boats, you have only once choice — win. as long as you present yourself with two options, you cannot focus. once you cannot focus, your chances of winning are reduced. focus is an amazing thing that does two completely opposite things at the same time: expands your vision and narrows it. be like Arkad, who loved leisure, and would not commit himself to things that would become burdensome for him to complete. be picky about what you allow yourself do, but don't do nothing. that's simply failure in party clothes trying to disguise itself. you're a man: to pick up a responsiblity is to commit to it. i remember one of my teachers stamping it into my being that leaders always find a way (for the team) to win. he lived it himself. sometimes i've fely like cursing him for teaching me that, because a lot of times, it was the only thing that spurred me to accomplishing some tasks (no, i've never cursed him, only that when the 'ice cream moments' come — when you feel you did 'enough' and should let things slide — i remember him and it, and i no longer feel comfortable slacking off). i'm told that if we did everything we were capable of, we would literally astound ourselves. this point was beautifully illustrated in the movie Facing the Giants, when Buck did the death crawl blindfolded.
  • this one's so important, i'm tempted to advise you to put your relationship on 'hold' if you're lacking here until you sort this out. have somewhere going (aka have your own business, but not entirely in that sense). a reason a lot of guys don't want to ask ladies 'out' (where? the coffee shop? the mall? Paris?) is that they feel women want ready-made guys. i've been convinced (today, actually) that what women really need is security, and they're willing to hope that a share in your 'business' (or vision, dream or whatever) will provide them that. so, have somewhere going, something doing. be aspiring to something great, and be walking in that direction, running when you can, stumbling or crawling when you're forced to, flying when you have the means to — but be getting somewhere great, a place you can share with her and the kids and other people. a place where you're a real man who looks behind him and sees people following simply because he's impacted them for good.
  • if you're not married to her, and you don't have the same (or very similar) value systems, break it up. let's face it, she's great. she's hot. but there's this problem: she's a party person, and you really don't dig parties. you don't mind a little libation now and then, and she's a teetotaler. stuff like that. please break up. there's the feeling of love, and there's the attitude of love. don't let the feeling blind you, because in a committed relationship, you live off the attitude of love, not the feeling (now you might understand why you never killed your annoying little brother). the feeling will wax and wane. the attitude is a choice. there's no point making the choice all the harder — it's hard enough without doing anything else. wherever you are, relationship-wise, keep driving the blinders back!. feelings are fickle things. it's a foolish man indeed who would risk the joy of 40 years or more for feelings that may have lasted 1 year or less (actually, you really shouldn't care how long the feelings have lasted). you're not emo by nature, so it's easier for you to sidestep your feelings and emotional attachments and deal with issues.

that's it for now. i've dishes to do. no point teaching and not doing. i'll update this later, so later!

Wednesday, June 17, 2009

Close marking (2)

wow. my lil' ol' blog post garnered some attention on Facebook. thanks for all the feedback. i guess it is true that people are really interested in relationships. so i wonder: are relationships so difficult to work that most people tend to have vicarious relationships, or what? relationship changes are what catches the eyes of quite a number of my friends on Facebook. were i to change my status to 'in a relationship', i'd get quite the feedback. and that's probably because i have developed the persona of the nasty grook.

i like the idea behind Ne-Yo's song She Got Her Own because it basically describes a sentiment i really feel: it's more of an honour if a lady chooses to be with me than if she needs me. that eliminates the "i married you because of your money/looks/body/<insert wanted item here>" problem. we're together because each of us clear-headedly considered options, thought things out, looked at our lives' goals, and chose to be together. guys (i don't think i could ever get to understanding how ladies work, so i'm talking to the people i do understand), it's long overdue that we stop thinking with our testicles (male hormones come from here, so pardon me). yeah, we are attracted by what we see, but for crying out loud — how long will we continue to be implicated as irresponsible playboys?

work beckons. i'll continue this some other day.

Sunday, June 14, 2009

Close marking

ki lo'n ro? o kan' fe'yin lat'aro…ki lo'n shele pel'omo yen? (Translation: what are you thinking about? you've been smiling for a while now…what's going on between you and that young lady?). So began a conversation with B today about a mutual friend. normally, i don't really like references to my single status. B's a good friend, so i let it slide. just told him that we're just friends. B didn't want to hear that. told B that i'd asked her out a while back and she said she wasn't game. B countered that even if it was last month, i could still ask her out again. i said i didn't want to, since i'd been put in the friend zone.

the friend zone. there probably isn't a female invention scarier to a young man. about the only thing scarier is the nice friend zone. one chick finds out you're a nice guy, somehow other chicks find out, and soon enough you end up as deputy assistant vice boyfriend to one or more chicks. meaning, you spend time with the chick, but you're disposable. she may cry on your shoulder, but you're expendable. enjoy what time you have with her, because she's got someone else in mind most likely. or so i think anyway. what do i really care?

i got thinking about what B said. she's a lovely young lady in more ways than one, but … i don't really think i'm up for a relationship now. more so since i decided that i don't have that much to offer anyone. and quite a bit in my life isn't going to change soon. it wasn't that long ago i thought any chick who liked me was either batty, extremely optimistic, or didn't know me well. i've since discovered that while the latter is usually the case, i have some redeeming qualities like…em, i'll get back to you on that one, hopefully before the world ends.

naw. i think i'll just sleep this off. and wake up feeling better. cause earlier last week i was feeling a little jealous of a friend. you see, he's in love. and i kept wondering why it seemed it never happened like that for me (okay, that ill-fated relationship doesn't count). till i saw one of my friends lamenting about the same thing on Facebook. ah well.

Sunday, June 07, 2009

Fooling around with Context Free

have to get to church now, but i was playing with Context Free, and after looking at examples and several tries, i created a checkerboard using it.

the CFDG source is below:

startshape checkerMain

rule checkerMain {
 // modify the numbers at the start to
 // change how many are repeated
 10* { y 2 } checker2 {}
}

rule checker2 {
 10* { x 2 } checker {}
}

rule checker {
 SQUARE {}
 SQUARE { b .5 x 1 }
 SQUARE { b .5 y 1 }
 SQUARE { b 1 x 1 y 1 }
 SQUARE { s .25 b .5 x 1 y 1 }
}

Friday, June 05, 2009

3D object conversion

"Install" is probably my middle name, with curiosity being the middle letter you don't see in there. So my computer is loaded with all kinds of software "just in case". sometimes i play with 3d apps. the ones i really use are Blender, Wings3D, Yafaray. other 3d stuff i have installed now includes Google Sketchup, an old version of Amapi, trueSpace 7.61 beta, Softimage Mod Tool, Mapzone, Terragen 2 and the open beta of Genetica 3 (no longer available, since the full version was released. i just hope they don't come after me for using it past the beta period).

anyhow, i had a few Sketchup models i wanted to import to Blender, since Blender is what i use for primary scene setup. i found out that Sketchup can export compressed Google Earth files, which internally use the Collada format. i exported the models, uncompressed them, and attempted to load the Collada file into Blender. all i ended up getting was a set of axes, most likely because the Blender Collada importer is about two years old. the free version of Sketchup can only export to Google Earth. the paid version is available for 480 minutes of trial, and can export to other formats, including 3DS, Wavefront OBJ and DXF (Blender does an excellent job of importing and exporting Wavefront). so i was in a quandary. Google, clear thinking and patience turned up three no-cost, honest solutions:

  • Use Softimage Mod Tool and Crosswalk to convert the Collada model
  • Use Meshlab to convert the Collada model
  • Use the Autodesk free FBX Tool to convert the model
so there you have it. i can stay honest and withing my (currently) really limited budget and use my Sketchup models in Blender!

Tuesday, June 02, 2009

And God sent a blessing in form of a cockroach...

i realize that most people, being completely normal (and not scientists — how did they ever find out a cockroach will live without its head for over a week before dying of thirst? who was keeping count?), will be grossed out by cockroaches. so am i. but i'm really grateful for yesterday's cockroach. may it be happy in cockroach heaven, wherever that may be.

what has God got to do with cockroaches? plenty. apart from the fact that He created them, He's the only one who can explain to the disgusting vermin that we don't want to share home or hearth with them.

anyhow, due to a couple of reasons, i was really ticked off with my dad last night. i went to clean the car, and was really finding it hard to release the pent-up aggression. then out of practically nowhere, a cockroach came wandering on the car. i flicked it off with the cloth i was using to clean the car, and resumed cleaning. a few minutes later, i saw it wandering again somewhere on the wall, got really ticked off, and then dispatched it to cockroach afterlife — if there is any such thing. and then really weird thought came to me: what if God sent the cockroach for me to take out my aggression on? the thought was so ridiculous i had to laugh, but i'm not so sure God didn't. so i'm grateful that God cared enough to send me a cockroach (not that i'm asking for any more) :D

Monday, June 01, 2009

Baby steps with new renderers

ok, so the 3-day weekend was fab. wasted a large portion of it playing Castlevania: Order of Ecclesia, which is the most difficult Castlevania game i've played to date (the demon-inspired 16-bit ones don't count). as a review put it: You will die. A lot.. anyhow, yesterday i decided to fire up Wings3D and see what i could come up with.

the original idea was to create a broadsword, but i kind of got bored with making a long blade and created a dagger. very simple dagger. then i remembered an old image in this article (skip to the last page, and click on the thumbnail), and decided to tamper with a good thing. modeling was done, fired up Blender for scene setup and materials. since i was being lazy, i didn't want to create a complex scene. i just wanted to play around with materials and Yafaray and Luxrender, for a couple of reasons.

when i first started using Blender, i didn't really like the internal raytracer. i could never seem to get the same great-looking scenes i saw in the galleries with it. then i heard of Yafray (the project that is now Yafaray), and i thought it sucked even more. i persevered, though, and i learnt how to use it to some extent (check out my DeviantArt gallery — and the scraps, too — to confirm). however, i've had to dispose of most of my knowledge about Yafray, because Yafaray is very different from it. sometime down the line, i started playing with Indigo and Luxrender. i liked both bcause of the great renders i saw, and disliked both because of the same reason — they are both unbiased renderers (which to me, means that they can take forever rendering if you let them. you stop the render when it's as good — think: noise or black spot free — as you want it). for the Basscom pen scene (look in my gallery for details), Indigo didn't render a texture (it only accepts UV-mapped textures), but Luxrender mauled it, so i preferred Indigo. that was until it went commercial (and i wish Nicholas Chapman and Ben Nolan success with Glare Technologies), and i started looking at Luxrender again.

so i worked hard last night to get my scene working well with both Yafaray and Luxrender, and left my lappie on all night rendering with Luxrender.

here's the Yafaray render (approx 2 minutes):
and here's the Luxrender render (6+ hours):
the materials suck, but it's a start. i'll see if i can dress it up some more and make it better. if you want the .blend file, please download it and the textures (you'll need to 'remap' them) from this link. please use, don't abuse. Edit: i almost forgot. yesterday was also my first time creating my own texture in Mapzone. it's the table texture. Mapzone is the only Windows-only software i used. everything else at runs on Linux and Mac OS X, but you might be able to use an emulation environment for it.

The Nigerian web is NOT ready for the mobile revolution

Thursday, May 21, 2009

Something for a web editor!

ok, i finished Fable: The Lost Chapters last night as a goody-two shoes with a halo round his head and ghostly butterflies who tossed Jack of Blades' mask away. and i have a mild headache. since i finished it (finally!), it's off my computer. maybe until i get bored again. but that's not what this post is about.

i have recently developed a strange condition called a 'conscience'. meaning i currently kick against the order of the day here in Nigeria, where pirated software and software license violations abound. for the most part, anyway. somehow, the old "i can't afford it" line seems old and worn to me (even though it's basically true for me anyway — some weeks back i was ranting about how some stock photography @ 100USD+ would cripple me financially). at least for now — maybe this time i won't be able to suppress my conscience again.

being an on/off software developer, i agree wholeheartedly that software developers should receive something for their efforts. and that's why i praise open source developers. the time and devotion needed to complete any software project is appalling. to continue development when you're not getting paid for it is praiseworthy. so i moved toward using freely available software (mostly open-source) for most of my work, including web development. unfortunately, since i'm getting older (and hopefully wiser), i lean more toward RAD ways and means, including WYSIWYG. since i'm not currently using Dreamweaver, and my web development tools of choice are of an 'edit source then preview' variety, i miss the design view of Dreamweaver. i've literally forsaken a project because i've no interest in hand-editing XHTML. so if anyone can recommend a non-sucky design-view-type freely available web editor, i'd be glad. i might even give something for it. definitely not my kingdom though. it may be small, but it's still quite valuable. well then, later.

Tuesday, May 19, 2009

First 'useful' Python script

here's my first 'useful' Python script. it converts a Crosswire SWORD IMP file to the XML needed by OpenSong scripture files. if this is useful to you, please let me know. and please use, don't abuse. you can download it here. full source code available below, and you'll obviously need Python to use it. Want to try it out? Grab a SWORD module (raw ZIP only, please!, convert it to IMP by following these instructions as far as creating an IMP file is concerned, then use my script.

# imp2opensong - converts a SWORD IMP file to an OpenSong XML file
# author: lewzscruz
# date: 18-May-2009
# license: public domain, i guess. use, don't abuse
# version: 0.2 ('cause i only tested with one source file!)

def strip_markup(line):
    '''Strips ALL markup from a line'''
    temp = line

    while True:
        # get first opening angle bracket
        open_angle_pos = temp.find('<')

        # quit if there's none
        if open_angle_pos == -1:
            return temp

        # get first closing angle bracket
        close_angle_pos = temp.find('>', open_angle_pos)

        # strip out the markup
        temp = temp[:open_angle_pos] + temp[close_angle_pos + 1:]

# prompt for input and output files
sourcefile = open(raw_input('Where is the input file? '))
destfile = open(raw_input('Where should I put the output file? '), 'w')

# start writing
destfile.write('<?xml version="1.0" encoding="utf-8"?>\n')
destfile.write('<bible>\n')

old_book = current_book = ''
old_chapter = current_chapter = ''
verse = ''

while True:
    # read lines till EOF
    line = sourcefile.readline()
    if line == '':
        break

    # trim the newline
    line = line[:-1]

    # don't do empty lines,
    # empty verses will be handled below
    if line == '':
        continue

    # and 'useless' lines
    if line.startswith('$$$['):
        continue

    # if we have a 'control' line
    if line.startswith('$$$'):
        # get the colon's location in the line...
        colon_pos = line.rfind(':')

        # ...and that of the space between the book name and the
        # chapter and verse
        lastspace_pos = line.rfind(' ')

        # ...now we know what book we're in...
        current_book = line[3:lastspace_pos]

        # ...the chapter...
        current_chapter = line[lastspace_pos + 1:colon_pos]

        # ...and the verse!
        verse = line[colon_pos + 1:]

        # if we changed books on this line,
        if old_book != current_book:
            # and we didn't just start,
            if old_book != '':
                # close the old chapter and book
                destfile.write('</c>\n')
                destfile.write('</b>\n')

            # start a fresh book
            old_book = current_book
            old_chapter = current_chapter = ''
            destfile.write('<b n="%s">\n' % (current_book,))
            continue

        # if we changed chapters,
        if old_chapter != current_chapter:
            # and it's not the beginning of a book,
            if old_chapter != '':
                # close previous chapter
                destfile.write('</c>\n')

            # start a fresh chapter
            old_chapter = current_chapter
            destfile.write('<c n="%s">\n' % (current_chapter,))

        # output real verses (there are fake ones in the source file),
        # including empty ones
        if verse != '0':
            # get the next line and strip the newline
            nextline = sourcefile.readline()[:-1]
            # output it, stripping any markup and whitespace
            destfile.write('<v n="%s">%s</v>\n' % (verse, strip_markup(nextline).strip()))

# finally, close the last chapter of Revelation,
# Revelation itself, and the Bible
destfile.write('</c>\n')
destfile.write('</b>\n')
destfile.write('</bible>\n')

# thanks for all the fish!
sourcefile.close()
destfile.close()

Thursday, May 14, 2009

I want my mommy…

…or so i'd like to say. But i can't. It's been over 5 years since my mom passed on. And since i'm not comfortable with the idea of talking with the departed, i'll just rant.

Mom should have been 50 today. My dad was telling me last night that if she was still here, he'd have organized a suprise party for her (she didn't like people making a fuss about her :)

ever since that day in January 5 years ago, we've done what we could to get along without her. And been rather successful at it. But sometimes, we crack. Like last night, when Dad's voice broke for a few seconds leading prayers. Or when i'm feeling particularly cut off from humanity. Or Dad's saying something crazy & i'm looking for someone to tell, "please come & take your husband!" (happens quite often actually XD). Anyhow, i'm about done here. We miss Mom. And we're grateful for the time we had with her.

Sunday, May 10, 2009

I hate software license agreements

today's rant started rather simply. i'd set my Facebook language to Pirates (English)— rather fun by the way, info courtesy Dade — and wanted to show some notifications I'd gotten via Twitter. I wanted something a little more than (Alt-)Print Screen, and could do some basic editing in it. I've used Techsmith's software offerings before, and they have a free lightweight screencap utility called Jing, and i decided to use that. then the fun began. i decided to actually read the license agreement for Jing, and by the time i got to the third paragraph i was tired of reading, for a couple of reasons:

  1. the agreement is especially verbose. not a big surprise there. just one more reason for me to hate lawyers and the law in general. developers like to adhere to the KISS principle. why can't lawyers — at least when dealing with unlearned mortals?
  2. the agreement looked like one gigantic wall of text (can you say gibberish?). call me lazy or stupid, but i finally agree: san-serif typefaces are much better for reading long blocks of text. the serifs just tend to drive you crazy. whenever i author on this blog, everything looks like a Matrix screen, so i tend to just concentrate on the part i'm just typing. sometimes i don't even pick up typos and whatnot because it's just plain hard to read (you get brownie points if you guess that the text is in a serif typeface, extra if you know that it's in a monospaced serif typeface. monospace has come to stay, but i'm beginning to think that monospace+serif = very bad idea.

i still don't know if the license asks me to murder my mother. and quite frankly, i really don't care. must it be so difficult to get software to use? even freeware? if i'm a measure of most people, license agreements are far too wordy and verbose to be of much interest/use to the people it affects the most. and i've no doubt in my mind that that is exactly what the lawyers want. did i mention i hate lawyers already? are you trying to help people or set traps for them, for crying out loud? i eventually installed Jing — without completing the license agreement — only to find that my internet was insane again and would not resolve Jing's mothership, the Screencast.com website. and since it's a new install, Jing didn't work. after uninstalling Jing and googling, i found Bug Shooting, another free screen capture software that has a smaller installer and a more readable license agreement. yes, it appears to lack a feature that Jing has and i'm used to — auto-capturing a window (you have to manually select the window area yourself), but i think that's not such a big problem if i can actually use the software, and it doesn't get in my way. Disclaimer: Jing is actually quite good. i've used it a bit, but i recommend you getting the not-free, but better-featured (and in my opinion, much better-behaved) Snagit if you can afford it. it probably worth the cash you'd fork out for it. i once got a free licence, but i wasn't in the mood for hunting it down where i'd backed it up.

anyhoo, here are screenshots of the respective license agreements for Jing and Bug Shooter. decide for yourself which one's easier to read (screenshots taken with Bug Shooting. and i still had to launch the GIMP to make the edits i wanted. picture i wanted to upload is here).

Jing

Bug Shooting

EDIT: double-clicking the Bug Shooting icon in the taskbar takes a screenshot of the currently focused window

Friday, May 08, 2009

Building Bridges

I have my own little world, Surrounded by my toys and my dreams, I'm often occupied, Tinkering away, In my little bit of earth. One day I spied someone, Curiosity ate at me, I wanted to meet them, But they were in their own world. I had blocks you know, Toys I treasured, So many of them, But my growing wonder At the sight of another Could not be denied. I got to the edge of my world I leaned and stretched as far as I could Yet my arms and legs fell short. I wanted to weep, run away and give up, saying I had tried. Then a thought came to me "Build a bridge" "What with?" "Your valued toys" I fought the idea "What? Give up my toys?" "Start while they're still there" So I dropped one block, not sure it would stay. To my surprise, it hung in the air, and never did sway. I built a little bit more, then gingerly stepped, to see if it would hold, I i decided to step on it. Once again wonder filled me As my toys did hold my weight And I let go of my land. Since then I've built some more bridges, Some I've completed, and seen other worlds, Some never reached the other world, Since my desire turned cold. It was a day like any other, I was tinkering again, Somewhat older, hardened, much colder Concealing my pain. But you looked like the sun that parted the dark clouds, I felt a stirring, like a coming to life, and somehow some warmth flickered in this cold heart again. So I wanted to meet you, But my toys would not do. For as far as they could go, I'd already built. All I had left were my dreams, very precious and few, If I were to use them, then what would I do? But love pushed me forward, In tears did I build, For it counted you worthy To walk over my hopes. At last I have finished, This bridge of my heart, The causeway is narrow, But it plays its part. I hope to welcome you To my world, and live in yours But as I escort you, Yeats will inspire my lips and my only desire: "HAD I the heavens embroidered cloths, Enwrought with golden and silver light, The blue and the dim and the dark cloths Of night and light and the half light, I would spread the cloths under your feet: But I, being poor, have only my dreams; I have spread my dreams under your feet; Tread softly because you tread on my dreams."

Thursday, April 23, 2009

God, please don't do something!

Saturday was not the nicest day I've spent in a while. Church had a program that day and the next, and I had a number of responsibilities to handle, including the ones I normally have at home. On the good side, my brother was home for the weekend, so he could handle some of the chores at home. On the minus side, he had to go out, and I was just informed that morning that painters were supposed to come to the flat that day :(

So the day basically progressed…after the church program in the evening, I was supposed to go somewhere with some other folks — when the clouds turned dark for the umpteenth time that day — but they meant business this time. it started raining, and we weren't able to get bikes where we were headed because of the rain. Everyone fired up his "Legediz Benz" and started hurrying while being pelted. Someone then said, "God do something", and I (jokingly) remarked that what if God, acting mischievous, decided to turn the knob controlling the rain to "Heavy Rain"? It started as a joke, but the rain did indeed get heavier — we all got soaked through and through. Still being pelted by the rain, I brought up the issue, and we all agreed, "God, don't do something! Turn off the rain!"

Moral of the story? Don't ask God to do "something". Ask Him to do something specific. :D

Thursday, April 16, 2009

Software gripes

this post is fairly ordinary — it's just a rant about some software i've had to deal with today. this morning, i was using my brother's computer when iTunes informed me that there was an update. great. i decided to update it, only to be reminded why i no longer use iTunes — it's bundled with QuickTime. you can get QuickTime by itself, if memory serves me, but you can't get iTunes by itself. shame.

something similar happened today when updating Aptana Studio. i'd installed the basic distro quite all right, then i wanted to update it to get some functionality (Javascript libraries, etc). most everything went smoothly when i only installed functionality for the latest version of the Javascript libraries except YUI and MooTools. i'd install support for the latest supported version, restart Apatana Studio, and it would prompt me again. the problem went away for MooTools when i decided to install support for the older version as well. the problem for YUI is that the download is large, so installing support for older versions will just eat disk space and not give me any returns. sigh.

UPDATE: yes, installing support for versions 2.4 through 2.7 of YUI for Apatana Studio left no more complaints. whoopee.

Thursday, April 09, 2009

I envy Python programmers

I've sort of settled with a programming language I generally use, C#. I know other languages too, and sometimes I wish I did more Python programming. Python really simplifies programming. As an example, I coded an application recently that automated pushing form values to a web page. In C# 3.0, the code would look like this:


using System.Collections.Specialized;
using System.Net;
//...
var formData = new NameValueCollection { { "Var1", "Value1}, {"Var2", "Value2"}};
var webClient = new WebClient();
webClient.UploadValues("http://localhost/localapp.aspx", formData);

In Python 2.X, the code would look like this:


import urllib
#...
formData = urllib.urlencode({ "Var1" : "Value1", "Var2" : "Value2"})
urllib.urlopen("http://localhost/localapp.aspx", formData)

There's no error handling or anything special in this. This example is rather contrived, to be completely fair, but when you add other things like multivariable assignment, and take into consideration Python's standard library, you might understand why I'm envious. Ah well

Thursday, April 02, 2009

Remarkable service

Joel Spolsky has an excellent article on customer service. I didn't really think there was much to the article until someone shocked me by doing something like that for me

there are several ORM toolkits for the .NET platform, most notably NHibernate. i came across Habanero sometime back, and i can't remember how, but i tried using it for a project, and found out that the FireStarter tool didn't apparently support Windows authentication for SQL Server. i decided to send them feedback about this, and got an immediate email that my feedback had been received. nothing strange about that. what is remarkable was that i got an email from the Habanero team yesterday detailing some workaround that allowed me use Windows authentication with both Habanero and Firestarter. considering that i'm not a paying customer, i'm really impressed with this. here's a big one for the Habanero team!

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).

Saturday, February 28, 2009

How I use Python

i love Python. i find it one of the most expressive programming languages i know. It's saved my bacon quite a number of times. for instance, when i generate test data for other applications i write, i generally generate the data (and usually the SQL to insert it into a database) with Python. also, when it comes to sorting data, it's much faster to write scripts to do basic data sorting (as an example, sorting out CDRs from Asterisk) in Python than it is in most languages. today was no exception. i had loads of numbers to send text messages to and i needed to weed out invalid destinations. for the first 50 or so, it was easy enough (but tiresome) to do by hand. when i started to look at just how many, i decided to write a script to help me sort out the numbers. abut 10 minutes later (mostly spent trying to create regular expressions that would do just what i wanted), i was done. and most of the program worked beautifully (well, there were some hiccups. i'm not perfect!)

Friday, February 20, 2009

The value of multiple cores

my laptop uses an AMD Turion 64 processor that clocks in about 1.8GHz. i've always thouht it was a pretty good one — at least until this morning. i've never been faced with the value of multiple-core processors personally as today. what happened is i was trying to get back into design & 3D, so i decided to model & render items i could find around me. so i started modeling this: after modeling and setting up the scene in Blender to render with Indigo, i started a render. almost six and a half hours into the render, it looks like this: then i take the scene to the office and try rendering on a Pentium Dual Core 2.0Ghz. about four and a half hours later, it look like this: obviously the second render is better. and it ran for a shorter time. i'm officially jealous! i want a multiple-core system now! :D

Wednesday, February 18, 2009

Accessing SQL Server (2005+) databases in .NET Windows services

just a simple quickie here. i completed my application (somewhat...do we ever really complete applications?) - and the service it was meant to configure — then found out that while it ran beautifully in console mode, it just sat there after connecting to the SMPP server. i kept wondering what the problem was. much later i realized that the service was created to run using the local Service account, which is a low-privileged account. as such, it cannot connect using Windows authentication to SQL Server versions that support it. in reality, this is the second time i've faced this issue. at any rate, all i needed to do was change the service to run under the local System account (a highly privileged account) and the problem was solved. another solution would probably be to use SQL Server authentication, which Microsoft doesn't recommend. yet running a service using the local system account is also seen as a bad idea. i guess you'll need to make a tradeoff to solve this problem.

by the way, this is the app i was complaining about. . many thanks to Component Factory for the excellent (and free) Krypton Toolkit.

Tuesday, February 17, 2009

Weird issue in Visual Studio

i was working on the config application for a service i wrote...but i ran into something really strange:

Thursday, January 29, 2009

The Matador

Just now I was having dinner, and the TV was on. We're subscribed to DStv, and while I usually don't watch TV, my computer was busy in the room, so I had to manage until I was done with dinner. M-Net Movies was showing The Matador, and I just happened to watch the scene where Bean (Hope Davis) wakes up and meets Danny (Greg Kinnear) having breakfast. They start kissing and then it gets heavier; Bean asks Danny if he has enough time, Danny already strips to his shorts when he shouts, "Tree!" — and a tree crashes into their kitchen. I could hardly stop laughing. I don't care how hard your hard-on is—a tree crashing where you want to have sex will put a stop to that quickly. No, I didn't stick around to watch the rest of the movie (it's still running now). Oddly enough, while reading about the movie, I found out that Danny asks Bean if she's still horny after the tree crashes. Is he an idiot or what?. Now if I were God...

Baby steps with Mono

Mono is definitely some great software. I downloaded and built Mono on our Asterisk server because it seemed I'd have to develop the application to handle the automated calling on Linux. Not wanting to hurt myself with PHP, Ruby or Python (time frame), I decided to continue using C# and .NET, since I knew enough about Mono to know it is cross-platform. What I wasn't prepared for is just how cross-platform it (and .NET) is. After downloading and building it, I created a "Hello, World" application in it and ran it on the Linux server. I then moved the compiled assembly to my Windows desktop and it ran with the Microsoft .NET framework! After I got home, I built one of my old programs, which had a reference to the excellent FileHelpers library. The library was probably built with Microsoft's tools, but I was able to build (and run) the application using Mono (for Windows).

That's pretty amazing, but the last part is even more amazing. I just tested the Devshock SMPP component (which was definitely built on Windows, using VB.NET), in a program I wrote using Mono on Linux. There's a text on my phone now that proves that .NET is an awesome platform, and Mono is a great cross-platform implementation of that platform. Mono rocks. Period.

Monday, January 26, 2009

Using the Asterisk Manager Interface (AMI) to make calls in C#

for some reasons, i've been interested in using Asterisk.NET (mostly because code completion in a GUI beats grokking code in a command line). one problem i'd always had, though, was making calls. for some reason, i'd just get the message 'Originate failed' returned to me. today i was working on my sample program again, when i got the same error. i then started looking through the Asterisk.NET code to find out what i could be doing wrong. i also dug out my trusty copy of .NET Reflector to analyze the assembly.

the main source of aggravation was that i could use call files, and they'd work. but with Asterisk.NET, at most i'd get a missed call. my code went something like this:

var myManagerConn = new ManagerConnection();
myManagerConn.Hostname = "asterisk-server";
myManagerConn.Username = "admin";
myManagerConn.Password = "god";
myManagerConn.Port = 5038;
var action = new OriginateAction();
action.Channel = "SIP/3595009";
action.CallerId = "3595009";
action.Context = "robocall";
action.Exten = "10";
action.Priority = 1;

myManagerConn.Login();

myManagerConn.SendAction(action);

myManagerConn.Logoff();
after some sniffing around in Reflector, i found the Timeout property for the OriginateAction class. i went looking in the code, and found that Asterisk would set it to a specific value (30000 milliseconds) if it wasn't set. knowing .NET initialization, however, i guessed that the underlying field was probably set to 0, and set the property explicitly to 30000. i ran the program again, and the call came in, the phone kept ringing (yay!) — but the program generating the call threw an exception complaining about a timeout. i increased the timeout to one minute to no avail. i then decided to set the timeout parameter for the SendAction() method of the Asterisk.NET.Manager.ManagerConnection. the resulting call was like this:
myManagerConn.SendAction(action, 30000);
. and the program worked. like that. so i guess i may just be able to get this automated call thing done without using a terminal to the Asterisk server.

Tuesday, January 20, 2009

Installing PEAR on Windows

i wanted to install PEAR on my Windows machine as a prelude to installing symfony. i'd installed PEAR before on Windows, no biee. but when i tried using the batch file to install PEAR today, i was greeted with a list of 12 options after deciding to install a system-wide copy. the last option specified C:\\. as the PHP executable path. every time i changed it to C:\\php.exe, i couldn't continue to install PEAR. i had to leave it as-is, install PEAR, then edit the pear.ini file to specify a correct path. ideas, anyone?

Monday, January 19, 2009

Shallow Relationships

as an example of just how shallow my relationships are, i just told my neighbour "Happy New Year". on the 19th. my neighbour. we live in the same building. and have lived every single day of this year in said building. pretty pathetic, don't you think?

Sunday, January 18, 2009

where's the cotton-pickin' "Undo" command in real life?

quite a bit has happened since i was here last. for one thing, it's now over 5 years since my mum passed on. and it seems that my dad is "officially moving on" — whatever that means in English. monday i was going home from work, and i saw this really hot (translate: hawt) chick getting out at Obalende. great body, pretty as a flower and had this really nice musical voice (i have no idea what that means either, but it sounds good ;)…and i started thinking about my life.

an ache i hadn't felt in a while came up (though i did the sensible thing and went looking for my next bus instead of gawking), an ache to have someone to hold, to talk to (don't act like you never felt it before! guys really want to have a beaty to rescue!)…and all that. there is no such person in my life. and in the last couple of months, i've been asked (subtly and non-too-subtly) quite a number of times about my "relationshipital" status. no, there's no one either here or on the horizon. so if i really want to hug someone, i'd better grab my pillow. and maybe weep into it. except i'm not that lame. or so i'd like to think. or maybe not. either way, it doesn't really matter since what i do with my pillow doesn't affect the price at which i buy fish in the market.

it's not like i've lacked opportunity to dig trenches and build bridges. at least i'm not in the "women are irritating" phase right now (on the contrary, they're currently interesting — but shall this soon come to pass also? i'm unhurried :D) it's just that for the most part — i get bored (ladies, seriously, it's got nothing to do with you. i easily get "bored" normally. so don't show up at my house with pitchforks, ok? ;), for lack of a better description. maybe they piss me off. maybe i piss them off. i dunno. rare has been the woman who held my attention for 6 weeks or more. i think i broke something. though i can't tell. few and far between are the friends with whom i share my secrets. that's another thing i realized. i've so many shallow relationships, i may just be scared of a real relationship. it's really easy to say, hi, bye. hey sweetie, you're looking good and all that crap, but…i need real relationships. not plastic people with vinyl smiles that are cracked and faded. i'm not even sure where this is coming from. despair? regret? but then, where exactly did i miss it? dunno. maybe this is just a random rant coming from a testosterone overload, but it doesn't matter. since it really doesn't affect the price of fish, anyway.

all said and done, i'll was over it in a couple of hours, then wonder why in the world i posted this anyway. since i wasn't the one who killed Jesus, and i'm not the third leg in humanity. just for fun, i wonder what kind of person would lose sleep thinking about me (ladies, here's an itty bitty cheat sheet: guys want to know you're thinking of them too. really. even though they act tough. guys like me, anyway. unless of course, i'm right and i'm in the minority ;). anyway, enough ranting. off to bed to start what i believe will be a glorious week. why? we two oddballs are going to be spending more time together. and it won't matter that there is no trench in progress. who's the other oddball? naisho da. have a great week!

PS: last year, i needed to do a head scan. i was somewhat excited about it because i believed that i would finally find out what nuts and whatnots were not in place in my head. the result came back…normal. seriously. i had a regular brain like everyone else. not a clockwork one. or an electronic one (might have fried a few circuits). it felt like a letdown. yet another proof that despite my best efforts, ore wa tada no ningen. ah well.

Saturday, January 10, 2009

2009!

still here. yep, opened this year rather late, but it's no biggie. 2008 was a great year, and i have high expectations of myself this year. nothing works until you make it work by finding how it should work then putting that knowledge into practice. so go out and make it a great year for yourself. and one more thing: new year resolutions suck. don't bother. just make normal decisions and live by them.