Friday, May 7, 2010

One second rule - stock market

The slope of the large drop on the stock market yesterday afternoon is insanity. In my mind there is no question it was not caused by Greece, or the US worker's productivity, or any rational concern. It was pure automated trading, similar models operating in very tight loops, selling in unison. Several blue chip stock's value went to 0, trading at less than a penny.

If I were congress I would enact a simple rule: anyone who buys a stock must hold it for at least one second. This would reduce the systematic danger by making such a high slope impossible.

-- Update Feb16.
Ha, look where I work. I guess another answer is automated trading is so effective and cheap and beneficial in reducing spreads for consumers that it is here to stay. So like early automobiles that were dangerous at first, we work to make them safer. I have read a few analysis of the flash crash, and no longer think HF trading was the predominant cause, nor the one-second rule an effective fix. (Although I'll offer no proof or evidence here).

Saturday, May 1, 2010

Setting X resolution the new way

I am spending some time trying to tweak my XBMC setup on Fedora 12 linux on a cute little Dell Studio Hybrid computer. One problem is my HDMI output has to go through a Sony HT-CT500 video receiver, so we can press "DVD" on the remote and switch from the Cable DVR box to the linux computer screen. Purely convenience, but the details in life are important.

This leads to the problem that the Sony video receiver clips the HDMI signal, even in its passthrough mode. Not great, why did the engineers not test it better? 1024x768 resolution is impossible, the LCD TV just goes blank. Could it be the TV or the HDMI cable? No, when I plug in the Linux box directly using the HDMI cable, it displays that resolution fine. Linux dutifully searches for an appropriate resolution on KDE startup and chose 640x480, but I think I can do better. Perhaps a shortsighted goal, but I can be an explorer, and am in such a mood now.

Ok, so how to determine what the exact limits of the Sony video passthrough is? Use the nifty new xrandr tool on Linux's X server. There is no longer an xorg.conf it seems, and good riddance.

Here is a little script that allows me to do a parameter sweep quickly. It is influenced by others, namely http://compbrain.net/archives/tag/xrandr. So far I have got 736x500 to work.

[xbmc@shitzu bin]$ cat try-new-res
#!/bin/bash
#
# Try different screen resolutions
#
# FDS 2010


set -x 

if (( $# != 2 ))
then
        echo "Give me two ints: horizontal vertical resolution"
        exit 1
fi
c=$(cvt -r $1 $2 | tail -1 | sed -e 's/Modeline//')
if ! xrandr --newmode $c
then
        echo "Too bad"
        exit 2
fi
name=$(echo $c | awk '{print $1}')
xrandr --addmode HDMI1 $name
xrandr --output HDMI1 --mode $name