Wednesday, March 4, 2009

Using continuity notions for traffic

While I was waiting in the stand-still traffic on I-70 on my way back from Copper Mountain, it struck me that making sure highway traffic flows nicely is like the continuity equations in electromagnetics. And just like in a nice transmission line, one doesn't want abrupt changes in the highway. Unfortunately, that's not how they are built. If I-70 had been an entirely two lane highway from Denver to Silverthorne (where the traffic starts branching out), we would have nice a smooth conveyor of traffic. But we spent some unknown billion dollars building that third lane to the junction with US6, causing all the traffic problems along with it.

Wednesday, October 8, 2008

Making Windows Search 4.0 work

One has to love the world of windows. Windows Search 4.0 is a great search software, except for mysterious reasons it failed to work on my desktop. After much scouring the web forums, and reinstalling and installing many times, I could not get it to work. All I got was:

Unable to initialize the filter host process. Terminating.

Details:
 Access is denied.   (0x80070005)

Finally, I used procmon (from Sysinternals) to look for what was going on. By looking for ACCESS DENIED results for Process named "searchfilterhost", I found out that it was failing on C:\Windows\Registration\R000000000010.clb . No mention of it on any websites. Renamed that file and everything worked. What the purpose of that file is, is a mystery for now.

Thursday, September 25, 2008

Converting real video to ipod compatible mp4

I was trying to convert some real video lectures I downloaded to ipod compatible format for later viewing. I looked for a program that would do the job for me. They fall mainly into two classes: ffmpeg based and mencoder based. ffmpeg is nice, except it doesn't work for some proprietary codecs (and my videos happened to use one). mencoder works for everything but has arcane options. After trying several candidates, I could not find one that worked.

Finally, I gave up and read up mencoder's manual page (which is well hidden on Windows). So here's a little script that I came up with to use with MinGW:

#!/bin/sh mencoder.exe "$1" -vfm realvid -sws 9 -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:turbo -of lavf -lavfopts format=mp4 -o "${1%.*}".mp4 -vc rv20win -ac rasiprwin

But that didn't work either. Apparently, ipod only supports a subset of the H.264 standard. After long hours of searching, I found the solution on an mplayer mailing list and modified it to work for my videos:

REM encoder_for_ipod.bat for %%i in (*.rm) do mencoder -vf harddup -of lavf -lavfopts format=ipod -af lavcresample=44100 -oac faac -faacopts mpeg=4:object=2:quality=50:raw -ovc x264 -x264encopts global_header:qp=30:threads=auto:level_idc=13:nocabac -vc rv20win -ac rasiprwin %%i -o %%~ni.mp4

Powered by ScribeFire.

Wednesday, July 16, 2008

Why most articles miss the point of patents

Apparently two Boston University academics did some research and said that litigation costs outweigh benefits from patents in most industries other than chemicals and pharmaceuticals. But, I think they may be underestimating the harmfulness of the current system. Currently patent holders are not using patents to make money, but mostly as constituents of a portfolio. Without the portfolio effect, there would be a lot more litigation. Indeed, small companies with a small portfolio get hounded out by large companies. Then there are the patent holding companies with no products, that are giving the large companies (who can be far more boisterous than small ones) a lot of trouble. Why is the situation so bad? Patents were intended as a limited grant of monopoly, so there would be an incentive for inventors to contribute to the public good. The invention becomes public knowledge after the patent expires. All nice and good. Unfortunately, patents have become a very effective tool in limiting use of public knowledge.
  1. Everyone from the inventor to patent examiner has an incentive based on number of patents approved. The USPTO is a money making organization, and they don't want to compromise that by insisting on the quality of the patent. Consequently, most patents have questionable novelty in them.
  2. Patents are mostly used as detterents as a part of a portfolio. Most of them probably are invalid, but testing that validity is extremely expensive.
  3. Small companies, that are usually more innovative, are routinely shut down by large companies using their patent portfolios. Case in point, Vonage vs Verizon.
  4. Large companies are terrorized by small patent holders. Case in point, Research in Motion paid $500million to settle a lawsuit based on an invalid patent.
  5. Patents are granted for the same period of time, regardless of the useful lifetime of an invention. Drugs can take a long time to develop and have decades on the market. Software takes a few weeks to develop and may be 2 years on the market. But patents in both cases are for 20 years.
  6. Patenting other people's common knowledge is easy. All you need to do is to get some common knowledge from another country and patent it. Patents on Basmati rice and turmeric are prime examples.

Sunday, June 15, 2008

New York Times double click menace

New York times has a new "double click" feature. It doesn't agree with a habitual double clicker like me. Turns out it's in one script altClickToSearch.js that I can block using Adblock Plus.