Skip to navigation

Round corners using nothing but CSS

July 12th, 2007

The titlebar of this blog has round corners thanks to the Spiffy Corners method.

Getting around the Penn library proxy to post directly to CiteULike

July 11th, 2007

As I wrote before, one of the few problems with CiteULike is that I cannot post an article with the CiteULike Bookmarklet if I’m accessing a journal via a library proxy server (that’s practically all the time). The CiteULike FAQ give the tip of using Greasemonkey to get around the proxy server problem.

I’ve finally started to look into this and wrote my first Greasemonkey user script. So far, this just works for a single journal. What it does: When I’m browsing the Journal of Behavioral Decision Making (JBDM) via the Penn library proxy server and click on the link to an abstract of an article, the greasemonkey script takes me to the abstract directly on the JBDM website. Once that has loaded, I can then click on my “Post to CiteULike” bookmark and the article gets posted. To get back to browsing JBDM via the Penn proxy, I have to use the dropdown menu of the Firefox back button and navigate a few steps back, to the page before I first loaded the abstract.

I hope to add a few more journals and then post the whole script online for download. I might also try to replace the URL that the abstract link on the Penn proxy JBDM site links to. I’m sure JavaScript can do that, but I don’t have time to figure it out right now.

In the meantime, this is what it looks like:

// ==UserScript==
// @name           PennJBDMabstract2JBDMabstract
// @namespace
// @description    Goes from penn proxy JBDM abstract to outside abstract
// @include*
// ==/UserScript==

var proxy = new RegExp("\/cgi-bin\/abstract");
var direct = "";
document.location.href=document.location.href.replace(proxy,direct) ;


The script above seems to work not just for JBDM, but for all journals from Wiley Interscience.

Here’s one for journals from Blackwell Synergy:

// ==UserScript==
// @name           blackwell synergy
// @namespace
// @include*
// ==/UserScript==

var proxy = new RegExp("");
var direct = "";

R: Combine two matrices column by column

July 9th, 2007

I have two matrices. I want to combine these, alternatingly picking the next column from a and from b.

> a <- matrix(c(rep(c(1:3),each=4)),4)
> a
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    1    2    3
[3,]    1    2    3
[4,]    1    2    3
> b <- matrix(c(rep(c(4:6),each=4)),4)
> b
     [,1] [,2] [,3]
[1,]    4    5    6
[2,]    4    5    6
[3,]    4    5    6
[4,]    4    5    6
> matrix(rbind(a,b),4)
     [,1] [,2] [,3] [,4] [,5] [,6]
[1,]    1    4    2    5    3    6
[2,]    1    4    2    5    3    6
[3,]    1    4    2    5    3    6
[4,]    1    4    2    5    3    6

Importing mysql database from the commandline

July 4th, 2007

I’ll be moving this blog to a different host (unfortunately, because it isn’t easy to get German ISPs to change the DNS settings, I will also move it to the domain at the same time). I can export the database using phpmyadmin, but on the new server I’ll have to import them from the commandline. These instructions should be all that’s needed.

Switching e-mail “From:” line on the fly in mutt

June 27th, 2007

Having trouble reconciling your multiple e-mail personalities? Mutt’s reply-hook and send2-hook are your friends for most cases. For switching on the fly, I use Trevor Parson’s method of defining macros in the .muttrc.