This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See http://www.interviewzen.com/interview/3PSvg | |
for i in range(1,101): | |
if i % 15 == 0: | |
print "FizzBuzz" | |
elif i % 3 == 0: | |
print "Fizz" | |
elif i % 5 == 0: | |
print "Buzz" | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Module> | |
<ModulePrefs title="sciverse-gadget" author_email="someone@example.com" description="An example gadget made at Dev8D 2011 for the purpose of testing out SciVerse and maybe entering the challenge."> | |
<Require feature="opensocial-0.9" /> | |
<Require feature="sciverse" /> | |
<Require feature="hub" /> | |
<Require feature="org.jquery.core-1.4.2" /> | |
</ModulePrefs> | |
<Content type="html" view="canvas"><![CDATA[ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Outputs a KML file with locations of certain comments from patientopinion.org.uk | |
Requires an API key to be provided on the command-line | |
""" | |
import urllib2 | |
import re, sys | |
from xml.etree.ElementTree import * | |
# TODO: implement a paging mechanism | |
takeNumber = 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Use content negotiation with a certain DOI to obtain linked data about that resource. | |
See also: | |
http://myemail.constantcontact.com/CrossRef-and-International-DOI-Foundation-Collaborate-on-Linked-Data-Friendly-DOIs.html?soid=1102390657767&aid=eTYx65PAErU | |
http://www.crossref.org/CrossTech/2011/04/content_negotiation_for_crossr.html | |
""" | |
import urllib | |
exampleDOI = 'http://dx.doi.org/10.1126/science.1157784' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -H "Accept: application/sparql-results+xml" "http://localhost:8000/sparql/" --data-urlencode "query=SELECT ?s ?p ?o { ?s ?p ?o . }" |
OlderNewer