Archive for the 'Technology' Category

Gamers solve molecular puzzle that baffled scientists

Topic: Technology| 1 Comment »

David: Imagine the mysteries Angry Birds could solve.
Sandy: Middle East Peace brought to you by Angry Birds.

Video-game players have solved a molecular puzzle that stumped scientists for years, and those scientists say the accomplishment could point the way to crowdsourced cures for AIDS and other diseases.
“This is one small piece of the puzzle in being able to help with AIDS,” Firas Khatib, a biochemist at the University of Washington, told me. Khatib is the lead author of a research paper on the project, published today by Nature Structural & Molecular Biology.
The feat, which was accomplished using a collaborative online game called Foldit, is also one giant leap for citizen science — a burgeoning field that enlists Internet users to look for alien planets, decipher ancient texts and do other scientific tasks that sheer computer power can’t accomplish as easily.
“People have spatial reasoning skills, something computers are not yet good at,” Seth Cooper, a UW computer scientist who is Foldit’s lead designer and developer, explained in a news release. “Games provide a framework for bringing together the strengths of computers and humans.”
Unraveling a retrovirus
For more than a decade, an international team of scientists has been trying to figure out the detailed molecular structure of a protein-cutting enzyme from an AIDS-like virus found in rhesus monkeys. Such enzymes, known as retroviral proteases, play a key role in the virus’ spread — and if medical researchers can figure out their structure, they could conceivably design drugs to stop the virus in its tracks. The strategy has been compared to designing a key to fit one of Mother Nature’s locks.
The problem is that enzymes are far tougher to crack than your typical lock. There are millions of ways that the bonds between the atoms in the enzyme’s molecules could twist and turn. To design the right chemical key, you have to figure out the most efficient, llowest-energy configuration for the molecule — the one that Mother Nature herself came up with.
That’s where Foldit plays a role. The game is designed so that players can manipulate virtual molecular structures that look like multicolored, curled-up Tinkertoy sets. The virtual molecules follow the same chemical rules that are obeyed by real molecules. When someone playing the game comes up with a more elegant structure that reflects a lower energy state for the molecule, his or her score goes up. If the structure requires more energy to maintain, or if it doesn’t reflect real-life chemistry, then the score is lower.
More than 236,000 players have registered for the game since its debut in 2008.
The monkey-virus puzzle was one of several unsolved molecular mysteries that a colleague of Khatib’s at the university, Frank DiMaio, recently tried to solve using a method that took advantage of a protein-folding computer program called Rosetta. “This was one of the cases where his method wasn’t able to solve it,” Khatib said.
Fortunately, the challenge fit the current capabilities of the Foldit game, so Khatib and his colleagues put the puzzle out there for Foldit’s teams to work on. “This was really kind of a last-ditch effort,” he recalled. “Can the Foldit players really solve it?”
They could. “They actually did it in less than 10 days,” Khatib said.

