Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
{ | |
"vhosts" : { | |
"test1.domain.com" : { "directory" : "/Users/mikeal/Documents/tmp" } | |
, "test2.domain.com" : { "proxy_pass" : { "port":8888, "host":"localhost" } } | |
} | |
, "locations" : { | |
"/test1" : { "directory" : "/Users/mikeal/Documents/tmp" } | |
, "/test2" : { "proxy_pass" : { "port":8888, "host":"localhost" } } | |
} | |
, "http_port" : 8080 |
{-# LANGUAGE PackageImports #-} | |
{- | |
You need to register your Twitter application at <http://dev.twitter.com/> | |
to get the consumer key and secret needed for OAuth. When connecting to | |
Twitter for the first time, do this: | |
let consumer = Consumer "consumer key" "consumer secret" | |
token <- authenticate |
import Control.Exception | |
import Control.Monad | |
import Control.Monad.IO.Class | |
import Data.ByteString.Lazy (ByteString) | |
import Data.ByteString.Lazy.UTF8 (toString) | |
import Data.Function | |
import Data.Enumerator | |
import Data.List | |
import Data.Maybe |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
"""Test docopt example. | |
Usage: | |
myopt.py run (update|watch) | |
myopt.py -h | --help | |
myopt.py --version |
Currently, Snap and Yesod are the two most active web frameworks for Haskell. In this document, I compare the template languages used by those frameworks for generating HTML.
Both template languages let programmers write markup directly in a markup language rather than generating it from within Haskell. Compared with static HMTL, template languages support substitution to dynamically determine parts of the content of the generated page.
[Heist] and [Hamlet] support different constructs to generate content dynamically. They also differ regarding their syntax for static content.
So I recently got one of these: http://elitekeyboards.com/products.php?sub=topre_keyboards,rf104&pid=yk2100 and promised to review it after a few days. It's now been a few weeks so I'm ready. I've been using a standard Realforce 104 before this.
Like all Realforce keyboards (aside from the Type Heaven which I haven't tried) this thing is built like a tank.
module FizzBuzzC | |
%default total | |
-- Dependently typed FizzBuzz, constructively | |
-- A number is fizzy if it is evenly divisible by 3 | |
data Fizzy : Nat -> Type where | |
ZeroFizzy : Fizzy 0 | |
Fizz : Fizzy n -> Fizzy (3 + n) |
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |