Tuesday, October 28, 2008
mmcinit causes reboot on beagleboard
mmcinit causes a beagleboard to reboot if it can't draw enough power. I had this problem when powering the beagleboard over USB from a unpowered hub. Plugging directly in to the PC solved the problem.
Thursday, October 9, 2008
last.fm-ripper: Undefined argument in option spec
I couldn't get last.fm-ripper to work, it kept giving the error "Undefined argument in option spec". I commented out a bunch of stuff then it worked again, watevar! Here are the random changes I made:
I don't know perl I don't want to know perl.
GetOptions(
#'help|?' => \$help,
# 'debug|d' => \$debug,
# 'no_covers|n' => $no_covers,
'artist|a=s' => \$artist,
'username|u=s' => \$username,
'password|p=s' => \$password,
'output_dir|o=s' => \$output_directory#,
#'aws_token|w=s' => \$aws_token
);
I don't know perl I don't want to know perl.
Saturday, September 20, 2008
Grab a set of tile images from an Illumina/Solexa run folder
This script copies a set of images for a single tile in an illumina runfolder and creates another runfolder containing just that image set. It's useful if you want to grab an image set to process it later, or save a representative sample.
Example:
./grabtile /staging/IL18/outgoing/080910_IL18_1380 4 100 $HOME/1380_4_100
#!/bin/bash
SOURCE=$1
LANE=$2
TILE=$3
DESTINATION=$4
echo Source : $SOURCE
echo Lane : $LANE
echo Tile : $TILE
echo Destination: $DESTINATION
mkdir $DESTINATION
mkdir $DESTINATION/Images
mkdir $DESTINATION/Images/L00$LANE
cd $SOURCE/Images/L00$LANE
find . -type d -exec mkdir $DESTINATION/Images/L00$LANE/{} \;
for ((CYCLE=1; CYCLE<=100; CYCLE++))
do
find ./C$CYCLE.1/ -name s_$LANE\_$TILE\_* -exec cp {} $DESTINATION/Images/L00$LANE/{} \;
done
Example:
./grabtile /staging/IL18/outgoing/080910_IL18_1380 4 100 $HOME/1380_4_100
Thursday, September 18, 2008
How do you get subversion to post directly to a blog?
I'm being proactive here.
Anybody care to weigh in? The simplest way to me would seem to be to setup an email hook and get it to email your blog directly (I guess it will depend on your blog software), blogspot for example supports sending to a special email address which gets automagically posted to the blog. It's not very secure but it would work.
[09:47] < nobodycares> can you create a hook into svn so that it tracks commits and
publishes the comments somewhere like a blog?
[09:47] < new> yes
[09:47] < new> easy way would be to get the svn to email in to the blog
[09:47] < nobodycares> I'm thinking that instead of a lab notebook you could have a blog of the svn
[09:47] < nobodycares> commit messages
[09:48] < nobodycares> how easy is it?
[09:48] < new> you can publish straight from an email address with, for example, blogspot
[09:48] < new> so you'd just tell the svn hook to mail that address
[09:48] < new> and it should all work
[09:48] < new> setting up a svn hook to send an email is easy
[09:48] < new> you need to have the MTA or whatever on your computer setup correctly mind
[09:49] < new> on the svn server that is
[09:51] < nobodycares> okay
[09:51] < nobodycares> I'm gonna forget about this. And ask you again in six months or so.
[09:52] < new> ok cool
[09:52] < new> so long as I know.
Anybody care to weigh in? The simplest way to me would seem to be to setup an email hook and get it to email your blog directly (I guess it will depend on your blog software), blogspot for example supports sending to a special email address which gets automagically posted to the blog. It's not very secure but it would work.
Sorting by a different comparison method in C++ (STL)
You have a list of numbers in C++ that you want to sort, but you don't want to sort them in simple numerical order. You might, for example, want to sort them by their deviation from 0. Here's how you do it using the STL:
Bang On!
#include <vector>
#include <iostream>
using namespace std;
class compare_deviation
{
public:
compare_deviation(int d) : deviation(d) {
}
bool operator ()(const int p1,const int p2)
{
int v1 = abs(deviation - p1);
int v2 = abs(deviation - p2);
return(v1 < v2);
}
int deviation;
};
int main() {
vector<int> numbers;
numbers.push_back(1);
numbers.push_back(-10);
numbers.push_back(-9);
numbers.push_back(-5);
numbers.push_back(0);
numbers.push_back(5);
numbers.push_back(6);
numbers.push_back(7);
numbers.push_back(10);
numbers.push_back(11);
compare_deviation comp(0);
cout << "Unsorted numbers: ";
for(vector<int>::iterator i=numbers.begin();i != numbers.end();i++) cout << " " << (*i);
sort(numbers.begin(),numbers.end(),comp);
cout << endl;
cout << "Sorted numbers: ";
for(vector<int>::iterator i=numbers.begin();i != numbers.end();i++) cout << " " << (*i);
cout << endl;
return 1;
}
Bang On!
Thursday, September 11, 2008
Urxvt and other terminal fun
Here's my .Xdefaults for urxvt, it's very simple:
I've also added an alias to clear my scrollback, it's useful in .bashrc:
BBC Micro FTW!
! urxvt*font: xft:Terminus:pixelsize=12
! urxvt*boldFont: xft:Terminus:pixelsize=12
urxvt*font: -*-profont-*-*-*-*-11-*-*-*-*-*-iso8859-*
urxvt*boldFont: -*-profont-*-*-*-*-11-*-*-*-*-*-iso8859-*
URxvt.keysym.M-y: perl:mark-and-yank:activate_mark_mode
URxvt.keysym.M-u: perl:mark-and-yank:activate_mark_url_mode
URxvt.perl-lib: /home/new/.urxvt/
URxvt.perl-ext-common: tabbed,mark-and-yank
URxvt.urlLauncher: firefox
urxvt*borderLess: false
urxvt*externalBorder: 0
urxvt*internalBorder: 2
urxvt*scrollBar: false
urxvt*depth: 32
urxvt*background: rgba:0000/0000/0000/0000
urxvt*foreground: #ffffff
urxvt*cursorColor: #ffff00
urxvt*cursorColor2: #00ffff
urxvt*cursorBlink: true
urxvt*inheritPixmap: false
urxvt*termName: rxvt-unicode
urxvt*saveLines: 65535
urxvt*scrollTtyOutput: true
urxvt*scrollTtyKeypress: true
urxvt*mouseWheelScrollPage: true
urxvt*cutchars: `'",;@&*=|?()<>[]{}
URxvt.urlLauncher: firefox
I've also added an alias to clear my scrollback, it's useful in .bashrc:
alias cls='tput reset'
BBC Micro FTW!
Thursday, August 14, 2008
Adding docs to external jars in eclipse
If you have some external jars, like in my case the GWT libraries and you want to add the handy javadoc to them - its not exactly obvious. You need to navigate on the Package explorer view to the "Referenced Libraries". Unfold this tree, and then right click on the relevant library. Click on properties and then javadoc. Add the directory and click validate just to check. Bingo - now the javadoc will appear using the tooltip in the main editor.
Subscribe to:
Posts (Atom)