Tuesday, July 22, 2008

Monday, July 21, 2008

My #100 post...

About a year ago, I departed from Penang island to PJ here. Or, I should say 'left'.

Yeah, it was mainly for the sake of changing to new job. That's what I'd told people including myself.

But deep inside my mind, I ain't know what was I doing that for actually.

Was it because of the past? I had failed? Stuck at the hole like forever where I had the big fall?

I don't know, till now. And I wouldn't tell anyone, even to myself. Because I was too afraid to face it perhaps. Fear, because of the unlikeliness/helplessness to change over things during my downhearted course of time.

Since my move to the new place, it turned out way harsh and ugly. It was all ugly around me. It began in my work, ended up in my living.

Two times I had given up to fight against the big waves of 'inhumanities' befell upon me. Two times I had placed my trusts back to the ship captains. Yet, this time, even the ship captain quit himself. Huh?

Is it worth that I've turned back again? Again I can't tell.

Before I could find an answer to that, I was hit by another biggest quest in life - love.

But first, is it really love that I'm thinking or feeling? Is that what's she been trying to tell? I failed to respond once to a girl, and this time, I can barely feel the presence of my enthusiasm anymore. I kinda feel the forever lost of the missing piece of puzzle in my heart.

What's the purpose of life without a goal? I couldn't find a solid answer to that yet but I know for sure I wouldn't want others to fall together with me. I always want to be alone. I want to amplify my inner voice outside to my ears.

If I ever failed you once terribly, I'm sorry for that, really. That's because I would not have wanted to fail you another time. You should move on, because I will too.

21 July '08
~ with a big question mark on future ~

Tuesday, July 15, 2008

Programming ~ Glitches in GetFiles() method (VB.NET)

~~~~~~~~~~~~~~~~ foreword ~~~~~~~~~~~~~~~~
When I started this blog, one of the things that came across my mind on creating new contents here was the writing on programming stuff. Besides the fact that I'm working as a programmer, I believe it's good to share the things I've learned with anyone who may be facing the same problem again (of which I got a ready solution here). And another thing is I've always found it difficult to get a "safe" place to put down these valuable ideas mainly because of my personal weariness disorder (I'll probably explain this in the future).

So, here comes the 1st post in my programming dimension.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Today, I got a problem in one of my programs which is actively running in my responsible customer's site. It's a "translator" program that picks up wire feed files coming from news agencies and translates them into a native format acceptable to the system that would make use of it. So, these feed files come in non-stop and a single wire news might be split into multiple files. For that reason, these files use a series of running numbers in their file names as a way to indicate the sequence in which they have been generated (and, the sequence in which they could be reassembled back).

OK, so that's the details we need to know now. As for my translator program, it's running on a configurable interval. Say, in every 5 minutes, it would go inside the source folder to which the feed files are generated, gather all the files currently in it, and start parsing the contents inside (and merge them if necessary). Then, the problem happened. First see, for a wire news that is split into multiple files, those files can only be merged if the file names are presented in a continuing series of running numbers (e.g. 1, 2, 3, 4, 5, 6 and so on). Here's an example (file names all start with xxx_):

File #1: xxx_1 (1st legitimate file of wire news a)
File #2: xxx_2 (2nd legitimate file of a)
File #3: xxx_3 (3rd)
...
File #10: xxx_10
File #11: xxx_11 (last legitimate file of wire news a)
File #12: xxx_12 (1st legitimate file of wire news b)
... (and so on)

In Windows Explorer, these files are sorted perfectly in the order as seen above. However, as my program is built in VB.NET, the GetFiles() function I'm using returns the the file names in this order instead:

File #1: xxx_1 (1st legitimate file of wire news a)
File #2: xxx_10 (10th legitimate file of a)
File #3: xxx_11 (last legitimate file of wire news a)
File #4: xxx_12 (1st legitimate file of wire news b)
File #5: xxx_2 (2nd)
File #6: xxx_3
...
File #12: xxx_9
... (and so on)

Now don't get it wrong here. The wire news 'a' was not built out successfully from the files xxx_1, xxx_10 and xxx_11 (file xxx_11 was last in the legitimate queue of wire news 'a'). This is because like I said, the split files could only be reassembled if they are processed in the order that a continuing series of running numbers are presented. Thus in this case, wire news 'a' was failed to be reconstructed upon receiving file xxx_10 (file xxx_2 was expected after xxx_1).

After knowing this is the order the GetFiles() function would return the file names, I immediately built a function just to sort the file names in the legitimate fashion as what's seen in Windows Explorer every day. Oh wait, this was the order used back in Windows 98 where the numbers in file names were totally ignored. So, the GetFiles() function was built out from Windows 98?

OK, I solved my problem. And I'm putting it into my archive (blog) here. So next time I would not take things for granted again in much the similar way of What You See Is What You Get (WYSIWYG). What I see (sort order of file names in Windows Explorer) Is 'Not' What I Get (sort order of the GetFiles() function). :S

Friday, July 4, 2008

My sweetest nightmare in computer games

Long long time ago... when I'd just begun using (playing) computer (games), I saw my bro was playing a game deep in the darkness all the time fighting monsters which could be hardly seen. Soon I got intrigued with its all-dark theme and its beautifully creepy music accompaniments. As I started to play it and got my avatar way down below the dungeon levels, I found myself cemented in it helplessly at the same time. I remember seeing (+ hearing) the gold and bizarre items dropped on the ground, the most charismatic dialogues ever found in games, and last but not last-of-all, the distant looks of all characters in the game which had always got my spectacles hitting the monitor just to get a really close look on them.

Then... Diablo came back! It came back with yet more fascinating arts and darkness this time. There were more dungeons, monsters, angels, avatars, skills, quests, items and more colors (I'm not talking about graphics here)!!! Oh yeah, and of course the best ever made game trailer I'd ever seen. Then I recalled that in the finishing cut-scene of Diablo I, my avatar pierced his forehead with the evil crystal he had pulled out from Diablo. With little surprises, I found myself had become my avatar himself! You really got me Diablo! You're the real diabolic monster! Since then I had been playing Diablo II for more than 4 years consecutively and in the end beating all Hell-level Diablos with all avatar classes. However, I could never accomplish one thing: to get the best weapons and armors out of the game myself.

In two or three years later (I hope so)... we'll be seeing Diablo waiting in his dungeons again and we shall beat him and his minions once again (hopefully not for the last time :P). Until then, I will be ready. See you, Diablo.

My buddy Diablo's personal homepage: http://www.blizzard.com/diablo3/

Wednesday, July 2, 2008

Digg ~ GOAL!! (Pic)

Very creative advertising by ESPN! =)

I'm not really a football fan. But I'd like to give it a try, I mean a shot :P

read more | digg story