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
(defn create-converters-panel | |
"Creates panel containing the labels and text fields." | |
[] | |
(let [ | |
create-an-inner-panel (fn [] (JPanel. (GridLayout. 0 1 5 5))) | |
label-panel (create-an-inner-panel) | |
text-field-panel (create-an-inner-panel) | |
outer-panel (JPanel. (BorderLayout.))] | |
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
(import '(java.awt BorderLayout GridLayout Toolkit) | |
'(javax.swing AbstractAction Action BorderFactory JFrame JPanel JButton | |
JMenu JMenuBar JTextField JLabel)) | |
(defn f2c | |
"Converts a Fahrenheit temperature value to Celsius." | |
[f] | |
(/ (* 5.0 (- f 32.0)) 9.0)) | |
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
# Bidirectional Hash | |
class BiHash | |
def initialize(a_hash) | |
raise Exception.new if a_hash == nil | |
@l2r = {} |
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
(defn create-simple-document-listener | |
"Returns a DocumentListener that performs the specified behavior | |
identically regardless of type of document change." | |
[behavior] | |
(proxy [DocumentListener][] | |
(changedUpdate [event] (behavior event)) | |
(insertUpdate [event] (behavior event)) | |
(removeUpdate [event] (behavior event)))) |
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
(defn create-simple-document-listener | |
"Returns a DocumentListener that performs the specified behavior | |
identically regardless of type of document change." | |
[behavior] | |
(proxy [DocumentListener][] | |
(changedUpdate [event] (behavior event)) | |
(insertUpdate [event] (behavior event)) | |
(removeUpdate [event] (behavior event)))) |
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
/** | |
* Shows a little about Object.clone()'s behavior. | |
* | |
* Object.clone() is a native method, so I couldn't look at the source code. | |
* I believe what it does is to copy object references. That means that | |
* if you don't override it, all clones will be pointing to the same | |
* instances of the contained members. | |
*/ | |
public class CloneTest { |
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
/** | |
* Shows a little about Object.clone()'s behavior. | |
* | |
* Object.clone() is a native method, so I couldn't look at the source code. | |
* I believe what it does is to copy object references. That means that | |
* if you don't override it, all clones will be pointing to the same | |
* instances of the contained members. | |
*/ | |
public class CloneTestA { |
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
/** | |
* Shows a little about Object.clone()'s behavior. | |
* | |
* Object.clone() is a native method, so I couldn't look at the source code. | |
* I believe what it does is to copy object references. That means that | |
* if you don't override it, all clones will be pointing to the same | |
* instances of the contained members. | |
*/ | |
public class CloneTestB { |
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
public String getObject() | |
{ | |
String result; | |
if (TO_ESCAPED_UNICODE.equals(translationType)) | |
{ | |
result = Strings.toEscapedUnicode(source); | |
} | |
else | |
{ | |
result = Strings.fromEscapedUnicode(source); |
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 com.fedcsc.asr.web.wicket; | |
import org.apache.wicket.MarkupContainer; | |
import org.apache.wicket.Component; | |
import org.apache.wicket.util.tester.WicketTester; | |
import java.util.List; | |
import java.util.ArrayList; | |
/** |