FlasCar: A Ghetto Flash Card Program

November 29, 2009 by andrewfong

I really didn’t want to pay for flash card software to help with studying, so I spent a few hours cobbling together FlasCar — my ghetto flash card program. It’s a Python script that parses a data file and generates an HTML / Javascript (jQuery) page that you can use.

Click here to try out the demo.

If you’re interested, you can download the Python script and make your own Javascript-powered flash cards. The details are in the README file. If you’re running Windows, you’ll need to install Python first. I think OS X and most Linux distros already have it, but if they don’t, go to the previous link  and get it.

Bing Censoring in China?

November 22, 2009 by andrewfong

Nicholas Kristof recently put up an article about Bing censoring simplified (mainland) Chinese searches. All of the major search players do this of course, but what’s new is that the censoring happens when if you’re searching from a U.S. IP address (as opposed to within China itself).

Kristof uses Tiananmen (天安门) as his search term, but I think that’s a little ambiguous. Tiananmen Square has a history that stretches well before 1989 (trivia of the day: the 1989 incident was not the first Tiananmen Square incident) and as a popular tourist location, it’s plausible that Bing’s algorithm would turn up lots of friendly-Tianamen-is-a-nice-place-to-visit results.

So let’s try the name of a certain evil cult outlawed in China.

For comparison, here’re the Google results:

Google has 7,490,000 results and Bing has 0? Now that’s implausible.

Interesting notes:

  • Today’s Bing background is of Potola Palace in Tibet, the former home of the Dalai Lama.
  • Google includes traditional Chinese character results in search results using simplified Chinese characters (see the last item in the screenshot above).

What’s the right length of time for copyright and patents?

November 14, 2009 by andrewfong

One of my issues with copyrights and patents are setup is how arbitrary their length is. Copyrights lasts for your entire life + 70 years. A patent lasts for 20 years. That seems odd to me. The end result of billions of dollars worth of product development can be under protection for a shorter amount of time than some doodle you scribbled on a napkin one afternoon.

Ideally, the length of time a copyright or patent lasts should be tied to market behavior by producers. I’m not sure how’d you make this work, but as a starting point, the market value of a copyrights or patent should correspond roughly to your sunk costs in producing the relevant intellectual property. One you account for those, I feel the law shouldn’t offer any additional protection. You are of course, entitled to try to earn a profit, but your profits should come not from a monopoly but from making a better product than your competitors — and I mean competitors in a very narrow sense. For example, I’d like to choose between book publishers based on factors like the quality of the paper or which ones offer digital copies, as opposed to which one of them managed to snag the exclusive rights to a book first.

I really can’t justify sunk costs as a barometer of the ideal value of a copyright over say, sunk costs + 20%, but it seems to jive from from the standpoint of putting the original content producer on a level playing field with the copycats. If anyone has thoughts on this, I’d be interested in hearing them.

Bus Scheduling

November 12, 2009 by andrewfong

This happens pretty frequently in Berkeley. Buses on a given line are spaced 10 minutes apart. Bus A swings by a stop around 9:40AM. A large number of students with 10AM classes pile on. Because there are so many people getting on the bus, Bus A falls a little bit behind schedule. At 9:50, Bus B swings by the stop, which is now empty. B spends relative little time there and is now ahead of schedule.

The same thing happens at the next few stops. As more and more people hop on Bus A, it falls further and further behind schedule. As it falls further and further behind schedule, more and more people accumulate at stops ahead of Bus A. Feedback loop ensues.

Meanwhile, as Bus A is falling further behind schedule, Bus B is increasingly getting ahead of schedule. Since Bus A was late, the gap in time between Bus A and Bus B is now smaller than anticipated. That smaller gap in time means that fewer people have accumulated (i.e. people who normally ride Bus B now ride Bus A). Less people to pick up means less people to drop off means less time at any given stop. Bus B gets further ahead of schedule, narrowing the gap between it and Bus A. Another feedback loop.

Eventually, Bus B catches up to Bus A, and you get this very annoying scenario of a long wait-time followed by two back-to-back buses. Meanwhile, because B was so far ahead of schedule, the gap between it and Bus C starts to grow. Bus C starts taking on passengers that missed Bus B (because it came and left the stop earlier than the time listed) and starts to fall behind schedule. The cycle repeats.

There is a slight correction mechanism here. If the driver of Bus B is smart, she’ll drive ahead of Bus A and try to even out the load distribution by picking up those large masses of waiting passengers that otherwise would’ve hopped on Bus A. Still, it’s not ideal. The delays and unpredictability is frustrating as heck, but I’m not sure how’d you get around it. Thoughts?

Gun Manufacturer Liability

October 29, 2009 by andrewfong

In Torts yesterday, we started on strict products liability. At some point, we touched on the liability of gun manufacturers for the costs of crimes committed with guns. This naturally started up a shitstorm.

First, let’s assume that there is in fact a legitimate public interest in ordinary citizens being able to buy a gun (if there weren’t, then we would be discussing banning guns period, not strict products liability). Given that legitimate interest, my initial reaction was that holding gun manufacturers liable for gun crimes would be horribly unfair. It’d be the equivalent of holdng auto-manufacturers liable for hit and runs. After talking to my modmate Sam though, I think, from an economic efficiency and loss distribution perspective at least, it’s an interesting proposition.

Read the rest of this entry »

Facebook Redirect Phishing

October 25, 2009 by andrewfong

Two of my friends inadvertently gave away their passwords to a Facebook password phishing site yesterday. If you don’t know what phishing is, see the Wikipedia article.

Hypothesis: The way Facebook formats its links in e-mails actually makes it easier for phishing sites to trick some users into giving their info.

Phishing websites work by creating mirror images of other websites and tricking you into logging in to them with your account info from the other site. So let’s pretend I owned notfacebook.com. I could trick people into giving me their Facebook password by sending them to http://notfacebook.com/login.php, a page that looks exactly like the actual Facebook login page, except when you entered in your password, you would be sending it not to Facebook, but to me.

Read the rest of this entry »

Check Out Lawless Lagomorphs

October 18, 2009 by andrewfong

Some helpful reminders re. Damn Small Linux

September 26, 2009 by andrewfong

Damn Small Linux (DSL) is a distro that’s less than 50MB. It’s great for booting off a USB stick (directions here). The problem (or feature) is that by default things don’t persist on DSL. To get that working, you’ll want to periodically back stuff up somewhere– in my case, I wanted to plop it back on the original drive I booted from.

To do that, just right click somewhere on the desktop and go to system > backup/restore. You’ll need to enter in the device that represents your USB stick (probably sda1). This will write a gzipped tar file to the drive. To restore, you just need to supply a “cheat code” of “dsl restore=sda1″. Note that this won’t remove any of the default files already in the home directory (e.g. events.cal) on the restore; it only restores stuff you’ve added or changed.

Also, the USB drive is mounted under /cdrom, so you can manually fish out any additional data you’ve stuck there as well.

Polygons

September 25, 2009 by andrewfong

Rabbits

Linking Test Scores and Teachers

August 10, 2009 by andrewfong

Under the “Race to the Top” guidelines, California may be ineligible for federal money because of a law pushed by the teachers’ union that prohibits the state from linking together student test scores and teacher performance. While there are a lot more issues at stake here than just test scores — e.g. state vs. local control seems to be an issue here — I’m not sure there’s anything inherently wrong with using student test scores to evaluate teachers.
Read the rest of this entry »