Skip to content

Instantly share code, notes, and snippets.

View sumtyme's full-sized avatar

Carl Summers sumtyme

  • Lockheed Martin
  • Colorado Springs, Co.
View GitHub Profile
main()
{
char first_letter;
int test_one;
int test_two;
float test_three;
float avg;
first_letter = 'A';
test_one = 0;
class ExtremaTests {
// maxArray()
// returns the largest value in int array A
static int maxArray(int[] A, int start, int end) {
if (start < end) {
int middle = (start + end) / 2;
maxArray(A, start, middle);
maxArray(A, middle + 1, end);
return Math.max(maxArray(A, start, middle), maxArray(A, middle + 1, end));
}else{
class ExtremaTests {
// maxArray()
// returns the largest value in int array A
static int maxArray(int[] A, int start, int end) {
if (start < end) {
int middle = (start + end) / 2;
maxArray(A, start, middle);
maxArray(A, middle + 1, end);
return Math.max(maxArray(A, start, middle), maxArray(A, middle + 1, end));
}else{
public abstract class BackedVirtualMemory extends SimpleVirtualMemory {
protected int currentPageIndex = 0;
protected int pageSize;
protected int maxPages;
public BackedVirtualMemory(){
this(100, 10);
}
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Path2D;
import javax.swing.JFrame;
import javax.swing.JPanel;
@sumtyme
sumtyme / Test.s
Created August 15, 2012 22:22
Just in case you were too lazy to do it:
.file "test.c"
.text
.p2align 4,,15
.globl swap1
.type swap1, @function
swap1:
.LFB11:
.cfi_startproc
movl (%rsi), %eax
xorl (%rdi), %eax
@sumtyme
sumtyme / Assignment2
Created October 18, 2012 17:38
Assignment2
public class Assignment2 {
private BufferedReader reader;
private String str;
public static void main(String[] args) {
Assignment2 program = new Assignment2();
}// main
public Assignment2() throws Exception {
@sumtyme
sumtyme / GuiChooser.java
Created November 2, 2012 21:33
"Real" code - Weka
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@sumtyme
sumtyme / TEST
Created November 13, 2012 19:58
TEST
TEST
@sumtyme
sumtyme / LineInfo.java
Created November 20, 2012 03:46 — forked from anonymous/LineInfo.java
LineInfo help!
/**
* LineInfo class
*
* @author sinister
*
*/
public class LineInfo {
private String myLine;