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
| ulReplace :: String -> String | |
| ulReplace ('_':'_':'_':'_':xs) = "1111" ++ xs | |
| ulReplace (x:xs) = x :(replace xs) | |
| ulReplace x = x |
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
| #include <stdio.h> | |
| typedef void (*ft) (const char *); | |
| ft f; | |
| void print1(const char *a) { | |
| printf("#1 -> %s\n", a); | |
| } | |
| void print2(const char *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
| #include <stack> | |
| #include <cstdio> | |
| class Dummy | |
| { | |
| public: | |
| void Release() | |
| { | |
| printf("remove: %p\n", this); | |
| } |
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
| /* | |
| 个人主页升级提示 | |
| */ | |
| div[abc="lxjts"] { display:none } | |
| div.profile_guide {display:none} | |
| /* | |
| 回顾微博点滴 | |
| */ | |
| div[class="WB_right_tips S_line2"] {display:none} |
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
| #include <stdio.h> | |
| typedef int (*callable)(); | |
| typedef struct | |
| { | |
| callable f; | |
| } call_st; |
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 Data.List | |
| import Data.List.Split | |
| strToTable raw = map (splitOn ",") rawRowList where | |
| rawRowList = splitOn "\n" raw | |
| tableToStr table = strJoin "\n" rawRowList where | |
| rawRowList = map (strJoin ",") table | |
| strJoin :: String -> [String] -> String |
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
| #include <cstdio> | |
| void print3arg(int a, int b, int c) | |
| { | |
| printf("a=%d, b=%d, c=%d\n", a, b, c); | |
| } | |
| void print2arg(int a, int b) | |
| { | |
| printf("A=%d, B=%d\n", a, b); |
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
| -- plz refer to http://stackoverflow.com/questions/4273413/y-combinator-in-haskell | |
| newtype Mu a = Mu (Mu a -> a) | |
| y f = (\h -> h $ Mu h) (\x -> f. (\(Mu g) -> g) x $ x) | |
| fakePower self n = if n == 0 | |
| then 1 | |
| else n*self(n-1) | |
| truePower = y fakePower |
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
| List2D := Object clone | |
| List2D dim := method(x, y, | |
| target := list() | |
| fillStrategy := "const" | |
| default := call evalArgAt(2) | |
| if(default type == "Block", fillStrategy := "func") | |
| for(i, 1, y, | |
| subTarget := list() |
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 scala.io.Source | |
| def getUserInputWhere(inputHint: ()=>Unit, cond: String=>Boolean) = { | |
| Stream.continually[String]( { | |
| inputHint() | |
| readLine() | |
| }).find( l => l == null || cond(l)).get | |
| } | |
| getUserInputWhere( |