I Will Do It By Hand One More Time

If you catch yourself saying this about a task for the third time, it is time to write a script for it. My contribution for today: when I want to process a large amount of photos my workflow usually starts with sorting through the contents of my SD cards and deleting the pictures with which I am not happy. If you are working on a rather dated computer as mine, having the corresponding RAW files in the same folder will cause you a headache with most picture viewers, especially when you try to flip through the files quickly. Moving them to a separate folder, however, will make you do the work twice. The following PurgeRaw script fixes this problem:

[code lang=”perl”]
#!/usr/bin/perl -w
use strict;

print “Searching for RAW files without matching JPG preview…\n”;

my @jpgs = glob(“*.jpg *.JPG”);
@jpgs or die “There are no preview JPGs in this directory.”;

my @raws = glob(“NEF/*.NEF RAW/*.NEF”);
@raws or die “There are no RAWs we could purge.”;

foreach (@jpgs) {
$_ =~ s/\..*//;
}

my @toDelete;
my $raw;
foreach (@raws) {
$raw = $_;
$_ =~ s/\..*//;
$_ =~ s/^.*\///;
if(!($_ ~~ @jpgs)){
push(@toDelete, $raw);
}
}

if(@toDelete){
print “Looks like we should delte the following RAW files:\n”;
foreach(@toDelete){print $_ . “\n”;}

print “Proceed with deleting? (Y/N): “;
my $answer = ;
chomp($answer);

if($answer eq “Y”){
print “Deleting…”;
foreach my $file ( @toDelete ) {
unlink $file or warn “Could not delete $file: $!”;
}
}
elsif($answer eq “N”){
print “Aborting without deleting anything.”;
}
else{
print “Wrong input – aborting without deleting anything.”;
}
}
else{
print “Did not find any RAW files eligible to be deleted.”
}
[/code]

This is obviously far from being anything sophisticated, but it does the job. If needed, you can grab the code from my github repository, that is also where I will add the next scripts when I catch myself counting to three again.

Google Health Retires

Google just announced the forthcoming end of their personally controlled health care record Google Health due to lack of widespread adoption. We have been working with the service since its launch in 2008 and used it as a back-end for various projects (most recently for a medication reconciliation tool tied to the SMART platform). Google Health was offering a very decent user interface, a fair amount of API support and some really good interfacing ideas; I hate to see this one go.

[UPDATE] You might deduct how important the project was in the end from the fact that it was not even worth a shutdown announcement for itself.

Cloud Computing and Software as Service in BMI

I gave the following presentation during a set of BMI related talks; it covers the cornerstones of cloud computing development and explores potential application fields in BMI.

It was created using Prezi, a neat little tool that allows you to break out of the power point cage. I am not entirely familiar with it (you will see some fairly uninspired slide clones in there), but the response of the audience was overall very positive, so I would recommend it.