<$BlogRSDURL$>

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 

Link
Genetic Predisposition to PTSD (Wired News - AP News) I can't help but wonder if there will be genetic tests to help people determine whether they will do well as a soldier or other professions where traumatic stress is likely. And whether such tests will become mandatory prior to enlistment as a way to limit the (future) cost in VA hospitals etc.

|

2007-03-08

Wired News: Adobe Tackles Photo Forgeries 

Link
Wired News: Adobe Tackles Photo Forgeries this is very interesting. adobe is using forensics techniques to detect manipulation. in the usual adversarial game played by computer security and cryptography researchers versus the attackers, can this work in the long term?

|

2006-12-21

Pro-consumer Standards and Anti-competitive Standards to Control Markets 

Link
This news story about mobile phone charger interfaces reminds me of Larry Page's minor rant about laptop power supplies and connectors at CES. Artificial barriers against consumers switching to competitors isn't new, of course, and mobile phone charger interfaces, laptop power connectors, etc are just a few of the newer instantiations. Let's consider some more examples, in no particular order: Feel free to add more in comments. One of the interesting things to me about the original article is that the US, the champion of free markets, seems to be so leery of market regulation that China and South Korea are ahead of us in trying to enforce a standard that will ultimately benefit the consumer. (Also handphone penetration in Asia is greater than in the US, so such regulation is arguably more important to those populations.) Luckily this kind of consumer protection is more (a mild version of) antitrust and not safety. Hopefully we won't take a step backward and eliminate the FDA or the Penna Dept Ag, or outlaw the UL labs....

|

2006-08-09

Gateway Pundit: New York Times Busted in Hezbollah Photo Fraud! 

Link
Gateway Pundit: New York Times Busted in Hezbollah Photo Fraud! -- this time, staged photos. Presumably the time, date, location is real, only the subject matter is staged. This is the kind of thing that would be difficult to prevent, were it more sophisticated and used different actors throughout. In this case, however, presumably face recognition could be applied, as well as some basic olde-style symbolic AI inferencing.

|

2006-08-07

Drinking From Home: Extreme Makeover - Beirut Edition 

Link
Drinking From Home: Extreme Makeover - Beirut Edition. Is it two photos of the same woman at the same event? Or is she a professional mourner? A technical means of providing supporting authentication for the photographic evidence would be a GPS-enabled camera where the coordinates / time are included in the photographic data being digitally signed.

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 

Link
The Jawa Report: Another Fake Reuters Photo from Lebanon -- another photo credited to Adnan Hajj that's obviously been manipulated.

|

2006-08-06

lgf: Reuters Doctoring Photos from Beirut? 

Link
lgf: Reuters Doctoring Photos from Beirut? is quite interesting and brings to mind ideas from over a decade ago of embedding secure, tamper-resistant hardware into digital cameras to digitally sign photos. Without something like that to provide a chain of evidence (when the chain of custody is weak), our faith in photographic evidence should necessarily diminish as photo manipulation gets easier and easier. Of course, photos may need post processing in order to enhance color balance, etc etc, and that's why authenticating that an original raw photo came from a particular camera is only a link in the chain of evidence. After all, shots (like the one with the dead body) can easily be staged. (NB: I have no idea if it was, and if it were, to what degree.)

|

2006-04-12

A New Kind of Innumeracy -- American Scientist Online - Gauss's Day of Reckoning 

Link
In American Scientist Online - Gauss's Day of Reckoning -- an otherwise excellent article -- the author thinks that an O(1) algorithm is just as good as an O(n) algorithm in these days when students do their work on laptops. This is just not true for an applied math or computer science course. What would be the appropriate term? "Innumeracy" doesn't quite capture the idea. "Inalgorithmy"? "Incomputeracy"?

|

2006-03-09

Quotes 

"I'm not entirely pro-stick."
Manoj Kasichainula

|

2006-03-06

Imperial College London - Scientists find stronger evidence for link between cat faeces and schizophrenia 

Link
A research article from the Imperial College London where their Scientists find stronger evidence for link between cat faeces and schizophrenia and the later ScienceDaily article indicate a link between Toxoplasma gondii and schizophrenia. This single cell parasite also cause rats to lose fear of cats, so calling it a parasite seem to be a bit of a misnomer. It is know to cause Toxoplasmosis which can cause problems during pregnancy for humans (presumably effect on other species unknown).

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 

