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
type Vector3D = (Float, Float, Float) | |
arr :: [ Vector3D ] | |
arr = [ ( 35, 30, 39 ),( 20, 12, 5 ) ] | |
tp :: Vector3D | |
tp = (19,13,3) | |
dist:: Vector3D -> Vector3D -> Float |
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
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
class HardcodedRangeTest { | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) { |
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
interface Command { | |
public void execute(); | |
public static final Command EMPTY = new Command() { | |
@Override | |
public void execute() { | |
// do nothing. | |
} | |
}; | |
} |
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
/** | |
* A functional Graph object in Scala, for learning purposes. | |
*/ | |
class Graph[V,W](val vertices: List[V], val edges: List[(V,V,W)]) { | |
override def toString(): String = vertices.toString() + ", " + edges.toString() | |
def addVertex(v: V): Graph[V,W] = Graph( v :: this.vertices, this.edges ) | |
def addEdge(e: (V,V,W)): Graph[V,W] = Graph(this.vertices, e :: this.edges ) |
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
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(tool-bar-mode nil)) | |
(custom-set-faces | |
;; custom-set-faces was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. |
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
: create-stack | |
dup | |
1 + cells allocate throw dup 0 swap ! | |
over over swap cells erase | |
swap drop | |
; | |
: write-on-top ( address n -- address ) swap dup dup @ 1 + cells + rot swap ! ; | |
: move-cursor ( address n -- address ) over dup @ rot + swap ! ; |
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
#!/bin/bash | |
function check-command { | |
type $1 > /dev/null 2>/dev/null | |
if [ $? -ne 0 ] | |
then | |
(>&2 echo "Command $1 expected, but not found.") | |
(>&2 echo "Please install dependencies: sudo apt-get install sqlite3 jq") | |
exit 1 |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package visitorchallenge; | |
import ast.Exp; | |
import ast.MulExp; | |
import ast.NegExp; |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package visitorchallenge; | |
import ast.Exp; | |
import ast.MulExp; | |
import ast.NegExp; |
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
class LinkedList: | |
def __init__(self, head, tail): | |
self.head = head | |
self.tail = tail | |
def reverse(self): | |
l = self | |
newl = None | |
while l: | |
newl = cons(l.head, newl) |
OlderNewer