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 python2 | |
'''Quick and dirty script for executing reql from the commandline''' | |
import json | |
import argparse | |
import rethinkdb as r | |
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
# Examples: | |
# | |
# from qcombinator import q | |
# q.add(3) # is equivalent to: (lambda doc: doc.add(3)) | |
# q.add(3).eq(4) -> (lambda doc: doc + 3 == 4) | |
# q.add(3).eq(4).or_('Dang!') -> (lambda doc: r.or_(doc + 3 == 4, 'Dang!')) | |
# q(3) -> r.expr(3) | |
# r.table('A').map(q.obj('ok')) -> r.table('A').map(lambda doc: {'ok': doc}) | |
import sys |
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
{ | |
"name": "Marmaduke", | |
"breed": "Mastif", | |
"jumping_height": 0.5, | |
"color": "brown", | |
} | |
def make_dog(name, breed, jumping_height, color='brown'): | |
return { | |
"name": name, |
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 Dog(object): | |
def __init__(self): | |
self.dict_ = {} | |
self.__dict__ | |
def add(self, name, breed): | |
self.dict_[name] = breed | |
def __repr__(self): |
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
fn main() { | |
let mut rows = [[ 1, 2, 3, 4], | |
[ 5, 6, 7, 8], | |
[ 9,10,11,12], | |
[13,14,15,16]]; | |
for i in range(0, 4u) { | |
for j in range(0, 3u) { | |
/// Here's what I'd like to do |
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
rustc --out-dir lib -L tmp src/term.rs && touch tmp/built | |
src/info/curses.rs:40:1: 40:12 error: macro definitions are not stable enough for use and are subject to change | |
src/info/curses.rs:40 macro_rules! def_escape( | |
^~~~~~~~~~~ | |
src/info/curses.rs:40:1: 40:12 note: add #[feature(macro_rules)] to the crate attributes to enable | |
src/info/curses.rs:40 macro_rules! def_escape( | |
^~~~~~~~~~~ | |
src/info/builtin.rs:711:1: 711:12 error: macro definitions are not stable enough for use and are subject to change | |
src/info/builtin.rs:711 macro_rules! def_escape( | |
^~~~~~~~~~~ |
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
#![feature(macro_rules)] | |
extern crate libc; | |
use libc::{c_char, c_int, c_long}; | |
#[link_name = "curses"] | |
extern { | |
fn setupterm (term: *c_char, fd: c_int, errret: *c_int) -> c_int; | |
fn tigetstr (s: *c_char) -> *c_char; | |
fn tparm (s: *c_char, |
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
Made an actual github repo for wiki/issues etc. Please see here: | |
https://github.com/deontologician/netezza_sqlalchemy |
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
{-# LANGUAGE TypeOperators, GADTs, StandaloneDeriving #-} | |
{-# OPTIONS_GHC -Wall #-} | |
import Prelude hiding(True, False, Bool, Eq) | |
data Z = Z | |
data S n = S n | |
data Nat n where | |
Zero :: Nat Z |
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
from datetime import datetime, timedelta | |
from sqlalchemy import * | |
from sqlalchemy.orm import * | |
from sqlalchemy.ext.declarative import declarative_base | |
Base = declarative_base() | |
class Version(Base): |