2008-12-15
Fun with python
$ time python -c "import sys; sys.stdout.write((lambda size, sizesq, allp, openclose: ((lambda mkbrd, brd, mv, av, d, finished: ((lambda h: h(h, mkbrd(), 0, 0, 0)) (lambda h, b, r, c, v: [lambda: ([lambda: '', lambda: ((lambda nb, nv: d([lambda:h(h, nb, r-2, c-1, nv), lambda:h(h, nb, r-1, c-2, nv), lambda:h(h, nb, r-2, c+1, nv), lambda:h(h, nb, r-1, c+2, nv), lambda:h(h, nb, r+1, c-2, nv), lambda:h(h, nb, r+2, c-1, nv), lambda:h(h, nb, r+1, c+2, nv), lambda:h(h, nb, r+2, c+1, nv)])) (mv(b,r,c,v), v+1))] [av(b,r,c)]()), lambda: brd(b)] [finished(v,r,c)]()))) (lambda: [-1] * sizesq, lambda b: '\n'.join((''.join('%4d' % v for v in b[i:i+size])) for i in range(0,sizesq,size)) + '\n\n', lambda b, r, c, v: b[:r*size+c] + [v] + b[r*size+c+1:], lambda b, r, c: int(r >=0 and r < size and c >= 0 and c < size and b[r*size+c] == -1), [lambda fl: ((lambda y: y(y,fl)) (lambda y, ff: [lambda: '', lambda: (lambda r: [lambda: r, lambda: y(y,ff[1:])][r=='']()) (ff[0]())] [len(ff)>0]())), lambda fl: ''.join(f() for f in fl)][allp], [lambda v,r,c: int(v==sizesq), lambda v,r,c: int(v==sizesq and r==0 and c==0)][openclose] ))) (int(sys.argv[1]), int(sys.argv[1])*int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3])))" 6 0 1
0 7 4 13 2 29
5 12 1 30 23 14
8 35 6 3 28 31
11 18 9 24 15 22
34 25 20 17 32 27
19 10 33 26 21 16
real 0m16.462s
user 0m16.420s
sys 0m0.010s
arguments: the 6 is the size of the board, 0 means to print the first found rather than all, and the 1 means to look for a closed path rather than an open path.
(Blogger ate earlier version due to bad < and > HTML escaping.)
|
2008-03-18
Wired News - AP News
|
2007-03-08
Wired News: Adobe Tackles Photo Forgeries
|
2006-12-21
Pro-consumer Standards and Anti-competitive Standards to Control Markets
- 120V 60Hz vs 240V 50Hz power
- international power plug adapters / phone adapters (separated, since all European power are electrically
- 240V 50Hz and the physical plug design is used to artificially separate the markets)
- POSIX/X etc vs Windows API
- unlocked mobile phones with SIM cards versus carrier-locked phones
- undocumented engine diagnostics computer interfaces in automobiles
- cryptographic authentication used in elevator control diagnostics/repair to lock out third part maintenance services
- purported authentication used to identify the manufacturer of mobile phone batteries
- authentication used to identify manufacturer of printer ink cartridges
|
2006-08-09
Gateway Pundit: New York Times Busted in Hezbollah Photo Fraud!
|
2006-08-07
Drinking From Home: Extreme Makeover - Beirut Edition
Of course, unless this kind of technology is available in consumer market models, the cost is likely to be prohibitive. Luckily, including GPS data in cameras might actually be coming, since it helps consumers geolocate their vacation photos etc.
|
The Jawa Report: Another Fake Reuters Photo from Lebanon
|
2006-08-06
lgf: Reuters Doctoring Photos from Beirut?
|
2006-04-12
A New Kind of Innumeracy -- American Scientist Online - Gauss's Day of Reckoning
|
2006-03-09
Quotes
2006-03-06
Imperial College London - Scientists find stronger evidence for link between cat faeces and schizophrenia
Theory: The historical myths associating witches with cats as familiars have their origins in schizophrenic hallucinations caused by toxoplasmosis.
I hope somebody with the necessary forensics skills can test this theory....
|
2006-02-04
Vermont Curry
2006-02-03
Baby Thieves
2006-01-06
Phone Companies Set Off A Battle Over Internet Fees (WSJ)
|
2006-01-01

