Friday, December 30, 2011

12 Must-See Skywatching Events in 2012

http://www.space.com/14085-12-amazing-skywatching-events-2012.html
This meteor shower reaches its peak in the predawn hours of Jan. 4 for eastern North America. The Quadrantid meteor shower is a very short-lived meteor display, whose peak rates only last several hours. The phase of the moon is a bright waxing gibbous, normally prohibitive for viewing any meteor shower, but the moon will set by 3 a.m., leaving the sky dark for a few hours until the first light of dawn; that's when you'll have the best shot at seeing many of these bluish-hued meteors.

Thursday, December 29, 2011

Can we lower medical costs by giving the neediest patients better care?

http://www.newyorker.com/reporting/2011/01/24/110124fa_fact_gawande?currentPage=all
If Camden, New Jersey, becomes the first American community to lower its medical costs, it will have a murder to thank. At nine-fifty on a February night in 2001, a twenty-two-year-old black man was shot while driving his Ford Taurus station wagon through a neighborhood on the edge of the Rutgers University campus. The victim lay motionless in the street beside the open door on the driver’s side, as if the car had ejected him. A neighborhood couple, a physical therapist and a volunteer firefighter, approached to see if they could help, but police waved them back.

Sunday, December 25, 2011

Pope Benedict XVI attacks Christmas consumerism at Mass

http://www.bbc.co.uk/news/world-europe-16328318
In his homily, he urged worshippers to "see through the superficial glitter of this season and to discover behind it the child in the stable in Bethlehem".
Seeing this story I couldn't help pointing out how much gold there is in the video of this guy giving his speech complaining about glitter.  Also, I'm contractually obliged to point out that the bulk of what we associate with Christmas has nothing to to do with Christianity.
http://en.wikipedia.org/wiki/Christmas#History

Tuesday, December 20, 2011

God of the Gaps

http://en.wikipedia.org/wiki/God_of_the_gaps
God of the gaps is a type of theological fallacy in which gaps in scientific knowledge are taken to be evidence or proof of God's existence. The term was invented by Christian theologians not to discredit theism but rather to discourage reliance on teleological arguments for God's existence.

Ideas For Government

  • Bills must be read aloud in their entirety before being voted on.
  • Only members present for the entire reading may vote on a bill.
  • Bills require a majority of all members, not just members present.
  • Bills must be published and read aloud at least one week prior to being voted on.
  • Emergency votes could waive the one week requirement with a 60% vote, but would only be valid for two weeks unless they were repassed after the week requirement.
  • Require a 200 word (or less) summary of goals of the bill.  Any part of the bill that does not directly address those goals is invalid.
  • No one may hold a public office if they have received over $10,000 in gifts or contributions (from any source) total in the past 10 years.
  • Starting one year prior to an election, anyone qualified for a public office may get signatures on a petition to receive funding for that election.  If they receive a number greater than 1/500th of the eligible voters then they receive some set amount of funding.  All ads or expenses related to the campaign must come from that fund exclusively.

Monday, December 19, 2011

Friday, December 16, 2011

Thursday, December 15, 2011

Abolish the TSA

https://wwws.whitehouse.gov/petition-tool/petition/abolish-tsa-and-use-its-monstrous-budget-fund-more-sophisticated-less-intrusive-counter-terrorism/c7L94bFB

The petition to abolish the TSA ended with the requisite number of signatures on Oct 22.  They finally posted a response, almost two months later.  It was written by the head of the TSA.  The petition can be summarized as: The TSA is an awful waste of money that robs us of our rights.  The response can be summarized as: The TSA is great.

Wednesday, December 7, 2011

Candy desk

http://en.wikipedia.org/wiki/Candy_desk
One senator with a particularly strong hankering for chocolate is Jim Talent from Missouri. Once during a vote, he called people away from the candy desk to his own on the other side of the row. There were oohs and aahs until six people walked away with Russell Stover Low-Carb Chocolates.
Basically, the Senate is just like Animal House.

Tuesday, December 6, 2011

Saturday, December 3, 2011

Authorities in Awe of Drug Runners' Jungle-Built, Kevlar-Coated Supersubs

http://www.wired.com/magazine/2011/03/ff_drugsub/all/1
The group summed up its findings in a 70-page white paper—marked FOUO, for official use only—that conveys a grudging respect for the engineers and craftsmen who were able to build something so seaworthy in the middle of a swamp. “The streamlined hull, diesel-electric propulsion system, and fuel ballast system design all show a significant level of technical expertise and knowledge of submersible operations,” it states. The hull, they discovered, was made from a costly and exotic mixture of Kevlar and carbon fiber, tough enough to withstand modest ocean pressures but difficult to trace at sea. Like a classic German U-boat, the drug-running submarine uses diesel engines on the surface and battery-powered electric motors when submerged. With a crew of four to six, it has a maximum operational range of 6,800 nautical miles on the surface and can go 10 days without refueling. Packed with 249 lead-acid batteries, the behemoth can also travel silently underwater for up to 18 hours before recharging.

Halt and Catch Fire

Halt and Catch Fire, known by the mnemonic HCF, refers to several computer machine code instructions that cause the CPU to cease meaningful operation. The expression "catch fire" is intended as a joke; the CPU does not usually catch fire.
Usually.

Wednesday, November 30, 2011

Genetically altered mosquito warriors could wipe out humanity's biggest killer

http://www.gizmag.com/genetically-modified-mosquitoes-aegypti-mosquito/20668/
The humble mosquito, and the deadly diseases it carries, is estimated to have been responsible for as many as 46 billion deaths over the history of our species. That staggering number is even more frightening in context - it means that mosquitoes are alleged to have killed more than half the humans that ever lived.
...
In short, the modified genes affect only the female mosquitoes, rendering them flightless. The larvae hatch on the water, and the females are unable to leave, rendering them harmless to humans and leaving them to die. The males are unaffected, so they mature normally, then mate with other females to pass the genetic modification on.

I've often wondered why stuff like this hasn't been done before.  Admittedly I'm not a geneticist, but it would seem we have gotten pretty good at genetically engineering simple lifeforms.  Particularly in this case, since we don't care much about the overall health of the insect.  Just produce insects that carry a gene that makes them sterile when there are two of them, and release tons of them.  It would seem like this has been done, although using radiation to sterilize them as opposed to genetics.

http://en.wikipedia.org/wiki/Sterile_insect_technique

A few years ago, I read something about genes that could affect the odds that they would appear in the sex cells.  A sex cell is supposed to have a random gene picked from the two possible genes (one from your father one from your mother).  These genes would increase the odds that they would be picked over the other choice to something over 50%.  This struck me as an interesting way to genetically engineer some sort of species as a weapon that dies off, (think the xenomorph from the Alien movies).  You create perfectly normal aliens and unleash them on some world.  However, included in the initial group would be a few individuals with a certain gene.  This gene would have various effects based on if the individual had two copies or one, and if they were male or female.  A male with one copy would be more likely to pass on the gene (maybe 90%).  A male with two copies would be sterile.  It would have no effect on females, they'd just carry it normally.

I wondered how effective this gene would be, and did some spreadsheet calculations.  I then wrote a basic program to simulate the odds.  I discovered that the gene was super effective as long as it had high enough probability.  The magic threshold appeared to be 86%.  At 85% the population would stabilize with a small core group of gene free males.  At 86% it would always wipe out the population, even when introduced into a large stable population.  I'm sure there's some interesting mathematical explanation for that point, but I don't know what it is, and I didn't really want to write a whole detailed post about this.

Oddly, I never added it to my site.  I vaguely remember not considering it done, but maybe that was before I realized that anything I do is done the first time I stop working on it.  I added it and it's there now, at the end of the C++ section.

http://daleswanson.org/programs.htm

Tuesday, November 29, 2011

How Software Companies Die

http://www.zoion.com/~erlkonig/writings/programmer-beekeeping.html

Read this and thought it was interesting, then I noticed it was written by Orson Scott Card.

Saturday, November 26, 2011

an illuminating metaphor for the process of biological evolution

http://www.youtube.com/watch?&v=l-uNFaUJo5c

