Skip to content

Instantly share code, notes, and snippets.

View thomwiggers's full-sized avatar

Thom Wiggers thomwiggers

View GitHub Profile
vraagZet :: Bord -> IO Int
vraagZet bord = do
putStrLn "Waar wilt u een steen plaatsen?"
putStrLn (showBord bord)
putStr "Op rij: "
hFlush stdout
x <- getLine
return $ read x
01:31 < TheGuyOfDoom> * ,
01:31 < TheGuyOfDoom> _/^\_
01:31 < TheGuyOfDoom> < >
01:31 < TheGuyOfDoom> * /.-.\ *
01:31 < TheGuyOfDoom> * `/&\` *
01:31 < TheGuyOfDoom> ,@.*;@,
01:31 < TheGuyOfDoom> /_o.I %_\ *
01:31 < TheGuyOfDoom> * (`'--:o(_@;
01:31 < TheGuyOfDoom> /`;--.,__ `') *
01:31 < TheGuyOfDoom> ;@`o % O,*`'`&\
$Header = 'Comments left on requests you made' . ($IncludeVoted ? ' or voted on' : '');
Kamer** leesKamers (std::ifstream& file)
{
int aantal;
file >> aantal;
Kamer **kamers;
kamers = new Kamer*[aantal];
for (int i = 0; i < aantal; i++)
{
bool eind;
0 0 nee
0 1 ja
0 6 help
1 2 ja
1 1 nee
1 6 help
2 3 ja
2 11 nee
2 6 help
3 4 ja
/**
* Maakt gebruik van het feit dat shorts 16bit zijn
*
*
* @param left
* @param right
* @return a size 3 byte array containing, when concatenated, (left << 12) |
* right
*/
public static Byte[] compressBytes(final short left, final short right){
<?php
$msgarray = <<<MSG
I threw a wish in the well,
Don't ask me,
I'll never tell
I looked to you as it fell,
And now you're in my way
I'd trade my soul for a wish,
Pennies and dimes for a kiss
I wasn't looking for this,
import simplejson, urllib, urllib2, cookielib, time, math
def conn(link, parameters):
f = cookie.open(link, parameters)
data = f.read()
f.close()
return data
def get(link):
f = cookie.open(link)
@thomwiggers
thomwiggers / gist:6160221
Created August 5, 2013 22:34
mox testing
(twobot)thom@Lethe ~/git $ python -m unittest aeolus.irclib.test.server
F
======================================================================
FAIL: testConnectEasy (aeolus.irclib.test.server.Server)
Tests connecting to a server
----------------------------------------------------------------------
Traceback (most recent call last):
File "aeolus/irclib/test/server.py", line 38, in testConnectEasy
self.mox.VerifyAll()
File "/home/thom/pythonenvs/twobot/local/lib/python2.7/site-packages/mox.py", line 286, in VerifyAll
import unittest
import socket
import mox
from aeolus.irclib.server import Connection
class Server(unittest.TestCase):
def setUp(self):
"""Initialises mocking objects"""
self.mox = mox.Mox()