From the top of the rock, with a view of the Empire State and the Verizon bldgs.
Not sure if the photo upload was any faster though.
|
2005-11-14
Pumpkin-shooting | The meaning of America | Economist.com
2005-11-08
National Security Letters
|
2005-10-15
Lunch at Primanti Bros
2005-10-10
Snugged
2005-10-07
Google Introduces Feed Reader
|
2005-09-18
2005-09-13
Disaster prep
2005-09-05
Wilderness preserve near shoreline
2005-08-20
Penguin!
2005-08-14
Angel Island ferry
2005-08-13
Bella Saratoga
2005-08-09
Economic Disintermediation and Banks
I read in the wall street journal that the fed rate hike is putting the squeeze on banks. In particular, banks' profit model of borrowing money at the short-term rate -- that's the savings of average joes and janes like us -- and then lending that money out at the long-term rate -- that's mortgages, corporate paper, etc -- disintegrates when the gap between the short-term rate narrows or even inverts. Well, we normally put up with long lines and poor customer service at banks because we think of banks as a safe place to park our money and have it earn an interest, but when we think of the situation as banks borrowing cheap money from us... it's not as copacetic.
The irony of business relationship perceptions aside, I can't help but wonder about whether the fed may have less macroeconomic control these days. The long-term rate not moving in response to the fed's adjustments of the prime rate may be indicative of structural changes. Just as the Internet enabled greater disintermediation between consumers and businesses, enabling me to mail order directly from larger businesses -- sometimes producers of goods and sometimes just larger, more efficient retailers like amazon -- perhaps another aftereffect of the dot bomb era is that individual investors are far more likely to invest directly in stocks and bonds, or at least mutual funds. Certainly the ease with which we can obtain business news, corporate financial information (conjecture: most companies put their annual reports on their web sites), SEC filings, etc makes it possible to be more informed direct investors.
Banks still provide greater safety through FDIC and risk sharing. With the options of investing in mutual funds, government bonds, corporate paper, and stocks, however, a wide range of risk/reward tradeoffs are readily available to the individual investor. It seems inevitable that more money will flow away from consumer banking to other financial instruments, and that the role of banks as intermediaries between investors and investment vehicles must necessarily be diminished.
|
2005-08-05
2005-07-31
Gilroy Garlic Festival
|
2005-03-26
dilution
people in the silicon valley who has gone through the so-called "dot bomb" era are probably more familiar with dilution in terms of stocks -- how the management desperate for money to keep the company alive (or, to line their own pockets before jumping ship) dilute the value of the stock held by the rank-and-file by suddenly issuing lots of stock to give to VCs (or themselves). inflation gone wild.
pretty soon, like homeopathic medicine, there's nothing left.
last night we went to see a movie. we got to the theater early, so we had to sit through not only the movie trailers but also the interminable advertisements. you know the kind: slide shows of random ads intermixed with movie trivia questions and answers. now, trailers are often selected based on audience demographics, but i have no idea whether the pre-trailer ads are or not. i suspect not.
but to get the facts down, the movie was downfall.
the ads for restaurants, dentists, florists, and that sort of thing aren't unusual. pretty generic. one was for vocational training. okay, maybe thinking that some audience members might want to become a paralegal, a firefighter, or a paramedic is reasonable. maybe most would qualify.
more restaurants and movie trivia.
wait, here's another educational themed one:
no travelling. get your master's degree in software engineering from cmu west. moffett field, mountain view.
my mouth dropped.
as a cmu alumnus, i can't help but feel that its reputation is being sold cheaply. i had first seen the lighted billboard along 101 advertising the MS degree, but the movie theater advertising is the straw that made me put fingers on keyboard. will cmu next advertise in the pennysaver? on the back of matchbooks?
yeah, what you get out of an education is inside, the knowledge, skills, and experiences that one takes away with you. the reputation of the institution, which may have served to draw you there in the first place, doesn't matter as much. and a research graduate degree is different from a terminal MS in SE.
but i can't help feeling that the value of my degree got diluted.
|
2004-12-13
what is the disulfide-bond analog for carbon nanotubes? unlike proteins, carbon nanotubes are rather regular. can they be doped in much the same way semiconductors are doped? could dopants be sites for disulfide-bond analogs to enable creation of nanotube bundles?
doping by replacing an occasional carbon with something else might be difficult; another possibility is to enclose atoms/molecules within the nanotube. can presence of ions inside be stable and affect things outside? or would ions simply repell each other and thus shoot out the ends of the nanotubes?
|
2004-10-06
python -c 'import sys;print (lambda f,n:f(f,n))(lambda g,n:[lambda:1,lambda:g(g,n-1)+g(g,n-2)][bool(n>1)](),int(sys.argv[1]));' 42
|
2004-03-22
|
2004-03-10
too bad duelling autonomous tractors in a contest to grow the most food using the least fuel/fertilizer/insecticide wouldn't be a fun contest to watch....
of course technology is a two sided sword, etc. i'm sure that there are autonomous vehnicle technology applications for civilian uses too. surely self-drive cars on the highways have a few truckloads of liability issues than cross country fast attack vehicles might have for military applications, just as UAVs might be difficult to commingle with normal air traffic. how long before fedex can fly packages using UAVs, so that chuck noland can stay home out of harm's way? well, chuck might be out of a job.... i ramble.
|
2004-03-06
|
2004-03-05
one implication: martian oceans drained beneath the crust and became chemically bound.
|








