I hereby claim:
- I am dalelane on github.
- I am dalelane (https://keybase.io/dalelane) on keybase.
- I have a public key whose fingerprint is 0950 6D8F 8321 BEC7 CD01 8CF5 4872 0994 FE4A ECD8
To claim this, I am signing this object:
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/'); |
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); |
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){ |
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; |
I hereby claim:
To claim this, I am signing this object:
# Converting roman numerals into numbers | |
# | |
# A homework helper by Dale and Grace Lane | |
# 1-Nov-2014 | |
# | |
# http://dalelane.co.uk/blog/?p=3244 | |
# | |
# some simple helper functions to make |
{ entities: | |
[ { type: 'PERSON', | |
class: 'SPC', | |
level: 'NAM', | |
mentions: | |
[ { mtype: 'NAM', | |
role: 'PERSON', | |
class: 'SPC', | |
text: 'Dale Lane', | |
location: { begin: 0, end: 8, 'head-begin': 0, 'head-end': 8 } }, |
/** | |
* Downloads the contents of a news story, then use the | |
* Watson Relationship Extraction service to identify | |
* the names of all the people mentioned in the story. | |
* | |
* @author Dale Lane | |
*/ | |
var async = require('async'); | |
var unfluff = require('unfluff'); |
# Get these from Bluemix and set as environment variables | |
# $BLUEMIX_WATSON_MACHTRANS_USER | |
# $BLUEMIX_WATSON_MACHTRANS_PASS | |
# $BLUEMIX_WATSON_MACHTRANS_URL | |
export FORMAT="rt=text" # or json or xml | |
export LANG_FROM="enus" | |
export LANG_TO="frfr" |
Inspired by https://medium.com/@samim/obama-rnn-machine-generated-political-speeches-c8abd18a2ea0 I tried training a recurrent neural network (RNN) for myself.
I exported every tweet I've ever posted as @dalelane, and used that as the training text. The idea was to see whether it would generate new tweets that looked like they could be things that I had written.
This is just a first quick attempt, with no attempts to tweak or tune the generation of the training model, or modify any other settings.
This is the kind of thing it's currently outputting: