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 public final enum LShrubbery; | |
.super Ljava/lang/Enum; | |
.source "Shrubbery.java" | |
# annotations | |
.annotation system Ldalvik/annotation/Signature; | |
value = { | |
"Ljava/lang/Enum", | |
"<", |
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
diff --git i/src/scene.cpp w/src/scene.cpp | |
index 8382ef7..3ef0d1a 100644 | |
--- i/src/scene.cpp | |
+++ w/src/scene.cpp | |
@@ -92,6 +92,9 @@ Color Scene::raytrace(const Ray& camera_ray, int level) const { | |
continue; | |
float int_distance2 = Ray::makeRay(camera_ray.getOrigin(), | |
intersection->getOrigin()).getDir().magnitude2(); | |
+ if (int_distance2 < 1e-6) | |
+ // Too close! We must move forwards a little. |
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/sh | |
# A very simplified version of OSX's say, using festival | |
# Usage: say [words] | |
if [ $# = 0 ] | |
then | |
echo "Usage: `basename $0` [words]" | |
exit 1 | |
fi |
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/sh | |
export PAGER= | |
[ $# -le 1 ] || (echo "Usage: git how [ref]"; exit -1) | |
[ "$1" ] && ref="$1" || ref=HEAD | |
old="$ref@{1}" | |
git rev-parse --short "$old" | tr -d '\n' | |
printf .. | |
git rev-parse --short "$ref" |
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
josh@tortuga:~/repo1$ (master) git ls-files -s | |
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 files | |
160000 8b2785e26ff50203b827a29a590fc4cf8b91fe10 0 repo2 | |
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 stuff | |
josh@tortuga:~/repo1$ (master) (cd repo2; git rev-parse HEAD) | |
8b2785e26ff50203b827a29a590fc4cf8b91fe10 | |
josh@tortuga:~/repo1$ (master) (cd repo2; git commit --allow-empty -m 'Updated repo2') | |
[master 0224058] Updated repo2 | |
josh@tortuga:~/repo1$ (master) git status | |
# On branch master |
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 TumbleDRYer | |
def initialize filename | |
@hash = Hash.new 0 | |
@links = Hash.new 0 | |
previous = nil | |
open(filename).read.scan /\w+|\W+/ do |word| | |
unless previous.nil? | |
@links[[previous,word]] += 1 | |
end | |
@hash[word] += 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
class TumbleDRYer | |
def initialize filename | |
@hash = Hash.new 0 | |
@links = Hash.new 0 | |
previous = nil | |
open(filename).read.scan /\w+|\W+/ do |word| | |
unless previous.nil? | |
@links[[previous,word]] += 1 | |
end | |
@hash[word] += 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
all: main | |
extern.o: extern.cpp | |
main.o: main.cpp | |
main: main.o extern.o | |
g++ $^ -o $@ |
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/sh | |
export PAGER= | |
ref=HEAD | |
old=ORIG_HEAD | |
git rev-parse --short "$old" | tr -d '\n' | |
printf .. | |
git rev-parse --short "$ref" | |
git diff --stat --summary "$old" "$ref" |
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.Scanner; | |
public class test { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
Either<Integer, String> x; | |
if (scan.hasNextInt()) { | |
x = Either.l(scan.nextInt()); | |
} else { | |
x = Either.r(scan.nextLine()); |