Tuesday, June 8, 2010

printing presentations from evince

sometimes i need to print presentation slides with just big text, and i want to do it n-up so it doesn't waste paper. i've found that the best way to do it with evince is to set 'layout' to two-sided: long edge (standard), pages per side: 6, page ordering: left to right, top to bottom, and 'paper' orientation: landscape. 12 slides per sheet and still very readable.
also, it often helps to concatenate pdfs together so the nup has multiple presentations without a page break:
pdftk in1.pdf in2.pdf in3.pdf cat output out.pdf

Monday, June 7, 2010

ocw

mit's opencourseware has quite a few classes up from course 15 (sloan school of management). worth a look.
15.010, maybe 15.060, 15.062, maybe 15.063, maybe 15.223/15.224, 15.351, 15.352, 15.356, 15.358, 15.369, maybe 15.391, 15.394, 15.402, 15.414, 15.431, 15.433, 15.616, 15.617, 15.628, 15.963, and 15.997 look interesting.
15.501, 15.511, 15.514, 15.515, 15.516, 15.518, 15.521, and 15.535 look like particularly interesting classes on finance.
i should also peek at 15.070, 15.075, 15.081, 15.084J, 15.085J, 15.093, 15.094J, 15.098,15.099, just to make sure i haven't missed any of the math there.

Friday, June 4, 2010

udev rules

finally got a udev rule in /etc/udev/rules.d/ so it will run my script on a hotplug event. first i had to run udevadm info --attribute-walk --name /dev/sdc1 to dump out a list of potential attributes to search. since this spits out info on the whole device chain, i found out that the section to look at was /devices/pci0000:00/0000:00:1d.7/usb1/1-7/1-7:1.0 (i tried matching on a lower level, but my script was executed twice with different env vars.) then i put a rule line into /etc/udev/rules.d/91-myhotplug.rules (91 because i want it to run after everything else) like this:
ACTION=="add", SUBSYSTEM=="usb", ATTRS{modalias}=="usb:v0...50", RUN+="/home/user/svn/bin/hotplugscript"
had to put in a sleep 6 before doing anything in the newly mounted fs because it seems to take about 5 s to settle down. (probably should loop-and-test in production-level code.) oh, and one other handy thing i googled up: use blockdev --flushbufs /dev/sdc1, for example, to flush one block device. sync just flushes them all. i have the whole bash script in brackets with a trailing & to make it fork off and return immediately; that's important because otherwise i found it hangs or dies at the sleep and nothing after that gets executed. and i did find that a umount after business is done in the udev script causes no problems.

Thursday, June 3, 2010

financial accounting info on google finance

google finance has easy access to the balance sheet, cash flow statement, and income statement of publicly traded companies for the last 5 quarters and 4 years, ready to scrape from an html table in a standard format, all in one page. for example, all this info for cisco is at
http://www.google.com/finance?q=NYSE:C&fstype=ii
probably would be a bit more reliable if there were one place i could grab xbrl files, but right now i can only find links to individual companies' websites. not very scriptable.
also, the summary page (eg, http://www.google.com/finance?q=NYSE:C) has a 'key stats and ratios' sidebar. i wonder if any of these are really metrics that the pros use. yahoo has insider and institutional trades at http://finance.yahoo.com/q/it?s=C although dailyfinance shows total holdings for insider trading at http://www.dailyfinance.com/company/citigroup-incorporated/c/nys/insider-transactions
yahoo has convenient pages for analyst estimates, showing average, high, and low earnings estimates from a number of analysts for current and next quarters and years; estimate and actual eps histories; eps estimate recent revisions; and estimates for revenue and growth for the company, industry, sector, and s&p 500 for comparison. for example, dell's page is at http://finance.yahoo.com/q/ae?s=dell pretty good start for fundamentals valuation. the analyst opinion page at http://finance.yahoo.com/q/ao?s=DELL also has price targets and quantitative recommendation poll numbers (in the chart near the bottom; i think the 'mean recommendation' listed above is is basically the dot product of the votes in each category with the arange(0,5) divided by the total votes). not sure i would completely base my decision making on free advice, but it could be worthwhile for a sanity check right before clicking the 'trade' button. looks like it only has these analyst opinions for individual companies; no etfs, etc. but the etfs have holdings info, so i could go from there to get some projections on stocks.
now i need good ways to project near/medium term trends in the bonds, precious metals, commodities, and fx markets.

guild wars on linux

cool. got guild wars running with wine on linux. the install and running the game was no problem, but i did need a couple of tweaks to get performance up to a playable level.
this page on the wiki was important, as it pointed out things like the emulated hardware acceleration for the alsa audio. (winecfg) i found that the pixel shader was fine to leave on, even though my hardware ain't that great. the wiki page says to use the pbuffer for osr on low-grade hardware, which i guess means to use a pixel buffer for off-screen rendering. i couldn't see how to do that, but fortunately it wasn't needed. also, i had to check the 'allow the window manager to control the windows' or else my keyboard wouldn't work and i couldn't even log in. i had previously changed the windows version to 2000 and installed a few winetricks, but i don't think those are too important.
some of the other changes i'm not sure if they are essential in isolation, but they're part of the final solution: (regedit) UseGLSL disabled, Multisampling enabled, anti-aliasing 2x in game. OffscreenRenderingMode to backbuffer seemed to help a lot with freezing graphics when moving (loading new shaders), even though the wiki page says to do that when the screen turns black. also, setting the game to fullscreen with the same resolution as my linux xwindows (1280x1024, like i said my hardware ain't that great) seemed to get better performance than any other resolution, even than lower ones. (it also avoids the annoying problem of panning around the virtual screen when i move the mouse to the bottom or right.) i also used WINEDEBUG=-all to turn off the errors and warnings, but i doubt that matters much. and i didn't bother to use the -windowed flag.
EDIT: based on the wine db, looks like pbuffer is a registry setting for OffscreenRenderingMode. a few other suggested settings, but i don't think i'll need them.

Wednesday, June 2, 2010

giffgaff

mobile phone company on the 02 network. maybe i need to look into this...

arizona's immigration law

william bennett has a good article up with some hard stats on the effects of illegal immigration crime in arizona. worth a read.