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
echo "----------" | |
echo "running command 1..." | |
time for i in {0..1000}; do true; done | |
echo "----------" | |
echo "running command 2..." | |
time for i in {0..1000}; do echo "hello world" >> file; done | |
echo "----------" | |
echo "running command 3..." |
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
# Sort by total time, in descending order | |
cat profiler_output_nqueens.csv | sort -n -r | |
# Sort by time per call (third column in file), in descending order | |
# -d "," means use "," as a field (column) delimiter | |
# -f 3,4 means grab fields (columns) 3 and 4 | |
cat profiler_output_nqueens.csv | cut -d "," -f 3,4 | sort -n -r |
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 EscapeHelloWorld { | |
public static void main(String[] args) { | |
System.out.println("A well-formed Java program has"); | |
System.out.println("a main method with { and }"); | |
System.out.println("braces.\n"); | |
System.out.println("A system.out.println statement"); | |
System.out.println("has ( and ) and usually a"); | |
System.out.println("String that starts and ends"); | |
System.out.println("with a \" character."); |
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 Polynomial { | |
public Polynomial add(Polynomial p) { | |
int degp = p.coeffs.length; | |
int degthis = this.coeffs.length; | |
int mindegree = Math.min(degp, degthis); | |
int maxdegree = Math.max(degp, degthis); | |
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 SimpleTest { | |
public static void main(String[] args) { | |
System.out.println( (char)('a'+5) ); | |
} | |
} |
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 MinMaxAccount extends BankAccount { | |
private double minBalance; | |
private double maxBalance; | |
public MinMaxAccount(Startup s) { | |
super(s); | |
this.minBalance = getBalance(); | |
this.maxBalance = getBalance(); |
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 six | |
class Test(six.Iterator): | |
def __init__(self, init): | |
self.init = init | |
def __iter__(self): | |
return self | |
def __next__(self): |
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
$ python3 numpy_array_timing.py | |
Using TensorFlow backend. | |
Approach 1 took 43.884194135665894 s | |
Approach 2 took 43.12157201766968 s | |
$ python3 numpy_array_timing.py | |
Using TensorFlow backend. | |
Approach 1 took 44.887431383132935 s | |
Approach 2 took 49.045594930648804 s |
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
data_path: "/Users/charles/fuel_data" | |
floatX : "float32" |
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.io.*; | |
public class Directory { | |
private static void crawl(File f, int indent) { | |
// Always print the name of the File object, with appropriate indentation | |
for(int i=0; i<4*indent; i++) { | |
System.out.print(" "); | |
} | |
System.out.println(f.getName()); |