This is a very interesting example of evolution using memes instead of genes.

Wednesday, November 23, 2011

Money Data

http://xkcd.com/980/huge/#x=-1464&y=-1264&z=4

I think I'd be happy if xkcd switched from comics to just monthly epic data presentations like this.  Here are some interesting things I found in it:
  • Annual cost of: cat - $670, internet - $720, cellphone - $928
  • 1965 ratio of CEO pay to production worker pay = 25x.  2007 ratio = 275x.
  • That royal wedding used $800,000 in flowers.
  • Iraq war cost more than Vietnam.
  • Combined Iraq/Afghanistan wars cost about 25% of WWII.
  • Nuclear power plus a Fukushima level accident every year costs less than solar or coal with external costs (although less than on shore wind).
  • State taxes are surprisingly regressive. 
  • Apple has $76 billion in cash reserves, they could buy 15 Nimitz class carriers (at $5 billion each, US has 10), or 422 F-22 Raptors (US has 187).
  • Walmart's annual profit of $16.4 billion could fund 88% of NASA's annual budget of $18.6 billion.

Tuesday, November 22, 2011

Overkill: The Rise of Paramilitary Police Raids in America

http://www.cato.org/pub_display.php?pub_id=6476

http://www.cato.org/pubs/wtpapers/balko_whitepaper_2006.pdf
These increasingly frequent raids, 40,000 per year by one estimate, are needlessly subjecting nonviolent drug offenders, bystanders, and wrongly targeted civilians to the terror of having their homes invaded while they're sleeping, usually by teams of heavily armed paramilitary units dressed not as police officers but as soldiers. These raids bring unnecessary violence and provocation to nonviolent drug offenders, many of whom were guilty of only misdemeanors. The raids terrorize innocents when police mistakenly target the wrong residence. And they have resulted in dozens of needless deaths and injuries, not only of drug offenders, but also of police officers, children, bystanders, and innocent suspects.
Also see this map:
http://www.cato.org/raidmap/

Paramilitary Policing From Seattle to Occupy Wall Street

http://www.thenation.com/article/164501/paramilitary-policing-seattle-occupy-wall-street
Then came day two. Early in the morning, large contingents of demonstrators began to converge at a key downtown intersection. They sat down and refused to budge. Their numbers grew. A labor march would soon add additional thousands to the mix.

“We have to clear the intersection,” said the field commander. “We have to clear the intersection,” the operations commander agreed, from his bunker in the Public Safety Building. Standing alone on the edge of the crowd, I, the chief of police, said to myself, “We have to clear the intersection.”

Why?
http://en.wikipedia.org/wiki/World_Trade_Organization_Ministerial_Conference_of_1999_protest_activity

Saturday, November 19, 2011

Police officer pepper-sprays seated, non-violent students at UC Davis

http://boingboing.net/2011/11/18/police-pepper-spraying-arrest.html




In the video above, you see a police officer [Update: UC Davis Police Lt. John Pike] walk down a line of those young people seated quietly on the ground in an act of nonviolent civil disobedience, and spray them all with pepper spray at very close range. He is clearing a path for fellow officers to walk through and arrest more students, but it's as if he's dousing a row of bugs with insecticide.
Well he's on paid vacation, so at least justice was done.

Monday, November 14, 2011

Scale of the Universe

http://www.primaxstudio.com/stuff/scale_of_universe/scale-of-universe-v1.swf

I've seen a lot of these, and even made one at some point, but this is by far the best one I've seen.

Saturday, November 12, 2011

5 Lessons of U.S. Plan for a Permanent Military Presence in Australia

http://www.theatlantic.com/international/archive/2011/11/5-lessons-of-us-plan-for-a-permanent-military-presence-in-australia/248266/
The U.S. has arranged with Australia to install a permanent military presence near the northern Australian town of Darwin, a move that signals shifts in President Obama's foreign policy and the U.S. vision for its role in the world. Obama will formally announce the new base with Australian Prime Minister Julia Gillard during his visit to Australia next week, the Sydney Morning Herald reported this morning.

Tuesday, November 8, 2011

Argument recap: For GPS, get a warrant

http://www.scotusblog.com/?p=131423
Midway through a federal government lawyer’s plea Tuesday for unrestricted power for police to use new GPS technology to track cars and trucks on public roads, Chief Justice John G. Roberts, Jr., sketched out just how the Court may well restrict the practice.   Despite an unqualified prior statement by the Court that one moving about in public has absolutely no right to expect privacy, the Chief Justice said that such a right might exist, after all, and it could trump the fact that the movement was in public.  If the Court can find a way to say just that, police almost certainly would have to get a warrant before using GPS to monitor where suspects go.

Monday, November 7, 2011

Vaccine-wary parents warned against sending ‘chicken pox lollipops’ through the mail

Parents fearful of vaccinations are being warned by a federal prosecutor that making a deal with a stranger who promises to mail them lollipops licked by children with chickenpox isn't just a bad idea, it's against the law.
Remind me again why we don't require a license before people can have kids?

Color of Time

I was stumbling and came across this site:

It changes the background color for every second of time.  The obvious way to do this would be the convert the HH:MM:SS of time into a RGB value.  However, it was clear that wasn't what that site was doing, because the color changed dramatically every second.  I thought perhaps there was something more interesting going on.  It did mention that every second would have a unique color, which would imply that it took the date into account too.  I thought perhaps it took the unix epoch time and converted that into hex values.  It could use a simple hash of the time and then just take the last 3 hex pairs and use them directly.  That wouldn't absolutely guarantee unique times, but it would be about as close as you could get with the limited space of RGB values.  Since 2563 = 16,777,216 you'd have enough colors to only have to use each twice per year.

I checked the source, and was somewhat disappointed to see it was just generating random values.  I guess it was just a concept.  You could at least seed the RNG with the hour, minute, or second values.

I decided it would be somewhat interesting to see it implemented the way I had originally envisioned it, and set out to make it.  I began by copying his code since it was relatively easy to follow.  However, every time I attempt to use javascript I'm reminded of the inadequacy of my "pretend it's just C++" method of programming it.  So, I scrapped the code and started over from scratch.  After more troubles trying to figure out how to do things that should be simple in javascript, I got it working pretty well.  There are still some things I'd like to change, but that's not very likely.

I'll admit his is prettier than mine, but I think mine is more interesting to watch.  In order to make full use of the color space I'm not directly using the HMS values.  I'm converting them into a ratio and then multiplying that by 255.  In other words (#seconds/60) *255.  This allows a just barely perceptible change in color each second.  Also, I wanted to make the foreground color complementary colors.  However this is apparently not that easy to do.  I ended up just subtracting each hex pair from 255, which gives sometimes complementary colors, and painfully jarring colors the rest of the time.

Saturday, November 5, 2011

White House Responds to Petitions

https://wwws.whitehouse.gov/petition-tool/responses

The white house has begun responding to the petitions that had the requisite signatures.  I was pretty cynical about what the responses would be.  However, I must say the responses surprised me. That is, I was surprised at how condescending, circular, and filled with bald faced lies they are.  Perhaps I'm too insulated from politicians' day to day lies.  

Also, I suspected that there would be petitions about not taking petitions seriously.  However I expected this would take a few months.  However, literally the day after the first responses were posted there were already multiple petitions to take the petitions seriously.  Here are some of my favorites:

Actually take these petitions seriously instead of just using them as an excuse to pretend you are listening

Offer a response to marijuana legalization petitions that isn't written by someone legally required to oppose them.

We demand a vapid, condescending, meaningless, politically safe response to this petition.


One silver lining is that they did respond to the petition demanding they acknowledge aliens. In their response they mentioned the various ways we're looking for signs of alien life.  Interestingly the first one, SETI, has been shut down since April 2011 due to lack of funding.  It requires $5 million in funding, ie, less than 0.0005% the cost of the Iraq War.

And since I've been watching these videos nonstop, I'll link this one about SETI here:
http://www.youtube.com/watch?v=EHuve33yOVY

Wednesday, November 2, 2011

Bizarre Lunar Orbits

