This file contains 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
#! /usr/bin/env perl | |
use strict; | |
use warnings; | |
my $program = <<'EOP'; | |
#! /usr/bin/env perl | |
use strict; | |
use warnings; |
This file contains 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
puts ([["daan", "v", "berkel", "1980"],["gmail", "com"]].map {|e| e.join(".")}).join("@") |
This file contains 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
"""Lyndon.py | |
Algorithms on strings and sequences based on Lyndon words. | |
David Eppstein, October 2011.""" | |
import unittest | |
from Eratosthenes import MoebiusFunction | |
def LengthLimitedLyndonWords(s,n): | |
"""Generate nonempty Lyndon words of length <= n over an s-symbol alphabet. | |
The words are generated in lexicographic order, using an algorithm from |
This file contains 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
p := 7; batchSize := 10; | |
for index in [1..batchSize] do | |
p := NextPrime(p); | |
phi := EulerPhi(p); | |
factors := Factorization(phi); | |
primitiveCount := EulerPhi(phi); | |
printf "%o, %o, %o\n", p, factors, primitiveCount; | |
end for; |
This file contains 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
bits := 32; batchSize := 100; | |
p := -1; maxQ := -1; | |
for i in [1..batchSize] do | |
p := RandomPrime(bits); | |
phi := EulerPhi(p); | |
factors := Factorization(phi); | |
q, _ := Max([factor[1] : factor in factors]); | |
primitiveCount := EulerPhi(phi); | |
if (q gt maxQ) then | |
maxQ := q; |
This file contains 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
bits := 32; batchSize := 100; | |
maxQ := -1; | |
for index in [1..batchSize] do | |
q := RandomPrime(bits - 1); | |
if q gt maxQ and IsPrime(2*q + 1) then | |
maxQ := q; | |
print 2*q + 1, q; | |
end if; | |
end for; |
This file contains 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
#! /usr/bin/env bash | |
# This script downloads the Android SDK. | |
# It depends on the following | |
# | |
# * curl | |
# * tar | |
BASE_DIR=`pwd` |
This file contains 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
package nl.tdd.enigma; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class Reflector { | |
private final Map<String, String> reflections = new HashMap<String, String>(); | |
{ |
This file contains 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
/* | |
RegisterDisplay.cpp - Library for 74HC545 controlled 7-segment display | |
Created by Daan van Berkel, May 30, 2012. | |
Released into the public domain. | |
*/ | |
#include "Arduino.h" | |
#include "RegisterDisplay.h" | |
RegisterDisplay::RegisterDisplay(int numberOfSegments, int clockPin, int latchPin, int dataPin) { |
This file contains 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
/rrand { rand 16#7FFFFFFF div } def |
OlderNewer