Skip to content

Instantly share code, notes, and snippets.

@ttreitlinger
ttreitlinger / TestHttp.java
Created May 5, 2010 10:02
apache http client sample
package http;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;

The document formatting was messed up – I don’t have MSWord installed on my laptop.

I’d format it as a table like this:

Employee
employee_id (pk)
first_name
last_name
sex
age
package com.filetest;
public class DictionaryEntry {
final public String word;
final public String translation;
final public String description;
public DictionaryEntry(String w, String t, String d) {
this.word = w;
@ttreitlinger
ttreitlinger / DictionaryEntry.java
Created December 16, 2010 13:17
should be part of DictionaryEntry.java
/**
* Lookup a word in the dictionary file
*
* @param word - the word we are looking for
* @return a string array with the word, the translation and description
* or null if the word can't be found
* @throws IOException
*/
public static String[] lookupWord(String word) throws IOException {
import java.io.IOException;
public class DictionaryEntryTest {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class DictionaryEntry {
class Report
def initialize deck, pile, players
@deck = deck
@pile = pile
@players = players
output_report
end
# template method
require "test/unit"
require 'pile.rb'
require 'card.rb'
require 'winning_cards_observer.rb'
class TC_Pile < Test::Unit::TestCase
def setup
@pile = Pile.new
end
require "test/unit"
require 'pile.rb'
require 'card.rb'
require 'winning_cards_observer.rb'
class TC_Pile < Test::Unit::TestCase
def setup
@pile = Pile.new
end
require 'player.rb'
require 'poker.rb'
class Casino
def initialize
@total_1 = {'John' => 0, 'Mary' => 0, 'Luke' => 0, 'Eimear' => 0}