Skip to content

Instantly share code, notes, and snippets.

View charlesreid1's full-sized avatar

Chaz Reid charlesreid1

View GitHub Profile
public class PassByRef {
public static void main(String[] args) {
int[] array = new int[3];
array[0] = 100;
modifyArray(array);
public class PassByRef {
public static void main(String[] args) {
int[] array = new int[3];
array[0] = 100;
modifyArray(array);
@charlesreid1
charlesreid1 / FisherYates.java
Last active May 22, 2017 17:29
Fisher Yates - Code Fragment
/*
This is the code written on the board
during lecture Monday 5/22/17.
CSC 142
Dr. Reid
*/
public class FY {
public static void shuffle(String[] a) {
import java.io.*;
import java.util.*;
public class WeatherData {
public static void main(String[] args) throws FileNotFoundException {
File f = new File("weather.txt");
Scanner in = new Scanner(f);
@charlesreid1
charlesreid1 / Directory.java
Last active August 31, 2021 08:44
Recursion: Directory Crawl Example with Java
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());
@charlesreid1
charlesreid1 / .fuelrc
Created May 6, 2017 13:02
fuel + lfw_fuel configuration for Python 2 or Python 3 compatibility
data_path: "/Users/charles/fuel_data"
floatX : "float32"
@charlesreid1
charlesreid1 / console_output
Last active May 6, 2017 11:57
Python 3: Numpy Array from Generator
$ 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
import six
class Test(six.Iterator):
def __init__(self, init):
self.init = init
def __iter__(self):
return self
def __next__(self):
public class MinMaxAccount extends BankAccount {
private double minBalance;
private double maxBalance;
public MinMaxAccount(Startup s) {
super(s);
this.minBalance = getBalance();
this.maxBalance = getBalance();
public class SimpleTest {
public static void main(String[] args) {
System.out.println( (char)('a'+5) );
}
}