Bookworm’s Delight

A few days ago, as I made my way through the MRT, I came across this set of advertisements on the safety screens. The Singapore National Library Board has launched an app where you can digitally borrow your selection of reading material online.

If you’re a Singapore Permanent Resident or Citizen, you can sign up online via their official website. For foreigners on an employment pass, you need to show up at a library with your EP, and pay the SG$53 annual fee (which includes a SG$10) one-time registration fee, to be issued with your myLibrary ID. (They only accept payment via card – NETS or FlashPay). The NLB website lists all locations of the libraries which are open on the weekends, and are open late.

Once you’re signed up, you have access to a very large selection (over 3,000) periodicals and electronic newspapers.

This is in addition to a very large selection of best sellers and books that are on offer. Even for the $53 fee (which is $1 per week), it is excellent value if you read, and would rather borrow a book than buy it, and are concerned about minimising your carbon footprint!

This is yet another example on how Singapore embraces technology for some of the simple things in life!

Cab rides in Singapore

I made a pleasant discovery during my first two weeks here in Singapore about cab rides. You can actually ride cabs for free every now and then!

Singapore has several major taxi companies. Their vehicles can be identified by the colour of their livery. The major ones are Comfort Taxi (Blue), CityCab (Yellow), SMRT Taxis (Brown), TransCab (Red), and Premier Taxis (Silver). I’ve had a good experience with all of them. Premier remains my favourite – they’re a bit more expensive than the rest, and tend to have nicer and better maintained cars. Cabs here are so well run, that Uber has almost no impact here.

Enter the disruptor… Grab Taxi, or Grab as it is now known.

They’ve got a similar concept to Uber where private vehicles driven by their owners can be hailed using a taxi hailing app, and will take you from one part of town to the other.

The difference is that the Grab App can be used to hail both Grab cars (which are driven by owners of private vehicles), and standard taxis as well as a range of different premium options from Grab.

Get $8 off your first ride

Sign up for the Grab App now!

This is where it gets better. Occasionally, Grab runs promotions where they give away rides that start and end within the Central Business District between 6:00 a.m. and 6:00 p.m. for free! (The caveat is that you need to use Grab pay where you provide the app with your credit card details).

This was a handy bonus for me during my first two weeks in Singapore. They ran the promotion for the first two weeks of April. Every morning, I would hail a Grab car at around 6:45 a.m. and would be at work by 7:00 a.m. in the air-conditioned comfort of a vehicle ride that was free! Come 5:00 p.m. in the evening at the end of the day, I would do it all over again. I went for a full two weeks without any commuting costs!

If that wasn’t good enough, among some of the vehicles that I got driven in were an Audi A4, a Volvo S70, and a Jaguar XJ6. Not too shabby for a ride sharing service.

Even if you’re visiting Singapore, I highly recommend that you use the Grab app to catch your rides around town. Click the link above to get $8 off your first ride, or use the referral code debashis75188 when signing up via the Android or iOS app which you can download via the respective App Stores.

Editing the WordPress .htacces file on Mac OS

Earlier today, I was attempting to edit the .htaccess file of my WordPress site on my Mac. To begin with, I couldn’t see the file on my cPanel hosted File Manager (it is set up as a hidden file). In order to get to the file, I had to FTP a copy across from my server onto my client machine, which happens to be a Mac.

Now I’m familiar on how this works with a PC – I’ve been a PC user for over 20 years now. Doing this on a Mac was a little different.

The issue was that even though I know I had downloaded my .htaccess file to my folder on my Mac, it wouldn’t show up. It was hidden. Unlike windows, there’s no easy way to “Show hidden files” in Finder as there is in Windows Explorer. I had to Google how to do it. Here’s how…

To show hidden files, first open up the Terminal app. If you’ve never used this, it’s here:

Applications > Utilities > Terminal

Right after the dollar sign you can go ahead and type or paste in the code below, and press enter.

defaults write com.apple.finder AppleShowAllFiles TRUE

At this stage, nothing will happen. To put the changes into effect, you will need to restart Finder for the changes to take effect. To do this, you can either

  • press option+command+esc to open the Force Quit Applications window, select Finder from the list and hit “Relaunch”, or
  • simply type in the code below in the Terminal window, and again press enter.
killall Finder

If you typed those lines correctly, your desktop icons should disappear for just a second while Finder restarts. Your changes have now gone to effect, and you ought to be able to navigate to your folder, and see your .htaccess file.

At this stage, all hidden files on the system ought to be visible. A lot of these will be system files.

You need to be careful while remembering that deleting any system files can break stuff on your computer. You need to take care not to edit anything that you are not familiar with.

Once you’re done editing your .htaccess file, you will probably want to restore your settings so that you don’t delete something by mistake.

To hide the files again, go back in the Terminal window, and type the following code in:

defaults write com.apple.finder AppleShowAllFiles FALSE

You need to restart Finder just like you’d done previously with killall Finder or the Force Quit Applications window. That’s all there is to it!

Excel macro to delete all rows in a table except the first one

Every now and then, I need an Excel macro to be able to delete all the rows in a table, except the first one. The following macro will do just that:

Sub DeleteTableRows(ByRef Table As ListObject)
    On Error Resume Next
    '~~> Clear Header Row `IF` it exists
    Table.DataBodyRange.Rows(1).ClearContents
    '~~> Delete all the other rows `IF `they exist
    Table.DataBodyRange.Offset(1, 0).Resize(Table.DataBodyRange.Rows.Count - 1, _
    Table.DataBodyRange.Columns.Count).Rows.Delete
    On Error GoTo 0
End Sub

This is not something that I came up with, but a piece of code that I found on StackOverflow.

Excel: Allowing a macro to proceed if it encounters an error condition

While building an Excel macro, occasionally, you may need to plan for an error condition where. In such a condition, if an error occurs, you may want the routine to ignore the current error and move to the next command. To do this, all you need to do is pre-pend the command with the following line of VB code:

On Error Resume Next

I’ve had to use this when I build a macro to filter content in tables. This is specifically when I need to clear all filters in a table, where the table may be in a condition where the filters are already cleared.