Bangkok Vacation – Day 2

After my first day in Bangkok, my second day’s a bit more fun.

  • In the morning, my brother and I had breakfast at the hotel.
  • Then visited the 4 faced Buddha (located between Siam Paragon and Central World?).
  • Had lunch at Siam Paragon (with a much saner meal than the dinner before).
  • Then toured the Siam Ocean World (located in the basement of Siam Paragon).
  • Went back to hotel for a massage.
  • Had dinner at Cy’an restaurant (in the Metropolitan hotel).
  • Went to Suan Lum night bazaar.

I thought pictures would be more interesting to look at. First, the tea we were served after first checking in on the first day.
Room service tea
The 5 coloured cubes are sweets. Careful, they’re very sweet. Then there’s the beds.
Beds in hotel room

Alright, my breakfast was pancakes with bananas, which was delicious.
Pancakes with bananas
My brother had waffles with walnut sauce (I think).

So in the morning, we went to the shrine housing the 4 faced Buddha. You can pay for dancers to dance for your good fortune, prosperity, peace and whatever you have in mind. There are 4 denominations: 2, 4, 6, or 8 dancers. This man paid for 6.
Shrine dancers

In the afternoon, we went to the Siam Ocean World. It’s 750 baht per adult, which includes a free drink, a choice between a note pad and a tote bag, a ride on a boat with glass bottom, and a 4-D movie experience. We weren’t in the mood to risk getting ourselves wet, so we skipped the boat ride. The 4-D movie is one of those you need 3D glasses with, and has physical sensations like rocking seats, wind-blowing-in-your-face kind of stuff. And here’s a snake I found.
Ocean World jungle snake
Despite the staff’s repeated reassurance and encouragement to go touch the snake, I had enough aquatic animals around without adding reptilian animals into the mix… I politely said no, went a bit ahead, and turned back to get that snap shot, then politely said no again, and turned tail and fled with as much decorum as I could muster.

What’s an Ocean World without the most feared cold-blooded killer in it?
Ocean World shark

The Suan Lum night bazaar was for me, a long boring expedition. I’ve never quite understood the fascination that shopping holds for some people, so I’m just there to experience the local atmosphere.

Well, I have a last picture. See if you can figure out what this is without checking up on the alt tag or the file name…
Subway coin token

Bangkok Vacation – Day 1

I’m just back from a trip in Bangkok, Thailand. My vacation was from 6 Dec till 8 Dec. It’s a short trip, and it’s actually because my brother asked me to go along than me planning to go. Here’s how it went on the first day…

The Killer taxi

There’s been some talk of unrest and stuff, but my brother assured me we’d be fine. We’re staying at the Metropolitan, a very nice hotel with a hefty price to match. The hotel’s located on a street filled with embassies, so I guess we’ll be alright.

Anyway, after landing in the airport, we went searching for taxis to bring us into the city. Apparently, there weren’t any more taxis. When we approached an airport exit, a Thai came up to us asking if we needed a taxi. My brother was confused because last time he came, he took one of those brightly coloured taxis. He went looking for a taxi stand. There wasn’t any, or at least none that were in use.

So we came back to this Thai, and he kept slicing his throat with his hand, repeating the words “Killer, killer”. From what we understood, people get killed in taxis? Or taxi drivers kill passengers? Tired, we agreed to take up the Thai’s offer, and another fellow rose up and gestured us to follow him.

He led us all the way into a carpark nearby. Meanwhile, I kept thinking the man’s going to lead us into some dark and dingy place and rob us or something. Very dodgy. Inside the carpark, he told us to wait near a pillar, ran to a car nearby and drove to us. It was a normal car. Really, I think for some (security?) reason, taxis really really aren’t allowed in airports anymore.

We climbed into his car and then left the airport. Along the way, I kept my senses up, ready for any misfortune. It was an uncomfortable ride. What a way to arrive in Thailand…

When we reached the hotel, my brother told me we were charged 900 baht. That’s like SGD 45, or about USD 29. That’s some taxi ride. On hindsight, we should have taken the limousine service available inside the airport itself. Costs about the same.

Siam Paragon, a dining disaster and fireworks

We checked in and rested up a little, shaken from the taxi trip. Then we set off to Siam Paragon, what my brother termed “the largest place I’ve ever seen”. The hotel concierge helped us hail a taxi and we’re off.

By the way, if there’s a safety belt in the taxi, use it. The traffic’s terrible and hectic, even at night. I guess I’m used to a more well-behaved street traffic in Singapore…

