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
-1.585 * | |
( | |
if (((1.262 * a + 1.262 * b) + -0.000) > 0) | |
then ((1.262 * a + 1.262 * b) + -0.000) | |
else 0 | |
) | |
+ | |
1.303 * |
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> | |
#include <vector> | |
#include <algorithm> | |
class Vertex { | |
public: | |
// Vertex id in vertexes. | |
int id; | |
// Index of vertex begin edge (first). | |
int idx; |
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 <cstdlib> | |
#include <vector> | |
#include <climits> | |
#include <algorithm> | |
#include <iostream> | |
class Computer; | |
class Link { | |
public: |
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
ch := make(chan interface{}) | |
msg := "foo" | |
go func() { | |
x := <- ch | |
if _, ok := x.(string); ok { | |
jlib.JPrint("%s", x.(string)) | |
} | |
close(ch) | |
}() |
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 Main | |
total | |
minusS : (n : Nat) -> (m : Nat) -> LTE m n -> Nat | |
minusS n m x = n - m | |
total | |
decNat : Nat -> Nat | |
decNat k with (isLTE 1 k) | |
decNat k | (Yes prf) = minusS k 1 prf |
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
consumeRPN [] st = last st | |
consumeRPN (x:xs) st | |
| x == "+" = consumeRPN xs (ll ++ [l1 + l2]) | |
| x == "-" = consumeRPN xs (ll ++ [l1 - l2]) | |
| x == "*" = consumeRPN xs (ll ++ [l1 * l2]) | |
| x == "/" = consumeRPN xs (ll ++ [l1 / l2]) | |
| otherwise = consumeRPN xs (st ++ [read x]) | |
where | |
l2 = last st | |
l1 = last $ init st |
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
type count int32 | |
type incrementable interface { | |
Inc() | |
} | |
type countable interface { | |
incrementable | |
Dec() |
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
cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DLLVM_ENABLE_ASSERTIONS:BOOL=ON -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 -DCMAKE_INSTALL_PREFIX:PATH=/usr ../llvm |
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
static double gaussian_noise(double mu, double sigma) { | |
double u1; | |
do { | |
u1 = ((double) lwt_rdrand64()) * (1.0 / (double) UINT64_MAX); | |
} while (u1 <= (DBL_EPSILON)); | |
double u2 = ((double) lwt_rdrand64()) * (1.0 / (double) UINT64_MAX); | |
double z0 = sqrt(-2.0 * log(u1)) * cos((2.0 * M_PI) * u2); | |
return z0 * sigma + mu; | |
} |
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
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json) | |
RETURNS json | |
IMMUTABLE | |
LANGUAGE sql | |
AS $$ | |
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json | |
FROM ( | |
SELECT * FROM json_each(data) | |
UNION ALL | |
SELECT * FROM json_each(insert_data) |
NewerOlder