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: