Skip to content

Instantly share code, notes, and snippets.

View StoneCypher's full-sized avatar

John Haugeland StoneCypher

View GitHub Profile
14> io:format("~p~n",[Sols]).
[[1,2,6,4,7,8,3,5,9],
[1,2,6,4,7,8,5,3,9],
[1,3,2,4,5,8,7,9,6],
[1,3,2,4,5,8,9,7,6],
[1,3,2,9,5,6,4,7,8],
[1,3,2,9,5,6,7,4,8],
[1,3,4,7,6,5,2,9,8],
[1,3,4,7,6,5,9,2,8],
[1,3,6,2,7,9,4,5,8],
// at which point we no longer need choices as a lookup list
// might as well collapse the assignment of choice into an initialization too
function checkAnswer() {
'use strict';
var choice = document.choiceform.choices.value;
if (choice === undefined) {
mysql> create table ulog(userid integer, ltype integer);
Query OK, 0 rows affected (0.05 sec)
mysql> insert into ulog values(1,1), (1,2), (2,1), (2,3), (3,1), (4,1), (4,1), (4,1), (4,2), (4,1), (1,2);
Query OK, 11 rows affected (0.01 sec)
Records: 11 Duplicates: 0 Warnings: 0
mysql> select userid, ltype, count(ltype) from ulog group by userid, ltype;
+--------+-------+--------------+
| userid | ltype | count(ltype) |
<!doctype html>
<html>
<body onkeyup="window.alert('yep');"></body>
</html>
<!doctype html>
<html>
<head>
<!-- import react, jquery, your controls -->
<script type="text/jsx">
var pollTime = 5000, // milliseconds
lastHit = new date().getTime() - pollTime;
function poll() { $.ajax({...}); }
<!doctype html>
<html>
<head>
<style type="text/css">
table, td { font-family: inconsolata, consolas, monospace; }
</style>
</head>
<body>
start
= w:(die _)* { return w.map(function(X) { return X[0] }); }
number
= [0-9]
nonzero
= [1-9]
// http://pegjs.org/online
start = basic*
basic = (w:sentence . ws q:quote ws e:expl ws? nl) { return { word: w, quote: q, expl: e }; }
quote = qt (s:sentence) qt { return s; }
expl = phrase
// http://pegjs.org/online
start = basic*
basic = (w:sentence . ws q:quote ws e:expl ws? nl) { return { word: w, quote: q, expl: e }; }
quote = qt (s:sentence) qt { return s; }
expl = phrase
Adopt. "He adopted a disguise." One may adopt a child, or an opinion, but a disguise is assumed.
All of. "He gave all of his property." The words are contradictory: an entire thing cannot be of itself.