This file contains hidden or 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 Fastrclient(object): | |
""" Creates a connection object and manages all communication | |
with the server.""" | |
def __init__(self, addr="localhost", port=4168): | |
self.clientsock = s.socket(s.AF_INET,s.SOCK_DGRAM) | |
self.addr = (addr,port) | |
self.count = 0 | |
self.count_l = threading.Lock() | |
This file contains hidden or 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
post_list = blobs_from_db | |
interested_in_formatting_posts = some_list1 | |
interested_in_formatting_the_page = some_list2 | |
# when modules are loaded they add methods to whatever "interest" lists they want | |
def format_posts(): | |
for element in post_list: # list of text blobs from database | |
for formatter in interested_in_posts: | |
element = formatter(element) |
This file contains hidden or 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
// Sample army storage for Ressel:Arena | |
#include <iostream> | |
#include <list> | |
#include <string> | |
using namespace std; | |
// Setting up the Node data structure, in this case a clone of "soldier" | |
// From the Ressel:Arena game.. |
This file contains hidden or 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
type Callback m a = [String] -> CommandLineT m a | |
type CallbackList m a = Map.Map String (Callback m a) | |
type Environment = Map.Map String String | |
data CommandState m a = CS { registry :: Environment | |
, callbacks :: CallbackList m a | |
} | |
newtype CommandLineT m a = CommandLine (StateT (CommandState m a) (InputT m) a) |
This file contains hidden or 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
{-# OPTIONS_GHC -fglasgow-exts #-} | |
module System.Console.CommandLine where | |
import System.Console.Haskeline | |
import Control.Monad.Trans (lift, MonadTrans) | |
import Control.Monad.State | |
import Control.Applicative | |
import qualified Data.Map as Map |
This file contains hidden or 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
--- | |
- Card: | |
name: Lumber Mill | |
type: Structure | |
cost: free | |
abilities: | |
- Produce: (L) | |
defense: 4 | |
unit_slots: 1 | |
- Card: |
This file contains hidden or 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
for file in ./bad*; do ./dj-lex ${file} > /dev/null; if ["$?" != "0"]; then echo "lex error on ${file}"; fi; done |
This file contains hidden or 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
-- | |
-- xmonad example config file. | |
-- | |
-- A template showing all available configuration hooks, | |
-- and how to override the defaults in your own xmonad.hs conf file. | |
-- | |
-- Normally, you'd only override those defaults you care about. | |
-- | |
import XMonad |
This file contains hidden or 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
import turtle as T | |
from random import randint | |
def spiral(linefun, incr=4, angle=30, iterations = 30): | |
for i in xrange(0,iterations): | |
linefun(i*incr) | |
T.left(angle) | |
def regular_line(length): | |
T.forward(length) |
This file contains hidden or 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
habitue@chompy ~/b/libtasn1 $ makepkg PKGBUILD | |
==> Making package: lib32-libtasn1 2.8-2 (Fri Mar 11 02:14:09 EST 2011) | |
==> Checking Runtime Dependencies... | |
==> Checking Buildtime Dependencies... | |
==> Retrieving Sources... | |
-> Downloading libtasn1-2.8.tar.gz... | |
--2011-03-11 02:14:09-- ftp://ftp.gnu.org/gnu/libtasn1/libtasn1-2.8.tar.gz | |
=> “libtasn1-2.8.tar.gz.part” | |
Resolving ftp.gnu.org... 140.186.70.20 | |
Connecting to ftp.gnu.org|140.186.70.20|:21... connected. |
OlderNewer