Sunday, December 28, 2008

Par2 Backups <- Note the second video

So I wanted to find a program that could make a parity for files. I already have most of my stuff on multiple hard drives, but I like to burn it to dvd every once in a while. My first thought was to do something like RAID 1 on dvd where I'd burn it to 2 dvds and any errors be fixed with the other. There turned out to be no easy way to do this, so instead I found a program called par2 which can build parities for files. At first I found it rather confusing, but now I rather like it. It claims to support multiple files, but I can't figure out how to make it work on a whole directory at once, it seems to want me to list every file indivdually, there must be some way to do it. Either way I found it easy to just compress everything first as a .7z archive, then build the parity for that. Here's how it works, you give it a command like par2 create test.mpg, and you get:
test.mpg.par2 - This is an index file for verification only
test.mpg.vol00+01.par2 - Recovery file with 1 recovery block
test.mpg.vol01+02.par2 - Recovery file with 2 recovery blocks
test.mpg.vol03+04.par2 - Recovery file with 4 recovery blocks
test.mpg.vol07+08.par2 - Recovery file with 8 recovery blocks
test.mpg.vol15+16.par2 - Recovery file with 16 recovery blocks
test.mpg.vol31+32.par2 - Recovery file with 32 recovery blocks
test.mpg.vol63+37.par2 - Recovery file with 37 recovery blocks

At first I didn't get this block concept, but as it turns out a block is just 1/1000th of a file. So if you had 1 block of parity data you could repair a file that was up to .1% corrupt. The blocks are interchangable, so if you only needed 1 block of parity data you could use any of the above files. If you needed 15 blocks worth you could use the first 4 files togethor (1 + 2 + 4 + 8 = 15 blocks), or you could use any of the last 3 by them selves each of which would have more parity then you needed. As one last example if you needed 25 blocks worth but were missing all but files 2-5 that would work (2 + 4 + 8 + 16 = 30 > 25).

The index file is always about 40kb, and is only useful to verify the file is ok, and I think you need it to rebuild the file. To rebuild you'll need at least 1 block, and the program will tell you exactly how many you'll need. By default it only does 5% (50 blocks) worth of parity, but I went ahead and ran it at 100%. My backup .7z file is about 500megs, so I'll be able to burn it plus all the parity data to a dvd, and then store it somewhere safe. The neat thing is I'll also be able to email myself the first couple parity files so that if there is mild corruption I'll be able to recover with just them.

I tested to make sure it worked, opened the file in a hex editor and deleted about half the file. I then delted a coupld of the parity data files, leave more than half it should need, it rebuilt the file fine. I then deleted the entire orginal file, and left all the parity files, and it complety rebuilt the file from scratch. It took a little over an hour to build the 100% parity on my 500meg file.

In fact, they are. In a remarkable experiment, Margaret Shin, Todd Pittinsky, and Nalini Ambady asked Asian- American women to take an objective math exam. But first they divided the women into two groups. The women in one group were asked questions related to their gender. For example, they were asked about their opinions and preferences regarding coed dorms, thereby priming their thoughts for gender-related issues. The women in the second group were asked questions related to their race. These questions referred to the languages they knew, the languages they spoke at home, and their family's history in the United States, thereby prim­ing the women's thoughts for race-related issues.

The performance of the two groups differed in a way that matched the stereotypes of both women and Asian- Americans. Those who had been reminded that they were women performed worse than those who had been reminded that they were Asian-American. These results show that even our own behavior can be influenced by our stereotypes, and that activation of stereotypes can depend on our current state of mind and how we view ourselves at the moment.

A second experiment tested the same general idea by priming the concept of the elderly, using words such as Florida, bingo, and ancient. After the participants in this experiment completed the scrambled-sentence task, they left the room, thinking that they had finished the experiment—but in fact the crux of the study was just beginning. What truly interested the researchers was how long it would take the participants to walk down the hallway as they left the building. Sure enough, the participants in the experimental group were affected by the "elderly" words: their walking speed was considerably slower than that of a control group who had not been primed. And remember, the primed participants were not themselves elderly people being reminded of their frailty—they were undergraduate students at NYU.

Wednesday, December 24, 2008

