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
| export(A=3399714628553118047); a(n)=parsum(k=0, 10^n, isprime(k^2+k+A)); | |
| default(threadsizemax,1000*10^6); \\ default 8MB was too small | |
| # | |
| print(a(11)); |
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
| a(n)=parsum(k=0, 10^n, isprime(k^2 + k + 41)); | |
| default(threadsizemax,1000*10^6); \\ default 8MB was too small | |
| # | |
| print(a(11)); |
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
| a(n)=parsum(k=1, 10^n, isprime(k^2+(k+1)^2)); | |
| default(threadsizemax,100*10^6); \\ default 8MB was too small | |
| # | |
| print(a(11)); |
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 | |
| nsockets=$(grep "physical id" /proc/cpuinfo | sort -u | wc -l) | |
| for((i=0; i<nsockets; ++i)) | |
| do | |
| coretemp=$(sensors -A | sed -n "/^coretemp-isa-000$i/,/^$/p") | |
| echo "$coretemp" | grep "Package" | sort | |
| high=$(echo "$coretemp" | grep "Core" | cut -b17- | grep high | sort -n) | |
| ts=$( | |
| ( | |
| echo "$high" | sort -n | head -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
| /* NOLINT(legal/copyright) | |
| f=parallel_dfs_bfs_evenly | |
| g++ $f.cc -O3 -Wall -pedantic -Wextra -fopenmp -o $f | |
| cpplint $f.cc | |
| cppcheck --enable=all --suppress=missingIncludeSystem $f.cc --check-config | |
| */ | |
| #include <string.h> | |
| #include <omp.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
| // NOLINT(legal/copyright) | |
| // g++ pi.cc -lgmp -lgmpxx -O3 -Wall -pedantic -Wextra -o pi | |
| // (cpplinted and cppchecked) | |
| // | |
| #include <time.h> | |
| #include <math.h> | |
| #include <gmpxx.h> | |
| #include <assert.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
| // NOLINT(legal/copyright) | |
| // g++ par.cc -O3 -Wall -pedantic -Wextra -o par -fopenmp | |
| // (cpplinted and cppchecked) | |
| // | |
| #include <string.h> | |
| #include <iostream> | |
| #include <cassert> | |
| #include <tuple> | |
| #include <queue> |
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
| "use strict" | |
| const jscad = require('@jscad/modeling') | |
| const math = require('mathjs') | |
| const { extrudeLinear } = jscad.extrusions | |
| const { hullChain } = jscad.hulls | |
| const { circle } = jscad.primitives | |
| const { vectorText } = jscad.text | |
| const { scale, translate } = jscad.transforms |
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 Karim Belabas, corresponds to GP nfeltdivrem() | |
| \\ https://pari.math.u-bordeaux.fr/archives/pari-users-2511/msg00054.html | |
| \\ | |
| gimod(w, z) = my(q = round(w / z)); w - q*z; | |
| gidivrem(w,z) = my(q = round(w / z)); [q, w - q*z]; |
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
| \\ verify that 𝔽₄ = ({0,1,a,b}, matrix +, matrix *) is a field | |
| \\ | |
| assert(b,s="")={if(!(b),error(Str(s)))}; | |
| F4 = { [[0,0; \\ 0 | |
| 0,0], | |
| [1,0; \\ 1 | |
| 0,1], | |
| [0,1; \\ a | |
| 1,1], |
NewerOlder