This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package us.greg; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.Reader; | |
import java.io.StringWriter; | |
import java.io.Writer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package us.greg; | |
import java.io.ByteArrayInputStream; | |
import java.net.URLEncoder; | |
import org.junit.Test; | |
import static org.junit.Assert.assertEquals; | |
import static org.junit.Assert.assertTrue; | |
import static org.junit.Assert.fail; | |
public class StreamReaderHelperTest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package us.greg; | |
import org.junit.Test; | |
import static org.junit.Assert.assertEquals; | |
import static org.junit.Assert.assertTrue; | |
import static org.junit.Assert.fail; | |
import java.io.BufferedReader; | |
import java.io.ByteArrayInputStream; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inst_section = { | |
:collie => 'furry', | |
:parakeet => 'feathered', | |
:cow => 'bovine', | |
:ant => 'stinging', | |
:snake => 'slithering', | |
:elephant => 'large' | |
} | |
puts inst_section[:ant] | |
puts inst_section[:cow] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package us.home.electronics; | |
import static org.junit.Assert.assertEquals; | |
import static org.mockito.Mockito.mock; | |
import static org.mockito.Mockito.when; | |
import org.junit.Test; | |
public class ProgrammableTest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package us.home.electronics; | |
import java.io.Console; | |
import java.io.IOException; | |
/** | |
* For conciseness, throw classes into just one source file | |
*/ | |
public interface Programmable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project name="programmable" basedir="." default="test"> | |
<property name="src.dir" location="src"/> | |
<property name="bin.dir" location="bin"/> | |
<property name="lib.dir" location="lib"/> | |
<property name="junit" value="${lib.dir}/junit"/> | |
<property name="mockito" value="${lib.dir}/mockito"/> | |
<path id="classpath"> | |
<pathelement location="${bin.dir}"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package old.school; | |
import java.sql.*; | |
/** | |
* run as follows: | |
* 1. javac OldSchoolJDBC.java | |
* 2. java OldSchoolJDBC | |
*/ | |
public class OldSchoolJDBC { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def account-info (hash-set | |
{:username "zak" | |
:balance 13.59 | |
:member-since "2009-02-01"} | |
{:username "mak" | |
:balance 12.59 | |
:member-since "2011-02-02"} | |
{:username "jak" | |
:balance 11.59 | |
:member-since "2009-12-02"})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; refs manage synchronous, coordinated state | |
; agents manage asynchronous, independent state | |
; atoms manage synchronous, independent state | |
; ref-set must be called within a transaction | |
; alter does the same thing as ref-set but alter implies the new | |
; value is a function of the old. ref-set implies old value is | |
; being obliterated and the ref will point to a new value. | |
; If a Transaction is initiated inside another transaction | |
; the inner transaction becomes part of the outer and commits | |
; when the outer does |
OlderNewer