Ariely and Shin conducted an experiment on MIT students. They devised a computer game which offered players three doors: Red, Blue, and Green. You started with 100 clicks. You clicked to enter a room. Once in a room, each click netted you between 1-10 cents. You could also switch rooms (at the cost of a click). The rooms were programmed to provide different levels of rewards (there was variation within each room's payoffs, but it was pretty easy to tell which one provided the best payout).

  • Players tended to try all three rooms, figure out which one had the highest payout, and then spend all their time there. (These are MIT students we're talking about).
  • Then, however, Ariely introduced a new wrinkle: Any door left unvisited for 12 clicks would disappear forever. With each click, the unclicked doors shrank by 1/12th.
    • Players jumped from door to door, trying to keep their options open
    • They made 15% less money; in fact, by choosing any of the doors and sticking with it, they could have made more money
  • Ariely increased the cost of opening a door to 3 cents; no change--players still seemed compelled to keeping their options open.
  • Ariely told participants the exact monetary payoff of each door; no change.
  • Ariely allowed participants as many practice runs as they wanted before the actual experiment; no change
  • Ariely changed the rules so that any door could be "reincarnated" with a single click; no change.
  • "Players just couldn't tolerate the idea of the loss, and so they did whatever was necessary to prevent their doors from closing, even though disappearance had no real consequences and could be easily reversed."

Sunday, December 21, 2008

Wall Street Kid and Daylight

So I've been obsessed with actually beating Wall Street Kid. I started keeping track of the prices on paper, and then switched over to a spreadsheet. After 3 games I finally bought the house (I probably would have got it in the second game but I accidentally agreed to buy it early). Turns out, there are 4 different types of stock and each week 2 of those types are doing well, and all the member stocks will tend to go up. There is no penalty for buying and selling so you want to buy and sell every day if needed. To make a long story short, after about 3 hours of logging data I used the strategy of buying whatever stock did best that day, usually the same stock does best all week. Buying the house is only the first level, but once you have it you can get loans, and it makes it pretty easy so I stopped playing. Note that I was getting about 20-25% a week by buying the best stocks. If you bought all the stocks in the types doing well you'll average about 15%. You have 4 weeks to turn 500k into 1000k so you need at least 19% a week, or 3.75% a day.

So I was reading something that mentioned that due to the Earth elliptical orbit the summer is longer than the winter. This meant that contrary to my long held belief the year did not have exactly equal amounts of day and night. So I put the sunrise/sunset data for a year into a spreadsheet and figured out exactly how much extra daylight we were stealing from the southern hemisphere (since they had extra night for our extra day). Turns out there are 4,644 hours 43 minutes of daylight per year, while you'd only expect 4,380 hours given 12 hour average daylight. Meaning we get an extra 264:43 of daylight every year, or 1:26 per day.

I've been wanting to start a new thread here for a while. I've been doing a lot of research about astronomy, so I was going to start with a email about that, but surprisingly I've been to lazy. But I am reading the first book I've read in months, and I like it a lot, so this email will be about that. It's called Predictably Irrational, and it's about how people behave irrational, but in a predictable manner, I'm not sure where they got the title from. Here's the review where I learned about it:

From the review I immediately compared it to Freakonomics, which I liked a lot, but if I remember you read and didn't really care about. Well I've attached it, so you can read it if you want. If you do you may want to not read my thoughts on it, as it'll be sort of like spoilers.

It starts with an example I've seen before, possibly on Slashdot, and that I may have written about in a past email. It is a supscription scheme for some economics journal. They had 3 options:
1. Internet-only subscription for $59.
2. Print-only subscription for $125.
3. Print-and-Internet subscription for $125.

When I gave these options to 100 students at MIT' s Sloan School of Management, they opted as follows:
1. Internet-only subscription for $59—16 students
2. Print-only subscription for $125—zero students
3. Print-and-Internet subscription for $125—84 students

However when he removed the middle option, the one no one picked, he got different results:
Au contraire! This time, 68 of the students chose the Internet-only option for $59, up from 16 before. And only 32 chose the combination subscription for $125, down from 84 before.

What could have possibly changed their minds? Nothing rational, I assure you. It was the mere presence of the decoy that sent 84 of them to the print-and-Internet option (and 16 to the Internet-only option). And the absence of the decoy had them choosing differently, with 32 for print-and-Internet and 68 for Internet-only.

And then there's this:
An ironic aspect of this story is that in 1993, federal secu­rities regulators forced companies, for the first time, to reveal details about the pay and perks of their top executives. The idea was that once pay was in the open, boards would be re­luctant to give executives outrageous salaries and benefits. This, it was hoped, would stop the rise in executive compen­sation, which neither regulation, legislation, nor shareholder pressure had been able to stop. And indeed, it needed to stop: in 1976 the average CEO was paid 36 times as much as the average worker. By 1993, the average CEO was paid 131 times as much.

But guess what happened. Once salaries became public information, the media regularly ran special stories ranking CEOs by pay. Rather than suppressing the executive perks, the publicity had CEOs in America comparing their pay with that of everyone else. In response, executives' salaries sky­rocketed. The trend was further "helped" by compensation consulting firms (scathingly dubbed "Ratchet, Ratchet, and Bingo" by the investor Warren Buffett) that advised their CEO clients to demand outrageous raises. The result? Now the average CEO makes about 369 times as much as the aver­age worker—about three times the salary before executive compensation went public.

Sunday, December 14, 2008,_its_all_about_Gnomes

"Mr. Somsel, in an interview Thursday, said he had done further research and was concerned that the radio signal — or the Internet instructions that would be sent, in an emergency, from utilities' central control stations to the broadcasters sending the FM signal — could be hacked into.

That is not possible, said Nicole Tam, a spokeswoman for P.G.& E. who works with the pilot program in Stockton. Radio pages "are encrypted and encoded," Ms. Tam said."

not possible = will be done in days.

Wednesday, December 3, 2008

I've sent this idea before, but this one is better because it includes estimates for the times where the exact number isn't specified, and brief descriptions of the offenses.
"For complaining about the lack of food and water, God sent fiery serpents to bite the people, and many of them died"