Wednesday November 03, 2004
MCWong
|
| Blah! MCWong |
|
Me gosh, my last blog was about The Open and since then Woods is no longer king of golf and Vijay became the first $10M man and it's already season ending Tour Championship! No no no ... I'm still working here, and why I don't blog is precisely ... some people do actually work for a living ... First time coming back here in months and I'm greeted with BIG RED warning that says "Please bear in mind that anybody in the world will be able to read what you are about to write...". Alright that just about reminded me why I stopped blogging months ago ... call it risk aversion. The truth, since then my baby started running and most recently - talking. Between a bouncing bubbly toddler and the high risk game of blog? No contest. Oh... Bush won... ok... done... moving on... (2004-11-03 10:43:26.0) Permalink Comments [2] Todd Wins The Open (Todd who?) Todd Hamilton (who?) won his first major! Holding off no less than world no. 2 Ernie Els in a 4 hole playoff. Todd led throughout on Sunday. Still led by 1 after Ernie birdied 17th, Todd start off 18th with a bad tee shot into thick stuff and a worse second short of the green and almost into the crowd, a free drop and a chip that went long, end up making bogey; while Ernie GIR but missed a makeable birdie which could have ended the match. The 4 hole playoff goes from hole 1, 2 and back 17, 18. A mistake in 17th tee par 3 left Ernie with the only bogey of the duo and cost him the claret jug. Phil Mickelson didn't really choke this time (well the monkey's really off his back after Masters) but still came up short and played second fiddle again. Tiger, yet again, didn't matter with a disappointing +1 on Sunday and finished 9th. Lee Westwood seemed to be inspired and shot 67 to finish 4th; Davis Love too finished with 67, who wasn't shown much on prime time TV coverage climbed to 5th. (2004-07-18 10:53:46.0) Permalink ksh scripting #4 : list elements v7 and v8
Alan offered cool advise on ksh scripting #3 with ... and I dig!
So I adapted
Here's pl7() which adapted the
And to add some flexibility, I can cater to user specified delimiters which would have been otherwise messy to do in pl version 1:
Give it a go:
I guess my intention was clear, in that I'm trying to let
PS: Okay why version 7 and 8? it took me that no. of iteration to figure out IFS. ;) ksh scripting flashback: #1 #2 #3 (2004-07-14 00:00:04.0) Permalink Comments [3] ksh scripting #3: list elements It seem unavoidable, at some point there is always some kind of list that needs spliting.
Here's to give it a go:
Why '|' as separator? Well, when was the last time you see this '|' thing in the English language? And, when was the last time you process a bunch of shell command pipelines all concatenated together into a list to be processed? I supposed you get them more often with each pipeline on a separate line, as in a shell script (?!); which you could readily process with read, grep, awk, sed and a zillion other utilities. Why not ':' as in /etc/passwd? I have scripts that process list of URL's, so 'http://...'! Not very convenient isn't it.
ksh scripting flashback: #1 #2 (2004-07-09 00:00:03.0) Permalink Comments [1] ksh scripting #2: unix friendly filename Every time I rip and encode tracks from my CD collections (yes I still buy them) to mp3, I had the need of getting a unix friendly filename from the human readable title since I use Solaris to do everything. I typically grab the titles from a free cddb out there that happens to have my album's details. But these come in various formats such as:
While I need them to be unix friendly, such as:
So I script it with the help of
I'm not even sure if I understand this now that I looked at it again. :(
The ksh scripting flashback: #1 (2004-07-08 00:00:02.0) Permalink Comments [5] True to the tradition of unix, this is as cryptic as it gets, but... elegant [GEEK!]
For those who like filename with obvious indication of it's genre, e.g.
I always use
and any error output,
Since my job does more code reading than writing, what's left is the occasional need to automate some test, so shell does it just fine. Instant and disposable (i.e. no worries about reusable values). Nevertheless, there are a few tricks here and there that I like to remember.
(2004-07-07 00:00:01.0) Permalink After Blackout ... Smallville gets a re-run After the Great Singapore Blackout ('ala Great Singapore Sale), the local free-to-air TV actually decided to re-run the last episode of Smallville. Why am I not particularly excited (I thought I should)? Must be the boring ending that I managed to catch as my area was the first to get electricity back. (2004-07-05 01:23:45.0) Permalink Something's really rare in modern Singapore. I've probably seen less than 3 blackouts in the last 10 years (at where I stay). Authority was quick to announce that it was a gas supply disruption that tripped the generators. These days, people are quick to jump to suspicion of another terrorist act. The blackout hit my place at 10:15pm SGT right when Smallville was on and was soon restored at 10:30pm, just long enough for me to miss the part on how Clark got himself strapped down and dunked into a pool of Kryptonite liquid which jolted his first memory of being put into the craft that brought him to earth.... ... Oh the blackout ... yeah, there was a blackout. At first I thought my main breaker tripped again as it did a few times. The amount of juice my appliances and gadgets draw must have been way too much, openning the envelope of my electricity bill every month is like watching a horror movie, less the entertaining value. First thought was to open the main door to let the lights from the corridor in, but it's dark outside too. Then when I look across Bishan Park seeing it's pitch dark, it struck me this one's the real deal. Having lived in a place like Manila for many years, "brownout" as it's called in Philippines, is a way of life. I rate myself much more prepared than average Singaporean, and it was quite true. Being the last person to go to sleep in the house every night, it wasn't a problem finding my way in the dark to get to a flashlight, and I know exactly where it was just for situations like this. Then it's the candles... which is not at all an essential item in a Singapore home as people don't expect blackouts, whether man or natural causes since there is no typhoon neither. Soon enough, my next door neighbor was calling out for help as she stand in pitch dark inside her unit, no flashlight, no candles, no clue! It took a while for me to dig up the bag of tea-light (the kind that's used for aroma therapy), and an old disposable lighter, lid up a few and handed a whole bunch to my next door neighbor. She was thanking us profusely and couldn't be more grateful. (2004-06-29 21:21:21.0) Permalink Source: Yahoo! Features June 28, 1838, Britain's Queen Victoria was crowned in Westminster Abbey. June 28, 1914, Austrian Archduke Francis Ferdinand and his wife, Sofia, were assassinated in Sarajevo by a Serb nationalist - the event which triggered World War I. June 28, 1919, the Treaty of Versailles was signed in France, ending World War I. Birthdays: Actor Alessandro Nivola is 32. Jazz musician Jimmy Sommers is 35. Actress-singer Danielle Brisebois is 35. Actor Gil Bellows is 37. Actor John Cusack is 38. Actress Mary Stuart Masterson is 38. Rock musician Saul Davies (James) is 39. Actress Jessica Hecht is 39. Record company chief executive Tony Mercedes is 42. Football Hall of Fame electee John Elway is 44. Actress Alice Krige is 50. Actress Kathy Bates is 56. Actor Bruce Davison is 58. Rock musician Dave Knights (Procul Harum) is 59. Former White House chief of staff Leon Panetta is 66. Senator Carl Levin, D-Mich., is 70. Actor Pat Morita is 72. Comedian-movie director Mel Brooks is 78. Blah! ... is one year wiser and forever 21. (2004-06-28 12:00:00.0) Permalink My baby just turned 1 year old and my gosh it was a big deal. Not fond of the idea of DIY parties, I opted to pay. It was so much more fun to have a party and not having to clean up afterwards. We picked a nice "town club" (as oppose to a "country club") The Legends Fort Canning Park and catered a spread of chinese dim sum for afternoon tea. Fort Canning Park is just next to Sun Singapore's office at Central Mall which was one of reason I know about the place. We sent all (except 1) invitation cards through e-mail, talking about digital age. After putting together a guest list, we soon realize everyone has email addresses. We received so many gifts we almost felt guilty ... nah... at least my daugther won't. Well I do need to thank everyone for a wonderful party. Here's the cheeky thank you card we sent out (less the photo) ... supposedly written by my daughter :-)
(2004-06-28 11:11:11.0) Permalink After working 8 straight days (Monday to Monday), at the brink of crashing, decided to do an orderly shutdown and reboot another day. Had to take a day off, to catch some sleep and much needed exercise (which normally means golf but now, driving range is a priviledge that I cherish). ... Then of course, there was the CPF housing insurance thing I need to take care of, got that done in the morning. ... Then send the wife to office at noon because it's Tuesday and she work late on Tuesdays. The husbandly thing to do, since I'm just "resting", I might as well drop her to office, right? ... ... Then need to exercise my warranty rights on my new T630, which took all "just" 2 hours, but that's another blog. ... Then went to the mall to pick out a DVD player to be used on my baby's upcoming birthday. (You bet, another blog.) ... since I'm in the mall, might as well pick up a few other things ... it's late afternoon so coffee and fried dough (not doughnut, chinese style, mmm ... something for a new category = food); rushed through the food bec. finally, ... driving range! Whacked the usual 2 buckets, and as usual glad that I have a day job; ... Wife SMS'd (aka Text), "don't forget the milk and diapers". ... Off to supermarket ... ... got home already 7:40pm, 2 hands full of shopping bags that weighs a ton. (At least I got my arms worked out). ... Then of course the "quality time" with my baby, which at this stage of her age means chasing her around in the house while she "explores". By the time I'm done and sat down to "rest", I realized I'd probably be less tired if I had been in office. :( So much for "Rest Day". (2004-06-23 11:11:11.0) Permalink A panoramic lost of direction ... What was I thinking... that was the EASTERN end of Bishan Park. Panic: brain not responding (2004-06-19 09:59:59.0) Permalink
... from my home! One of the successes of Singapore, clean and green. This is Bishan Park, stretches about 2 kilometres long, this is the western end [eastern end actually] of the park. A second success, this is the view from a public housing apartment! Generally refered to as "HDB flat", or Housing Development Board .. flat (?a very British apartment unit?). Whooopi! My shift is over and going back to my comfy flat... Boohoo... I'll be baaaaack ... again tomorrow. (2004-06-19 00:10:20.0) Permalink Comments [2] Things we do to keep customer happy. Finally weekend after a long week? No sir, mine continues. Can't help to feel dreadful having to wake up at 6am on a Saturday, not for golf, but heading for office ... yawn! Beside having been doing that for the whole week; and will again, on Sunday, Father's Day: my first ever Father's day being a father. Since the web is 24x7, so do computers that runs them, so do vendors like Sun who support them. Having 3 geographies means we cover 8 of the 24hours in a day. So when USA is on summer time (DST), work hour here starts at ungodly 7am. Those on "duty" watch the sky for flares and do rapid response, and call for reinforcement if need be. On weekends, we are it! Singaporean says, "die die must do", doesn't make much gramatical sense but, you get the meaning. We're paid alright, but how do I value the smile when my daughter saw me awoke as early as she, and then her bewildered look right before I rush out the door while waving goodbye? (2004-06-18 19:19:19.0) Permalink While having my daily fix of Sun blog (kind of becoming yet another addiction), I came across hoffie's happy endorsement of downloading gaim from blastwave and interestingly traced to maintainer torrey. Hey, that's Torrey! Can't miss Torrey if you read email support aliases. >-) Since I had procrastinated too long to compile gaim 0.77 myself (got the source but not the time) and to think that 0.78 is already out, I figured, hey, why not, let's be lazy. I remember doing pkg-get some time ago when it was still BOLTpget.pkg, but can't recall what for; which means it probably failed for some reason. Anyway, this time, it was painless and by far the best user experience I've had installing free stuff! Installing anything for that matter! pkg-get -i gaim A couple of y's later for 'yes' to run script with su priv, Gaim 0.78 was up and running! That's all there is! Considering that I had an empty /opt/csw, so pkg-get were downloading obscene amount of packages that at some point I was actually worried. (Should I?) With such easy success, it didn't take long for me to continue with: pkg-get -i gqview And again, no problem whatsoever. This time was a lot faster considering most of the big dependent packages are already done. blastwave ROCKS! Here's yet another satisfied customer. :-) (2004-06-17 02:02:02.0) Permalink Comments [4] |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||