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
node_child_process.cc | |
16:extern char **environ; | |
229: // Save environ in the case that we get it clobbered | |
231: char **save_our_env = environ; | |
268: environ = env; | |
277: // Restore environment. | |
278: environ = save_our_env; | |
node.js | |
63: // Set the environ variable NODE_MODULE_CONTEXT=1 to make node load all |
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
template <class TFunc> | |
auto map(const TFunc &f) -> FList<decltype(f(_Ty()))>* | |
{ | |
auto temp = new FList<decltype(f(_Ty()))>(); | |
for (auto i = begin(); i != end(); i++) | |
temp->push_back(f(*i)); | |
return temp; | |
} |
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> | |
template <typename TList, typename TFunc> | |
void forEach(const TList& list, const TFunc& fn) { | |
for (auto it = list.begin(); it != list.end(); ++it) | |
fn(*it); | |
} | |
int main() | |
{ |
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
int main(int argc, const char *argv[]) | |
{ | |
if (argc != 2) { | |
printf("Usage: xml_test <filename>\n"); | |
return 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
#IfWinActive SmoothDraw | |
1::SelectColor(0) | |
2::SelectColor(1) | |
3::SelectColor(2) | |
4::SelectColor(3) | |
5::SelectColor(4) | |
6::SelectColor(5) |
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
rInt :: String -> Int | |
rInt = read | |
count :: String -> Int | |
count [] = 1 | |
count (a:[]) = 1 | |
count (a:b:c) = count (b:c) + twice | |
where | |
twice = if isValid (a:b:[]) then count c else 0 | |
isValid s = (rInt s) < 27 |
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 Data.Maybe | |
type Point = (Int, Int) | |
data Line = Line Point Point | |
deriving (Eq, Show, Ord) | |
fx (Line (n, _) _) = n | |
fy (Line (_, n) _) = 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
main() { | |
var a = map(Char, [78, 111, 119, 32, 72, 105, 113, 105, 110, 103, 0]); | |
println(Type(a)); | |
println(a); | |
} | |
> Array[Char, 11] | |
> Now Hiring |
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
procedure fact; | |
overload fact(static 0) = 1; | |
[n | n > 0] | |
overload fact(static n) = fact(static n - 1) * n; | |
main() { | |
var x = fact(static 4); // == 24, calculated at compile time | |
} |
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
############################### | |
gcd(a, b) = if (b == 0) a else gcd(b, a % b); | |
----------------------------------^ | |
main() { | |
############################### | |
rational.clay(2,34): error: type propagation failed due to recursion without base case | |
compilation context: |
OlderNewer