Archive for August, 2007

Jeremy Piven is My Hero

0

I saw him a 70s/80s movie with a forehead that stretched all the way to his mid-skull. These days it seems with each movie he does he sprouts more hair.

Jeremy Piven is my hero. Now I just have to find out what his fertilization technique is.

Novel Content Aware Image Resizing Technique

1

Check out this video of a novel method for resizing images while preserving important content. Simple idea, nicely done. Via Wonko.

iPhone As a Full Portable Computing Device?

1

Apparently you can install ssh, python, and even Django on the iPhone (via Simon).

Python has libraries for just about everything you’d want to do (POP, IMAP, SMTP, XPMM, etc), and includes a built in Web server. Python/Django for the backend, HTML/CSS/Javascript for the UI (via the built-in iPhone Web browser) – I think this means you can build any app you want for the iPhone…

Anybody know if the iPhone is accessible from the Web (ie. the iPhone is the server, my laptop is the browser)? Does it have an IP address or other hook to let you see it?

I’m really tempted to get one of these things, if only for the experiments. Who am I kidding though, I don’t have time for the hundred other half-finished projects I’ve started….

Intelligence and Sex

0

Interesting article on the correlation between intelligence (as measured by IQ) and onset and frequency of sexual activity. Via NerdLife.

Depending on the specific age and gender, an adolescent with an IQ of 100 was 1.5 to 5 times more likely to have had intercourse than a teen with a score of 120 or 130. Each additional point of IQ increased the odds of virginity by 2.7% for males and 1.7% for females. But higher IQ had a similar relationship across the entire range of romantic/sexual interactions, decreasing the odds that teens had ever kissed or even held hands with a member of the opposite sex at each age.

Female-Male HIV Transmission: 1 in 5 Million?

1

This article in Psychology Today discusses HIV transmission rates:

According to a study in the Journal of the American Medical Association, men almost never get HIV from women. A healthy man who has unprotected sex with a non drug-using woman has a one in 5 million chance of getting HIV. If he wears a condom, the odds drop to one in 50 million. And though it’s easier for men to infect women, the odds that an HIV-positive man will transmit the virus to a woman through sex are less than one in 1,000.

I looked for the original study but didn’t find it. Does anybody know if these stats are correct?

SQLAlchemy and Elixir Presentation

0

cleverdevil has a nice, concise overview of SQLAlchemy (Python ORM) and Elixir (Active Record style ORM built on top of SQLAlchemy). Take a look.

awk Example

0

This example captures most of the common things I end up doing with awk, so I’m noting it here for future reference:

awk -F, '/00:00:/ { print $3-past, $1, $2, $3; past=$3 }' state9930.rate | sort -n -r > daily.sorted.rate

Which is saying:

  • The field separator is “,” (ie. the input file fields are separated by commas).
  • For each line that matches “00:00:”
    • “$3-past” subtracts the “past” value from the current third field.
    • Print the various fields.
    • After printing, “past” is set to the current third field

Threads Considered Harmful

1

So says Roman Shaposhnik, frequently referencing Edward E. Lee’s “The Problem with Threads“. I largely agree; threads are not a mechanism that can be effectively used by mere mortals, and we are all, after all, mere mortals. The default everything-is-shared setup seems the exact opposite of what’s needed: default of nothing-is-shared-unless-explicitly-declared.

The sweet spot of scalable Web apps these days is multi-process with explicit sharing via shared-memory (eg. memcached) or messaging. I don’t know if there’s a whole lot wrong with that. We may need easier or more integrated mechanisms for invoking and using the shared memory/messaging, but otherwise it’s a nice model – it’s well understood, scales well to multiple CPUs, and is reliable.

I remember a paper from back in grad school (Joe Pasquale’s operating systems class) that delved into the relative overhead of processes versus threads, making the point that the difference is not that large in modern operating systems. Anybody know of the relative overhead of processes versus, say, Java threads in Linux?

I really need to play more with Erlang and company, there may be interesting insights or programming models there…

OpenOffice For Batch Converting PowerPoint to HTML/PDF/etc?

9

I’d like to convert a number of powerpoint presentations to something more friendly for browsing; ideally HTML/jpg or flash, or less ideally PDF. I’m looking for some sort of command line utility to do this in OSX and/or Linux.

OpenOffice seems like a likely candidate – it does a nice job of importing powerpoint, and can print to the formats I’m looking for. I can’t seem to find a command-line oriented way of interacting with it, however.

I know OpenOffice supports APIs for interacting with it, and is accessible via Perl (example here). It also seems there’s a commandline option (-p and -pt) to print files, although I can’t get those to work.

Does anyone know of a way to get OpenOffice to convert Powerpoint files to HTML/Flash/etc via the commandline on a server (no X11)?