This file contains hidden or 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 llcalc; | |
import java.util.StringTokenizer; | |
class Expr { | |
Term term; | |
Expr2 expr2; | |
Expr(Term term, Expr2 expr2) { | |
this.term = term; | |
this.expr2 = expr2; |
This file contains hidden or 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
# from "The AWK Programming Language" (A.V.Aho, B.W.Kernighan, P.J.Weinberger) | |
# recursive descendent parser | |
def expr | |
e = term | |
while $tokens[$index] == "+" || $tokens[$index] == "-" | |
$index += 1 | |
e = ($tokens[$index - 1] == "+") ? e + term : e - term | |
end | |
return e |
This file contains hidden or 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
Sub AppendFile(inFilepath, outFilepath) | |
On Error Resume Next | |
ForAppending = 8 | |
Set output = gFileSystem.OpenTextFile(outFilepath, ForAppending, True) | |
Set input = gFileSystem.OpenTextFile(inFilepath) | |
Do Until input.AtEndOfStream = true | |
line = input.ReadLine | |
output.WriteLine line | |
Loop | |
input.Close |
This file contains hidden or 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width, target-densitydpi=device-dpi"> | |
<title>Run!</title> | |
<style> | |
canvas { | |
border: 1px solid #9C9898; | |
} | |
</style> |
This file contains hidden or 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width, target-densitydpi=device-dpi"> | |
<title>Ripple</title> | |
<style> | |
canvas { | |
border: 1px solid #9C9898; | |
} | |
</style> |
This file contains hidden or 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width, target-densitydpi=device-dpi"> | |
<title>Draw Lines</title> | |
<style> | |
body { | |
margin: 0px; | |
padding: 0px; | |
} |
This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript"> | |
var app = { | |
rect: { | |
x: 100, | |
y: 100, | |
w: 100, | |
h: 100, | |
a: 0 |
This file contains hidden or 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
class MyRecord | |
def initialize(line) | |
@alpha, @number, @value = line.split | |
end | |
attr_reader :alpha, :number, :value | |
end | |
def print_alpha_number(records) | |
num_keys = records.map{|rec| rec.number}.uniq.sort | |
alpha_keys = records.map{|rec| rec.alpha}.uniq.sort |
This file contains hidden or 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
include Java | |
import java.awt.Rectangle | |
import java.awt.geom.Ellipse2D | |
import java.awt.geom.Line2D | |
import java.awt.geom.Point2D | |
import java.awt.geom.Rectangle2D | |
import java.lang.Math | |
import javax.swing.JFrame |
This file contains hidden or 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 gnu.io.CommPortIdentifier; | |
import gnu.io.PortInUseException; | |
import gnu.io.SerialPort; | |
import gnu.io.UnsupportedCommOperationException; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.io.OutputStreamWriter; |