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
#!/bin/bash | |
CHAIN=SELFCONTROL | |
IPTABLES=/sbin/iptables | |
IP_PATTERN='/^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$/p' | |
usage() { | |
echo "Usage: $0 <IP address or hostname>" | |
exit 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
" OpenFOAM/FreeFOAM | |
autocmd BufRead *.[CH] set expandtab shiftwidth=4 filetype=cpp | |
autocmd BufRead *.[CH] set cindent cinoptions=+s-2,(s,U1,is,g0,Ws,l1,t0 cinkeys=0{,0},0),:,!^F,o,O,e |
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
;; for OpenFOAM | |
(c-add-style "OpenFOAM_HGW" | |
'( | |
(c-basic-offset . 4) | |
(c-tab-always-indent . t) | |
(indent-tabs-mode . nil) | |
(c-comment-only-line-offset . (0 . 0)) | |
(c-indent-comments-syntactically-p . t) | |
(c-block-comments-indent-p nil) | |
(c-cleanup-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
const fvPatchList& patches = mesh.boundary(); | |
forAll(patches, patchi) | |
{ | |
const fvPatch& curPatch = patches[patchi]; | |
if (isType<wallFvPatch>(curPatch)) | |
{ | |
forAll(curPatch, facei) | |
{ | |
label faceCelli = curPatch.faceCells()[facei]; |
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
#PBS -l nodes=1 | |
cd $PBS_O_WORKDIR | |
reconstructPar -case $PBS_O_WORKDIR > $PBS_O_WORKDIR/log.reconstructPar |
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 fact) | |
(define *num-list* '(1 12 123 1234 12345 123456)) | |
(define (factorial n) | |
(define (iter k acc) | |
(if (= k 1) | |
acc | |
(iter (- k 1) (* k acc)))) | |
(iter n 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
#include <stdio.h> | |
#include <string.h> | |
#include <time.h> | |
#include <mach/mach_time.h> | |
#include <gmp.h> | |
void factorial(mpz_t n, mpz_t res) | |
{ | |
mpz_t unit, zero, cnt; | |
mpz_init_set_ui (unit, 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
diff -ru streamFunction/Make/files streamFunctionV/Make/files | |
--- streamFunction/Make/files 2013-06-11 11:33:58.000000000 +0200 | |
+++ streamFunctionV/Make/files 2013-12-17 15:15:36.255538814 +0100 | |
@@ -1,3 +1,3 @@ | |
streamFunction.C | |
-EXE = $(FOAM_APPBIN)/streamFunction | |
+EXE = $(FOAM_USER_APPBIN)/streamFunctionV | |
diff -ru streamFunction/streamFunction.C streamFunctionV/streamFunction.C | |
--- streamFunction/streamFunction.C 2013-06-11 11:33:58.000000000 +0200 |
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 <iostream> | |
#include <ctime> | |
#include <gmpxx.h> | |
typedef mpz_class Integer; | |
Integer N[] = {1, 12, 123, 1234, 12345, 123456}; | |
Integer sum_digits(Integer n); | |
Integer factorial(Integer 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
alexey at daphne in tests$ clang++ gmp_test.cxx -lgmp -lgmpxx -std=c++11 -O3 | |
alexey at daphne in tests$ ./a.out | |
2652733 | |
Execution time: 8394.96 ms | |
alexey at daphne in tests$ |