http://science.nasa.gov/science-news/science-at-nasa/2006/06nov_loworbit/
The orbit of PFS-2 rapidly changed shape and distance from the Moon. In 2-1/2 weeks the satellite was swooping to within a hair-raising 6 miles (10 km) of the lunar surface at closest approach. As the orbit kept changing, PFS-2 backed off again, until it seemed to be a safe 30 miles away. But not for long: inexorably, the subsatellite's orbit carried it back toward the Moon. And on May 29, 1972—only 35 days and 425 orbits after its release—PFS-2 crashed.

Friday, October 21, 2011

A Digital Direct Democracy For the Modern Age

"Last month the White House created an online petition system through which constituents can directly voice any grievances and concerns to the US government. Any petition that reaches 25,000 signatures (5,000 originally) is promised an official reply. This weekend the first petitions will be closing, and already many have far exceeded the required number of signatures. Is this the way for the voice of the electorate to gain more weight in modern politics, or is it the web version of a placebo button? Will the President's office really consider the top pleas, which include petitions to Legalize and Regulate Marijuana, Forgive Student Loan Debt, and Abolish the TSA?"

This is somewhat interesting.  Not that I think it will change anything, but it will be interesting to see what "official response" they get.

https://wwws.whitehouse.gov/petitions#!/petitions/popular/0/2/0/

In particular, I am very interested in the official response this one will get:
https://wwws.whitehouse.gov/petitions/!/petition/formally-acknowledge-extraterrestrial-presence-engaging-human-race-disclosure/wfYDlmlG

Legal Tender? Maybe Not, Says Louisiana Law

"Lousiana has passed a law that says people may no longer use cash for second hand transactions. The idea is to make all transactions traceable, thus foiling copper theft, etc. This move has profound implications that range from constitutional rights to Bitcoin, Craigslist and so forth; I wonder if there are any Slashdotters at all that support such a move." On the list of exceptions: people who deal in used goods or "junk" less frequently than once per month, and (drumroll, please) pawn shops. That means a pretty big chunk of the population who post in online classified ads in Louisiana are probably already in violation.
I was hesitant to post this, since it seemed so crazy that it had to be either made up or exaggerated.  But it appears to be real.  Also, note it was signed on July 1st.
http://www.legis.state.la.us/billdata/byinst.asp?sessionid=11RS&billid=HB195&doctype=ALL

Thursday, October 20, 2011

Underwater exploring is banned in brazil

The latest news from 1985:
http://www.nytimes.com/1985/06/25/science/underwater-exploring-is-banned-in-brazil.html
A dispute between the Brazilian Navy and an American marine archeologist has led Brazil to bar the diver from entering the country and to place a ban on all underwater exploration.

The dispute involves Robert Marx, a Florida author and treasure hunter, who asserts that the Brazilian Navy dumped a thick layer of silt on the remains of a Roman vessel that he discovered inside Rio de Janeiro's bay.
http://en.wikipedia.org/wiki/Pre-Columbian_trans-oceanic_contact

Tuesday, October 18, 2011

Candidates who spend more usually win

http://www.politifact.com/truth-o-meter/statements/2011/oct/17/occupy-wall-street/occupy-wall-street-protesters-sign-says-94-percent/
The center found that in 2008, the biggest spenders won 93 percent of House races and 86 percent of Senate races. In 2006, the top spenders won 94 percent of House races and 73 percent of Senate races. And in 2004, 98 percent of House seats went to candidates who spent the most, as did 88 percent of Senate seats.

Sunday, October 9, 2011

Qu8k Rockets Above the Balloons

http://science.slashdot.org/story/11/10/09/1618252/qu8k-rockets-above-the-balloons
"Lately we've been inundated with 100k' balloon flights and amazing video footage from space — the flights usually taking better than an hour to achieve apogee. Derek Deville took a shortcut to 121k' using a 'home made' Q rocket motor and a ton of engineering genius. On September 30, 2011 at 11:08am, Qu8k (pronounced 'Quake') launched from the Black Rock Desert in Nevada to an altitude of 121,000' in 92 seconds before returning safely to earth.This small documentary on the flight is probably one of the most brilliant Amateur Rocket videos out there right now." The launch was an attempt to claim the Carmack Prize. (And Deville evidently likes to launch another kind of rocket, too.)

Saturday, October 8, 2011

Encyclopedia

http://en.wikipedia.org/wiki/Toilet_paper_orientation

Pages: 12
Words: 5331
Characters: 32701

Saturday, October 1, 2011

Dale Swanson: A Valuable Reference

Probably the funnest part of having web sites is looking at the logs and seeing where my site is linked from.  Here is a good one:
http://www.kgbanswers.com/can-you-use-everclear-alcohol-to-fuel-your-car/10796083

They quote my site and then cite it as a reference.  To be fair, the part that follows the quote makes it pretty clear I thoroughly researched my facts:
Besides getting you very drunk it can also be used to fuel your car, no modification needed, just pour it in and go. It can also be used when you need fire, as it is highly flammable, and can be used as an effective cleaning agent. The Center for Survival Statistics recently published a report that said Everclear was directly responsible for saving the lives of over 12 billion people last year alone [1].
...
[1] This sentence is completely made up.

Sunday, September 25, 2011

How To Predict The Future

A while ago, I noticed a trend when people made predictions for the future.  Short term predictions tended to be too short, while long term predictions tended to be too long.  For example, some new technology that you think will be around in 10 years will probably be closer to 20 years.  On the other hand, if you think a technology will take 500 years it'll probably be something like 250.

I think there's relatively simple explanation for this.  People tend to focus on big changes and overlook small ones.  If we take a technology like solar power, there are plenty of predictions about it being cheap enough for large scale use in 10 years.  However, these predictions likely overlook the various small problems with implementation.  Perhaps we will have solved the largest problem keeping costs high in 10 years, but there will be a number of other problems that we haven't solved, many of which we aren't even aware of yet.

It is even clearer in long term predictions.  Look at a sci-fi story from a few decades ago, and you will see lots of technology that is inferior to today's tech.  A well know example of this is the original Star Trek series from the 60s.  They use big clunky controls, and the portable devices are already inferior to a tablet computer.  Keep in mind it is set over 200 years in the future, so there is little doubt that we will be massively more advanced than them by the same time.  The exceptions to this would be single big inventions that may well be impossible (eg faster than light travel, matter transport).

