Badminton on Rails
RSS icon Home icon
  • Easy or Hard?

    Posted on February 25th, 2009 Raymond Law No comments

    I had the following conversation with a colleague about a client project recently.

    easy_or_hard

    At that moment, it strikes me that sometimes I want the easy ones but at other times I want the hard ones. But why? After some thoughts, I concluded with:

    I want the easy ones because they are easy and quick, but annoying and boring. And I want the hard ones because they are challenging and interesting.

    I think the following matrix describes it best:

    Easy Hard
    Annoying
    • Change copy from List Users to Search Users
    • Rename the column from fee to amount
    • Change all occurrences of this to that while Replace All would be too dangerous
    • Modify all images to be half the size and with a different image format/extension
    Interesting
    • Make sure we can seamless deploy to staging and production with ease using Capistrano
    • Make changing the type field also changes the available choices for the month field in the form with javascript
    • Charge a recurring fee with PayPal and ActiveMerchant when it is not inherently built in, and with lots of PayPal docs to read
    • Style the site with HTML, CSS, SASS according to this professionally designed PSD with a lot of croppings

    Do you get the point?

    As software engineers or programmers (sometimes interchangeable terms IMO), we like to solve challenging and interesting problems, regardless of difficulties. Ideally, we like everything to be in the easy and interesting quadrant, but we certainly like (sometimes prefer because it is also challenging) things in the hard and interesting quadrant as well. We would accomplish things in these two quadrants with our fullest attention and best effort.

    Stuff that belong to the easy and annoying, and hard and annoying quadrants bore us. We naturally pay less attention and try to do them with spare time. However, they still need to be done. They become a drag.

    Now we understand the matrix, but what can we do about the drag?

    This is what I think.

    I may feel ActiveMerchant is a joy and interesting to work with, but someone else may think it is a distraction to the project and just want to settle with using Authorize.net when it is already supported by ActiveMerchant to do recurring payment.

    I may feel having to crop all images again and save them in a different format is a waste of my development time, but a photographer may actually enjoy such work and may even add a drop shadow to make the images look better.

    The difference is in the interpretation.

    Interpretation

    Different people interpret the same thing differently based on their own level of interest/time/concern, …/etc. That is a fact, not an argument.

    In software development, instead of the project manager assigning tasks to each engineer, programmer, QA, you name it, based on time, skill levels, familiarities with certain code pieces, scopes, existing client relationships, maybe, just maybe, it is better to ask each person which of the tasks they have the most interest in and then assign tasks based on level of interest. That way, each person on the team will put forth his/her best attention/effort to accomplish them.

    Potential pitfalls

    • What if none of the tasks interest me? Maybe put that person in a different project that has tasks that interest him?
    • What if many people are interested in the same task? Who gets to work on it? Maybe pair programming in which several people can participate and can have inputs?
    • If I keep picking tasks that seem easy (on the surface), would it make me look lazy?
    • If I pick several hard tasks, I may make myself too busy.

    Again, we should not be blind folded by interpretaion. I may think it is easy but someone else may think it is interesting and solve the task better. I may think it is hard but since I am so interested, I may solve it with higher efficiency, hence less time.

    The above is just a thought. I have not actually tried it to see how well the process works. However, since project management is so boring and annoying to so many people. We may as well put a different interpretation to it. It certainly is a paradigm shift in project management.

  • Moving from Typo to Wordpress

    Posted on February 23rd, 2009 Raymond Law No comments

    I recently moved my blog from Typo to Wordpress. Typo served well and it was written in Rails. However, it was more difficult to upgrade and I just don’t have enough time to maintain it and keep it up to date. So it has been running at version 4.1.1 which requires Rails 1.2.6. So a change is imminent and I found a couple resources by Stuart Johnston and Max Newell.

    Those are GREAT starts!. However, I had to modify the migration script for my Typo version (4.1.1) and the latest Wordpress version (2.7.1 at the time of this writing). Fortunately, the script is just pure SQL. That means I had to inspect the Typo and Wordpress database structures to correctly map the tables and columns between the two databases. It is not the funnest thing in the world though, but this has to be done. If you have other versions of Wordpress, I recommend you upgrade to the latest version first. That way, you don’t have to worry about Wordpress’s table structures because I already did this for you. If you are using a different version of Typo, feel free to modify this migration script and post feedback.

    Here are the steps that you need to take after grabbing the script:

    > mysqldump typo_db articles_tags tags categorizations categories contents feedback > typo.sql
    > mysql typo_db < typo.sql
    > mysql typo_db < typo_4_1_1_to_wordpress_2_7_1.sql

  • Dealistic is launched

    Posted on July 29th, 2008 Raymond Law No comments

    Andrew and I have been working on a new site Dealistic after our work at OnMyList.

    We’ve also put up a screencast to show off our features (HUGE thanks to Sherry)

    It lets you find deals by specifying a list of tags and it can notify you by email, RSS feed, and/or SMS when new deals appear that match your tags.

    We made the site because we often need to find deals on things we want to buy but we spend way too much time looking for irrelevant deals on a lot of different sites. With Dealistic, what you get is what you want.

    Never miss a deal because you don’t have time to find it! Just add a tag at Dealistic and we will let you know when a deal that you are looking for appears.

    We also have a feedback tool that we hope you can give us suggestions to do better.

  • Home-made Strawberry Banana Rendezvous

    Posted on July 28th, 2008 Raymond Law No comments

    Today I was stressed out while working because of the construction drilling noise near my house (I am working from home for Intridea). So I took a break, and tried to make a dessert aka Cold Stone Creamery ’s Strawberry Banana Rendezvous.

    Ingredients I used:

    • Turkey Hill strawberry ice-cream – not the greatest ice-cream brand but that’s what was on sale at Wegmans last night…
    • Hersey chocolate chips
    • A few Strawberries
    • Half of a banana – I ate the other half separately

    I put all these in a bowl and mix it to gether for one minute. The taste comes close. However, it doesn’t resemble ice-cream anymore as I am missing one huge ingredient – the “cold stone.”

    I guess the “cold stone” must be needed to keep the ice-cream ice-cream during the mixing process. The result was more like a milk shake than ice-cream. I still ate it all since I am a big ice-cream lover and I couldn’t just throw it away to the trash! I mean, it is going to look like that in my stomach anyway, right?

    So if anyone has a substitute for a cold stone, let me know. This is what I think can simulate the “cold stone.”

    • Put the bowl in the freezer and take it out only when you are ready to begin the mixing process.
    • Take the ice-cream out at the last possible second.
    • Surround the bowl with a box of ice.
    • It is probably a good idea to max your AC or do this only in the winter. A few degrees below freezing and being outdoor in Canada may help too.

  • Test/Behavior-driven development

    Posted on March 25th, 2008 Raymond Law No comments

    I have done testing using the Rails testing framework (test-driven development) and also am looking at RSpec (behavior-driven development), so I asked Chad Fowler about his view on the two approaches. He told me the inventor of behavior-driven development said to him:

    “You don’t need to do behavior-driven development because you already know behavior-driven development.”

    Translation: TDD and BDD are basically the same thing. If you really understand what TDD is about, you are already doing BDD, regardless which testing framework you are using.

    I also asked him how long it takes to do TDD/BDD versus w/o any testing. He answer:

    “Negative twenty percent.”

    A lot of existing projects don’t follow TDD/BDD and it is difficult/impossible to get involved in the middle and do that because development time is expected and it is less motivating when you are the only developer who writes tests.

    Therefore, one thing I am determined to do from now on is that for my next Rails personal project, before I write any code, I will write a test to fail and then write code to make it pass.

    Initially, it may take more time and getting used to, but hopefully it will cut down on debugging time and redesigning later on in the development process.

    I’ve heard about TDD/BDD for quite some time and have also tried for some personal projects. But I think I will really force myself to strictly follow this paradigm, so I can get a real feel of how well it works.

  • Entrepreneurial Psychology

    Posted on March 25th, 2008 Raymond Law No comments

    This is a very entertaining article by Marc Andreessen about Charlie Munger’s Poor Charlie’s Almanack. The following are some of the quotes that I find particularly interesting and it resonates with me. I can go back to read this to remind myself of some of these principles instead of reading the whole long article.

    One: Reward and Punishment Superresponse Tendency

    This is why stock options work so well in startups – and the fewer people in a startup, the better stock options work, since when there are only a few people in a company, it’s usually crystal clear to each person how her work will impact the value of the company.

    As a company grows, stock options and other forms of equity-based motivation become less and less useful as an incentive tool, since it becomes harder for many employees in a large company to see how their individual behavior would have any effect on the stock price of the overall corporation. So, more tactical incentives kick in, such as cash bonuses.

    Even engineers need counter-goals: incent engineers based purely on a ship date, and you’ll get a shipping product with lots of bugs. Incent based on number of bugs fixed, and you’ll never get any new features. And so on.

    Two: Liking/Loving Tendency

    Second, an entrepreneur, like any manager, has to fire people who aren’t great or who aren’t right for the tasks at hand. This naturally makes people not like you, particularly the people you fire. But again, not doing this backfires: nobody great wants to be in a company populated by mediocre or ill-fitting peers.

    Finally, some entrepreneurs have emotional resistance to pursuing a strategy that does not meet with immediate approval from press, analysts, and other entrepreneurs. This is worth watching carefully – if everyone agrees right up front that whatever you are doing makes total sense, it probably isn’t a new and radical enough idea to justify a new company.

    Three: Disliking/Hating Tendency

    So when your startup’s competitive juices get flowing – especially for the first time – and you find yourself fixated on a competitor, be sure to take a step back and say, is this really what we want to be focused on right now – is the market we’re both in really large enough to warrant this? If so, sure, go for it, guns blazing. But if not, stepping back and thinking about how to focus instead on creating a large market might be more valuable.

    Four: Doubt-Avoidance Tendency

    In my view, entrepreneurial judgment is the ability to tell the difference between a situation that’s not working but persistence and iteration will ultimately prove it out, versus a situation that’s not working and additional effort is a destructive waste of time and radical change is necessary.

    Five: Inconsistency-Avoidance Tendency

    I think this is something that every entrepreneur needs to watch very carefully. Sometimes it’s simply a matter of timing – and if people just aren’t ready for a new idea, you usually can’t make them ready, and you have to wait for them to change or for a new generation of customers to come along.

    My favorite way around this problem is the one identified by Clayton Christensen in The Innovator’s Dilemma: don’t go after existing customers in a category and try to get them to buy something new; instead, go find the new customers who weren’t able to afford or adopt the incarnation of the status quo.

    Six: Curiosity Tendency

    The only important thing I can think to add – aside from the importance of hiring curious people – is that lack of curiosity can be a huge danger to a startup in the following way: often, your initial strategy won’t quite work, but you can learn as you go based on other things that happen in the market and eventually iterate into a strategy that does work. Obviously, insufficient curiosity can prevent you from seeing the new data and lead you to continue to pursue a losing strategy even when you wouldn’t have to.

  • How to lose a friend in 30 minutes?

    Posted on March 11th, 2008 Raymond Law 4 comments

    Since I have Verizon FiOS running perfectly for 3 days now, I called to cancel all my Cox services. It took 3 attempts to do it.

    First call:

    I navigated through their complex and redundant voice menu to finally hear “Please hold.” Boy they mean it. I was put on ’silent’ hold for 15 minutes, then a strange music was on then off, and back on hold I was. Taking a peek from working on my Macbook, I was disconnected :(

    Hmm… I figure they really can’t afford to lose any more customers to Verizon and they are probabl thinking maybe I will change my mind and call Verizon instead to cancel my FiOS. Nice try!

    Second call:

    Again I was greeted by their automated voice system. BTW, Cox has been my friend many times more than the number of friends I made since I had ICQ, AIM, MSN, Yahoo, Google Talk, Skype, Facebook,… combined.

    Here is the conversation (not exact word by word coz I can’t possibly remember that many words coming out of a robot’s mouth):

    Robot: Thank you for choosing Cox Communications, your friend in the digital age. (Some spanish…)

    Robot: Welcome to the Cox automated service, … so tell me in just a few words, tell me why you are calling today?

    Me: Cancel services.

    Robot: Did you say “Change your existing services?” If so, please say yes,….

    Me: Cancel!

    Robot: I am sorry I did not understand you. Please try again. You can say in a few words…

    Me: Fucking Cancel!!!

    Robot: I am sorry…

    I just hung up… Should I send them a letter through USPS?

    Last call (hopefully ever):

    I made yet another friend with Cox. Usual greeting not worth repeating anymore.

    Robot: Thank you for choosing Cox Communications, your friend in the digital age. (Some spanish…)

    Robot: Welcome to the Cox automated service, … so tell me in just a few words, tell me why you are calling today?

    Me: Cancel ALL services.

    Robot: Did you say “Cancel all services?”

    Me: YES!!!

    Robot: Okay. Please hold while I transfer you to a representative…

    Apparently, the key to cancel with Cox is the word ALL.

    I finally was able to speak to a guy who helped me cancel my services with Cox. He asked:

    Human: May I ask why you want to cancel?

    Me: (Not wanting to hear any last minute pitch about how I would suffer after losing Cox as my friend) I switched to Verizon. It was cheaper, works better, got more stuff. It was kind of a no-brainer.

    That finally sealed the deal and ended my long-lasting friendship with Cox. So I wrote this post to celebrate my new friendship with Verizon FiOS, hoping our friendship will not come to a bitter end.

  • I hate TSA and laugh at their stupidity

    Posted on March 11th, 2008 Raymond Law No comments

    TSA stupidity on Macbook Air

    Seriously, TSA is just wasting the government’s (hence our tax) money and does not provide much in return. They are known to harrass regular traverlers. I was once a victim while traveling on work. I wrote an essay about it but am not sure if I should post it…

    FUCK TSA!

  • Another reason not to get the Macbook Air…

    Posted on March 10th, 2008 Raymond Law 2 comments

    Apparently, the Macbook Air is known to disappear into thin airLOL

  • I have Verizon FiOS installed!

    Posted on March 9th, 2008 Raymond Law No comments

    The technician came at 8:30 in the morning on a Sunday and woke me up in bed. I am actually appreciative for the guy to show up early and on time. Cox never keeps their promise…

    This guy, Jason, is probably one of the most knowledgeable technicians that I’ve ever had at my house. He seems very proficient at the installation of the ONT, BBU,… And he had the TV remote controls memorized! He covers his shoes before walking on my carpet. So that’s a bonus.

    The router Verizon gives me is actually very capable. Before, I feared that they would lock many configurations and not let me mess with it. But it actually turns out to be a MUCH more capable router than my crappy DI-524. And it does true WPA2 (it is initially configured with WEP, so you have to manually configure it). the TV set-top box actually connects to the router as 192.168.1.100 to download programming, so do NOT block anything above 100.

    I ordered the 5MB/2MB D/L and this is the result of a speed test:

    So far I am quite happy with the service and ready to dump Cox.