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
class InsertQuery | |
def initialize(model_class, column_names, returning = nil) | |
@model_class = model_class | |
@column_names = column_names | |
@returning = returning | |
@rows = [] | |
@executed = false | |
end |
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
import bdb | |
# This is a custom debugger that calls the specified handler on each function | |
# call. | |
class _CallTracerBdb(bdb.Bdb): | |
def __init__(self, call_handler, return_handler): | |
bdb.Bdb.__init__(self) | |
self._call_handler = call_handler | |
self._return_handler = return_handler |
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
class Sudoku | |
SIZE = 9 | |
NUMBERS = (1..9).to_a | |
def initialize | |
@board = Array.new(SIZE) { Array.new(SIZE, nil) } | |
end | |
def [](x, y) | |
@board[y][x] |
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
CFLAGS=-lm -lnetpbm | |
clifford: clifford.c |