July 27th, 2009

ronin

How to shark the "guess the number of M&M's in the jar" contest.


http://www.youtube.com/watch?v=YtjD3mRrVT4

I'll give you the salient facts:

- M&M packing fraction 66.5%, +/- 1% (there's actually a research paper on the subject!)
- Average M&M volume: 0.715 ml

I won't tell you what the estimated total number of M&Ms was - watch the video. But what I will tell you is, his estimate turned out to be off by only two M&Ms! Probably he got a little lucky, but even so, his estimate was accurate to 0.19%!

SCIENCE: It works, bitches!
ronin

Why skilled immigrants are leaving the US.


Lured by the prospect of climbing to the top of his field, New Delhi native Swaroop Ganguly came to the U.S. 10 years ago and earned a PhD in electrical and computer engineering from the University of Texas at Austin in 2005. He became an expert in an emerging technology called spintronics, used to power semiconductors, and worked at several chip companies, including Freescale Semiconductor. But Ganguly, now 32, is moving back to India this summer. Although he has been doing postdoctoral work at the University of Texas, he figures his prospects for research and professional development are probably better in his home country. "I feel quite excited about going back," he says.

Ganguly has already accepted a job as a professor of electrical engineering at the Indian Institute of Technology, Bombay. The position will pay a fraction of the salary he had been earning in the private sector—about $15,000 compared with $100,000—but it will offer considerably more job security and the freedom to do the exploratory research he wants to do. "The real lure of being in the U.S. is to do really innovative work, but the space for that seems to be shrinking," he says. "The Indian government is putting a huge amount of funding into science and technology, so even if they can't pay high salaries, it's an attractive prospect."

Ganguly is one of a number of highly skilled immigrants preparing to leave the U.S. as the nation's economy slows. With the U.S. unemployment rate approaching double digits, job opportunities are diminishing and calls to restrict immigration have gotten louder. Those who favor tightening the rules argue that U.S. citizens should get first priority for jobs.
A Blow to Prospects for Economic Recovery

But the issue is tricky when it comes to the most educated and skilled immigrants—people like Ganguly. When well-paid individuals leave the country, that cuts into already depleted tax revenues for state and local governments. The departure of top talent in technology and science may also undercut the prospects for a recovery in the U.S., many economists say. These immigrants often start companies and come up with technological breakthroughs, creating new job opportunities for all.

"We benefit from a flow of really smart people coming here to work in our companies and start new ones," says David Hart, a professor of public policy at George Mason University in Arlington, Va., who co-authored a study on immigrant entrepreneurship released this month. "It's important that the U.S. remain a magnet for people who fuel innovation and growth."


http://www.businessweek.com/print/bwdaily/dnflash/content/jul2009/db20090724_178761.htm

People are constantly telling me, "The India peoplez are gonna take yer jerb!!" It hasn't happened yet, and I don't think it's going to. ReturnPath outsourced some stuff when I was there, it didn't stop them from hiring more people. If anything, it seemed it allowed the company to focus more on the hard problems, and to do that they needed to hire more people in their US office.

So hearing that all the smart Indian guys are going back to India worries me. I know that not all of them are great engineers. (Great engineers are always a pretty small percent of any graduating class, regardless of where the class graduates.) But any time we lose engineers I get worried.
ronin

Fun with NULL pointers, or how the 2.6.30 local root exploit works.


Herbert Xu recently noticed a problem where a lack of packet accounting could let a hostile application pin down large amounts of kernel memory and generally degrade system performance. His solution was a patch which adds a "pseudo-socket" to the device which can be used by the kernel's accounting mechanisms. Problem solved, but, as it turns out, at the cost of adding a more severe problem.

Well-written kernel code takes care to avoid dereferencing pointers which might be NULL; in fact, this code checks the tun pointer for just that condition. And that's a good thing; it turns out that, if the configuring ioctl() call has been made, tun will indeed be NULL. If all goes according to plan, tun_chr_poll() will return an error status in this case.

But Herbert's patch added a line which dereferences the pointer prior to the check. That, of course, is a bug. In the normal course of operations, the implications of this bug would be somewhat limited: it should cause a kernel oops if tun is NULL. That oops will kill the process which made the bad system call in the first place and put a scary traceback into the system log, but not much more than that should happen. It should be, at worst, a denial of service problem.

There is one little problem with that reasoning, though: NULL (zero) can actually be a valid pointer address. By default, the very bottom of the virtual address space (the "zero page," along with a few pages above it) is set to disallow all access as a way of catching null-pointer bugs (like the one described above) in both user and kernel space. But it is possible, using the mmap() system call, to put real memory at the bottom of the virtual address space. ...


http://lwn.net/SubscriberLink/342330/f66e8ace8a572bcb/
"Not an angel"

Study: Abstinence-Only Lunch Programs Ineffective At Combating Teen Obesity


"Although these students were repeatedly warned about the evils of eating and made to take fasting pledges, the abstinence-only program did little to curb their overall appetite for food," the report read in part. "In fact, students at Woodbridge were nearly three times more likely to develop type 2 diabetes than children who were given a portion of meat, whole grains, and green vegetables, and then encouraged to skip dessert."

Perhaps more troubling, students who completed the abstinence-only program were reportedly unable to answer the simplest questions about their own digestive systems, and some as old as 17 still believed they could catch high blood pressure from their very first Snickers bar.


http://www.theonion.com/content/news/study_abstinence_only_lunch