Siam Paragon was okay. It’s just a humongous shopping centre. Since I’m not into shopping, there’s nothing really to see.

It was dinner time, and I wanted to try some Thai food, against my better judgement since I don’t take spicy stuff. I decided on this restaurant offering northeastern Thai cuisine. My brother and I seriously didn’t understand any of the menu items. The only thing my brother wanted was pineapple rice, and they didn’t have it. So we just chose based on the menu title and the little we could make out of the pictures.

It was terrible. The dishes were either decidedly sour, or spectacularly spicy (even though we distinctly said non spicy), or superbly sweet. The only sane dish was the “kai lan” vegetables, and even that had a chilli aftertaste. It starts a little sweet and a few seconds later, BAM, the chilli hits you and you’re left scrambling for water.

We finished what we could, and called for the bill. The waitress gave us complimentary desserts, two small glasses of greenish stuff. I only caught “mint” from her explanation. The glasses looked like those used for containing whiskey shots. I took a sniff, then sipped a little bit. It tasted sweet, and refreshing, … and a little like cough mixture syrup.

We left the restaurant, and with not much else to do, we went back by taxi. Oh yes, taxi fare starts at 35 baht. That’s like less than SGD 2. And the fare increases pretty slowly.

Where were we? Oh yes, the journey back. There were a lot of bangs and other loud noises out on the road. It wasn’t until the taxi driver pointed to the sky that we realised what was going on. Fireworks. People were lined up on the side, even clustered in the middle of the road, just to view the fireworks exploding in the sky. The occasion? The day before, 5 Dec, was their king’s birthday.

So with a nerve-racking arrival, a fiery dinner, and night-brightening fireworks, my first day in Bangkok ended.

P.S. We were staying at Metropolitan because my companion who shares half my DNA got a special staff rate (his final ultimate big boss owns the hotel). Lucky me.

Practical Programming (part 1)

There are many factors affecting the success of a software project. Amongst them, we have

  • Skill level of individuals (from manager to coder)
  • Time involved
  • Tools involved
  • Project complexity

and probably many more you can add. So how can you successfully complete a project practically? How can you balance customer satisfaction, code quality, time constraints and other factors in the most efficient and practical manner?

I was intrigued to explore this when one person asked how can one prepare for a new project and another person asked about end user testing. For those following this blog, you might know that I’m helping out with two teams in my company. Right now, I’m their only .NET (and front-end) developer. My colleagues deal mainly with the backend programs.

I’ve been involved in a start-up company where there was only one other programmer. I’ve also worked with a team of over 10 programmers, of different nationalities, working on a project involving culture localisation in a language none of us were native in (Japanese). Given my current situation, I’m the only programmer, so I’m really interested in practical stuff.

Coming from a mathematical background (as opposed to a computer science one), I don’t know a lot about software development theories and paradigms and stuff. So from what I understand, there is the extreme, full-on software development life cycle (SDLC), complete with UMLs and class diagrams and process flow diagrams and what-nots. There’s usually a lot of documentation involved (I hate those…). There’s usually platoons of programmers involved. There’s usually expensive software and tools and databases involved. The projects are also usually measured in months or even years.

Being mired up to my nostrils in documentation, bureaucracy and meetings with no motivation from completing significant milestones, is not my idea of a fun time.

In this age where the world is getting flatter, companies need to move faster, teams need to move faster. You need to move faster. What happens is that products and services need to be launched faster, earlier and more frequently. And you know what? I don’t think the method of software management mentioned above is going to cut it.

In an age where there’s less time and resources, and you’re expected to create more value, the full life cycle method will drag you down like a 10-ton anchor into the depths of dwindling profitability. Programming practically in this situation requires you to rethink process flows and cut out the fluff. It requires you to be more flexible, more multilingual, more agile.

The point of programming, of creating software, is to make people’s lives better. The resulting software must be practical (or at least fun). The process of creating the software must also be practical (and definitely be fun). So in the next part, we’ll explore the other extreme, of how agile methodologies fit into practical programming.

Audio Player plugin settings

I was just playing around with the Audio Player plugin for my first podcast. On the day of the post, I was a bit nervous, because I’ve never done a podcast before, and I didn’t know how it would look in an RSS feed reader.

So I subscribed to my own feed to make sure. It was a good thing I did. At the appointed time, I awaited eagerly, earnestly, even ecstatically. No post in my feed reader. Oh no. Ok, maybe FeedBurner was a little slow. So I waited a little longer.

