I hereby claim:
- I am jsp1611 on github.
- I am jpoulton (https://keybase.io/jpoulton) on keybase.
- I have a public key ASD83O5Y8gADmSAG8sdXcnHhwLEUhO5hzVP0hPfw0MUeeQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/** | |
* Remove every other element from an array. | |
* | |
* @author jon | |
*/ | |
public class RemovingElements { | |
public static String[] remove(final String[] arr) { | |
final String[] rem = new String[arr.length % 2 == 0 | |
? arr.length / 2 |
/** | |
* Going to the cinema. | |
* | |
* @author jon | |
*/ | |
public class GoingToTheCinema { | |
public static int movie(final int card, final int ticket, final double perc) { | |
int visits = 0; | |
double systemA = 0; |
import org.w3c.dom.Document; | |
import org.xml.sax.SAXException; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.ParserConfigurationException; | |
import javax.xml.transform.Transformer; | |
import javax.xml.transform.TransformerException; | |
import javax.xml.transform.TransformerFactory; | |
import javax.xml.transform.dom.DOMSource; |
import java.io.IOException; | |
import java.nio.file.*; | |
import java.nio.file.attribute.BasicFileAttributes; | |
import java.util.EnumSet; | |
import static java.nio.file.FileVisitOption.FOLLOW_LINKS; | |
import static java.nio.file.FileVisitResult.CONTINUE; | |
/** | |
* Recursively iterate over a file structure starting at some |
package com.codenumb.vtd; | |
import com.google.common.base.Charsets; | |
import com.google.common.io.Resources; | |
import com.ximpleware.*; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; |
;; Define a function f such that: | |
;; f(n) = n if n<3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n> 3 | |
;; This is the recursive implementation that doesn't scale well | |
(define (f n) | |
(if (< n 3) | |
n | |
(+ (f (- n 1)) | |
(* 2 (f (- n 2))) | |
(* 3 (f (- n 3)))) | |
) |