Oh, something wasn't right when I wrote my first little game at age eight - I was going to figure this computer thing out quick and move along as usual. So many software-years later - sixteen of them professional, and eight of those in startups - I suppose I must admit defeat on that "quick" part. But as the next wave of programmers enter the arena, and I see them face some of the same problems (think, "Oh, man, don't do that again") and many new and different ones ("Wow, that was cool") I feel I can still do good in the world.
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
module CachingImageDB ( | |
CachingImageDB, | |
openCachingImageDB, | |
ImageSizeType, | |
storeImage, | |
lookupImage, |
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
require 'yaml' | |
class Tumbledry | |
attr_accessor :patterns | |
def initialize | |
File.open('repetative.txt', 'r') do |f| | |
@data = f.read() | |
end | |
self.patterns = {} | |
@numpat = 1 | |
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
#include <boost/foreach.hpp> | |
#include <cassert> | |
#include <map> | |
#include <set> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
static bool pattern_matches_file(string const& pattern, string const& file) { | |
// Build an NFA recognizer (currently only supports '*' and '?') |
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
augroup Kiwi | |
au! | |
autocmd BufNewFile,BufRead *Spec.m,*Spec.mm set foldmethod=expr foldexpr=KiwiFoldLevel(v:lnum) | |
augroup END | |
function! KiwiFoldLevel(lnum) | |
let line=getline(a:lnum) | |
if line=~'^\s\s*\(context\|describe\|it\)\s*(' | |
return ">" . (indent(a:lnum) / (&sts ? &sts : &ts)) | |
elseif line=~'^\s\s*});\s*$' && getline(a:lnum+1)!~'^\s*$' |
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
function! RunBuildCommand(cmd) | |
let l:BuildLog = "build/vim.log" | |
if bufname("%") != "" | |
silent write | |
endif | |
echo "Building... " | |
let l:StartTime = reltime() | |
exec "silent !" . a:cmd . " >" . l:BuildLog . " 2>&1" |
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
It is by caffeine alone that I set my mind in motion. It is by the beans of Java that thoughts | |
acquire speed, that hands acquire shaking, the shaking becomes a warning. |
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
map <leader>xt :call RunKiwiSpecs()<CR> | |
map <leader>xb :call Build()<CR> | |
augroup cprog | |
au! | |
autocmd BufNewFile,BufRead * set formatoptions=tcql nocindent comments& | |
autocmd BufNewFile,BufRead *.c,*.cc,*.cpp,*.hh,*.hpp,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,:// sts=4 sw=4 et | |
augroup 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
% A comment starts with '%' | |
123 -42 0 0xffff 0xDEAD 0b111101 % Numeric literals | |
"Hello, World!\r\n\t" % String literals | |
true false % Boolean literals | |
[ 2 3 4 ] % List of integers | |
printf + * / - on? % Names | |
-> % Naming operator | |
<- % Non-executing value-of operator |
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
#!/usr/bin/env csi -ss | |
(use test) | |
(use srfi-1) | |
(define (compute-bowling-score input) | |
(define (pins-knocked-down input-offset) | |
(case (string-ref input input-offset) | |
((#\X) 10) | |
((#\-) 0) | |
((#\/) |
OlderNewer