Blog



All timestamps are based on your local time of:

[ « Newer ][ View: List | Cloud | Calendar | Latest comments | Photo albums ][ Older » ]

Thought of the day2009-03-21 19:18:16

It's not who you know, it's who knows you. Which is a function of what you know (among other things). So there!

I always hated people who went around saying "it's not what you know, it's who you know". Nepotism is self-propagating right up until it implodes.

[ 0 Comments... ]

The definitive guide to whitespace, part 12009-03-10 23:17:14

Part 1: method invocations

The rules

  • Arguments in favor or against any of the options must not be based on subjective viewpoints (e.g. "it looks prettier").
  • Mention of languages that do not follow a C-style syntax is strictly prohibited (to avoid flame wars).


The options

optionA(foo, bar, func(baz));
optionB( foo, bar, func( baz ) );
optionC (foo, bar, func (baz));


The arguments
Option A is the shortest, requiring the least amount of typing, and fastest compilation time.

Options A and B have no whitespace before the opening parenthesis, therefore requiring a shorter search string when looking for instances of the method invocations (i.e. grep "optionA(" instead of grep "optionA (").

Option B is most convenient for manipulation via a tool (such as a naive code preprocessor), since useful tokens can be obtained by splitting the code on whitespace. Option A would return things like "optionA(foo," which are less useful than "optionB(" and "foo," separately.

The conclusion
To be determined once y'all weigh in with additional options and arguments.

[ 16 Comments... ]

A girl named Florida2009-03-07 16:32:34

So I came across the "girl named Florida" problem today on somebody's blog. (Part 1, 2, 3). The problem is taken from the book "The Drunkard's Walk" by Leonard Mlodinow and is easily googleable. Here's the problem:

Suppose that a family have two children.
1. What is the probability that both of them are girls?
2. Suppose you know that at least one of the children is a girl. Now what is the probability that both children are girls?
3. Suppose you know that at least one of the children is a girl, and her name is Florida. Now what is the probability that both children are girls?


The answers provided are 1/4, 1/3, and 1/2, respectively (I'm not sure if these answers are actually in the book, but I assume they are based on what everybody is parroting). You can follow the supposed logic in the part 2 link above, or in question 3 here.

The thing is, the solutions given make no sense intuitively. And therefore, I don't think they're right. Knowing the name of one of the girls shouldn't change a thing, because you can assume that the girl is named "x" and the exact same reasoning would apply. Therefore the answers to question 2 and question 3 must be the same.

My answers are 1/4, 1/2, and 1/2. For the second question, there are really four possibilities with equal probability: BG, GB, GG, and GG. And half of them have two girls. Another way of looking it is to simply discount the child you know is a girl. Since the two children are independent events, the second child has a 50% chance of being a girl, and therefore there is a 50% chance that they are both girls.

I'm convinced my solution is right. As a consequence I'm also convinced that everybody else must be stupid, starting with the author of the book (assuming the book says 1/3). Somebody please prove me wrong.

[ 14 Comments... ]

Memory lane2009-03-04 23:58:18

So the other day I was looking for one of my older posts and instead I would up reading a bunch of them and realized just how wrong I am when I predict stuff. So I went back two years in posts and here's a mish-mash of forward-looking statements I made:

  • Post #269 - Froogle. I said that in a couple of years Google Product Search would be considered a viable contender to Amazon. Well, they've got a couple of months before the deadline is up, but I'm not holding out any hope of that one happening. FAIL.
  • Post #276 - Google Gears. Well, this one's a mixed bag. At this point, Gears is really only used by Google products, and very few people have Gears installed in their browsers. Although they're still moving in the direction I talked about in that post, they're not going very fast. Need more time to see where this ends up.
  • Post #287 - Parakey. Not only does parakey.com seem to have been wiped of the face of the earth, so does blakeross.com. And whatever their stuff might have looked like, I don't see it in Facebook. At all. I didn't have any predictions on this one, but looks like my "hope" was squashed pretty flat.
  • Post #292 - Javascript. I can barely believe I wrote this post. It's amazing how much working as a browser developer has changed my views of the web. I hate Javascript more than I ever have in my life, and I hate the web developers who abuse it so much more. I'm amused when I realize that the "dom.appendChild" problem I mentioned with Safari in that post was actually correct behavior on Safari's part and incorrect behavior by everybody else. Javascript 2.0/Ecmascript 4.0 has since been killed, to be replaced with Ecmascript Harmony. Firebug is waay better than Opera's new Dragonfly debugger. Really I just take back everything I said in that post.
  • Post #300 - The 700Mhz spectrum. Well that's come and gone, with Verizon the winner. 'Nuff said.
  • Post #316 - Micro-hoo. Seeing as how this never actually happened my predictions are irrelevant. But I'm wondering if the whole ordeal succeeded in shaking up both Yahoo! and Microsoft somewhat from their complacency. I don't really know, but if it did I don't think it was enough.
  • Post #322 - IE8. It's been a year and a day since they announced their intention to ship IE8 with standards mode as default. They haven't flip-flopped on that decision. Keepin' my fingers crossed...


I'm sure if I dig deeper into my post archives I can find lots more examples of outrageous prediction failures but really that would just be depressing. I remember lots of google-related predictions for pie-in-the-sky ideas that never went anywhere. It also seems like I've significantly reduced my frequency of prediction posts, which is probably for the best anyway. And of course, this post wouldn't be complete without at least one more prediction: I predict I will post even fewer predictions in the upcoming year than I did last year. Ha!

[ 0 Comments... ]

And the winner is...2009-02-16 20:30:39

*drumroll* eMusic! And by winner, I really mean LOSER.

So for over a year now, I've been setting up unique forwarding emails for each online account I sign up for, so as to better track incoming spam. To my surprise, the only spam I got (until today) was from the email addresses I used for mailing lists. I subscribe to a handful of W3C mailing lists, and the email addresses are publicly visible, so spam there is expected and normal.

But today, I received the first piece of spam from an actual account email address, and it was the one I gave to eMusic. The piece of spam I got was for some get-rich-quick scheme, complete with Bayesian-filter-busting keywords glued to the bottom.

I suppose I should also mention that I got some junk (newsletters and the like) from some of the other accounts (Aeroplan comes to mind) that I didn't sign up for, but was able to opt-out from. None of those were misleading in any way; it was obvious who sent it. The eMusic spam I got today was the first that was completely unrelated, and proves that they allowed spammers to get their grubby hands on my email address in violation of their privacy policy.

Also, I should also mention that I terminated my eMusic account a couple of months ago (24th November 2008, to be exact), so it might be that they only sell your email address after you're no longer a customer of theirs. But they're still a rotten egg in my book. And their music selection sucks.

[ 5 Comments... ]

Losing sight2009-02-07 15:01:45

It seems to me that people often lose sight of their goals. This happens particularly when their goal isn't easily quantifiable or measurable, so instead of focusing on the goal itself, they focus on some indicator that is measurable. This is a reasonable approach, since it allows you to work towards the goal and measure progress. However, the problem is that they forget to make sure that their indicator remains a valid indicator of the goal as they make progress. Inevitably the indicator is no longer representative of the progress, and yet they continue along the path the indicator indicates.

Consider the following examples:

  • The police have a goal of increasing public safety. This is hard to measure directly, so instead they use the indicator of putting criminals in jail. This is easily measurable, and is an indicator of public safety. At least at first. Once they forget their goal was public safety, they start locking people up left and right for the most trivial things. Taken to the extreme, everybody ends up in jail and the "public" is safe. But that's not really a desirable outcome.
  • Managers have a goal of increasing employee productivity. Again, hard to measure directly. Some of them use hours spent working as an indicator of productivity. Makes sense, no? But only upto a point. After that point, increasing hours worked decreases productivity.
  • Athletes want to be in good physical shape. Fitness is hard to measure. However, walk into any gym and look around - everything has numbers for you to measure your progress. If you start lifting weights, the max weight you lift becomes your indicator. If you continue down that path and forget about your original goal, you end up becoming decidedly unfit (think bodybuilders).
  • People in general want to be happy. Happiness is pretty darn hard to measure. Initially, a good way to be happy is to be able to do what you want, which requires money. Therefore, your disposable income is an indicator of happiness. But how happy are the ultra-rich? Past a certain point having more money just weighs you down.


The list goes on. There's lots of goals that people work towards every day, but can't directly measure. It's fine to use an indicator, just remember that every so often you need to throw out your indicator and find one that better reflects your goal at the level you're at.

[ 0 Comments... ]

Le parkour2009-01-04 15:32:38

So as some of you are aware, I've been practicing parkour for a while now (about 16 months, actually).

I started doing it mostly because it looked neat and I was in need of physical activity that involved more than just typing on a keyboard. Parkour is great for staying in shape because a large part of it is physical conditioning to strengthen the body. We tend to use a lot of muscles that don't normally get used and so parkour workouts are a lot more comprehensive than for most other sports. The biggest benefit, though, is that it's a more socially-oriented workout than just going to the gym. This makes it a lot more fun and keeps you motivated to keep going.

The other neat thing about parkour for me personally, is just the sense of freedom I get when I do it. Parkour as a technical discipline is about efficiency of movement, and that's definitely a big part of it. But really, everybody has their own reasons for practicing parkour. For me, it's the sense of physical freedom I get, because the only thing that can hold me back is myself.

That's the other big thing about parkour - a lot of it is mental rather than physical. It's relatively easy to train your body and get stronger, but convincing yourself that you can jump across a 10-foot gap with a big drop is a whole another story. Even if you can do the same distance on level ground, there are huge mental blocks that you have to get past in order to pull it off. Facing (and overcoming) those mental challenges is a pretty exhilarating experience.

And no, I have not played Mirror's Edge.

[ 3 Comments... ]

Hacking the universe for fun and profit2008-12-28 17:04:01

This blog entry inspired by Stevey's latest post.

So... assume the universe is an embedded system (seems pretty likely, all things considered). What I want to know is: how can we (theoretically) break out of the system?

One of the comments on Stevey's post mentions the buffer overflow exploit as a way of breaking out of a system. However, buffer overflows (at least the traditional cracker-induced ones) are performed by entities outside the system rather than entities inside the system. A traditional buffer overflow results from the cracker feeding in more input to the system than it can handle, and then exploiting the mayhem that results for fun and profit. As humans inside the universe, this avenue isn't really available to us.

How about non-traditional buffer overflow exploits? Are there variations on the theme that might be available to us? Can we push around stuff within the universe in ways that it wasn't designed to handle? Possibly, but in order to do so we need a better idea of how the universe works under the covers.

Another approach, which I think is more promising, is to try to find design and/or implementation flaws in the universe and exploit those. The first comment on the post has a link to this page which describes one example of this. The system had a design flaw that wound up being inadvertently exploited by code inside the system to break out of it. There might be similar implementation flaws that result in exploitable behavior (i.e. what happens if we manage to cool a lump of matter to absolute zero?).

So the next question is: how do we find such flaws? Again, we need to have a better idea of how the universe works in order to locate potential flaws. I'm sure we'll stumble across them anyhow in due time but I don't think I'll still be around when that happens (heck, maybe the universe won't even be around then).

Ok, so let's postulate about the implementation of the universe. If you had to implement a universe, how would you design it?

Personally I would probably use VHDL or a similar language. That allows you define a bunch of rules which get executed in parallel every time increment. The input is the state of all the variables in the system, and the output is the new state of the all the variables. In the universe, I would represent each basic particle's basic properties (mass, n-dimensional position/velocity, etc.) as the variables, and the laws of physics as the rules.

So how to exploit VHDL code? Hmm.. I don't remember nearly enough of ECE 427 to answer that. Need to think about this more...

[ 1 Comment... ]

Alternative power2008-12-15 00:03:02

It seems like most of the companies capitalizing on alternative ("green") sources of energy (e.g. Bullfrog Power) are harnessing wind and water to generate electricity. Definitely an improvement over coal/oil, but I'm wondering if all we're doing is switching to a less evil alternative.

Using the wind to generate electricity necessarily removes energy from the wind, which means the wind can travel less distance. This is bound to have some sort of effect somewhere, and though it may be negligible now, supermassive wind farms may make it less negligible. And even if it's not negligible it's probably really hard to track and measure properly, which means it's going to be ignored.

Just some food for thought.

[ 6 Comments... ]

Oh crap2008-12-10 09:24:06

You know what this means... Facebook groups actually *do* have an impact in the real world! This does not bode well...

[ 3 Comments... ]

[ « Newer ][ View: List | Cloud | Calendar | Latest comments | Photo albums ][ Older » ]

 
 
(c) Kartikaya Gupta, 2004-2025. User comments owned by their respective posters. All rights reserved.
You are accessing this website via IPv4. Consider upgrading to IPv6!