Skip to content

Instantly share code, notes, and snippets.

@tnhansel
tnhansel / Profile.py
Last active September 10, 2016 01:14
import csv
from Tkinter import *
f = open('students.csv', 'a')
fields = 'Last Name', 'First Name', 'Middle Name', 'Date of Birth(DD/MM/YYYY)', 'Phone Number', 'Graduation Date(MM/YYYY)' , 'TUid' , 'Email Adress' , 'Major' , 'Undergraduate(Yes/No)'
f.write (str(fields) + '\n') #I have problem here
f.close()
/* Monopoly.java
*
* CSCI 111 Fall 2013
* last edited November 2, 2013 by C. Herbert
*
* This package contains code that can be used as the basis of a monopoly game
* It has a class of BoardSquares for the board squares in a Monopoly game,
* and a main program that puts the squares into an array.
*
* The main method has code to test the program by printing the data from the array
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class GraphAdjacencyList
{
/* Makes use of Map collection to store the adjacency list for each vertex.*/
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class GraphAdjacencyList
{
/* Makes use of Map collection to store the adjacency list for each vertex.*/
@tnhansel
tnhansel / TestCase.java
Created January 20, 2014 02:23
Chess TestCases
/**
* Created by hanseltan on 1/19/14.
*/
public class TestCase {
int rowBegin;
int colBegin;
int rowEnd;
int colEnd;
boolean correctResult;
@tnhansel
tnhansel / ReadData
Created December 3, 2013 22:07
Read data from .txt
import java.util.Scanner;
public class ReadData
{
public static void main(String[] args) throws Exception
{
String message; // holding the line coming from the source
// creating the file class and giving its excat location
@tnhansel
tnhansel / gist:7531151
Created November 18, 2013 16:50
MobileComputer Database
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package computer;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
@tnhansel
tnhansel / gist:7129262
Last active December 26, 2015 09:28
search algorithm
import java.util.ArrayList;
public class Search {
public static void searchComputer(ArrayList<MobileComputer> arrayList){
MobileComputer a;
boolean found = false;
for (int i=0; i<arrayList.size(); i++ ){
if (arrayList.get(i).getSerialNumber()>arrayList.get(i+1).getSerialNumber()){