Almond-crusted mascarpone-filled kumquat marmalade- and créme de cacao-glazed blackberry and raspberry tarts

August 11th, 2008

Can Haz Wallet?

August 3rd, 2008

I found this today on University between 10th and Vermont in San Diego.

Custom Wikipedia CSS & Javascript for iPhone

August 2nd, 2008

This afternoon I made a custom stylesheet and script to format Wikipedia nicely for me when I am logged on from my iPhone. If you have a Wikipedia account, you can easily use them by adding them to your own monobook.css and monobook.js. Screenshots below.

Hidden Categories in Wikipedia

July 12th, 2008

While searching for a list of unwatched articles in Wikipedia (which isn’t published as far as I can tell), I found the category of hidden categories. Interestingly, the “hidden categories” category itself is not a hidden category[1].

[1] Wikipedia Signpost: Role of hidden categories under discussion

What’s wrong with Yelp?

May 3rd, 2008

Imagine for a moment that you were a point in multidimensional space, and your nearby neighbors in this space are people that share your preferences for restaurants, bars, and clubs. In this model, a bar you like is very near to you (e.g., by a Euclidean metric), while some place you hate is far away.

This model rules Yelp. A review on yelp is a measurement of the distance between the reviewer and the reviewed. The review will be favorable if and only if the reviewer is nearby the reviewed in the model.

A restaurant (e.g., Bite) gets good reviews because the people that review it know or can guess, before they go there, that they will like it. If they didn’t, the place wouldn’t have such stellar reviews.

So why do some places get terrible reviews? I see cases that would cause this. First, if a new nightclub (e.g., Universal) is still “figuring itself out,” it might attract a lot of people expecting one thing and getting another. In other words, they are not near the place in the model, but they visit it anyway because they think they might. Likely, because the place is so new, many people are testing it out, so you can expect the reviews to be unfavorable, even by the people who are supposed to like it, because the presence of outsiders ruins the whole experience.

In another case, a super-exclusive bar might only cater to a very narrow range of clientele. In other words, you have to be unusually close to this bar in the model in order to like it. Perhaps it only supports one or two cliques of regulars, and everyone else is shunned.

In this example, the radii correspond to the ability of a bar or restaurant to support a wide or narrow section of people.

Dangers of Anonymous Function Closures

April 7th, 2008

John Resig’s jQuery uses a standard technique of anonymous function closures to namespace its internal functionality.

(function(){
  // jQuery stuff goes here...
})();

This is all well and good until you want to inline this code under some of your application code, as I did while working on Eventful’s MySpace application. Consider this example, written in standard Javascript style.

var foo = function(bar) {
  console.log("foo");
  return bar;
}

(function(){
  console.log("bar")
})();

What do you expect this code to print? If you say “bar”, you’re wrong. It prints “foo bar” because in this context the anonymous function closure becomes a call to the function that prints “foo” and returns the function that prints “bar”, which is then called.

Most of us probably wouldn’t notice what just happened because we are so used to Javascript interpreters automatically inserting semicolons after function definitions.

The danger is assuming, as John Resig and hundreds others have, that your anonymous function closure is the first token in a new line. In my case, it wasn’t. The solution? Either start meticulously sprinkling semicolons in your application code, or just add a single semicolon before your parenthetical block, guaranteeing it’s the first token in the line.

;(function(){
  // jQuery stuff goes here...
})();

Tortilla Soup

November 25th, 2007

Semester Conclusion

December 17th, 2006

I haven’t written anything in a few months because there is no time during the semester to work on anything fun. This semester was good, but challenging. I took three graduate classes, each culminating in a final project. For bioinformatics, I did some biclustering research based on some earlier work by my thesis advisor. In digital image processing, I designed a method to detect brake lights for autonomous vehicles. Lastly, Michael Jolson and I made this cool general-purpose distributed computing system based on a market model for database systems.

Reversed Blogs

August 9th, 2006

Take a regular blog, and flip it around. What do you get? A reversed blog, of course, where vistors write questions or comments and the author anwers. Sounds stupid, but I think people could get a lot of fun and use out of this. I see this manifesting as a single site with multiple instances (e.g. blogger or livejournal), funded by ads, and configurable to control who can ask questions, who can answer, and so on.

Here are a few examples. A couple’s answers their friends’ questions. A researcher’s or expert’s revblog answers questions from others in her field. A CEO’s revblog answers his company’s employees. Changing the parameters around may allow anybody to ask and answer (a forum) or only the author to ask (a traditional blog), but keeping in the spirit of “questions” and “answers.”

For instance, imagine this were a reversed blog where I come up with silly ideas and you tell me if they suck or not. Would that be a good idea?

WikiSyntax

August 6th, 2006

I’m working on a Greasemonkey script to add syntax highlighting to Wikipedia in Firefox. The trick is to replace the edit page’s textarea with an editable iframe as the page loads, then you can do crazy fun stuff with the document which I will refrain from mentioning because it’s much too nerdy.

At first I thought an extension was the way to go, but its turns out extensions are aimed at tweaking Firefox’s interface, not fussing with the page. Greasemonkey is perfect for the job, since it basically just executes a script on every page that matches a given pattern. Plus, users don’t have to go through the hassle of downloading crap and restarting the application.

WikiSyntaxThis screenshot shows link underlining, headers, and boldface (i.e., embiggening). I haven’t figured out how to handle styling as the page is edited, though, but once that’s out of the way the rest should just be a matter of regex hacking.

Here is a quick WikiSyntax demonstration.