University of Washington
A screen shot shows how the Foldit program posed the monkey-virus molecular puzzle.
One floppy loop of the molecule, visible on the left side of this image, was particularly tricky to figure out. But players belonging to the Foldit Contenders Group worked as a tag team to come up with an incredibly elegant, low-energy model for the monkey-virus enzyme.
“Standard autobuilding and structure refinement methods showed within hours that the solution was almost certainly correct,” the researchers reported in the paper published today. “Using the Foldit solution, the final refined structure was completed a few days later.”
Khatib said the Seattle team’s collaborators in Poland were in such a celebratory mood that they insisted on organizing a simultaneous champagne toast, shared over a Skype video teleconference.
“Although much attention has recently been given to the potential of crowdsourcing and game playing, this is the first instance that we are aware of in which online gamers solved a longstanding scientific problem,” Khatib and his colleagues wrote.
The parts of the molecule that formed the floppy loop turned out to be of particular interest. “These features provide exciting opportunities for the design of retroviral drugs, including AIDS drugs,” the researchers said.
Looking for new problems to solve
The monkey-virus puzzle solution demonstrates that Foldit and other science-oriented video games could be used to address a wide range of other scientific challenges — ranging from drug development to genetic engineering for future biofuels. “My hope is that scientists will see this research and give us more of those cases,” Khatib said.
He’s not alone in that hope. “Foldit shows that a game can turn novices into domain experts capable of producing first-class scientific discoveries,” Zoran Popovic, director of University of Washington’s Center for Game Science, said in today’s news release. “We are currently applying the same approach to change the way math and science are taught in school.”
That’s something that Carter Kimsey, program director for the National Science Foundation’s Division of Biological Infrastructure, would love to see happen. “After this discovery, young people might not mind doing their science homework,” she quipped.
One caveat, though: Playing Foldit isn’t exactly like playing Bejeweled. “Let’s be honest, proteins aren’t the sexiest video game out there,” Khatib told me. Give the game a whirl, and let me know whether it’s addictive or a drag.
Tale of a Contender
The final decisive move in the Foldit Contender Group’s solution to the monkey-virus puzzle involved twisting around that floppy loop, or “flap,” in the structure of the enzyme. The paper published today notes that one of the Contenders, nicknamed “mimi,” built upon the work done by other gamers to make that move.

Speeding up local rsync transfers

Topic: Technology| 1 Comment »

At long last, I am rebuilding my storage server. Apparently 82,000 pictures/movies/etc is just too much for my little 750 GB drive to handle.

So I turned to my Linux partition to get the job done. I’m building my storage server on Linux, and the data I had to transfer was on a windows NTFS drive, so I knew the transfer would be slow-er, thanks to NTFS-3G and FUSE but when I fired up rsync to (hopefully) replicate times, dates, and such on the EXT4 filesystem, I thought the transfer rate was a tad slow, ~15-19 MBps.
sudo rsync –verbose –progress –stats –compress –recursive –times –links –exclude System\ Volume\ Information –delete /tmp/evectra/ /tmp/storage/

So some googling later while the files were copying and I discover that on local transfers, –compress really slows down the transfer rate. So, armed with that information, I axe the option:
sudo rsync –verbose –progress –stats –recursive –times –links –exclude System\ Volume\ Information –delete /tmp/evectra/ /tmp/storage/

Apparently, in this case, –compress took 30% off my speeds. Yuck. Now it’s much faster, ~29MBps. Which isn’t great, but what can you do? Besides reboot into windows, remount the destination drive in another machine, samba mount the drive, and experiment with copying the files over Gigabit.
I’ve got to resist the urge to mess with things to get better speed. :(

Firefox cubs

Topic: Technology| No Comments »

If you have a free moment, please go to to check out the 2 Firefox cubs and help them get their next treat!!! The cubs made me feel like…squeezing my computer to bits.



Python and EXIF Metadata: There’s more than one way to do it!

Topic: Technology| 2 Comments »

So, at the persistent urging of my friend Stephen, I decided to dip my toe once more into the snake-infested waters of the Pythonian Amazon instead of reaching into my back pocket and hacking the problem to pieces with my Perl.

The problem:

I love Windows Live Photo Gallery.  It has changed my photo-organizing life.  However, someone at Microsoft  decided to be briliant and make the import wizard (a jewel that groups your pictures by time so you can import groups of pictures taken at approximately the same time), groups picture by DATE MODIFIED instead of date taken.  Which is brilliant.  Especially if you are on a trip and want to “prematurely” edit or tag any picture while it is still on the memory card.

So essentially, I just get back from a trip with my in-laws and I have about 300 pictures suffering from this “date modified” sickness.

The solution:

This time, instead of Perlifying up a solution, I turn to the “There should be one– and preferably only one –obvious way to do it” Python way to do it, and discover that “There are 10, or more, non-obvious ways to do it, but only some of them do everything you want and most of them do part of what you want.”

Eventually, I grabbed PIL (Python Imaging Library) from comment on a similar rant against Python EXIF handling and called it good:

from PIL import Image
from PIL.ExifTags import TAGS

def get_exif(fn):
ret = {}
i =
info = i._getexif()
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
ret[decoded] = value
return ret

My quick and dirty script to change “date modified” on all pictures in a directory (recursively!) turned out to look like this:

from PIL import Image
from PIL.ExifTags import TAGS
import pprint
import time
import datetime
import os
import sys

def get_exif(fn):
ret = {}
i =
info = i._getexif()
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
ret[decoded] = value
return ret

def set_modify_time(_filename):
exif_info = get_exif(_filename);
pp = pprint.PrettyPrinter(indent=4)
print exif_info[‘DateTime’]

#Get EXIF Creation Date
exif_date,exif_time  = exif_info[‘DateTime’].split(‘ ‘)
print exif_date,exif_time
(y,mm,d) = exif_date.split(‘:’)
(h,min,s) = exif_time.split(‘:’)
date_list = (y,mm,d,h,min,s)
print date_list
#       int_date_list = [map(int, i) for i in date_list]
#WTF< why the H is that this:
#(’2006′, ’18′, ’12′, ’17′, ’18′, ’26′)
#[[2, 0, 0, 6], [1, 8], [1, 2], [1, 7], [1, 8], [2, 6]]
int_date_list = map(int, date_list)
print "int_date_list:", int_date_list
(y,mm,d,h,min,s) = int_date_list
print y,mm,d,h,min,s
#create unix timestamp object from EXIF date
exif_dateTaken = datetime.datetime(y,mm,d,h,min,s)
print str(exif_dateTaken)
unix_timestamp = time.mktime(exif_dateTaken.timetuple())

#set modify,access times on file
os.utime(_filename, (unix_timestamp, unix_timestamp))

return 1

def dir_files(_dir):
fileList = []
rootdir = _dir
for root, subFolders, files in os.walk(rootdir):
for file in files:
print ‘fileList’, fileList
return fileList

def listFiles(dir):
basedir = dir
print "Files in ", os.path.abspath(dir), ": "
subdirlist = []
for item in os.listdir(dir):
if os.path.isfile(item):
print item
subdirlist.append(os.path.join(basedir, item))
for subdir in subdirlist:

if __name__ == "__main__":
file = ‘C:\\tmp\\DSCN1229.JPG’
files = dir_files(‘E:\\Raw’)
print files
for file in files:
print file
if(file.find(‘JPG’) != -1):

Of course Python sucks and uses stupid whitespace, so I had to wrap the above in a <pre> tag.  Ugh. I’m sorry I spared you the fun game of “guess where the indentation goes!”, but I digress.

Anyway, that only gets me halfway there, because what I really want is a way to be able to both READ and WRITE EXIF metadata in Python. Because my camera decided it was 2037 for a few dozen pictures. And now we come to the title of my post. Apparently, there are several hundred ways to do that in Python, and not all of them will do what I want (read and write EXIF stuff) or are supported anymore (which is kind-of important).

So here, there’s more than one way to do it.

I’ll let you do the research and decide:

Meanwhile, I’ll be doing some old-fashioned date math and changing some metadata. One hundred and five times. Thanks.

P.S. I know that the “there should be one way to do it” probably applies to the Python language syntax and structure, but that still doesn’t make me any less irritated that there isn’t an “anointed” way to read metadata on files. For the love, this is the BIGGEST problem facing our information society over the next hundred years, we need to get a grip on it. Which Microsoft, of all people, seems to have done by integrating Metadata editing into every aspect of the Windows Vista and Windows 7 file manager. Linux needs to catch up. But that deserves another rantpost.

Let’s see if Microsoft Word 2007 can really post to a blog

Topic: Technology| No Comments »

I guess it can. There you go, kids!

Day 2: Don’t buy a Nikon Coolpix L5 if you want to take pictures of the Grand Canyon

Topic: Technology, Travel| No Comments »

So, Nikon has descended into the valley of suck. Sorry, I am going to rant for a bit, and then I’ll get back to the trip. We are driving around Mesa Verde, trying to get to the spectacular “Sun Temple”, stopping every 5 seconds to take more pictures of cliff dwellings, and my camera batteries die in the middle of a shot. Which is fine, since I subscribe to the “digital cameras should take AAs” school of thought, and I have a bunch of rechargables. So I pull two out from my case and pop them in. My Nikon happily starts up, and makes a wonderful musical startup noise. Which I had turned off last year when I bought the camera. And now comes the great part:

In the middle of a shot. Every time I turn on the camera (which was about fifteen times). And now my camera is hosed. Hosed because I don’t have INTERNET ACCESS or the MANUAL to look up what the aptly-named “system error” means.


It looks like this error does exist. The manual says that this helpful error means that the internal electronics of the camera are malfunctioning. The remedy is to take out the batteries and replace them with a fresh set…and if that doesn’t work, take the camera to your Nikon dealer. I’m assuming that a new system board for my camera, plus repairs, would come the about $200 more than the camera is worth. So, since this is the third set of batteries I’ve tried, I can safely assume that I might as well chuck my camera off a cliff. Which I will be seeing many of in the next few days. It will be tempting.

EU takes Microsoft into a back alley for a friendly chat, again…

Topic: Technology| 1 Comment »

Back Alley Beatings!Hello. Today is is a rant day. This morning, my wife informed me that the EU has fined Microsoft a record $1.3 billion dollars (probably an even billion euros), for more anti-competitive, antitrust violations. Now, I know that there are usually three sides to every story, one from the one giving the beating, one from the one taking the beating, and one from the one watching the beating, but I’m going to take Microsoft’s side on this one. Granted, I’m certainly not a huge Microsoft fan (I live in a battered users’ shelter after Vista pushed me down the stairs one too many times), but come on. Yes, Microsoft certainly has been anti-competitive. However, once the DOJ started going after them, it seems like everyone has jumped on the bandwagon. As a loyal TWiT listener, I’ve been convinced that the EU hates Microsoft and wants it to “play fair” (read: die and burn) for a while now, pummeling it into releasing stupid crap like Windows XP N (XP sans Windows Media Player), etc. Now, though, I’m just convinced that the EU sees Microsoft as an alternate income stream, a far-off evil US company that it can take into a back alley and “talk to” whenever it needs a few greenbacks (in March 2004, the EU fined Microsoft $613 million dollars for not sharing communications information). My real issue with this is that basically the EU fined Microsoft because it disagrees with the amount Microsoft is charging companies who license its patents. What? You mean if I invent something, and I hold the patent, and I want to make money off my work, you, the mighty EU, are going to tell me what I can and can’t charge for them? Of course not. I’m some schmoe who isn’t worth an EU business lunch. But as soon as I make enough money ($51.12 billion in 2007), you want your cut, (after your first cut, taxes) or I’ll have a little “accident”. Why should you be able to tell me what I can and can’t charge for licensing my patents?

Maybe I believe too much in a free-market system. It just seems weird that Microsoft has become the EU’s punching bag lately. After all, OS X comes bundled with (count them) a web browser (Safari), a media player (iTunes), a video conferencing and chat application (iChat), a web server (Apache), iLife, which includes iPhoto, iMovie, iDVD, GarageBand and iWeb, (a picture organizing and editing app, a movie editor, a DVD authoring program, a sound editing program, and a web authoring program), and I see no “bundling” lawsuits from the mighty EU or DOJ against Apple. I can’t even begin to imagine the Euro signs in the eyes of the EU commissioner, or minister, or high chancellor, or whatever, if Microsoft had started bundling all of those magical products in Windows XP back in 2003. Either it’s ok, or it isn’t. If you are going to go after Microsoft, go after Apple too. I’m sure we can find plenty of companies whose product was run into the ground after Apple “bundled” their own stuff. Anyway, rant over. I feel better. (because I don’t have to give 1 out of every 50 dollars my business earns this year to the EU, I just get to pay normal American taxes.)