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 | |
plist_path=`find . -type f -iname *.plist -d 2` | |
build=`git rev-parse --short HEAD` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $build" $plist_path |
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
APORT3 EQU 03FD0H | |
BPORT3 EQU 03FD2H | |
CPORT3 EQU 03FD4H | |
CNT3 EQU 03FD6H | |
FND EQU 03FF0H | |
IR_WR EQU 0FFC1H | |
IR_RD EQU 0FFC3H | |
DR_WR EQU 0FFC5H | |
RAME EQU 0EFFFH | |
FLAG EQU RAME-0FFFH |
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
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
CGEventMask eventMask = CGEventMaskBit(kCGEventKeyDown); | |
CFMachPortRef eventTap = CGEventTapCreate(kCGHIDEventTap, | |
kCGHeadInsertEventTap, | |
kCGEventTapOptionDefault, | |
eventMask, | |
eventHandler, | |
NULL); | |
CFRunLoopSourceRef runLoopSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventTap, 0); |
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
module DFA | |
( DFA (..) | |
, trans | |
, run | |
, accept | |
) where | |
import qualified Data.Map as Map | |
import qualified Data.Set as Set | |
import Data.Maybe |
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
-- define data type | |
data Tree a = EmptyTree | Node a (Tree a, Tree a) deriving (Show, Read, Eq) | |
-- create single node | |
treeNode :: a -> Tree a | |
treeNode item = Node item (EmptyTree, EmptyTree) | |
-- covert from/to list | |
treeFromList :: (Ord a) => [a] -> Tree a | |
treeFromList items = foldr treeInsert EmptyTree $ reverse items |
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 | |
bubbleSort :: (Ord a) => [a] -> [a] | |
bubbleSort [] = [] | |
bubbleSort (first:[]) = first:[] | |
bubbleSort (first:remains) = | |
if first < smallest | |
then first:(bubbleSort bubbledRemains) | |
else smallest:(bubbleSort (first:(tail bubbledRemains))) | |
where bubbledRemains = bubbleSort remains |
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
split :: (Eq a) => [a] -> [a] -> [[a]] | |
split _ [] = [[]] | |
split sep (list_head:list_tail) = | |
if list_head `elem` sep | |
then []:splited_tail | |
else (list_head:(head splited_tail)):(tail splited_tail) | |
where splited_tail = split sep list_tail | |
main = do | |
putStr (show (split " " "this is a book")) |