Skip to content

Instantly share code, notes, and snippets.

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.UrgencyHook
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
main = do
mysql> select * from ringers order by last_name;
+-----+------------+--------------+---------------+
| id | first_name | middle_names | last_name |
+-----+------------+--------------+---------------+
| 129 | Joanna | M | Ainsworth |
| 166 | Rachel | C | Aland |
| 29 | Terry | M | Astill |
| 161 | Guy | W | Atchison |
| 114 | Nigel | J | Bailey |
| 26 | Roger | D | Bailey |
mysql> select ringer_performances.credit, concat_ws(' ',ringers.first_name, ringers.middle_names, ringers.last_name) as name from ringer_performances, ringers where ringers.id = ringer_performances.ringer_id and ascii(ringers.middle_names) != 0 having credit != name;
+-------------------------+-----------------------+
| credit | name |
+-------------------------+-----------------------+
| Nicholas W. Jones | Nicholas W Jones |
| Mark A. S. Jones | Mark A S Jones |
| Peter J. Bennett | Peter J Bennett |
| Andrew J. Graham | Andrew J Graham |
| Richard S. J. Saddleton | Richard S J Saddleton |
| James R. S. Sawle | James R S Sawle |
@IgnoredAmbience
IgnoredAmbience / gist:836139
Created February 20, 2011 17:38
RBST dumpStructure
void RBST::dumpStructure() {
dumpStructure(m_head, 0);
cout << endl;
}
void RBST::dumpStructure(RBSTNode* target, int d) {
cout << endl;
for (int i = 0; i < d; i++) {
cout << ' ';
}
@IgnoredAmbience
IgnoredAmbience / aggregate.awk
Created March 8, 2011 12:51
Condor Stuff for Prolog AI Coursework
{
played[$1, $2] += $3
blue[$1, $2] += $4
red[$1, $2] += $5
draw[$1, $2] += $6
moves[$1, $2] += $7
if(mmin[$1,$2] == 0) mmin[$1,$2] = 999
mmin[$1, $2] = ($8 < mmin[$1, $2] ? $8 : mmin[$1, $2])
mmax[$1, $2] = ($9 > mmax[$1, $2] ? $9 : mmax[$1, $2])
time[$1, $2] += $10
@IgnoredAmbience
IgnoredAmbience / Points.csv
Created September 14, 2011 08:40
Routeing Guide
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 4 columns, instead of 3. in line 1.
Abbey Wood,,Charlton,Slade Green
Aber,,Cardiff Central
Abercynon,,Pontypridd
Aberdare,,Pontypridd
ABERDEEN,Routeing Point
Aberdour,,Inverkeithing Group,Kirkcaldy Group
Aberdovey,,Machynlleth Group
Abererch,,Machynlleth Group
Abergavenny,,Hereford,Newport (S.Wales)
Abergele & Pensn,,Shotton
@IgnoredAmbience
IgnoredAmbience / CW2Queries.sql
Created December 8, 2011 02:46
Aren't these lovely little(!) queries? Thought not...
/* To see all columns defined */
SELECT tables.table_name, column_name, data_type, is_nullable FROM information_schema.tables JOIN information_schema.columns ON information_schema.tables.table_name=information_schema.columns.table_name ORDER BY tables.table_name, ordinal_position;
/* To list primary keys */
SELECT table_constraints.constraint_name, table_constraints.table_name, column_name FROM information_schema.table_constraints JOIN information_schema.key_column_usage ON table_constraints.constraint_name=key_column_usage.constraint_name WHERE constraint_type='PRIMARY KEY' ORDER BY table_name;
/* To list foreign keys */
SELECT foreign_key.constraint_name, foreign_key.table_name AS fk_table, fk_column_usage.column_name AS fk_column, primary_key.table_name AS pk_table, pk_column_usage.column_name AS pk_column FROM information_schema.table_constraints AS foreign_key JOIN information_schema.key_column_usage AS fk_column_usage ON foreign_key.constraint_name=fk_column_usage.constraint_name JOIN information_sche
def test_1597508139407119806
result = object = LinkedList.new
assert_instance_of LinkedList, result
assert_equal #<LinkedList:0x000000024c9b98 @item=nil, @next=nil>, result
end
Method 'inspect' called with arguments [] and no block. Returns '<Mock Object>'
def test_1112482470919012214
result = object = LinkedList.new(SPLATS::Mock)
assert_instance_of LinkedList, result
assert_equal #<LinkedList:0x000000024c8c20 @item=<Mock Object>, @next=nil>, result
@IgnoredAmbience
IgnoredAmbience / test.rb
Created December 27, 2011 18:24
lib/test.rb
load 'splats.rb'
load '../samples/SimpleTest.rb'
load '../samples/LinkedList.rb'
def test(c, t)
g = SPLATS::Generator.new(c, t)
g.test_class do |t|
p t
end
end
@IgnoredAmbience
IgnoredAmbience / LinkedListTestOutput.rb
Created January 5, 2012 15:41
The core of the test output, (not created with teh cli)
def test_365841417240653195
result = object = LinkedList.new
assert_instance_of LinkedList, result
end
def test_2024363897907211119
result = object = LinkedList.new(nil)
assert_instance_of LinkedList, result
end
def test_3572475628101917877
mock0 = MiniTest::Mock.new