Damn right you can.

March 3, 2010

Seen on Planet Debian: ‘Can you get cp to give a progress bar like wget?’ The solution starts:

#!/bin/sh
cp_p()
{
   strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
...

The author notes in the comments:

If you feel the need to point out an alternative solution, then you have missed the entire point by a wide margin.

—lamby

0

scrape.py

February 27, 2010

At PyCon, I saw a lightning talk about scrape.py, a lightweight Python library for parsing webpages/interacting with them programmatically. For example, finding page elements:

>>> from scrape import *
>>> s.go('http://zesty.ca/')
<Region 0:17780>
>>> d = s.doc
>>> t = d.first('title')
>>> t
<Region 247:258 title>
>>> t.tagname
'title'
>>> t.text
u'Ka-Ping Yee'

The presentation I saw focused on the use case of testing your website. This is definitely a pain point for me personally: I currently either grep the HTML with regexes or I parse the whole thing using ElementTree and use XPath. But there’s still a couple of problems: 1. JS isn’t usually testable this way; 2. you often have to construct your HTML with an eye towards testability. For example, to test pagination, you might need to add a class or id specifying that this is the pagination section and that these pages link to pagination things.

0

Sex as cause of carpal tunnel syndrome

February 25, 2010
Tags:

Via Suzanne, who writes "this is bad news for computer scientists".

A new paper in Medical Hypotheses journal posits that carpal tunnel syndrome can be caused by sexual intercourse. From the abstract:

It is proposed that carpal tunnel syndrome can develop during sexual intercourse when the hands become repeatedly extended while under pressure from the weight of the upper body. Of the eight risk factors associated with non-occupational carpal tunnel syndrome, age, marital status, pregnancy and use of hormonal agents can be explained by changes in the frequency of sexual intercourse. On the other hand, obesity, macromastia and large chest circumference can be explained by the increased pressure imposed on the wrists by the heavier upper body associated with such conditions. The bilaterality of carpal tunnel syndrome can be explained by the fact that both hands are needed to support the upper body during sexual intercourse. A parallel decrease in the frequency of sexual intercourse and the incidence of carpal tunnel syndrome between the sixth and the seventh decades of life suggests a possible cause and effect relationship between sexual intercourse and carpal tunnel syndrome.

Also: if you do push-ups, you might invest in getting some push-up bars. See also JWZ’s experiences with his wrists.

0

How To Safely Store a Password

February 16, 2010

Thanks Adam — how to safely store a password.

Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt. Use bcrypt.

Good to know!

Comments Off

TCP weirdness, IMAP, wireshark, and perdition

February 10, 2010

Seen on Planet Debian: a nice writeup of a debugging session with a user watching over his shoulder.

One thing to note about user empowerment: Fred isn’t a tech geek, but he can be curious about the technology he relies on if the situation is right. He was with me through the whole process, didn’t get antsy, and never tried to get me to "just fix it" while he did something else. I like that, and wish i got to have that kind of interaction more (though i certainly don’t begrudge people the time if they do need to get other things done). I was nervous about breaking out wireshark and scaring him off with it, but it turned out it actually was a good conversation starter about what was actually happening on the network, and how IP and TCP traffic worked.

Comments Off

USGS Earthquake Facts and Statistics

February 7, 2010
Tags: ,

Gus mentioned to me that the USGS collects earthquake data. Among other things, they will tell you the last earthquake in New York (or any other state) and show you a seismic hazard map of New York (or any other state if you follow the link from their by-state index). However, in trying to find a "last five or ten earthquakes in New York" feed, I stumbled on the Earthquake Facts and Statistics page, which contains this gem:

We detect, but generally do not locate, about 50 mine blasts (explosions) throughout the United States on any given business day. These blasts typically occur between noon and 6 PM local time Monday through Saturday. Of these, about one event every two days is large enough that we compute a location for the blast and post it to a separate explosions listing.

(See a map here.)

You guys! You bunch of crazy scientists.

Comments Off

LCA: Static analysis with GCC plugins

February 7, 2010

Seen on LWN: a fascinating article about static analysis done using GCC plugins.

There are a few interesting plugins in the works. One of them is the LLVM compiler, which can be plugged in to perform the back-end functions for GCC. Another is milepost, which uses a brute-force approach to figure out the optimal settings of the command-line flags for a specific body of code. Then, there are "the hydras," which are Taras’s work. These plugins take an interesting approach, in that the actual analysis work is done in JavaScript scripts. The idea was originally seen as amusing – "wouldn’t it be fun to put Spidermonkey into GCC?" – but it has actually worked out well. JavaScript is a relatively nice, concise language which makes it easy to implement the needed capabilities.

Comments Off

Joey Hess: started termcasting

February 4, 2010

Seen on Planet Debian: Apparently there’s a thing called termcasting, and some people are doing it.

I’ve hooked one of my laptop’s terminals up to the net, so anyone with IPv6 can telnet in and see it.

I’ve long wanted to be able to broadcast my terminal sessions on occasions when it makes sense. Like when I’m fixing someone’s bug, or closely collaborating with someone distant.

Comments Off

Hottest Heads of State

January 22, 2010

Thanks Mike for bringing this to my attention: Hottest Heads of State list. Top of the list?

http://travelogue.betacantrips.com/wp-content/uploads/2010/01/wpid-ukraine-tymoshenk.gif

Yulia Tymoshenko Prime Minister of Ukraine

Obama is #15. Putin in a wifebeater is #24. There are 217 heads of state listed.

Comments Off

Misa Digital Guitar makes your Rock Band Peripherals feel inadequate

January 22, 2010

Seen on LWN: a look at a Linux-based guitar.

OK, so not only am I suffering from a terrible case of gadget lust, but I find fascinating some of the comments like this one:

actually all it does is make it easier for talentless people to claim how good they are at playing guitar, when they aren’t playing at all. get a real guitar if you’re serious or go back to the guitar hero b/s.

I think it’s an interesting idea that because an instrument isn’t "real" guitar, then it doesn’t count. Clearly a game like Guitar Hero is different from a real guitar — the Rock Band instruments are all simplified versions of the real thing. But the idea that you don’t have any skill as a musician because your instrument is in a nontraditional form seems a little untenable..

Comments Off