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
function CheckIPString(Str,inCouldBeEmpty) | |
{ | |
if (Str == "") return inCouldBeEmpty; | |
var regExpIP = new RegExp("^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$"); | |
if (!regExpIP.test(Str)) return false; | |
var ipArray = Str.split("."); | |
for (var i = 0; i < 4; i++) { | |
if ((Math.floor(ipArray[i]) < 0) || (Math.floor(ipArray[i]) > 247)) return false; | |
} |
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 <stdint.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <stdbool.h> | |
#include <math.h> | |
#define CLOCKTYPE CLOCK_MONOTONIC | |
uint64_t* sieve_of_atkin_f(uint64_t 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
leading_zero_strip = $(shell echo $$(echo $(1) | sed 's/^0*//')) | |
__plus = $(shell echo $$(($(1) + $(2)))) | |
plus = $(call __plus,$(call leading_zero_strip,$(1)),$(call leading_zero_strip,$(2))) | |
__minus = $(shell echo $$(($(1) - $(2)))) | |
minus = $(call __minus,$(call leading_zero_strip,$(1)),$(call leading_zero_strip,$(2))) | |
__mult = $(shell echo $$(($(1) * $(2)))) | |
mult = $(call __mult,$(call leading_zero_strip,$(1)),$(call leading_zero_strip,$(2))) |
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
su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm' |
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
Traceback (most recent call last): | |
File "./plot.py", line 116, in <module> | |
plot_planes(s) | |
File "./plot.py", line 75, in plot_planes | |
P.tricontour(x, y, fl, [0.5], colors='black') | |
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 3090, in tricontour | |
ret = ax.tricontour(*args, **kwargs) | |
File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 8922, in tricontour | |
return mtri.tricontour(self, *args, **kwargs) | |
File "/usr/lib/pymodules/python2.7/matplotlib/tri/tricontour.py", line 280, in tricontour |
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
data = N.loadtxt(filename) | |
x = 100*data[:, xidx] | |
y = 100*data[:, yidx] | |
fl = data[:, flidx] | |
asp = 4.5/(xlim[1] - xlim[0]) | |
P.figure(figsize=(8, 8*asp)) | |
P.clf() | |
P.tricontour(x, y, fl, [0.5], colors='black') |
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
from scipy.spatial import Delaunay | |
from matplotlib.tri import Triangulation | |
data = N.loadtxt(filename) | |
x = 100*data[:, xidx] | |
y = 100*data[:, yidx] | |
pts = N.column_stack((x, y)) | |
tri = Delaunay(pts) | |
mtri = Triangulation(x, y, tri.simplices.copy()) |
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$ |
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
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 |