60 agonising minutes later, I checked my feed again. No post! What happened? Turns out the options settings for the plugin were differently set for what I had in mind. I wanted a flash player for every audio file in the post, and I’ll manually provide a link for downloading it.

And what did I do? I set it such that it appears in a post but not in a feed. As a DIC member would say, “I am stupid”.

Quickly, I set things right. First, in the WordPress “Options” panel, under “Audio Player”, I set the following
Audio Player options settings
I checked the “Replace syntax” and the “Enclosure integration” options.

Then I set these
Audio Player feed options settings
This was the crucial one. There were two other selections for the dropdownlist, “Download link” and “Nothing”. Since I’m setting anchor links myself, and I wasn’t sure about “Custom”, I just set it to “Nothing”. I thought it meant the player or audio file won’t appear in the feed. Big wrong assumption. It literally meant nothing would be shown. Not a sound, not a word, not a letter, not even a full stop. As far as syndication was concerned, the post didn’t even exist. Just set this to “Custom” and you should be fine.

I saved all the settings, and checked my feed. All was well.

There were two audio files in that post, and I also found out only one can be enclosured (meaning only one is displayed at the end of a post), although more audio files (in the form of anchor links) can be included. Luckily, the first one I inserted in the post was the one I wanted.

Can your program survive reruns?

The ability to perform repetitive tasks in the exact same manner every time is one of the key advantages of a computer. Programs are written to behave in the exact same manner every time they’re run. Yet sometimes, they don’t.

So the question is, do you write code such that your program can survive rerunning itself?

What I mean is, if your program somehow fails, can it be rerun with minimal fuss on your part? The database equivalent is the transaction. Within a transaction, any insert, update or delete operation will either all complete or all fail. If some operation fails, everything is rolled back, and nothing is done. There’s zero fuss from your part in this case, although you might have to check why it failed.

Some programs when rerun (after failure), require a lot of intervention. I deal with batch programs that typically do the following

  • download files via FTP
  • validate file content
  • upload file content into database

In between those steps, there’s opening of file pointers to read file content and write logs. There’s updating of database tables of process status and timestamps. There’s retrieval of data, and use of temporary tables. There’s writing a bunch of output files.

The point is, there’s no transactional control present. If something failed somewhere, I had to dig through the log files, check up on the database table data, and check on any file output, just to see where it went wrong. Any operations prior to the error had already been done. Any corrections I needed to do will either be undoing all those prior operations, or set things up such that the program could continue from where it left off (assuming the program could continue from where it left off).

Sometimes, it could take hours to find out where the error was, and reset everything back to the state before the program was run. I had to make sure. Because if the second run was a failure again, it could be a result of my undoing of things. Or it could be a result of the same error again. Or even a different error. I wouldn’t know.

These programs are usually the legacy programs. I guess the previous programmers were very optimistic, that the programs would always run as intended. I’ve seen my colleague lose an entire day just to patch things up so the program could be run again.

Sometimes, you have to change something, like modifying the file sequence number stored in the database so that on the next run, the correct file is retrieved. That’s fine. What you should concentrate on is minimal fuss.

Simple instructions commented in the program code is a way of alleviating future agonies. Something like “update this, delete that and run again with this parameter”. It’s beneficial to you and future programmers maintaining the code.

Do you have suggestions to write code that survives reruns? Leave your comments!

Christmas office decoration

It’s about 3 weeks till Christmas and decorations are going up. Shopping centres and malls are decorating. Orchard Road (a major stretch of shopping venues in Singapore) is being decorated. Why not offices?

So my colleague took it upon herself as master decorator and whipped out her secret stash of decorabilia, and enlisted the help of another colleague and myself to help deck our portion of office space.

So here’s the obligatory Christmas tree
Christmas tree

She decided to spruce up the thin railing of our cubicle partition this year, with this result
Decoration along cubicle partition

Since we’re here, I might as well show you what my desk looks like…
Part of my desk
That’s the left wing. The right wing looks messier, with more stacks of files and paper. I’ll spare you the image…

Here’s my computer
My computer
Yes, it’s still with a cathode ray tube monitor. I take good care of it, so barring unforeseen circumstances, it does what it does. It’s getting a little cranky though, a bit slower than before…

Oh yes, apparently, the ground is not enough for my creative colleague. She attacked the ceiling too.
Decoration on fire sprinkler
The fire sprinklers aren’t doing anything useful anyway…

[There has been one made up word in this post]