When someone is writing a story based in the future they need to come up with each invention.  It's easy to come up with major inventions (particularly if they are needed for the plot), but most inventions aren't major.  Most inventions are small and evolutionary.  In the last 50 years there have been a few major inventions (and there is no hard line, so it's futile to try to decide exactly what has been major vs minor), but there have been millions and million of small innovations.  Most of the change in our daily lives is from these small innovations vs the major revolutionary inventions.  On top of this, most of these innovations have been incremental, ie, they relied upon the previous innovations to exist first.  Without coming up with the long chain of innovations, it would be impossible to predict the one at the end.

Getting back to my main point, short term predictions need to be lengthened, while long term predictions need to be shortened.  When I come up with a prediction I just double it if it's < 50 years, or half it if it's > 200 years.  This is ok, but I figured there had to be a better way to make the adjustments.  I wanted to come up with some formula that would tend to move predictions towards a certain time frame (eg 100 years).  I had some requirements.  First, it should tend to about double short term predictions, and half long term ones.  Second, as the year gets closer to 100 the adjustment should become relatively less, with the adjusted year never being moved past 100 years.  Last, I wanted one formula for < 100 and > 100 years, not a piecewise function. 

I came up with a formula to do this a few years ago, but didn't save it.  My recent reading of Manna made me think about this again.  So, I started a spreadsheet and set out to come up with a new formula that fit my requirements.  After some tinkering I came up with this:$$$\cdot$$$ $$$\frac{}{}$$$
$$N=I^{\sqrt{\frac{2}{\log{I}}}}$$
Where: N is the new outputted year, I is the inputted year, and log is the base 10 log.  And if it's not clear, the sqrt is an exponent of I.

This worked out pretty well.  It's a bit too high for input years < 5 years, and an input of 1 year causes a divide by 0.  10 years gives 26, 25 gives 47, 50 gives 70, 150 gives 122.  Looking at the adjusted values though, I think the turning point is too far out.  More thought convinced me that something like 70 years was probably better.  Changing this was rather easy.  I used 2 because log10(100) = 2.  So it followed I could just replace 2 with log10(t).  This had the additional benefit of making the base of the log not matter (as long as you use the same base on the top and bottom)
$$N=I^{\sqrt{\frac{\log{t}}{\log{I}}}}$$
Where: N is the new outputted year, I is the inputted year, t is the year where the turn from adding years to subtracting years happens, and log is any base log.

Looking at the formula I noticed something interesting.  If you're unaware, calculators commonly perform base 10 or base e logs.  If you want to perform a different base log you need to use the following formula:
$$\log_b{x} = \frac{\log{x}}{\log{b}}$$
Where: logb(x) is the base b log of x, and log is any arbitrary base log.

In other words, if you want to find the base 7 log of some number, but can only compute the base 10 log then you have to find the base 10 log of whatever number you want to find the base 7 log of, and then divide by the base 10 log of 7.

With this knowledge, it should be clear that the above formula is really:

$$N=I^{\sqrt{\log_I{t}}}$$
Where: N is the new outputted year, I is the inputted year, t is the year where the turn from adding years to subtracting years happens, and logI is base I log.

I attempted to get the variables out of the exponent using more logs.  I failed, but managed to get it in a different, and I feel interesting, form:
$$N = I^{\sqrt{\log_I{t}}} = b^{\sqrt{\log_b{t} \cdot \log_b{I}}}$$
Where: N is the new outputted year, I is the inputted year, t is the year where the turn from adding years to subtracting years happens, and logb is the base b log.

If we use a base of 10 for the logs, and a turning year of 100 this becomes:
$$N = 10^{\sqrt{2 \cdot \log{I}}} = 10^{\sqrt{\log{(I^2)}}}$$
Where: N is the new outputted year, and I is the inputted year.

This formula is about as simple as I can make it. More importantly than that though, it reveals some interesting things. First, note how there are two functions, log and sqrt, and then their inverses, 10^x and x^2. They are nestled inside each other in an alternating fashion. Second, note that the conversion is now simply a power of 10. This means you can just focus on the exponent part to get a feel for how it will behave.

Anyway, I made two graphs showing how the function translates years. First is specifically the input years < 100. The second ranges 0-10,000.

In the second graph it's clear that it's similar to a simple log graph.  I was worried that something as simple as log(I) could produce an adequate curve.  A simple log(I) hugged the x axis too much, but multiplying by 100 steepened the curve.  Then, subtracting 100 shifted it down so that the graph went through the point (100, 100).  This looked ok for the low values, however, it flattened out too quickly for the higher values.  I played around with the values some more, but couldn't find any way to get the curve right.

So, I'm pretty happy with my formula.  Maybe I'll think about it some more and try to figure out if there is a simpler way to get that curve.  After all, I always need ways to avoid studying the math that I'm actually going to be tested on.

If you want some more interesting info on the formula, Wolfram|Alpha never ceases to amaze:
http://www.wolframalpha.com/input/?i=10^sqrt%28lg%28x^2%29%29

Tuesday, September 20, 2011

Obama unveils plans to cut US deficit

http://www.bbc.co.uk/news/world-us-canada-14975745

I generally don't bother posting about super obvious news like this.  However, after reading the proposal I was rather surprised.  As always, I recommend you simply read the source documents first hand:
http://www.whitehouse.gov/sites/default/files/omb/budget/fy2012/assets/jointcommitteereport.pdf

It's very readable, and broken up into four sections (jobs, savings, health, tax).  Each section is filled with a few dozen ideas to accomplish that goal.  Each of those with a paragraph or two giving more detail.  In other words, it lends itself to skimming.  A word of caution: the pdf bookmarks seem to have been created by some sort of 'cat playing with laser pointer dot on keyboard' system, so steer clear of them.

Since you won't read it, I'll go over some of my favorite parts.  First, it mentions some of my biggest pet peeves, farm and oil subsidies.  Second, it mentions selling off the vast property holdings of the US.  I'd be amazed if either of these ever come to fruition.  

On the taxes side it deals with two of the loopholes I'm aware of that allow the top 1% to pay so little taxes.  First, is the capital gains tax.  If you aren't aware interest from investments isn't taxed as income.  Rather it is all taxed at the same flat rate, which I think is currently 15%.  It is common for the very rich to get most of their income as interest on investments, so they end up paying only 15%.  Second, is depreciation of assets.  That allows the rich to deduct the loss of value of things from their income.  However, it oddly only addresses depreciation with respect to airplanes, and then only says the schedule should be increased from 5 years to 7.  Frankly, I have no idea if what actual effect that would have, and I don't know why it's not being more generally applied.  Although I think the capital gains tax is more important.

Two major savings items that don't seem to be mentioned are reducing the size of the military, and increasing age of eligibility for social security.

While it's not perfect, it's far better than anything I would have expected to see proposed by a traditional politician.  In my opinion one of the following must be true:
  • It is only being proposed because the president knows it has no chance to pass, and it will garner him some general goodwill (see I tried).
  • There are even deeper loopholes that the rich actually use to protect their income from taxes.
  • Will end up passing, but stripped down to the point that it represents the worst of both worlds (see health care bill).
  • My view of US politics is overly cynical.

Monday, September 19, 2011

Manna by Marshall Brain

http://marshallbrain.com/manna1.htm

Rather interesting short story about a possible outcome of robots being able to perform more and more jobs.  The ideas were interesting, although I found it slightly long winded and preachy at times.  However, I suspect that could be a result of my distaste for fiction in general.

Sunday, September 18, 2011

Comparison of Four Major Scripting Languages

http://hyperpolyglot.org/scripting

A detailed comparison of PHP, Perl, Python, and Ruby.

Saturday, September 17, 2011

Scientists Discover 'Hidden' Code in DNA Evolves More Rapidly Than Genetic Code

http://www.sciencedaily.com/releases/2011/09/110916152401.htm
The researchers discovered that as many as a few thousand methylation sites on the plants' DNA were altered each generation. Although this represents a small proportion of the potentially six million methylation sites estimated to exist on Arabidopsis DNA, it dwarfs the rate of spontaneous change seen at the DNA sequence level by about five orders of magnitude.
This suggests that the epigenetic code of plants -- and other organisms, by extension -- is far more fluid than their genetic code.

Saturday, September 10, 2011

Brownian ratchet

http://en.wikipedia.org/wiki/Brownian_ratchet
The device consists of a gear known as a ratchet that rotates freely in one direction but is prevented from rotating in the opposite direction by a pawl. The ratchet is connected by an axle to a paddle wheel that is immersed in a fluid of molecules at temperature T1. The molecules constitute a heat bath in that they undergo random Brownian motion with a mean kinetic energy that is determined by the temperature. The device is imagined as being small enough that the impulse from a single molecular collision can turn the paddle. Although such collisions would tend to turn the rod in either direction with equal probability, the pawl allows the ratchet to rotate in one direction only. The net effect of many such random collisions should be for the ratchet to rotate continuously in that direction. The ratchet's motion then can be used to do work on other systems, for example lifting a weight against gravity. The energy necessary to do this work apparently would come from the heat bath, without any heat gradient. Were such a machine to work successfully, its operation would violate the second law of thermodynamics, one form of which states: "It is impossible for any device that operates on a cycle to receive heat from a single reservoir and produce a net amount of work."

Wednesday, September 7, 2011

Did the CIA Do Enough to Protect Bin Laden's Hunter?

http://www.theatlanticwire.com/global/2011/07/did-cia-do-enough-protect-bin-ladens-hunter/39867/
But it was the story's intro--not the analyst's bio--that caught the eye of the group Cryptome, which specializes in data leaks. The AP mentioned that John was standing "just outside the frame" in the iconic photograph, below, of President Obama's national security team in the Situation Room during the raid that killed bin Laden. Cryptome homed in on the yellow patterned tie of a man just off camera (see red arrow) and then identified a tall man, face in full view and wearing the same or similar tie in another photo of the national security team from the White House Flickr stream. They also spotted the same man in a photo of CIA Chief Leon Panetta attending a private briefing on Capitol Hill that the AP says John also attended. Cryptome speculated that the man wearing the tie in question was John.

Sunday, September 4, 2011

How To Solve Basic Science Formulas

While taking intro science classes I've notice a lot of people who don't have any system for solving basic science formulas. Once one develops a system for solving these equations they become very easy. Indeed, it is a criticism of many science classes that simply solving these equations blindly doesn't teach one anything about science. I'll leave that debate for somewhere else, and instead go over the process of solving these types of problems.

I'd also like to note that solving simple physics formulas isn't only useful for those in science classes.  Over on the Physics Forums I see many people asking questions that they could solve themselves by simply Googling the formulas and then plug and chug away.

Before we begin, you should be able to manipulate algebraic formulas to solve for different variables. Given:
$$$a+b=\frac{c}{d}$$$
you should be able to solve for a, b, c, or d. For example, $$$d = \frac{c}{a+b}$$$.  If you're unsure about how to do this Khan Academy is a great site covering tons of math and science at all levels.

Second, it would behoove you to familiarize yourself with the common variables used in whatever area you are working. Usually, these are pretty obvious (e.g. m for mass, v for velocity), but sometimes the obvious choice is already taken and something else must be used.

For the first example here are some formulas involving energy:
E = mhg
E = 1/2 m v2
Where:
E is energy, m is mass, h is height, g is gravitation acceleration = 9.8 m/s, and v is velocity.

Q: What is the velocity of an object with a mass of 500 kg and a kinetic energy of 100,000 J?

Begin by identifying the variables given, as well as the one asked for.  We identify m = 500 kg, E = 100,000 J, and v = ? (we are looking for it).  Now we must find a formula that has these variables.  The second formula (E = 1/2 m v2) has all these variables.  However, we need to solve for v.  We can either solve for v before (while it is only variables) or after (while is is all numbers) we substitute numbers for variables.  Which is easier will depend on the problem and person.  Solving first has the advantage of avoiding some messy arithmetic, particularly on tests where the numbers are likely to cancel out nicely.  It also only has to be done once for a given variable.  So, if you have several problems all asking for the same variable it will make sense to solve for that variable once.

Getting back to this problem, I would solve for v first:
$$E = \frac{1}{2} m v^2$$
$$\frac{2 \cdot E}{m} = v^2$$
$$\sqrt{\frac{2 \cdot E}{m}}=v$$ (Ignoring the negative root)
Now we replace the variables with the known values:
$$\sqrt{\frac{2 \cdot 100,000\,\mathrm{J}}{500\,\mathrm{kg}}}=v$$
And now we solve the arithmetic:
$$v = 20\,\mathrm{\frac{m}{s}}$$

I'd like to mention something about units.  You could simply recognize that meters per second is the expected units for velocity and assume that is what your result is.  However, you can also solve units in the same way as you solve numbers.  In this case we need to know that J = $$$\mathrm{\frac{kg \cdot m^2}{s^2}}$$$.  Dividing J by kg is the same thing as multiplying it by 1/kg.  Hence, the above formula with numbers removed gives:
$$\sqrt{\mathrm{\frac{kg \cdot m^2}{kg \cdot s^2}}}=\mathrm{v}$$
kg/kg cancels out giving:
$$\sqrt{\mathrm{\frac{m^2}{s^2}}}=\mathrm{v}$$

And taking the square root gives the expected m/s.

For a second example I'll be using an electricity question. Here are several formulas in this area:
$$F=\frac{k \cdot q_1 \cdot q_2}{r^2}$$
$$V=IR$$
$$R=\frac{\rho \cdot L}{A}$$
$$E=\frac{k \cdot q}{r^2}$$
$$V=\frac{w}{q}$$
$$A=π \cdot r^2$$

Where:
F is force from the charge.
k is Coulomb's constant = 9 x 109 $$$\mathrm{\frac{N \cdot m^2}{C^2}}$$$
qn is the charge of particle n.
r is the radius, or distance between the two charges.
V is voltage aka electrical potential difference
I is electrical current, measured in amps
R is resistance
ρ (greek letter rho) is resistivity of a material
L is length
A is cross sectional area
E is electrical field strength (volts/meter)
w is work

Here is a list of ρ (rho) values for common materials:
Material ρ [Ω·m] at 20 °C
Aluminium 2.82×10-8
Calcium 3.36×10-8
Copper 1.68×10-8
Gold 2.44×10-8
Iron 1.0×10-7
Lithium 9.28×10-8
Nickel 6.99×10-8
Silver 1.59×10-8
Tungsten 5.60×10-8
Zinc 5.90×10-8

Q: A copper wire is 40 cm long and 1 cm in diameter. What is the resistance of the wire?

Begin by identifying all the variables given, as well as the one being asked for.  Since all the formulas use standard units (meters, kilograms) I find it best to just immediately convert these into the standard units.
L = .4 m
d = .01 m
ρ = 1.68×10-8 Ω·m (value for copper taken from above chart)
R = ? (this is what the question is looking for)

Now we look at our available formulas and find the one which uses those variables.  In this case, none only have those variables.  However, $$$R=\frac{\rho \cdot L}{A}$$$ is only missing one, A (cross sectional area).  Thus, we must solve a sub problem first.  We see there is a formula for cross sectional area provided: $$$A=π \cdot r^2$$$, this only requires radius, which we know is half of diameter (if you wish, you can pretend d = 2r was provided and do a second sub problem to find r).  Using the area formula we find that:
A = 7.85 x 10-5 m2

With the above list of variables, we can now solve for the original unknown (R).
First rewrite the original formula:
$$R=\frac{\rho \cdot L}{A}$$
Then substitute in the known variables:
$$R=\frac{1.68×10^{-8} \Omega\,\mathrm{m} \cdot 0.4\,\mathrm{m}}{7.85 × 10^{-5}\,\mathrm{m}^{2}}$$
Then solve the numbers and units separately:
$$R= 8.56×10^{-5} \frac{\Omega\,\mathrm{m}^2}{\mathrm{m}^2}$$
Units cancel the same way numbers do.  Thus, m2/m2 cancels out and we are left with just Ω as our units, which is what we expect.  It is easier to just drop all the units and then assume the final units are what they are supposed to be.  However, actually solving the units provides an important check.  If you are unsure if you are correctly remembering a formula simply solving with only units can tell you if its wrong.  In addition, solving the units while doing the math will help show simple errors.

I could continue giving examples, however I think the basic process is pretty easy to follow (also laziness).  Just identify the variables.  Find a formula with the correct variables in it.  Plug in the numbers and solve.  I suggest you simply think of things to calculate then Google to find the formulas.

Friday, September 2, 2011

How the full unredacted Wikileaks cables were leaked

http://www.spiegel.de/international/world/0,1518,783778,00.html

Just in case you haven't heard, the entire set of cables that Wikileaks has and was gradually publishing has now been leaked.  The important fact here is that Wikileaks had been redacting the names and other specific low level info.  Well now a 350 MB 7z file is available on The Pirate Bay.
http://thepiratebay.org/torrent/6644172/Wikileaks_Cables__Full__Unredacted__and_Decrypted_%28cables.csv%29
The password being:
ACollectionOfDiplomaticHistorySince_1966_ToThe_PresentDay#

Monday, August 29, 2011

How Irene Lived Up to the Hype

http://fivethirtyeight.blogs.nytimes.com/2011/08/29/how-irene-lived-up-to-the-hype/
So Irene right now ranks as the 10th-deadliest storm since 1980, with some possibility of that number going higher. And it ranks as the 8th most destructive storm economically, give or take. Meanwhile, it received about the 10th-most media coverage.

I found this storm rather annoying.  Not because it was overhyped, but because the hype was overhyped.  If you don't like hype don't watch the news.  Hype is their business, and business is good.

In the age of the internet there really isn't any reason not to get your information directly from the source for things like this.  Do you think Fox/CNN is operating their own fleet of weather buoys, or planes dropping sensor probes into the storm, or weather satellites, or supercomputers running simulations?  They are all getting their data from the NOAA, so you might as well too.

Sunday, August 28, 2011

Image Formats, And Which To Use

As someone who spends an enormous amount of time on the internet, one of my problems is when people use the wrong image format.  This leads to either too big a file size or a crappy looking image.  Which format to use is a pretty simple thing to figure out.  First some background.

JPEG is probably the the most common image format.  It is an old format.  While there are better choices, it is entrenched in many places.  JPEG will likely be around for quite a long time.  The key aspect of JPEG is that it is a lossy format.  This means that it loses information as a trade off for a smaller file size.  This is similar to how MP3s work.  JPEGs can have various quality settings which allow one to decide how much quality (and file size) the image loses.

GIF is also an old image format.  However, unlike JPEG it is lossless.  That means that no quality is lost when saving an image as GIF.  There are caveats to that though.  The biggest problem is that GIF only supports 256 colors.  This is fine for things like logos and icons, but any real world image will have a significant loss of color info.  Today GIF has largely been replaced by PNG.  However, one thing GIF has going for it is animation.  If you see an animated image on the web any time soon it's likely to be a GIF.

PNG was created largely to replace GIF, both due to patent issues and just general better quality.  Like GIF, PNG is lossless.  It overcomes GIF's main downfall by supporting either 24 bit or 8 bit color.  This means PNGs can either be smaller than GIF for similar color loss, or perfect color.  If JPEGs are MP3s then PNG is FLAC.

BMP is is a lossless and totally uncompressed image format used by MS Paint.  It produces huge files, which generally makes it the worst possible choice for anything.  Using our audio comparison BMP is a crappy version of WAV.

TIFF is another lossless image format.  This one is often used by scanners.  Like BMP, TIFF produced huge files and should be avoided unless you have a specific reason for using it.

SVG is different from the other formats described here in that it stores info about how to draw the image rather than what the image is.  The result is small file size and an image that can scale up infinitely (since the computer is drawing the image itself).  It is analogous to MIDI.  The downfall is that it uses more processing power, and isn't universally supported by web browsers.  In addition, it will only work for simple images that are collections of lines.  Wikipedia likes to use SVG a lot, much to my dismay.  Getting this image link crashed Firefox, twice.

Now that we've covered the common image formats it's time to answer the question: Which image format do I use and when?

For real world images (eg images taken with a camera), JPEG is the right choice.  PNG or TIFF could be used if you want no data loss at all, but you'll pay for it with a huge file size.

For images that were created on a computer (eg logos and icons), PNG is generally best.  If you have a heavily used image and want to minimize file size an 8-bit PNG is most likely going to be the smallest file size.  People often use JPEG for these types of images which leads to both greater file size and worse image quality.

To illustrate the differences I made a few example images:

Here is a screen shot of Wikipedia:
PNG Full 79 KB
GIF 58 KB
JPEG Low 53 KB
PNG 8-bit 37 KB


















The full PNG is a perfect image with no quality loss.  It's 79 KB.  The GIF and 8 bit PNG both lose some color info in exchange for a lower filesize.  The 8 big PNG is the smallest file I could get at 37 KB.  I've included a low quality JPEG (setting 15/100 in Gimp) to show the artifacting that JPEGs produce with high contrast changes such as you see in computer graphics.  Note in the 8 bit PNG that only the color gradient in the Windows title bar shows color loss.  All the color icons are fine.


Here is a computer created graphic:
PNG 8-bit 37 KB
JPEG High 183 KB
JPEG Low 46 KB











In this case the original image was a 47 KB GIF.  The 8 bit PNG will never lose color info over an 8 bit GIF and will almost always be smaller (about 25% smaller in this case).  The NOAA probably uses GIF for maximum compatibility (IE6 doesn't fully support PNG), and simply out of habit.  I recommend you open the PNG and the high quality JPEG in tabs and compare them.   The JPEG may look alright to begin with, but looking at the PNG shows the JPEG is quite blurry, losing data near any sharp edges.  This highlights why JPEG is a terrible choice for computer graphics.  Also keep in mind the JPEG is almost 5x as large.


Now here is an image taken with a camera:
JPEG High 124 KB
JPEG Low 28 KB
PNG 8-bit 230 KB









Really, the only choice here is a decent quality JPEG (85/100 pictured).  The low quality JPEG is much smaller but also horrible looking.  If file size is a concern you would probably want to go with something in the middle.  The 8 bit PNG was the smallest file of the various others I tried, and doesn't look very good.  A full quality PNG was 786 KB, with no noticeable improvement over the 124 KB JPEG.

Here are some tables with the files sizes (in KB) of the various formats I tried:

FormatKBNotes
wiki.png8bit.png37.4Color Loss
wiki.pngbw.png45.3B/W
wiki.jpglow.jpg51.7Artifacts
wiki.gif.gif58.3Color Loss
wiki.gifbw.gif65.3B/W
wiki.pngfull.png79.4Perfect
wiki.jpghigh.jpg182Slight Artifacts
wiki.bmp.bmp678Huge
FormatKBNotes
irene.png8bit.png36.7Perfect
irene.jpglow.jpg46.4Bad Artifacts
irene.gif.gif46.9Original
irene.pngfull.png66.124-bit
irene.jpghigh.jpg183Artifacts
irene.bmp.bmp627Huge
FormatKBNotes
catskills.jpglow.jpg27.6Low Quality
catskills.jpghigh.jpg124Good Quality
catskills.png8bit.png230Color Loss
catskills.gif.gif275Color Loss
catskills.gifbw.gif500B/W
catskills.pngfull.png786Perfect
catskills.bmp.bmp1671Huge

Something in the water

http://articles.boston.com/2011-08-21/bostonglobe/29912200_1_caleb-banta-green-drug-experts-new-drug
On March 4, 2008, Field and Banta-Green and other colleagues initiated a single-day study. Ninety-six Oregon municipalities agreed to take part in the research. They were large and small, rural and urban, representing 65 percent of the state’s population. The researchers took a portion of the daily flow from local water-treatment facilities and headed back to the lab, where they injected 2 millimeters of the sewage onto Field’s instrument and scanned it for meth, cocaine, and ecstasy. The same rigor that scientists apply to a new employee or an athlete taking a drug test, Field and Banta-Green were now applying to raw sewage. The results were very clear: The components of ecstasy appeared in less than half the treatment plants, cocaine’s components in 80 percent of them. The molecules of meth, though, were in all of them. The researchers published the study in 2009 in the journal Addiction to much academic fanfare.

Thursday, August 25, 2011

How to get $12 billion of gold to Venezuela

http://blogs.reuters.com/felix-salmon/2011/08/23/how-to-get-12-billion-of-gold-to-venezuela/
But here’s one last idea: why doesn’t Chávez crowdsource the problem? He could simply open a gold window at the Banco Central de Venezuela, where anybody at all could deliver standard gold bars. In return, the central bank would transfer to that person an equal number of gold bars in the custody of the Bank of England, plus a modest bounty of say 2% — that’s over $15,000 per 400-ounce bar, at current rates.

Sunday, August 14, 2011

Why Haven't We Been Contacted By Aliens?

Consider the following: there are about 300 billion stars in our galaxy.  We have every reason to believe that these stars typically support a wide variety of types of planets.  In addition, there are hundreds of billions of galaxies, similar to our own.  Current estimates for stars in the visible universe are about 70 sextillion (7 × 1022).  Our solar system and Earth formed a relatively late 10 billion years after the universe began.  Other stars had formed and died by then.  Life on Earth formed a few hundred million years after the Earth formed.

Thus, it would seem there was both ample locations and ample time for life to have formed many many times other than on Earth.  Our universe and galaxy should be teeming with life.  With so much life, and with that life having a considerable head start on us, the unavoidable question is:
Why Haven't We Been Contacted By Aliens?

This question is known as the Fermi Paradox, and if you've never read about it I suggest you check out the Wiki article.  Here I will attempt to cover some of the major explanations for why there has been no contact with aliens.

Earths Are Rare
As I said above there are at least 7 × 1022 stars in the visible universe.  To date we've discovered over 500 planets outside our solar system.  However, those planets are mostly quite different from Earth, and unlikely to support life.  This is largely a result of the conditions that make planets easier to detect (very large mass, very close and short orbit).  We have only just begun to search for Earth like planets, but we have already found a few that could qualify.  We have no reason to think that Earth like planets are particularly rare.  Even if they were as rare as 1% of star systems, the absurd number of stars would mean there would still be an unimaginable number of Earth like planets.  I don't think that there is a lack of suitable locations.

Life is Rare
With only one example of a planet that supports life, we have very little idea of what kind of conditions are needed for life to begin.  There are a few things about Earth that are unusual, and if these things are necessary for life to begin it could mean that life just doesn't happen that often.  These go beyond a planet being Earth like (which usually means small, rocky, and having liquid water).  We have a large tilt giving us seasons, a large moon giving tides, and our star is located in a rather sparse area, protecting us from various cosmic catastrophes.  You can read some more of the interesting things Earth has going for it on Wiki.

In addition, while evolution does an excellent job of explaining how life can go from a basic replicating stage to the diverse complex array we are a part of today, we have no explanation for how life can spontaneously beginSome experiments have shown amino acids can form from sterile conditions similar to what would have been present on the early Earth.  However, while amino acids are an important component of life, they themselves are not life.

However, I don't think there is anything about the Earth that is that uncommon.  Nor is there anything that seems like it would be totally insurmountable.  Life on Earth began within a half a billion years of Earth forming.  A typical star system would last about ten billion years.  It seems like life began very shortly after it was possible on Earth.  Given our one example, I see no reason to assume life is particularly unlikely given reasonable conditions.

Intelligent Life is Rare
Many people have a flawed impression about evolution.  Specifically, that it leads to better and more advanced life.  Better is too broad a word to have much meaning, and while it certainly can lead to more advanced life, it isn't a foregone conclusion. 

Simply put, evolution is just a process where genes that cause themselves to be more likely to be passed on (by producing organisms better adapted to their environments, or more likely to successfully reproduce), tend to become more common.  These genes represent small changes, which over very long periods of time can lead to great diversity.  Note that neither 'better adapted to their environments' nor 'more likely to successfully reproduce', is equivalent to 'more advanced'.  More advanced may be a way to achieve those goals, but in and of itself is not a goal.

The evolution of human intelligence took 'only' 7 million years.  Life had existed for about a billion years, and complex land based vertebrates had existed for several hundred million years.  It seems like human level intelligence could have evolved earlier if it was a significant evolutionary advantage.

Another evolutionary misconception is that improvements in speed, size, strength, intelligence, etc are advantages.  While these things could be an advantage, they are trade-offs.  They come with an increase in calorie demands.  If the improvement doesn't allow for a corresponding increase in calorie intake, then it is a disadvantage.  The human brain is no exception to this; it consumes about 20% of the calories we take in.

It is not hard to imagine how the increased intelligence of humans may not have been enough to offset the increased caloric demands that went along with it.  Would a human, without the accumulation of knowledge passed down, be any better at surviving than another great ape?  The fact that we are here would seem to be evidence that the increased intelligence would be an actual advantage.  However, there could have been a unique set of selective pressures that caused intelligence to be beneficial.  If this is the case, it could be that diverse complex life is common, but that intelligence is rare or unique. 

Intelligent Life Tends to Destroy Itself
The ability of the human race to destroy itself is a unique and recent development.  More than a hundred years ago it wouldn't have been possible for any group of humans to wipe out the entire human race.  With nuclear weapons, this became possible.  There are other methods that would have the same result as well, some that could be accidents.  It could be argued that as intelligent life develops more and more technology the number of ways it could destroy itself only increases.  Eventually it becomes certain that one of these things will happen.

That being said, I've never been a fan of this explanation.  It would seem we are unlikely to wipe ourselves out anytime soon, and we have already reached a point where we are detectable from space.  In a hundred more years it seems reasonable we could be taking the first steps into other solar systems.  Once we reach that point, I would think we'd be a lot harder to wipe out.  Again, with the number of stars it would only take a very small percentage of civilizations that didn't wipe themselves out to lead to a huge number of civilizations that should be present.

Faster Than Light Travel is Impossible
While simply accelerating to the speed of light is impossible there are a number of 'loop-holes' that would allow for travel between two points in less time than light would take.  If it turns out that even these are impossible and that it is truly impossible to travel astronomical distances faster than light then this would pose a significant problem for galactic colonization.  There could be a few dozen current civilizations in our galaxy that we'd never contact due to the distances.

That being said, it would take at least 100,000 years to cross our galaxy.  If there were thousands or more advanced civilizations it seems probable that some would be traveling around at close to the speed of light, and that some would have come across the Earth by now.

These are just the main reasons I think are most likely to be relevant.  Wikipedia goes into much more depth.  In addition there is something called the Drake equation, which aims to estimate the current number of advanced civilizations given a set of variables.  If I had to make a guess as to the reasons, I'd have to say a combination of rarity of intelligent life and faster than light travel being impossible.

Sunday, August 7, 2011

Firefox Extensions

I started using Firefox a long time ago, back when it was Phoenix.  It was a great day when I discovered it.  The superiority to IE was unquestionable. I'm not sure if I could have spent every waking moment of my life on the internet without it. The two main features that drew me in right away were tabs, and extensions. Tabs are now the norm, and while other browsers allow extensions, Firefox has the advantage of the huge catalog of extensions available already.

Now it seems Firefox's momentum has slowed. While IE continues to be abandoned, Chrome has risen to capture those users. One of the benefits of Firefox was that it was fast and lean. It was just a basic web browser. If you wanted more, that's what extensions were for. Unfortunately, Firefox has fallen victim to the same problem that every successful program has. Feature creep is inevitable in a popular program. The simple fact is, it's more fun to add new features rather than sit around fixing bugs.

Still, I have grown dependent on some extensions, and will likely not switch away from Firefox for a while. I decided to write a post about what extensions I use, so that people can be more like me. I have a page on my site about the programs in general I use, so feel free to install all them too.

Without further ado, here are my currently installed Firefox extensions:
Adblock Plus - This pretty much goes without saying.

Download Statusbar - I've used this for years. Makes downloads just show up in a status bar, instead of a box.

FlashGot - I installed this years ago first as a way to build galleries from predictable image names (ie sequentially numbered images). Now I use it to do two things. First, download all links with a certain extension. Second, to download embedded flash videos (eg Youtube).

Greasemonkey - If you don't know what Greasemonkey is, it is pretty interesting. It is a javascript engine that lets you run scripts on certain pages. In effect it allows for small simple extensions that only run on certain pages, which mainly change the look of sites. I've written a handful of custom ones. Some of the others I use are: Show Just Image - which auto forwards to just the full sized image on the endless array of image hosting sites. Super iGoogle, which removes the worthless stuff (sidebar) from the iGoogle page. And xkcd titles, which displays the "secret" alt text under the image rather than requiring you to hover over it.

Multi Links - Multi Links is an interesting recent addition. It allows you to right click and drag a box which will open any links you cover in new tabs.

NoScript - If you're unaware of NoScript, it blocks javascript from running on certain sites. You can either have it run by default on everything and blacklist sites, or block it by default and whitelist sites. It's great for security and blocking ads and stuff that would autoplay sounds. It's also funny how many sites have some sort of security that is entirely javascript and bypassed with NoScript.

RefControl - RefControl lets you hardcode your referral string, which lets websites know what site you are coming from. I have no idea why I have it installed, no doubt trying to bypass some restriction somewhere.

StumbleUpon - StumbleUpon is probably the greatest invention since the internet. You tell it what interests you have, then click the stumble button and it displays sites that fit those interests. You can thumb up or down sites and that determines how often they are shown to other people, as well as further determining what types of sites you like. Essentially it's a never ending stream of mildly amusing or interesting content.

Tab Mix Plus - Tab Mix Plus allows a ton of customization for how tabs behave and look. Some things which I think it has allowed (some of these may be default behavior): Allow tabs to be very small, and take up multiple rows, great for when you have 100 tabs open. Make new tabs open at the end of the list, instead of near the current tab or whatever the hell the crazy default is. Reload or close all tabs either to the right or left of current tab.

Those are all the extensions I have currently installed. Here are ones that I've had installed previously, but have determined I don't need.
Firebug - A great developer tool. Allows you to examine the CSS and JS on a page and debug it step by step.

Forecastfox - Displays weather in status bar. Don't need it since I've discovered WeatherSpark, and check it 20 times a day.

Nightly Tester Tools - Pretty good set of advanced tools. Really the only things I ever used was the ability to copy extensions to clipboard, and display the build in the title, which does nothing, but makes me feel cool.

Saturday, July 23, 2011

How Michigan managed to empty its penitentiaries while lowering its crime rate.

http://www.washingtonmonthly.com/features/2010/1011.mogelson.html
When parolees are less likely to reoffend, more prisoners can be let go without jeopardizing public safety. Going hand in hand with Michigan’s improved recidivism rates, therefore, has been a correspondent increase in parole approvals. Over 3,000 more prisoners were paroled in 2009 than were paroled in 2006; approvals for violent offenders have gone up by more than half (from 35 to 55 percent), while approvals for sex offenders have more than quadrupled (from 10 to 50 percent). As a result, during the past three years, the number of state inmates in Michigan has shrunk by 12 percent, reversing a sixteen-year trend of steady prison population growth. The turnaround enabled Governor Jennifer Granholm to shut down ten prisons last year, and an additional eight are slated to be closed by the end of 2010.

Wednesday, July 20, 2011

Sunday, July 17, 2011

Why don't things in orbit fall?

This has been explained in plenty of places, probably a lot better than I'll do, but I enjoy explaining things, and it is a good way to solidify my own understanding of them.

If you asked random people why things in orbit don't fall I'd expect you'd get an answer about lack of gravity in space.  While strictly speaking there is so little gravity in the majority of space as to be considered none, this is not true of near Earth orbit.  Things like the space shuttle and the International Space Station orbit at about 200 miles above the surface of the Earth. 

Orbital mechanics can be pretty complex. There are strange results like it taking more energy to send a probe closer to the sun than farther away from it. However, the basics are easy enough to understand. To begin, we can look at the the formula for finding the force of gravity, which is pretty easy.  $$$F=G\frac{m_1 m_2}{r^2}$$$ Using this formula we can find the force that an object should have at orbital height.
$$F=G\frac{m_1 m_2}{r^2}$$
Where:
F is force of gravity
G is the gravitational constant, 6.67384 × 10-11N m2 kg-2
m1 is mass one (Earth 5.9742 × 1024 kg)
m2 is mass two (object)
r is the distance between the masses

Before we move on, it is important to discuss r. You may be tempted to think the distance between the Earth and an object sitting on Earth's surface is 0 (or very close). Indeed, in common usage it is. However, when dealing with gravity all distances are measured from centers of gravity. As far as these formulas are concerned everything is infinitely small with all the mass in a point (which would make everything a blackhole [which leads to an interesting consequence that blackholes behave the same as any other object at a distance beyond their event horizon]). This means that we must add the radius of Earth (6,378,100 m) to whatever height above Earth the object is at.

Is there no gravity in orbit?
Let's begin with a 100 kg object on Earth's surface:
$$F=6.67384 × 10^{-11} \mathrm{N\,m^2\,kg^{-2}}\frac{5.9742 × 10^{24}\,\mathrm{kg} \cdot 100\,\mathrm{kg}}{(6,378,100\,\mathrm{m}) ^2}$$
$$F=980\, \mathrm{N}$$

Newtons (N) is the SI unit of force, analogous to pounds.  An apple has a weight of about one newton.  It doesn't matter if you have a intuitive feel for what that force is. You just need to be able to compare it to the force in orbit, which is:
$$F=6.67384 × 10^{-11} \mathrm{N\,m^2\,kg^{-2}}\frac{5.9742 × 10^{24}\,\mathrm{kg} \cdot 100\,\mathrm{kg}}{(6,731,100\,\mathrm{m}) ^2}$$
$$F=880\, \mathrm{N}$$

Note the only difference is the increase of r from 6,378,100 m to 6,731,100 m, or a 5.5% increase. That is significant, but not overwhelming. The force on Earth's surface is 980 N while the force at ISS orbit is 880 N. This force is weight. Thus, an object in ISS orbit weighs 90% what it does on Earth's surface.

Why don't things in orbit fall then?
Now that we know there is only a small decrease in the force of gravity a few hundred miles up in orbit, the next question is why don't the things fall then? The answer is that they do. This isn't some silly trick answer either. Objects in orbit are falling towards Earth at all times. Indeed, orbit is accurately called free fall.

Why don't they hit the Earth then?
This question leads to the key aspect of orbit. It isn't the height; it's the speed. When we put something in orbit, the bulk of the fuel is used not to get the object high, but to get it moving very fast. I calculate that it takes about 9 times the energy to get an object to orbital velocity as to get it to orbital height. To understand why this is important, let's look at the picture from above again:

Now I have no idea which direction the astronaut is moving, but let's assume it's from left to right. Notice the curvature of the Earth below him. It's slight, but it's there. The Earth is nearly a perfect sphere, thus the curve is constant. If you travel in a straight line on the Earth the surface will slightly curve down and away from you. This drop off is very slow, and thus not noticed. We can figure out how fast the drop off occurs, and the answer is 7.98 inches per mile. To be clear, this means when you travel one mile on the Earth's surface you drop about 8 inches (relative to a flat plane parallel to your first step).

How long would it take to fall 8 inches?  Since acceleration due to gravity is constant we can use the kinematic equations to find the answer.
$$d= v_i t + \frac{1}{2}a t^2$$
Where:
d is distance traveled (7.98 inches = 0.202692 meters)
vi is the initial velocity (0 in this case so this term drops out)
t is time, what we are looking for
a is acceleration, which in this case = g = 9.80665 m/s2

Doing some shuffling we find:
$$\frac{0.202692\,\mathrm{m}}{4.903325\,\mathrm{m/s^2}}=t^2$$
Solving for t, we find t=0.2033 seconds.

Thus, it would take about 0.2 seconds to fall 8 inches. Here's an interesting question: What would happen if you traveled a mile in the 0.2 seconds it took you to fall 8 inches? You would fall 8 inches closer to the Earth, but the surface of the Earth would also drop away about 8 inches. In the end you would be no closer or farther from the surface of the Earth. This is precisely what orbit is.

A mile in 0.2 seconds works out to about 18,000 mph. We tend to think that very fast speeds are unstable, but this is only because of atmosphere, which creates drag and slows things down. If there was no atmosphere then things would continue at whatever speed they are at indefinitely. It should now be clear why things must be lifted to be put into orbit. It is not to get them a little bit higher above Earth's center of gravity. It is to get them out of the atmosphere so that the incredible speeds required for orbit can be achieved.

Orbits tend to be ellipses, and rather complicated. But, for our purposes, we can treat them as perfect circles. Here is the formula for circular orbits:
$$v=\sqrt{\frac{m_2^2 G}{(m_1 + m_2) r}}$$
Where:
v is orbital velocity
m2 is the mass of object being orbited (Earth)
G is the gravitational constant
m1 is the mass of the object orbiting
r is the distance between (the center of masses of) the two objects

Notice that if m1 is insignificant compared to m2 that the bottom term becomes m2 * r. Since the top is (m22 * G), a $$$\frac{m_2}{m_2}$$$ can drop out to 1, leaving:
$$v=\sqrt{\frac{m_2 G}{r}}$$
Since the mass of Earth is constant, the only thing that matters is height above Earth. You should already be thinking that this height won't have much effect at normal orbital heights since it is only a 5.5% increase in r. We can use Google calculator to do this math for us very easily.
At Earth's surface, v=17,685 mph
At ISS orbit, v=17,215 mph
Which comes very close to Wiki's figure of 17,239.2 mph. To put these numbers in some context, a 747's cruising speed is about 570 mph. The fastest known plane was the SR-71 with a top speed around mach 3.3 or 2200 mph.