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 the number of factors of x, starting at n | |
public int mystery (int n, int x) { | |
return (n<x)?((int) n%x==0)+mystery(n+1, x):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
void clearLCD () { | |
clearLCDLine(0); | |
clearLCDLine(1); | |
} | |
void waitForRelease () { | |
while(nLCDButtons != 0) | |
delay(25); | |
} |
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
there is n:d=4,o=5,b=150:12d3,24f#3,39p,64e,12a3,12p,12p,12f#3,24f#3,39p,64g,12a3,12p,12p,12a3,12f#3,12a3,12p,12p,12d4,12f#3,12a3,12p,12p,12b3,12b3,12d4,12p,12p,12g3,12b3,12d4,12p,12p,12d3,12f#3,12a3,12p,12p,12f#3,12f#3,12a3,12p,12p,12g3,24b3,39p,64f#,12d4,12p,12p,12b3,24b3,39p,64a,12d4,12p,12p,12d3,24f#3,39p,64e,12a3,12p,12p,12f#3,24f#3,39p,64a4,12a3,12p,12p,12e3,24g3,39p,64d,12b3,12p,12p,12g3,24g3,39p,64f#,12b3,12p,12p,12a3,12c#4,12e4,12p,12p,12c#3,12b3,12a3,12p,12p,12d3,24f#3,39p,64e,12a3,12p,12p,12f#3,24f#3,39p,64g,12a3,12p,12p,12a3,12f#3,12a3,12p,12p,12d4,12f#3,12a3,12p,12p,12b3,12b3,12d4,12p,12p,12g3,12b3,12d4,12p,12p,12d3,12f#3,12a3,12p,12p,12f#3,12f#3,12a3,12p,12p,12g3,24b3,39p,64f#,12d4,12p,12p,12b3,24b3,39p,64a,12d4,12p,12p,12d3,24f#3,39p,64e,12a3,12p,12p,12f#3,24f#3,39p,64a4,12a3,12p,12p,12e3,24g3,39p,64d,12b3,12p,12p,12g3,24g3,39p,64f#,12b3,12p,12p,12a3,12c#4,12e4,12p,12p,12c#3,12b3,12a3,12p,12p,12g2,24b3,39p,64a4,12d4,12p,12p,12b2,24b3,39p,64c#,12d4,12p,12p,12d3,12f#3,12a3,12p,12p,12f#3,24f#3,39p |
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
public class Name implements Comparable { | |
private String first, last; | |
public Name (String firstName, String lastName) { | |
first = firstName; | |
last = lastName; | |
} | |
public int compareTo(Object obj) { | |
Name other = (Name) obj; |
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
repeat | |
-- Get the "hour" | |
set timeStr to time string of (current date) | |
set Pos to offset of ":" in timeStr | |
set theHour to characters 1 thru (Pos - 1) of timeStr as string | |
set timeStr to characters (Pos + 1) through end of timeStr as string | |
-- Get the "minute" | |
set Pos to offset of ":" in timeStr | |
set theMin to characters 1 thru (Pos - 1) of timeStr as string |
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
#pragma config(Motor, port1, rightWheel1, tmotorVex393_HBridge, openLoop) | |
#pragma config(Motor, port2, rightWheel2, tmotorVex393_MC29, openLoop, reversed) | |
#pragma config(Motor, port3, rightWheel3, tmotorVex393_MC29, openLoop, reversed) | |
#pragma config(Motor, port4, leftWheel2, tmotorVex393_MC29, openLoop) | |
#pragma config(Motor, port5, leftWheel3, tmotorVex393_MC29, openLoop) | |
#pragma config(Motor, port10, leftWheel1, tmotorVex393_HBridge, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
#pragma platform(VEX) |
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.*; | |
public class Compat { | |
public static void main (String args[]) { | |
Random r = new Random(System.nanoTime()); | |
System.out.println(""+r.nextInt(100)+"&"); | |
} | |
} |
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
public class dogtagexample{ | |
/** | |
* Checks that a dog tag is valid | |
* @param dogTag the dog tag to be checked | |
* @return true if the dog tag is a valid dog tag | |
*/ | |
public static boolean checkDogTag (String dogTag) { | |
if(dogTag.length()!=4) | |
throw new IndexOutOfBoundsException(); |
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
public class intester { | |
public static void main (String args[]) { | |
int testInt = 135; | |
int sum = 0; | |
sum = testInt%10; //adds 5 to the sum | |
testInt=testInt/10; //devides the test int by 10 | |
sum = sum + testInt%10; //adds 3 to the sum | |
testInt=testInt/10; //devides the test int by 10 | |
sum = sum + testInt%10; //adds 1 to the sum | |
System.out.println(sum); //returns 9 |
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"> | |
// This will parse a delimited string into an array of | |
// arrays. The default delimiter is the comma, but this | |
// can be overriden in the second argument. | |
function CSVToArray( strData, strDelimiter ){ | |
// Check to see if the delimiter is defined. If not, | |
// then default to comma. | |
strDelimiter = (strDelimiter || ","); |