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
require 'router' | |
use Rack::CommonLogger | |
use Rack::ShowExceptions | |
use Rack::Lint | |
use Rack::Static, :urls => ["/static"] | |
run Router.new |
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
(ns parse.core | |
(:require [instaparse.core :as insta])) | |
(def parser | |
(insta/parser | |
"sexp = lparen operation rparen | |
<lparen> = <'('> | |
<rparen> = <')'> | |
operation = operator + args | |
operator = '+' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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 literatePrimes; | |
import java.util.ArrayList; | |
public class PrimeGenerator2 { | |
/** | |
* Computes the first prime numbers; the return value contains the | |
* computed primes, in increasing order of size. | |
* @param n |
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 com.hollandandbarrett.tpl.literatePrimes; | |
public class PrimeGenerator3 { | |
private static int[] primes; | |
private static int[] primeMultiples; | |
private static int lastRelevantMultiple; | |
private static int primesFound; | |
private static int candidate; | |
// Lovely little algorithm that finds primes by predicting |