Skip to content

Instantly share code, notes, and snippets.

@TheLouisHong
TheLouisHong / ReadFile.java
Last active December 22, 2015 00:48
A program that reads unknown Serialized objects, with problems,.....
package com.louishong;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.lang.reflect.Field;
public class ReadFile{
@TheLouisHong
TheLouisHong / CharCheck.java
Created October 17, 2013 03:44
Martino'w HW
import java.util.Scanner;
public class CharCheck {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.println("Begin!");
while (true) {
char input = keyboard.next().charAt(0);
if (isDigit(input)){
@TheLouisHong
TheLouisHong / PrintOneOverN
Created October 17, 2013 15:41
Another Martinos HW
public class PrintOneOverN {
public static void main(String[] args) {
int finalDinominator = 20;
for (double i = 1; i <= finalDinominator; i++) {
System.out.println(1d/i);
}
}
}
@TheLouisHong
TheLouisHong / WhosTheBiggest.java
Created October 17, 2013 16:36
Once again, another HW
import java.util.Scanner;
public class WhosTheBiggest {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
while (true) {
Integer[] inputs = new Integer[3];
System.out.println("Enter 3 positive digits");
try {
import java.util.Scanner;
public class WhosTheBiggest {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
while (true) {
Integer[] inputs = new Integer[3];
System.out.println("Enter 3 positive digits");
try {
@TheLouisHong
TheLouisHong / WhosTheBiggest.java
Created October 18, 2013 01:39
Once again, updated
import java.util.Scanner;
public class WhosTheBiggest {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
mainLoop:
while (true) {
Integer[] inputs = new Integer[3];
@TheLouisHong
TheLouisHong / PrintNumberTriangle.java
Last active December 25, 2015 21:59
Another one of martins assignments. 1.03 version
public class PrintNumberTriangle{
public static void main(String []args){
int midNumber = 8;
for (int y = 1; y<=midNumber; y++) {
for (int x = 1; x<=y; x++) {
System.out.print(x + " ");
}
for (int space = 0; space<4*(midNumber-y)-2; space++) {
System.out.print(" ");
import java.util.Scanner;
public class AverageCalculator {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
float sum = 0;
int count = 0;
mainLoop: while (true) {
System.out.print("Input a number, -1 to find average: ");
import re
# Engine
class Reddit2HTMLConverter:
def __init__(self, regPattern, formatStr, formatter):
self.regPattern = regPattern
self.formatter = formatter
self.formatStr = formatStr
using UnityEngine;
public class PausableTimer {
private float _timerStart = -1;
private float _timerTime;
public PausableTimer(float initialTimerTime = 0) {
_timerTime = initialTimerTime;
}