Main

Technology Archives

February 13, 2004

The battle of the Miserable Failures

By now, most people know how some members of the blogging community collectively managed to get George Bush's page ranked first in Google when searching on the terms "miserable failure".

Just now on a whim, I decided to pay Google a visit and see if Bush still occupied that ignominious spot. Lo and behold, it seems like Michael Moore has now displaced Bush for the top spot.

But look! Out of nowhere, we've got Jimmy Carter quickly coming in and making a strong debut! He's followed by Senator Hillary Clinton, and Howard Dean too seems to be gunning for the lead.

Now, I can't let this one just slide, so I'm pitching in to keep our friend Georgie on top.

Ahhh Google... it's not just a search engine, but the battlefield of the future. A place where the wars for the minds of the web-surfing masses are waged.

Bring it on.

February 19, 2004

Yahoo Groups: When good intentions go bad

I get around 300 or so emails on an average weekday to my personal account alone, down from a peak of 400 when I was actively job hunting. (Lest anyone think that these messages are from female admirers around the world, the bulk of them are from various mailing lists that I'm on. And probably 1/3 is spam which gets filtered out. ;-) )

Anyhow, while it is a challenge trying to keep up with all (a set of good filters definitely helps), a sort of side effect is that if I get significantly less than that on a weekday, I know something's wrong.

Anyhow, over the last week or so, I noticed a significant drop in my incoming email levels, and was perplexed. Upon further discovery, it looked like many emails from Yahoo Groups hosted mailing lists were not reaching me. I sign into Yahoo, and look at my groups -- I'm still listed as being a subscriber. Then I do a bit more digging, and see a message in small font saying that one of my email addresses was bouncing.

Apparently, someone sent a email containing a ".scr" virus script to a Yahoo-hosted list that I'm on. The message goes through (Yahoo should have rejected it, of course), and is then correctly rejected by Stanford's email server. This triggers a "bounce" message alerting Yahoo of that fact. Now, unfortunately for me, Yahoo interpreted the bounce to mean that my Stanford CS address was no longer active, which it most certainly was. It wasn't until I noticed that no Yahoo groups mail had been coming to my cs.stanford.edu address that I knew something was wrong, and in the few days it took, I've probably missed several hundred messages.

Now, most of them were not critical for me to have received, but I can certainly imagine a easy denial of service attack whereby a user subscribes to a large mailing list, intentionally sends out a email with an unwanted file extension, and cause the receipients' mail servers to bounce the message, and effectively and automatically mass-unsubscribes many people from the group without notice.

I can definitely understand the good intentions of this 'feature': to prevent bounced messages when an email address expires. Yet, my experience is an example of several good-intentioned things gone wrong: failure to differentiate between a bounce due to an invalid email address versus a bounce due to a virus email, and most fundamentally, glaringly bad user design -- and from Yahoo, no less.

One of the first principles any software designer learns is to always alert the user of an error condition, if at all possible. At the very least, Yahoo groups should alert the user that one of their addresses is bouncing via an alternate non-bouncing email address if they have one registered with Yahoo, which I certainly do.

So, with the proliferation of email viruses going around, if anyone reads this and is wondering why they've suddenly stopped receiving Yahoo groups mail, now you know. And as they say, knowing is half the battle. =)

February 27, 2004

Bridging the Xanga gap... again

I'm not a very big Xanga fan for many reasons, so I chose to host my own blog using Movable Type. Yet, the reality is that many of my friends do use Xanga, and just read everything through Xanga'a built-in aggregator, rarely if ever checking out other non-Xanga sites.

For a while, I was cutting and pasting entries in my real blog to my Xanga site. However, I soon grew too lazy. I wanted some automatic way of mirroring entries to Xanga, like I've seen a friend of a friend do. So, being the lazy nerd that I am, I figured out the protocol that Xanga used, and hacked together a Perl script to do it for me.

So, to all you out there in Xanga land, I am back for good! =)

And, if you're interested in using the script yourself, check out the project page. Enjoy!

March 1, 2004

Bool-yah!

Warning: this is a nerdy entry. So you might want to come back some other time, if you don't dig this stuff... =)

Working as a professional programmer, you realize that there's just so much practical stuff you learn on the job that's never taught in the classroom, even at a top CS school like Stanford, that's nevertheless pretty important to know if you want to be the best at what you do. Today at work was one of those moments of learning.

Anyhow, most people know that in C++, there is a built-in bool type for boolean values. The exact implementation of this bool type is left to the compiler writer, though. Now, in Visual C++ and versions of gcc later than 3.0, bool is a byte that can only be TRUE or FALSE. In Visual C++, there's another type, BOOL (defined as a 32-bit int in the Windows header files) which can be NONZERO (TRUE) or ZERO (FALSE).

What's the difference, you may think. Well, the compiler sometimes generates extra code for a bool.

For example

return A != 0
for a bool must generate (in assembler)

if(A != 0)
  return 1;
else
  return 0;
In fact, Visual C will give you a “performance warning” error in this case.

While the same code for a BOOL can be

return A;

Similarly, the code bool

 A = (J != 4);
will generate a warning error and the code

if(J != 4)
  A = 1;
else
  A = 0;
The code
BOOL A = (J != 4);
will generate
A = !(J-4);

Now, if you're working with a deeply-pipelined processor, a branch misprediction can be costly in terms of cycles, so you can see why you want to avoid as much as possible, branching ops in your generated assembly code, especially in speed-critical inner loops. A BOOL being a 32-bit type rather than an 8-bit type is also more efficient for operations but less efficient for storage.

Now, of course, almost everything in CS can be thought of as a size vs. speed tradeoff: if you need to store arrays of bools (if you are, you aren’t coding well, though) an array of bool is better than an array of BOOL, but, if you really want to save space, you can use an array of bits, which take even longer than bools for operations but is far more efficient for storage.

Anyhow, I think I've bored everyone except for about 2 or 3, but this was fascinating to me. So people, check those typedefs! =)

April 14, 2004

A better mousetrap

Warning: another programming entry. There's an old saying, build a better mousetrap and the world will beat a path to your door.

This programmer currently finds himself in need of a better mousetrap -- specificaly, a way to search for text. I'm talking about an intelligent grep that's aware of language syntax, so that I could search for text while ignoring comments in files. Or search for all occurances of a variable name, but only amongst variable names, rather than amongst all text in a file in general.

Someone's had to come up with something like that -- any decent editor will have syntax coloring of source code, so it should be a small incremental feat to be able to search text that's eg: a variable name, a constant string, not a comment.

But no one on the team seems to have heard of such a beast, and googling didn't help much, but then again, I didn't really know how to phrase the query without being too broad.

So, anyone that comes up with such a tool will probably win the hearts of millions of frustrated programmers all over the world, this one included.

Anyone?

About Technology

This page contains an archive of all entries posted to Ryu2.mind in the Technology category. They are listed from oldest to newest.

Self-expression is the previous category.

Thoughts is the next category.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.32