• 2013: Resolutions

    I like my resolutions being a bit open ended. Some people like a fixed achievement, e.g. lose 5kg, save $10,000. Those I would call goals; multiple goals can be derived from a single resolution. To me, resolutions are meant to guide you, more like a religion or a bible.

    Here’s mine for 2013:

    • Spend less, invest wisely;
    • Learn more, share more;
    • Make friends, be more compassionate;
    • Bitch less, create more;
    • Eat less, keep exercising.

    Happy New Year to all my friends and readers of this blog.

    – From a tiny corner of Singapore

  • Facebook Page for Noisy Neighbours Issues in Singapore

    It has come to a point where I decided to spam the MPs and create a public page on Facebook.

    I’m posting this here so hopefully people with similar issues will find it, post their issues and show the real extent of the problem.

    http://www.facebook.com/SingaporeNoisyNeighbours

    Please invite your friends, etc. and share the page out so it will have the intended audience/reach to have impact.

  • Oppa PHP Style

    It’s been some time ever since I’ve done much serious coding and decided to get myself updated… with Korean music.

    Just joking.

    I’ve been doing some research on PHP frameworks. My primary requirements were that the framework supported MVC (most do), is capable of friendly URLs, is simple/easy to use, provides basic wrappers around security (such as XSS and SQL Injection) and most importantly it must have good online support and resources.

    I pay particular attention to documentation as it plays an important part to help developers quickly learn/adopt a new framework.

    I spent many hours over the weekend reading documentation, installation guides and watching tutorials and eventually settled for CodeIgniter. I found it quite complete and particularly easy to learn. It is well documented, has a good tutorials and did not require that I learn a new template syntax. Above all it deploys really quickly with minimal configuration.

    I would like to bring your attention to the Style Guide in the CodeIgniter User Guide. It is very detailed and contains a lot of good coding practices, especially on how braces should be (opening on a new line instead of on the same line) and how PHP tags should be opened (and not necessarily closed). I suggest that PHP developers follow this style guide.

    There’s also an add-on to CodeIgniter that I would recommend and that is Grocery CRUD (Create, Retrieve, Update, Delete). Grocery CRUD makes it extremely easy to create a simple maintenance screen for back-end data, especially for short-term projects. It’s certainly better than sending users to phpMyAdmin.

    Finally, just to share, here’s my version of .htaccess file that I use to remove index.php from the URL. It is largely similar to the example by CodeIgniter with an additional exception for CSS and JavaScript files.

    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|user_guide|robots\.txt|(.*)\.css|(.*)\.js)
    RewriteRule ^(.*)$ /projects/ci201210/index.php/$1 [L]

    That said, I have only done research and not actually used the framework on a full project yet. I’d love to hear any comments and/or recommendations you have.

  • Letter to my MPs on Cyclists

    Dear Mr. Liang, Ms. Sim, et al.,

    There has been some commotion after several cyclists were killed in road accidents, and after meeting with another reckless cyclists yesterday I feel I need to write to an authority about this before more people get hurt.

    I am not sure which ministry (LTA? SPF?) to send this to, hence I am writing to you.

    I recall that many years back there was an old man/lady being run over by a bicycle on pavement. Newspapers reported the incident and mentioned that bicycles are not allowed on pavements.

    Over the years it has become common knowledge that bicycles are not allowed on pavements and people have started to cycle on the roads. I am starting to see more and more people take up cycling, but these cyclists are becoming more of a nuisance and road hog, posing not only inconvenience but danger to both themselves and road users.

    I am a driver and cyclist myself and I usually cycle on pavements because I feel it is safer. I will give way to pedestrians when I meet them. Moreover my wife is not a very proficient cyclist, and I think that cycling on the road would be extremely dangerous.

    I have heard from friends that they get fined $50 for cycling on pavements, which I think is ridiculous if they weren’t cycling recklessly. Enforcement should be against any reckless cyclist, be it on the road or pavement.

    I’ve seen countless number of cyclists flout traffic rules, and here is one such incident causing an accident:
    http://singaporeseen.stomp.com.sg/stomp/sgseen/this_urban_jungle/1279106/reckless_cyclist_runs_red_light.html

    Another public video of a cyclist switching lanes recklessly at Jurong East and getting hit by a car (skip the first few seconds of the video):

    Along Woodlands Road all the way to Bukit Timah which I travel daily, the road is already very bumpy, winding and narrow due to the Downtown Line MRT construction:

    • Vehicles will need to keep an entire lane distance just to avoid the cyclists around the bends.
    • During peak hour this causes traffic jams and are a nuisance as bicycles are slow moving vehicles (20-30kph max).
    • These cyclists tend not to stop at traffic lights.

    Also, buses are very wide and use an entire lanes width. Since cyclists keep left and the left lanes are now mostly bus lanes, buses have to make bigger evasive maneuvers to avoid cyclists.

    I would like to suggest that we allow cyclists to cycle on pavements with the exception of electric bicycles which are much heavier and can go very fast (a lot of illegal ones are around nowadays).

    The rationale for my suggestion is:

    1. The probability of a pedestrian getting seriously injured being run over by a bicycle is less than having any form of motor vehicle hit a cyclist.
    2. There is no legislative requirement for cyclists to know traffic rules before they cycle on the road (e.g. basic theory test), and hence difficult to enforce.
    3. There is no legislative requirement for cyclists to be identified (e.g. number plate) and penalized for errant cycling, and hence difficult to enforce.
    4. We should not discourage people from cycling on pavements around the neighborhood. It is a cheap, green and healthy activity and can be a good family activity.
    5. I am aware that there are PCNs but the routes that PCNs take are sometimes not convenient if one uses bicycles as a mode of transport, e.g. to the market.

    Sincerely,
    Justin Lee

  • Cyclists: Road or Pavement?

    After some recent news about cyclists being run over by cars, people started saying things like cars pay for road tax, COE, ERP and hence cyclists need to stay off the road. Cyclists then start saying that their bikes don’t wear off the road. WTF?!

    See this forum discussion.

    I think some people are just damn narrow minded. It’s not about road tax, ERP or COE. It’s about your own safety when cycling.

    Law says you can ride on the road. It does not say you *must* ride on the road if you feel it’s not safe. There are park connectors. Hell screw it, even if there’s no park connectors I will *still* choose to ride on the pavement.

    Same goes for nobody says you *can* walk on the road, but some people still choose to walk on the road.

    And some cocks still choose to cycle 2 abreast on a busy or narrow road. I know the law says you *can*, doesn’t mean you *should*. This shows how selfish people can get. Bicycles are slow moving vehicles, and if you want to talk about rules of the road, then bikes should jolly well KEEP LEFT.

    I am for cycling on pavements, illegal or not.. my safety is my top priority. If the roads are too busy to cycle on, I’ll get on the pavement. On pavements bicycles should give way to human pedestrians, that’s about all we need to do for a peaceful society. I don’t know which civil service idiot said we can’t cycle on pavements. They should shoot themselves. The number of fatalities of cyclists vs. cars is certainly higher than old aunties vs. bicycles.

    Why not on the road? Because our roads are getting too crowded with bus lane and all. It poses even more danger to a cyclist AND other road users. The bicycle is slow and fragile. Riding alongside a road with bus or lorry going at twice its speed is so damn dangerous. People have to swerve to get away from crazy ass cyclists swinging left to right trying to pedal hard to keep up with road traffic speeds.

    Secondly there are lots of traffic rules to abide to when using the roads. A lot of cyclist do not follow these rules. They cycle on the road, then turn onto pedestrian crossings when they meet a red light, or simply beat the light, or turn into filter lanes, or cycle across zebra crossings. Just a few examples of the many many crazy cyclists I’ve seen.

    There’s no control over bicycles on the road. There’s no license plates to identify a person, there’s no (legislative) need to know road traffic rules to ride on the road, there’s no speed limit, no traffic camera — nothing, basically, to enforce that bicycles must adhere to traffic rules.

    And if you start telling me because you have a road bike hence you need to cycle on the road, then I can tell you I have a Ferrari and I should race on the roads too.

    It’s not always about the money. Your life is worth more than that.

  • Saving is a virtue, investing is a method

    I thought this would be a very good blog entry so I decided to write it.

    I was out with my junior from Ngee Ann Polytechnic. He wanted to get himself a nice Cello before he serves NS so we went Cello shopping. After viewing some nice instruments we sat down at TCC and I had a chat with him.

    My first advice to him was not to spend his life savings on a Cello. He assured me that that was not all the money he had and he had intended to use some of his savings to invest in blue chips. My first reaction was 😮 (not bad for a 19yr old!)

    I asked him, what kind of yield are you expecting from, say, $5,000.

    “5-7%”, he said.

    “That’s pretty much nothing”, I said.

    It works out to $250-$350 per year or about $20-30 per month if the yields meet his expectations. I told him that he’s still young and while his earning power is zero at the moment his expenditures are at an all time high. I sold him a new concept that at this point in life he should first learn to reduce his expenditure because that gives a better “yield” in relative dollars versus investing his life savings of several thousand dollars, not to mention the risks of investments.

    Afterall most people spend a larger portion of their income than save and it is generally easier to save 10% more than to earn an additional 10% from the savings.

    N.B. Saving does not mean scrimping, i.e. being a cheapskate to an extent that it impacts the wellbeing of yourself and people around you.

    One way to go about doing this is to leverage credit cards with cash rebates. But the bill must be paid in full at the end of each month, i.e. do not overspend. For example I have a UOB One card that gives me approx 3% cash-back on my expenses. If I spend on average $800 a month that works out to about $20+ per month, which is about the same amount that he would have gotten if his investments of $5,000 yielded 5%-7%.

    This is just one example, and probably not the best. There are many, many of these cards out there. I heard Standard Chartered even gives you $100 for a new sign up!

    If you are a student and not eligible for a card, just get an adult to sign up for you or be your guarantor. It is actually a good way to build a positive credit rating and to learn to manage your finances.

    Of course some apply for all the wrong reason, e.g. to get discounts eating out at fancy restaurants or simply to show off. It’s not that discounts are bad but when you keep eating out for the sake of that 15% discount, you are doing it for the wrong reasons. A plate of $3 chicken rice versus 15% off a $30 buffet is not savings.

    Without self control all these credit facilities can go out of hand and that’s exactly what the banks want — for you to default payment and pay the hefty 25% p.a. interest rate and $50 late payment fee, or to buy that Prada bag and miss one of your 12-month installments.

    Saving is a virtue and one should always start with that. Investment is one of the many methods to grow your money only when you already have enough money to go around.