This file contains hidden or 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
| alias svnaddall="svn st | grep ^? | awk '{print$2}' | xargs svn add" |
This file contains hidden or 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 AVLIterator { | |
| AVLTree tree; | |
| Node begin; | |
| Node end; | |
| Node current; | |
| AVLIterator(AVLTree t) { | |
| this.tree = t; | |
| current = begin = t.findMin(t.root); | |
| end = t.findMax(t.root); |
This file contains hidden or 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
| float[] x = { | |
| 88, 431, 431, 124 | |
| }; | |
| float[] y = { | |
| 115, 367, 188, 331 | |
| }; | |
| void setup() { | |
| size(640, 480); | |
| } |
This file contains hidden or 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
| // Returns 1 if the lines intersect, otherwise 0. In addition, if the lines | |
| // intersect the intersection point may be stored in the floats i_x and i_y. | |
| char get_line_intersection(float p0_x, float p0_y, float p1_x, float p1_y, | |
| float p2_x, float p2_y, float p3_x, float p3_y, float *i_x, float *i_y) | |
| { | |
| float s1_x, s1_y, s2_x, s2_y; | |
| s1_x = p1_x - p0_x; s1_y = p1_y - p0_y; | |
| s2_x = p3_x - p2_x; s2_y = p3_y - p2_y; | |
| float s, t; |
This file contains hidden or 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
| function Random(initialValue) { | |
| var A = 48271; | |
| var M = 2147483647; // 2^31-1 | |
| var Q = (M / A) >> 0; | |
| var R = M % A; | |
| initialValue %= M; | |
| if (initialValue < 0) | |
| initialValue += M; |
This file contains hidden or 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
| var addProperty = function(obj, property, value) { | |
| var salt = Math.random(), saltValue; | |
| var saltGetter = function() { | |
| return saltValue * salt; | |
| }; | |
| var saltSetter = function(value) { | |
| saltValue = value / salt; | |
| }; |
This file contains hidden or 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
| //<script type="text/javascript"> | |
| var guess = (function() { | |
| var code = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | |
| var randomize = function(a, b) { | |
| return Math.random() < 0.5 ? -1 : 1; | |
| }; | |
| var total = 10; | |
| var remain; | |
| return { |
This file contains hidden or 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
| var numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | |
| var total = []; | |
| var testCount = 10000; | |
| for (var i = 0; i < numbers.length; i++) { | |
| total[i] = []; | |
| for (var j = 0; j < numbers.length; j++) { | |
| total[i][j] = 0; | |
| } | |
| }; |
This file contains hidden or 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
| #include<stdio.h> | |
| #include<stdlib.h> | |
| #include<time.h> | |
| int main(int argc, char **argv) { | |
| /* | |
| U\C R P S | |
| R 1 0 2 | |
| P 2 1 0 |
This file contains hidden or 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.*; | |
| static int count = 0; | |
| class Player implements Comparable<Player> { | |
| int id; | |
| float score; | |
| int win; | |
| int lose; | |
| Player() { |