jump to navigation

Hacking the Planet to save it October 19, 2009

Posted by Chao in Uncategorized.
add a comment

Paul Buchheit (Mr Gmail & FriendFeed) has a fascinating essay about Hacking being a way to find shortcuts and loopholes to success. He begins:

Every system has two sets of rules: The rules as they are intended or commonly perceived, and the actual rules (“reality”). In most complex systems, the gap between these two sets of rules is huge.

Sometimes we catch a glimpse of the truth, and discover the actual rules of a system. Once the actual rules are known, it may be possible to perform “miracles” — things which violate the perceived rules.

Can we use this spirit of hacking for environmental causes? Here’s a great example. We’ve heard that there’s a Texas-sized garbage patch floating somewhere in the pacific. Yes, using fewer of those convenient but non-biodegradable plastic bags would be a good idea. But wouldn’t an even better idea be to figure out how to make these bags biodegradable? That’s exactly what a teenager figured out.

SuperFreakonomics seems to have riled up a lot of environmentalists with the same philosophy: add hacking (they call it “geoengineering”) to the list of things we should do in addition to more established green practices (like recycling).

Let’s add more Science Fair Sponsorships to the next stimulus package we’ll be needing soon!

Interesting proposal to make Ajax crawlable October 7, 2009

Posted by Chao in Uncategorized.
add a comment

Could have lots of repercussions in the SEO world!

Official Google Webmaster Central Blog: A proposal for making AJAX crawlable.

This Is a Photoshop and It Blew My Mind – Photosketch – Gizmodo October 6, 2009

Posted by Chao in Uncategorized.
add a comment

This Is a Photoshop and It Blew My Mind – Photosketch – Gizmodo. Wow, researchers from Tsinghua and Singapore no less!

Finally fixed my MBP’s once a week “blue (well, grey) screen of death” September 25, 2009

Posted by Chao in Uncategorized.
add a comment

I have to adpanicmit it – my mac has been acting like a windows machine ever since I upgraded to Leopard (no, not Snow Leopard). OK, only in this respect: it’s been crashing on me every week or two.

At first I thought it was buggy Leopard, then I thought it was my bluetooth keyboard (since it happened most often when the keyboard initiated a connection to my mac). But then I replaced it with a wired keyboard, and it still happened – just a little less.

Well, I finally upgraded to Snow Leopard on a brand new spanking MacBook Pro and it still happened (after a few days). That was the straw that broke the camel’s back I started being superstitious and suspecting everything including my USB hub or my display monitor. I started blabbering my problem to everyone.

Well, that blabbering actually worked. My genius syadmin-savvy brother Ming suggested I look at the crawl stack of the kernel panic report. I protested that they were just filled with hex numbers. But then I thought of looking them up on the console log. And lo behold, just beneath the sea of hex numbers, was revealed the true source of my agony.

It was DoubleCommand, a utility I had installed eons ago that allowed me to mimick “forward delete” on a mac notebook keyboard. It worked so well that I had forgotten I had installed it. And the crash was so intermittent that I wasn’t able to link it as the buggy software for years! And it turns out they actually had a fix for it over a year ago – I just didn’t know.

So, for the 3 remaining folks who suffer from this affliction, hope your googling brings you here :)

DoubleCommand.

Designing a large scale community moderation system for Yahoo! Answers – Wikimania September 17, 2009

Posted by Chao in Uncategorized.
add a comment

All of our sites require user submission, and at a certain point they all get bogged down by spam (notably clipclip and coolqs). So, this video about how the Yahoo Answers moderations system came about and evolved seems particularly interesting…

Designing a large scale community moderation system for Yahoo! Answers – Wikimania.

Sending a camera up 100,000 feet – for $150! September 17, 2009

Posted by Chao in Uncategorized.
add a comment

space.1337arts. Wishing I were a student again :) Sounds like a fun project to try out.

Picture from 93000 feet up

Snow Leopard in all its geeky details September 3, 2009

Posted by Chao in Uncategorized.
add a comment

Mac OS X 10.6 Snow Leopard: the Ars Technica review – Ars Technica.

Warning: all 23 pages worth! But interesting details about what exactly is 32-bit and 64-bit about 10.6, improved compilers, closures in C?!… and I’m still only on page 12!

Money can buy you happiness August 31, 2009

Posted by Chao in Uncategorized.
add a comment

It really depends how you spend it!

via Happiness: A buyer’s guide – The Boston Globe.

An ‘Only in Silicon Valley’ Wedding Registry – Bits Blog – NYTimes.com August 25, 2009

Posted by Chao in Uncategorized.
add a comment

Javascript: Textarea/text field with UI for limiting max characters August 12, 2009

Posted by Chao in Uncategorized.
add a comment

Want to build a Twitter clone? You’ll need a text field that limits text entry to 140 characters?

How ’bout one of those faddish question and answer sites (like alas our own failed) CoolQs? You’ll need the same widget that tells you how many characters you have left for your question.

You could use the MAXLENGTH or SIZE attributes for the <input> field. But that doesn’t provide the user with the instant feedback as to how many characters the user has left as the user types away.

Well, it’s your lucky day – I have just the widget for you if you use the Prototype library.

To turn any html text field or textarea, try


new TextLimiter<source elt>, <options>

e.g.

new TextLimiter 'whatsup', {limit:140}

<source elt> is the text field or textarea object you want add TextLimiter behaviors to. You can specify the DOM id or the javascript object, as per standard Prototype classes.

Optional options (is that redundant?) include:

  • statusElt: DOM element to provide feedback as user types. statusElt.show() is called when the user starts typing.
  • countElt: The DOM element usually within statusElt that is dynamically updated to show how many characters are left.
  • limit: the maximum number of characters allowed. Hard-coded default is 110.

Here’s the code:

var TextLimiter = Class.create();
TextLimiter.prototype = {
 initialize: function(textField, options) {
 //options: statusElt, countElt, limit
 this.textField = $(textField);
 this.options = Object.extend({limit:110}, options || {});
 var status = this.options.statusElt = $(this.options.statusElt);
 if (status) {status.hide();}
 this.options.countElt = $(this.options.countElt);
 this.textField.observe('keyup', this.keyUp.bindAsEventListener(this));
 this.textField.observe('focus', this.focus.bindAsEventListener(this));
 },
 focus: function() {
 if (this.options.statusElt) {this.options.statusElt.show();}
 },
 keyUp: function() {
 var field = this.textField;
 var limit = this.options.limit;
 if (field.value.length > limit) {
 field.value = field.value.substring(0, limit);
 } else if (this.options.countElt) {
 var total = limit - field.value.length;
 this.options.countElt.innerHTML = total;
 }
 }
};