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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
//#define _SVID_SOURCE | |
//#define __USE_BSD | |
#include <dirent.h> | |
typedef struct Vector{ |
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 <stdarg.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
char* | |
vstrf(char* format,va_list aq){ | |
int n; | |
int buflen=64; | |
char* buf=malloc(sizeof(char)*buflen); | |
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
Before calling loadWorkbook, call following command. | |
> .jcall("org.apache.poi.hssf.record.crypto.Biff8EncryptionKey","V","setCurrentUserPassword","password") |
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 sort(int* v,int l){ | |
if(l<=1) return; | |
int d[l],b=0,e=l; | |
memcpy(d,v,l*sizeof(int)); | |
for(int i=l-1;i>=0;i--) | |
if(d[i]<=d[0]) v[b++]=d[i]; | |
else v[--e]=d[i]; | |
sort(v,b-1); sort(v+b,l-e); | |
} |
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 OverloadedStrings #-} | |
import Data.Aeson | |
import qualified Data.Text as T | |
import qualified Data.ByteString.Char8 as B | |
import qualified Data.ByteString.Lazy.Char8 as L | |
import Network.HTTP | |
import Network.HTTP.Base | |
import Network.URI | |
import Control.Applicative | |
import Control.Monad |
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 Debug.Trace | |
--dat=[1,3,5,0,2,4] | |
--dat=[10,9,8,7,6,5] | |
--dat=[39,88,67,5,69,87,82,64,58,61] | |
dat=[2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,18,17,20,19,22,21,24,23,26,25,28,27,30,29,32,31,34,33,36,35,38,37,40,39,42,41,44,43,46,45,48,47,50,49] | |
--dat=[10,20,11,12] | |
--tr v = trace (show v) v |
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
dat' n =replicate n [0..(n-1)] | |
qvalid=all (\v -> case v of | |
[] -> False | |
_ -> True) | |
qdrop:: Int->[[Int]]->[[Int]] | |
qdrop pos board= | |
let b=zip [1..] board |
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 Debug.Trace | |
import Control.Monad | |
import qualified Data.Map as M | |
import qualified Data.Set as S | |
--tr a b = trace (a++show b) b | |
tr a b = b | |
flat=foldl (++) [] | |
board=S.fromList $ flat $ map (\a -> map (\b -> (a,b)) [0..7]) [0..7] |
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 TypeSynonymInstances #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
import Control.Monad | |
import qualified Data.Map as M | |
import qualified Data.List as L | |
import qualified Data.Set as S | |
data Disk= | |
White | |
| Black deriving (Read,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
cmd/run-inst.hs:40:12: | |
Couldn't match type `TerminateInstances' with `RunInstances' | |
When using functional dependencies to combine | |
Transaction TerminateInstances Value, | |
arising from the dependency `a -> r' | |
in the instance declaration in `Aws.Ec2.Commands.TerminateInstances' | |
Transaction RunInstances Value, | |
arising from a use of `simpleAws' at cmd/run-inst.hs:40:12-24 | |
In the expression: | |
simpleAws cfg (QueryAPIConfiguration $ B.pack region) |
OlderNewer