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> | |
#include <stdlib.h> | |
#define mask(c) (1 << ('z' - c)) | |
#define all (1 << (('z' - 'a') + 2)) - 1//bitmap when all the characters have been seen | |
int contains(char *haystack, char *needle) { | |
int seen = 0; //bitmap of characters we have been seen |
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 foo { | |
public: | |
foo(int) {} | |
foo(const foo&) {} | |
}; | |
int main () { | |
foo b(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(foo(1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))); | |
} |
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
foo foo foo |
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 forever_alone { | |
friend class forever_alone; | |
}; | |
int main() { } | |
Compiled under g++: | |
g++ forever_alone.cc -o forever_alone | |
forever_alone.cc:2: warning: class ‘forever_alone’ is implicitly friends with itself |
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
inline | |
std::string GetVillageOwnerJson(Player p, const std::vector<std::string> &properties) | |
{ | |
json_spirit::Object root; | |
//std::vector< json_spirit::Pair > root; | |
BOOST_FOREACH(std::string f, properties) | |
{ | |
if(IsValidPlayerProperty(f)) | |
{ |
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
r.table(Build.__tablename__).get(build_id).update({'result': r['result'] + line}).run() |
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
r.table(Build.__tablename__).get(build_id).update(lambda row: {'result': row['result'] + line}).run() |
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
Exception in thread "main" java.io.FileNotFoundException: Could not locate leiningen/core/user__init.class or leiningen/core/user.clj on classpath: (protobuf.clj:1) | |
at clojure.lang.Compiler.eval(Compiler.java:5441) | |
at clojure.lang.Compiler.eval(Compiler.java:5416) | |
at clojure.lang.Compiler.load(Compiler.java:5858) | |
at clojure.lang.RT.loadResourceScript(RT.java:340) | |
at clojure.lang.RT.loadResourceScript(RT.java:331) | |
at clojure.lang.RT.load(RT.java:409) | |
at clojure.lang.RT.load(RT.java:381) | |
at clojure.core$load$fn__4519.invoke(core.clj:4915) | |
at clojure.core$load.doInvoke(core.clj:4914) |
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
r.table("table_name").filter(function(score) { | |
return score("scoreboard")("teamPlayerParticipantsStats")("externalizedData").type_of() == "ARRAY" | |
} |
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
def sub_tasks(val, depth): | |
if depth > max_depth: | |
return r.branch(val["tasks"] == 0, [val["priority"]], r.error("depth exceeded")) | |
else: | |
return [val["priority"]] + val["tasks"].concat_map(lambda x: sub_tasks(x, depth + 1)) | |
r.table("tasks").concat_map(lambda x: sub_tasks(x, 0)).reduce(lambda x,y, x + y).run() |
OlderNewer