I hereby claim:
- I am pringley on github.
- I am pringle (https://keybase.io/pringle) on keybase.
- I have a public key ASCNyhQcf8iNgwvmQv-3tE9FQX4cbH4JqJGQRWOPMBohugo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
from itertools import permutations | |
colors = ["Red", "Green", "Ivory", "Yellow", "Blue"] | |
nations = ["England", "Spain", "Ukraine", "Norway", "Japan"] | |
drinks = ["Coffee", "Tea", "Milk", "Orange Juice", "Water"] | |
pets = ["Dog", "Snail", "Fox", "Horse", "Zebra"] | |
smokes = ["Old Gold", "Kool", "Chesterfield", "Lucky Strike", "Parliament"] | |
middle = lambda xs, x: xs[2] == x | |
first = lambda xs, x: xs[0] == x |
import Data.List (permutations, zip5) | |
2 | |
3 main = do | |
4 putStrLn $ head [n | (n, _, _, "Water", _) <- answer] ++ " drinks Water" | |
5 putStrLn $ head [n | (n, _, "Zebra", _, _) <- answer] ++ " has the Zebra" | |
6 putStrLn "\nFull answer:"; mapM_ print answer | |
7 | |
8 where | |
9 colors = ["Red", "Green", "Ivory", "Yellow", "Blue"] | |
10 nations = ["England", "Spain", "Ukraine", "Norway", "Japan"] |
import collections | |
import gmpy | |
from Crypto.Util.number import getPrime | |
PublicKey = collections.namedtuple('PublicKey', ('modulus', 'generator')) | |
Key = collections.namedtuple('_Key', ('modulus', 'generator', 'lambda_', 'mu')) | |
Key.public = lambda self: PublicKey(self.modulus, self.generator) | |
# Generated by atmospheric noise |
#!/usr/bin/env python | |
"""Pandoc filter to add include syntax. | |
Usage:: | |
pandoc --filter ./pandoc-includes.py | |
The Markdown syntax to include documents is as follows: |
#!/usr/bin/env python3 | |
# | |
# Copyright (c) 2013 Ben Pringle | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
Code for this project is available at Pringley/grisbr-concept.
This is a proof-of-concept bridge between Ruby and Python to perform matrix multiplication.
Motivation: The power of a scripting language lies partially in its community-developed libraries. Different languages have different strengths -- for example, Python has excellent numeric and scientific packages that Ruby
" Vim syntax file | |
" Language: Todo file | |
" Maintainer: Ben Pringle | |
" Latest Revision: 11 July 2013 | |
if exists("b:current_syntax") | |
finish | |
endif | |
" Define line types |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
/* | |
* permute() - print all permutations of each bin | |
*/ | |
void permute(std::vector<std::vector<int> > bins); | |
// Helper funtions |
EXECUTABLE=main | |
CC=g++ | |
CXXFLAGS=-Wall | |
SOURCES=$(wildcard *.cpp) | |
OBJECTS=$(SOURCES:.cpp=.o) | |
.PHONY: all test clean | |
all: $(EXECUTABLE) |