I have got to visit Vermont one of these days.


|

2006-02-03

Baby Thieves 

Link
I need Viagra for my bit pipes!

|

2006-01-06

Phone Companies Set Off A Battle Over Internet Fees (WSJ) 

Link
Content Providers May Face Charges for Fast Access. this makes me wonder if electric companies will soon follow suit. my electric company doesn't know what I do with the delivered power, much as the phone (or cable) company doesn't know (or shouldn't know) what I do with the delivered bits. but imagine if they did: would they charge differently for higher value-added uses? electricity used for entertainment, such as game systems, TVs, DVD players, and audio systems might be charged at a premium rate compared to electricity used for basics such as lights or heating, since there are alternatives to using electricity for lighting and heating (not as much of a monopoly), but there's really no alternative for electric appliances, especially higher value-adding appliances such as PCs or TVs....

|

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 

Link
FORE!

|

2005-11-08

National Security Letters 

Link
an interesting read. one question that springs to mind is whether protection against unreasonable search and seizure includes information about the individual held by a third party. perhaps that's an overly anal line of inquiry, since the spirit of the constitutional guarantee would seem to include privacy violations. then again, i don't play a supreme court justince on TV.

|

2005-10-15

Lunch at Primanti Bros 

Now that's a sandwich!


|

2005-10-10

Snugged 

Charlie loves grandma's pillows.


|

2005-10-07

Google Introduces Feed Reader 

Link
Google Introduces Feed Reader: "Continuing its push into the universe of blogs and feeds, Google has launched a feed reader application. Google Reader is a browser-based application that works with virtually all popular browsers on Windows, Mac and Linux platforms...." heh. just tried out google reader, and used a little menu to blog.

|

2005-09-18

Grandma and Dad at the Portland Rose garden


|

2005-09-13

Disaster prep 

Link
This is a useful post about what to have for emergencies.

|

2005-09-05

Wilderness preserve near shoreline 


|

2005-08-20

Penguin! 


|

2005-08-14

Angel Island ferry 

From the upper deck.


|

2005-08-13

Bella Saratoga 

Lunch at 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

Marvin at Penang garden.


|

2005-07-31

Gilroy Garlic Festival 

the Gilroy Garlic Festival was interesting. not nearly as much garlicky food as i had imagined though -- yeah, there was garlic ice cream, but it wasn't really garlicky enough; and there were garlic fries and garlic bread, but those you can get at many restaurants. still, it was fun. even the next morning, i could still taste garlic in my mouth.

|

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

disulfide bonds crosslink proteins. they are broken and recreated -- annealed? -- in order to curl hair.

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

stupid python tricks. what does this one-liner do?
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

i need more than just a weekend to decompress. and to write this position paper.... well, at least it's short, mostly done, and will use graphics to convey the main ideas. more hacking on it tomorrow.

|

2004-03-10

the darpa autonomous vehicle race will take place this saturday. no, i won't be going to vegas to absorb the heat of the desert sun and to revel in the excitement of the race. i'd felt the thrill -- by osmosis, or maybe it was by induction -- enough times watching chip test or deep thought battling against grand masters that cheering the red team on will not seem so different, despite the contrast of las vegas and wean hall. metaphorical warfare, and a contest using and testing new technologies that will surely come in handy for future, not-so-metaphorical wars.

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

want: automatic windshield wiper / defogger / defroster. detect rain via moisture sensor or via semiconductor laser (IR?) through windshield glass, using an incidence angle where total internal refraction (TIR) works when the interface is glass-air, but not (or not as well) when the interface is glass-water, and thus trigger windshield wiper activation / control wiper frequency. external temperature sensors are common and can trigger defroster/defogger, though maybe internal humidity sensing is also needed.

|

2004-03-05

conjecture: without plate tectonics and a hot, soft mantle (aesthenosphere)/liquid upper core, there would be no oceans. solid rocks can absorb water (crystalline structure is somewhat porous) as well as chemically bind water (see this), but magma/heated rocks drives water out (and to planetary surfaces). one potential reaction is the transformation of olivine to serpentine and back. the oceans may be deep; the lithosphere is even deeper.

one implication: martian oceans drained beneath the crust and became chemically bound.


|

This page is powered by Blogger. Isn't yours?