Skip to content

Instantly share code, notes, and snippets.

View jagd's full-sized avatar

C. Wu jagd

  • Germany
View GitHub Profile
#!/usr/bin/perl
#
# Script to calibrate the measured result
#
# Author: wuchuanren@gmail.com
# Date: 01.Jun. 2013
#
use strict;
@jagd
jagd / feko.vim
Created April 4, 2011 12:16
.vimrc patch for editfeko / prefeko (*.pre) syntax highlight
"" feko
autocmd BufNewFile,BufRead *.pre set filetype=feko
autocmd filetype feko call Feko()
function! Feko()
"" Syntax Highlight
set syntax=feko
@jagd
jagd / gist:805782
Created February 1, 2011 12:13
Miller-Rabin in Haskell
{-
x^(n-1) % n == 1
k == n-1 == d*(2^m)
und
a^d % n == (1 || n-1)
oder irgendeine
a^(d * (2^i)) % n == n-1
davon, i = 1, 2, 3 ... m
-}
@jagd
jagd / gist:804850
Created January 31, 2011 21:29
Miller-Rabin in C for uint32_t
int MillerRabin(uint32_t a, int n)
{
/* x^(n-1) % n == 1 */
/* k == n-1 == d*(2^m) */
/* davon :
* a^d % n == 1
* oder
* a^(d * (2^i)) % n == n-1
* davon, i = 1, 2, 3 ...