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 <string.h> | |
#include <stdlib.h> | |
#define SHA1_SHIFT(word, bit) \ | |
(((word) << (bit)) | ((word) >> (32 - (bit)))) | |
#define F(t, b, c, d, x) \ | |
do { \ | |
if(0 <= t && t <= 19) \ | |
x = (b & c) | ((~b) & d); \ |
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> | |
#include <pthread.h> | |
#include <unistd.h> | |
typedef struct tid { | |
int n; | |
pthread_t *thread; | |
} tid_t; |
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
.SUFFIXES: .erl .beam .yrl | |
.erl.beam: | |
erlc -W +'{parse_transform, smart_exceptions}' $< | |
.yrl.erl: | |
erlc -W +'{parse_transform, smart_exceptions}' $< | |
ERL = erl |
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 <stdlib.h> | |
#include <time.h> | |
#include <stdio.h> | |
#include <iostream> | |
#include <map> | |
#define LEVEL 128 | |
/* | |
* <Skip 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
#include <pthread.h> | |
#include <stdio.h> | |
#include <time.h> | |
void *func(void *param_p) | |
{ | |
int *p = (int *)param_p; | |
printf("## start: %u\n", (unsigned int)pthread_self()); | |
for(int i = 0; i < 100000; i++) { |
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
// name: curve.cpp | |
// compile: $ g++ curve.cpp `pkg-config gtkmm-2.4 --cflags --libs` | |
#include <cairomm/context.h> | |
#include <gtkmm/drawingarea.h> | |
#include <gtkmm/main.h> | |
#include <gtkmm/window.h> | |
#include <gtkmm.h> | |
#include <iostream> |
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 MAX 100000 | |
int main() | |
{ | |
int lis[MAX]; | |
int n = 0; | |
int j = 0; |
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
-module(euclidean). | |
-export([euclidean/2]). | |
euclidean(M, 0) -> M; | |
euclidean(M, N) when M rem N == 0 -> N; | |
euclidean(M, N) -> euclidean(N, M rem N). |
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
-module(heron). | |
-export([heron/3]). | |
heron(A, B, C) -> | |
S = (A + B + C) / 2, | |
math:sqrt(S * (S - A) * (S - B) * (S - C)). |
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 <stdarg.h> | |
void cps(int a, int b, ...) | |
{ | |
void *p; | |
void *m; | |
va_list ap; | |
va_start(ap, b); | |
p = va_arg(ap, void *); |