Here's a good bash hack for linux 2.6. If there are less jobs in the current shell than cores in the box, then it will background the job. Otherwise it will block.
_count() {
echo $#
}
_num_cpus() {
[ -d /sys/devices/system/cpu/ ] && echo $(_count /sys/devices/system/cpu/*) || echo 1
}
sat() {
local go=0
if [ $(jobs -l | wc -l) -ge $(_num_cpus) ] ; then
while trap '((go++))' SIGCHLD ; sleep 1 ; ((go--)) ; [ $go -eq 0 ] ; do : ; done
fi
$@ &
trap SIGCHLD
}
And here's how I use it.
for i in a b c d ; do sat lzma $i ; done
jack |
posted Mon Jun 2 16:33:46 2008 |
#
category:
Debris
We went to Bainbridge Island for our anniversary. As usual, we took some pictures.
jack |
posted Sun May 6 21:32:45 2007 |
#
category:
outside/other
[jack@needle:~]$ mtn crash N
mtn: misuse: There is no spoon.
jack |
posted Sun Apr 1 11:04:25 2007 |
#
category:
debris
I have recorded reams of data from paddling:
Everything is keyed on time, using the Time::HiRes perl module. Now I just need to test a few hypothesis:
I do not really believe that paddling is that simple, but I'm looking for some well defined problems to brush up on my skills with R
jack |
posted Tue Mar 27 08:43:44 2007 |
updated Tue Mar 27 08:45:53 2007 |
#
category:
outside/paddling
I was listening to Beneath the Mire from Ghost Reveries, and it struck me that the lyrics concisely summed the pathos infused music:
Beneath the mire
drowned desire
jack |
posted Tue Mar 27 08:32:53 2007 |
updated Tue Mar 27 08:46:12 2007 |
#
category:
debris
I have a Sharp SL-C3100 clamshell Zaurus (also known as a spitz), which has a 4GB Hitachi Microdrive in it.
Although I think Microdrives are nifty, they have problems:
So I replaced the 4GiB Microdrive with an 8GiB NAND flash card.
Issues that I ran into
Here's the patch
*** linux-2.6.16/drivers/ide/legacy/ide-cs.c.orig Thu Jan 4 21:10:30 2007
--- linux-2.6.16/drivers/ide/legacy/ide-cs.c Thu Jan 4 21:16:59 2007
***************
*** 413,418 ****
--- 413,419 ----
static struct pcmcia_device_id ide_ids[] = {
PCMCIA_DEVICE_FUNC_ID(4),
PCMCIA_DEVICE_MANF_CARD(0x0007, 0x0000), /* Hitachi */
+ PCMCIA_DEVICE_MANF_CARD(0x000a, 0x0000), /* Unknown */
PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704),
PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401),
PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */
jack |
posted Mon Jan 8 08:33:48 2007 |
updated Tue Mar 27 08:45:43 2007 |
#
category:
debris
On Wednesday, I showed up at practice with my Zaurus, gps, heart rate monitor, and accelerometer.
The new addition to this is the accelerometer, which adds significant resolution to the data. It supports sampling rates up to ~475Hz, but I only had it working at 25Hz (that's how fast it worked reliably with minicom).
As a first pass, I turned everything on and put it in my drybag. I wanted to get a feel for how it all worked.
After practice I loaded up all of the data into R, and set up the data as time series.
A major error source is the correlating of the starting points of the time series. The GPS, and HR monitor are fairly easy to correlate (because they have reasonably accurate clocks onboard). The raw accelerometer output I used didn't timestamp the data. As I was using minicom to capture the accelorometer output, I ended up using the ctime of the minicom capture file. Assuming a capture rate of 25Hz(which it was set to), and the number of samples, I estimated the start time.
I'll write a zaurus application that does this.
A keen observer will note that the accelerometer also isn't calibrated well.
At 25Hz, you can see the individual strokes.
This means it should be possible to systematically analyze what acceleration waveform correlates to the highest hull speed, and thus validate what stroke technique is most efficient.
That, however, is gonna take a schwack of work.
jack |
posted Fri Dec 8 16:30:39 2006 |
updated Fri Dec 8 16:45:28 2006 |
#
category:
outside/paddling
Telus is extending their EVDO network into the US .
I wonder how they are going to sell their rate plans, when the competition is selling a better service (unlimited instead of 250MiB cap) for about half the price .
Maybe they'll be competitive, and Canadian subscribers will have a lever for getting data service for a reasonable price.
jack |
posted Thu Dec 7 13:56:45 2006 |
#
category:
debris
This year, we're getting clubcard to print our annual calendars. However, living in the world of reflected light they accept artwork in CMYK colour space, and not RGB .
This opened up the can of worms that we had mostly been ignorant of before -- colour management. There are lots of resources on the web for how to set up a workflow for colour management.
However, I needed to stitch a pages from different sRGB sources, and convert them to CMYK.
The best way I found to do this was:
* rasterize the images to TIFF in RGB space. I used ghostscript
* get sRGB and CMYK colour profiles from Adobe
* use LCMS (Little Color Management System) to project the images from RGB to CMYK
* compress the resultant tiffs and hand them off
Although ghostscript can rasterize directly to CMYK TIFFs, I was unable to find how to apply a colour profile to the process, and the results were poor.
In the future, I'll just use Scrubus to generate the whole thing directly in CMYK.
jack |
posted Wed Dec 6 13:55:12 2006 |
#
category:
debris
Snow in Vancouver. A very good reason to be far away from a road.
jack |
posted Mon Nov 27 09:15:02 2006 |
updated Wed Jan 10 21:14:19 2007 |
#
category:
debris
A weblog by Jack Cummings