Thursday, July 25, 2013

Royal baby and reality

Congratulations to Prince William and Kate... you got a beautiful royal baby George Alexander Louis. And of course he is a media sensation. See here for one...

Ok, he has first name, and 2 middle names (?), and a title named "Cambridge". What's his last name? Does he even have one? Whatever it is it probably doesn't matter. And he would probably one day be a king of England. (I probably won't live long enough to see his reign) or even Charles' reign as Elizabeth II seems able to still reign for a very long time.

Ok kids (especially girls). Look at this real prince. Look at his parents (future king and queen). Do they look like those you see in cartoons? You would expect his little car seat to be well decorated with crown symbols for his royal come home? Look pretty regular to me.

Modern queens and kings and princes don't get the real power they used to have. (Why keep them around is actually a good question). So kids, don't bother fantasizing to be prince and princess with your dresses and toys. They are just tricking your parents to buy stuff.

Tuesday, July 23, 2013

Programming vocabulary: currying

I came across with the term "currying" in some javascript book. Oh it has nothing to do with that yellow (or green or red) spicy dish. Haskell Curry has programming language and concept named after his last name AND first name. Now that's impressive. Even Albert Einstein and Issac Newton didn't acheive have that (heard of anything called Albert or Issac)?

See here for details... so you can break a function into a function and then pass it to an internal (partial) function.

Can someone raise hand: "uh, just how gains do you have by doing this?" Do you really find this useful?

Monday, July 15, 2013

Make your input boxes glow

Once upon a time I heard a UI design guy talk to our client... "Do you want your search box to glow?" The client goes, "ooh I like that."

I didn't have a clue what styles make that happen. Glad that wasn't an interview question.

Testing:

Here is how: "focus" and "box-shadow".

<style type="text/css">
input {
    border:2px solid #dadada;
    border-radius:7px;
    font-size:20px;
    padding:5px; 
}

input:focus { 
    outline:none;
    border-color:#9ecaed;
    box-shadow:0 0 10px #9ecaed;
}
</style>
Testing <input type=text size=10>

Monday, July 8, 2013

Google Reader goodbye

So the Google Reader is gone. Mourned by quite a few people on the Internet. I've seen many articles about it along with suggestions of alternatives. Google killed it because of low usage... Really, if there is so low usage when is there so many people missing it? Well even if Google killed it, it is still on your phone and not Google is not such tyrant yet to delete stuff on your phone. If this is no more updates to it that doesn't bother me as this fairly simple app needs no update. But alas, the app stops working, won't get new feeds!

Ok, what's a good alternative? I tried to look for one and gosh the Permissions on some of these are kinda scary: access to your memory card and everything. Download at your own risk. But there is a news/feeds app right from Google: Google Currents. This has more elaborate UI and works pretty well. (I need to learn how they do this scrolling UI, probably some Ice Cream sandwich feature)

Tuesday, July 2, 2013

Pluto's moons

I live under a rock. The demoted planet Pluto has five moons and the last two just officially named: Kerberos and Styx. News item here. They used to be known as P4 and P5. Ok, from the baby astronomy books I've read... I thought it only has 1 or 2 moons. I must be reading some old book because P4 and P5 was discovered just in 2011 and 2012.

This dwarf planet is just less than 0.24% the mass of Earth (how do they measure that? see here. Kepler's Laws rules) and it attracted 5 moons. Impressive isn't it... So moons are fly-by rocks captured by gravity?

Earth would be much more interesting if we have more than 1 moon. See, ancient Chinese associate the sun with man and the moon with woman. Hard to do such analogy if we have 5 moons.

Pluto's orbital period is 238 years. The entire USA's history is just 237 years as of now. (2013-1776=237). When Pluto and its moons visit the same spot next time around... the USA and Earth would be different, very different, if it is still around.