Technology news and views
RSS icon Email icon Home icon
  • Understanding MySQL Control Flow Functions

    Posted on May 21st, 2009 Sandeep 1 comment

    Sure, the documentation for control flow functions is available right here. But it’s not the easiest thing in the world to understand. The documentation, I mean – since the examples given there are very simple cases.

    Here’s a portion of it, explaining the CASE statement:

    CASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN result ...] [ELSE result] END

    CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...] [ELSE result] END

    The first version returns the result where value=compare_value. The second version returns the result for the first condition that is true. If there was no matching result value, the result after ELSE is returned, or NULL if there is no ELSEĀ  part.

    mysql> SELECT CASE 1 WHEN 1 THEN 'one'
        ->     WHEN 2 THEN 'two' ELSE 'more' END;
            -> 'one'
    mysql> SELECT CASE WHEN 1>0 THEN 'true' ELSE 'false' END;
            -> 'true'
    mysql> SELECT CASE BINARY 'B'
        ->     WHEN 'a' THEN 1 WHEN 'b' THEN 2 END;
            -> NULL

    Great, but how do you use it in an actual scenario where you want to, let’s say, update a column based on its current contents?

    Read the rest of this entry »

  • Mobile Number Portability in India. Finally.

    Posted on May 11th, 2009 Sandeep No comments

    While mobile number portability (MNP) has been in use for the last several years in many parts of the world, India was still lagging. The Department of Telecommunications (or DoT) finally mandated the provisioning of the MNP service. Officially, the department defines the MNP service as follows:

    Mobile Number Portability Service means a service which allows subscribers to retain their existing telephone number when they switch from one access provider to another irrespective of mobile technology or from one technology to another of the same or any other access service provider (sic).

    This is good news!

  • A Wordle analysis of Techbook

    Posted on May 5th, 2009 Sandeep No comments

    Wordle just won the 2009 Webby for Best Use of Typography. So I just had to run it on Techbook.

    wordle-analysis

    Click for larger image

  • Gmail Language Selection Feature FAIL

    Posted on May 4th, 2009 Sandeep No comments

    Why? Because it doesn’t exist, apparently.

    The last few days I’ve been visiting maps.google.cz. Today when I opened Gmail, Google decided, for whatever reason, to present me with the Czech version of the site. I don’t speak Czech, and naturally I looked around for a “Gmail in English” or “Change Language” link – but couldn’t find it anywhere.

    gmail-other-language

    Click for a larger image

  • Nokia E71x Cell Phone Appears on AT&T

    Posted on May 4th, 2009 Sandeep No comments

    Just came across this bit of news that AT&T will carry the Nokia E71x (no doubt a North American version of the E71). I decided to look it up on the AT&T website. Here’s what I saw.

    Nokia E71x

    Nokia E71x on AT&T

    Looks like somebody wanted to play with the HTML title tag.

    Anyway, at 0.39″ thickness, this is a sleek, full QWERTY phone that I wouldn’t mind owning. The phone’s got a 2.4″ display which is a bummer, but hey, I can connect to the Internet directly using either the data cable or Bluetooth – assuming AT&T hasn’t disabled it. Oh wait, there’s no mention of it on AT&T’s website about this feature, which leads me to believe that they have, in fact, disabled it.

  • A new look for Techbook

    Posted on May 1st, 2009 Sandeep No comments

    After several months of running the very nice Almost Spring theme on my blog, I switched to the Gear theme today. Let me know if you like the new look.

    Of course, the fact that JD upgraded the WordPress version to 2.7 was a major factor in getting me to make the switch.