Skip to content

Instantly share code, notes, and snippets.

<span about="#ethanol"
xmlns:chem="http://www.blueobelisk.org/chemistryblogs/">
<span property="chem:smiles">CCO</span>
</span>
<?xml version='1.0' encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0'
>
<xsl:param name="layout">ref</xsl:param>
<!--
Author:
@baoilleach
baoilleach / kinect.py
Created January 15, 2011 16:01
This file makes Jens happy because it allows Avogadro to be controlled by kinect...almost
import os
from PyQt4.QtCore import *
from PyQt4.QtGui import *
##import sys
##sys.path.append("C:\\Python26\\Lib\\site-packages")
##sys.path.append("C:\\Python26\\lib")
import Avogadro as avo
@axiomsofchoice
axiomsofchoice / Jmol.java
Created January 17, 2011 00:41
Hacked Kinect Version of Jmol
package org.openscience.jmol.app;
import java.awt.Point;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import javax.swing.JFrame;
import javax.vecmath.Vector3f;
import org.openscience.jmol.app.jmolpanel.*;
@axiomsofchoice
axiomsofchoice / OSC_TestServer.java
Created January 17, 2011 00:44
Test OSC server for the Jmol Kinect #pmrhack Emits a test signal - useful if you don't actually have a Kinect
package com.foo;
import java.net.SocketException;
import java.net.UnknownHostException;
import javax.vecmath.Vector3f;
import com.illposed.osc.OSCMessage;
import com.illposed.osc.OSCPortOut;
@baoilleach
baoilleach / Jmol.java
Created February 4, 2011 16:27
Rotate X axis onto Hand axis
/* $RCSfile$
* $Author: hansonr $
* $Date: 2009-07-01 00:58:33 +0100 (Wed, 01 Jul 2009) $
* $Revision: 11158 $
*
* Copyright (C) 2000-2005 The Jmol Development Team
*
* Contact: jmol-developers@lists.sf.net
*
* This library is free software; you can redistribute it and/or
@axiomsofchoice
axiomsofchoice / moire-ball.svg
Created March 19, 2011 00:22
Using a mask and animation to demonstrate Moire patterns
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@axiomsofchoice
axiomsofchoice / seq.hs
Created March 22, 2011 23:38
A brute-force attempt to test a few examples for the "sequence" puzzle
let primes = [2,3,5,7] in let mult (x,y) = x*y in let {f 0 ls = ls ; fn ls = map mult (zip primes (f (n-1) ls)) } in f 3 primes
@axiomsofchoice
axiomsofchoice / binarysearch.py
Created April 18, 2011 15:29
An attempt at Jon Bently's binary search algorithm challenge from his book "Programming Pearls"
"""
An implementation of binary search, based on the challanges in the following blog posts:
http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html
http://reprog.wordpress.com/2010/04/19/are-you-one-of-the-10-percent/
http://www.solipsys.co.uk/new/BinarySearchReconsidered.html?tw
This was not my first attempt however, there was a broken version (of course)
that I wrote prior to running it for the first time. Sadly I didn't take a
snapshot before I fixed it but the bug was fairly major; although I'd worked
@shellac
shellac / dbpedia-load
Created April 18, 2011 15:42
Loading some of dbpedia locally
$ curl -O http://openjena.org/repo-dev/com/hp/hpl/jena/tdb/0.8.10-SNAPSHOT/tdb-0.8.10-20110325.114138-12.zip
...
$ unzip tdb-0.8.10-20110325.114138-12.zip
...
$ export TDBROOT=TDB-0.8.10-SNAPSHOT
$ PATH=$TDBROOT/bin:$PATH
$ curl -O http://downloads.dbpedia.org/3.6/en/external_links_en.nt.bz2
$ curl -O http://downloads.dbpedia.org/3.6/en/article_categories_en.nt.bz2
$ curl -O http://downloads.dbpedia.org/3.6/en/homepages_en.nt.bz2
$ bzcat *.bz2 | tdbloader2 --loc DBpedia /dev/stdin