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
#!/bin/sh | |
while [ -d ../.svn ]; do cd ..; done | |
svn update |
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 <iostream> | |
#include <list> | |
#include <sstream> | |
using namespace std; | |
int to_val(char face) { | |
switch (face) { | |
case 'A': return 14; | |
case 'K': return 13; |
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/runhaskell | |
import Control.Applicative | |
import Data.List | |
import Data.Maybe | |
import qualified Data.Set as S | |
type Board = [[Char]] | |
type Point = (Int, Int) | |
data Direction = N | S | E | W deriving (Eq, Ord) |
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
host unix? | |
hostname %h.csc.calpoly.edu | |
user cjford |
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
balanced :: Int -> Int -> String -> Bool | |
balanced hi _ _ | hi < 0 = False | |
balanced hi lo xs | lo < 0 = balanced hi 0 xs | |
balanced _ lo "" = lo == 0 | |
balanced hi lo ('(':xs) = balanced (hi + 1) (lo + 1) xs | |
balanced hi lo (')':xs) = balanced (hi - 1) (lo - 1) xs | |
balanced hi lo (':':'(':xs) = balanced (hi + 1) lo xs | |
balanced hi lo (':':')':xs) = balanced hi (lo - 1) xs | |
balanced hi lo (_:xs) = balanced hi lo xs |
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
doCase n = do | |
s <- getLine | |
putStrLn $ "Case #" ++ show n ++ ": " | |
main = do | |
n <- getLine | |
mapM_ doCase [1..read n] |
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 <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
int main () { | |
printf("1: %s\n", getenv("PWD")); | |
setenv("PWD", "/etc", 1); | |
printf("2: %s\n", getenv("PWD")); | |
execl("/usr/bin/printenv", "/usr/bin/printenv", "PWD", NULL); | |
} |
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
import Data.List | |
import qualified Data.Map as Map | |
type WordMap = Map.Map String [Int] | |
wordsByLine _ [] = Map.empty | |
wordsByLine n (s:ss) = Map.unionWith (++) (Map.fromList [(w, [n]) | w <- nub $ words s]) | |
(wordsByLine (n + 1) ss) | |
printWords = mapM_ (putStrLn . formatWord) . Map.toList |
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 in your project: | |
// https://developer.mbed.org/teams/ublox/code/C027_Support/ | |
// plus, ONLY when compiling without CELLULAR_NETWORK: | |
// https://developer.mbed.org/users/mbed_official/code/EthernetInterface/ | |
// https://developer.mbed.org/users/mbed_official/code/mbed-rtos/ | |
#include "mbed.h" | |
// ... | |
#define CELLULAR_NETWORK 1 |
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 ExistentialQuantification, ImpredicativeTypes, MultiParamTypeClasses, FlexibleInstances #-} | |
module Topics (topics) where | |
import XMonad | |
import XMonad.StackSet | |
import XMonad.Layout.Grid | |
import XMonad.Layout.PerWorkspace | |
import XMonad.Layout.Tabbed | |
data LayoutBox a = forall l. LayoutClass l a => LB (l a) |