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
package My::Exception; | |
use Moose; | |
use Devel::StackTrace; | |
use overload | |
'""' => sub { shift->message }; | |
has message => ( | |
is => 'ro', | |
isa => 'Str', |
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
diff -r 1190503e3c7d mako/lexer.py | |
--- a/mako/lexer.py Sat Jan 21 18:57:01 2012 -0500 | |
+++ b/mako/lexer.py Tue Jan 31 14:29:30 2012 -0800 | |
@@ -91,31 +91,32 @@ | |
def parse_until_text(self, *text): | |
startpos = self.match_position | |
+ text_re = r'|'.join(text) | |
+ brace_level = 0 | |
while True: |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="http://stuff.veekun.com/reset.css"/> | |
<style type="text/css"> | |
html { | |
height: 100%; | |
} | |
body { | |
display: box; |
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
use strict; | |
use Irssi qw(command_bind MSGLEVEL_HILIGHT); | |
use vars qw($VERSION %IRSSI); | |
# Recommended key bindings: alt+pgup, alt+pgdown: | |
# /bind meta2-5;3~ /scrollback prev | |
# /bind meta2-6;3~ /scrollback next | |
$VERSION = '0.02'; | |
%IRSSI = ( |
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
priority: -- through ++ | |
due date: fall 2012! not sure when yet. get movin bucko | |
THINGS TO REDESIGN/REIMPLEMENT | |
++ pokemon | |
- consider doing something more useful with moves. perhaps only show current gen (or current compatible gens, i.e., 4 and 5), and put the massive table on yet another subpage? | |
++ pokemon flavor | |
- currently wasting a ton of space here, much of it on near-duplicates. need to consolidate like crazy. | |
- show differences between shiny/not, male/female in a more useful manner |
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
use std; | |
import libc::types::common::c95::c_void; | |
import libc::types::os::arch::c95::c_char; | |
import libc::types::os::arch::c95::c_int; | |
type SCREEN = c_void; | |
type WINDOW = c_void; | |
extern mod ncurses { | |
fn initscr() -> *WINDOW; |
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 <assert.h> | |
#include <setjmp.h> | |
#include <signal.h> | |
#include <stdio.h> | |
static jmp_buf _strlen_jump; | |
static void* _strlen_label; | |
static void* _strlen_done_label; | |
static void _strlen_divzero(int signal) { | |
_strlen_label = _strlen_done_label; |
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
extern mod std; | |
use std::map::HashMap; | |
use std::map::Set; | |
use std::map::vec_from_set; | |
enum Choice { | |
Many(Set<int>), | |
One(int), | |
} |
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
trait Context<T> { | |
fn enter() -> T; | |
fn exit(); | |
fn with(block: fn(T)) { | |
block(self.enter()); | |
self.exit(); | |
} | |
} |
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
Some rough edges I have bumbled across. Bearing in mind that I don't do a lot | |
of low-level statically-typed work: | |
- Strings are indexed as `u8`, which is incompatible with `char`. If strings | |
are going to be a first-class type, they should really really REALLY REALLY | |
act as sequences of Unicode codepoints as much as possible, whatever the | |
implications of that may be. A trait for `[u8]` could add some niceties for | |
sequences of meaningless bytes, and `str` could have a method that provides | |
a view to its UTF-8 encoded byte sequence without needing copying etc. (I | |
know, indexing by codepoint is O(n), but there are countermeasures.) |
OlderNewer