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
/* remove the fixed width from the overall page */ | |
#content { | |
width : auto; | |
margin-left: 15px; | |
margin-right: 15px; | |
} | |
/* use proportion instead of pixels to specify size */ | |
/* of main list and the right info boxes */ | |
#listbox { |
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 alternative to java.lang.Double.parseDouble which isn't synchronised like | |
* the Java implementation is. | |
* | |
* Explanation in http://dalelane.co.uk/blog/?p=2936 | |
* | |
* @author Dale Lane ([email protected]) | |
*/ | |
public class DoubleParser { |
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
# | |
# Create an ICS calendar with the sessions available at a DC Leisure Centre | |
# using the info found by scraping the timetable website | |
# | |
# http://dalelane.co.uk/blog/?p=3017 | |
# | |
# Dale Lane | |
# [email protected] | |
# |
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
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(1337, '127.0.0.1'); | |
console.log('Server running at http://127.0.0.1:1337/'); |
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
var sqlite3 = require('sqlite3').verbose(); | |
var db = new sqlite3.Database(':memory:'); | |
db.serialize(function() { | |
db.run("CREATE TABLE lorem (info TEXT)"); | |
var stmt = db.prepare("INSERT INTO lorem VALUES (?)"); | |
for (var i = 0; i < 10; i++) { | |
stmt.run("Ipsum " + i); | |
} |
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
var sqlite3 = require('sqlite3').verbose(); | |
var db = new sqlite3.Database('data/demodb01'); | |
db.serialize(function() { | |
db.run("CREATE TABLE IF NOT EXISTS demo (runtime REAL)"); | |
db.run("INSERT INTO demo (runtime) VALUES (?)", new Date().getTime()); | |
db.each("SELECT runtime FROM demo", function(err, row) { | |
console.log("This app was run at " + row.runtime); |
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
var express = require('express'); | |
var app = express(); | |
console.log("Registering endpoint: /"); | |
app.get('/', function(req, res){ | |
res.send('hello ROOT world'); | |
}); | |
console.log("Registering endpoint: /stubbed"); | |
app.get('/stubbed', function(req, res){ |
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
var sqlite3 = require('sqlite3').verbose(); | |
var db = new sqlite3.Database('data/demodb02'); | |
db.serialize(function() { | |
db.run("CREATE TABLE IF NOT EXISTS counts (key TEXT, value INTEGER)"); | |
db.run("INSERT INTO counts (key, value) VALUES (?, ?)", "counter", 0); | |
}); | |
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 sandbox; | |
import java.io.ByteArrayInputStream; | |
import java.io.InputStream; | |
import javax.xml.bind.JAXBContext; | |
import javax.xml.bind.JAXBElement; | |
import javax.xml.bind.Unmarshaller; | |
import javax.xml.bind.annotation.XmlAttribute; | |
import javax.xml.bind.annotation.XmlRootElement; |
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 sandbox; | |
import java.io.ByteArrayInputStream; | |
import java.io.InputStream; | |
import javax.xml.bind.JAXBContext; | |
import javax.xml.bind.JAXBElement; | |
import javax.xml.bind.Unmarshaller; | |
import javax.xml.bind.annotation.XmlAttribute; | |
import javax.xml.bind.annotation.XmlRootElement; |
OlderNewer