Brian Anderson banderson at mozilla.com
Thu Aug 8 11:54:26 PDT 2013
from https://mail.mozilla.org/pipermail/rust-dev/2013-August/005158.html
| package pipe_foundations.example; | |
| import pipe_foundations.Pipe; | |
| import pipe_foundations.SimpleFilter; | |
| public class ExampleFilter extends SimpleFilter<Integer, String> { | |
| public ExampleFilter(Pipe<Integer> input, Pipe<String> output) { | |
| super(input, output); | |
| } |
| # lets you output to an arbitrary stream with `puts`, etc., for convenience | |
| def with_stdout(new_stdout) | |
| old_stdout = $stdout # $stdout usually be STDOUT here, but not if you nest this function | |
| $stdout = new_stdout | |
| yield | |
| $stdout = old_stdout | |
| end |
| ; how to write scripts: http://www.autohotkey.com/docs/ | |
| #IfWinActive ahk_class CabinetWClass ; File Explorer | |
| ^Backspace:: | |
| #IfWinActive ahk_class Notepad | |
| ^Backspace:: | |
| Send ^+{Left}{Backspace} | |
| #IfWinActive | |
| ; source and context: http://superuser.com/a/636973/124606 |
Brian Anderson banderson at mozilla.com
Thu Aug 8 11:54:26 PDT 2013
from https://mail.mozilla.org/pipermail/rust-dev/2013-August/005158.html
| Unicode symbols for copy-pasting | |
| (this file is UTF-8 encoded) | |
| apostrophe | |
| http://en.wikipedia.org/wiki/Apostrophe | |
| ’ | |
| quotation marks | |
| http://en.wikipedia.org/wiki/Quotation_mark | |
| “ |
| # app name: do thing | |
| def mainAction(): | |
| main_region = None#TODO literal region | |
| main_region.click(None)#TODO whatever actions | |
| App.focus("")#TODO app name string e.g. "Sikuli IDE" | |
| for i in range(1): | |
| mainAction() |
| var HomeURL = 'http://syntax.ubergibson.com/'; | |
| var SHJSLoaded = false; | |
| var SHJSSyntaxLoaded = false; | |
| var SyntaxHighlighted = false; | |
| function shjsLoaded() { | |
| SHJSLoaded = true; | |
| if (SHJSSyntaxLoaded && !SyntaxHighlighted) { | |
| SyntaxHighlighted = true; | |
| sh_highlightDocument(); |
Here is a testing framework I wrote (for CS 360 class). You can use it to test if your Scheme functions give the correct output. Here’s an example of how you use it:
(load "test-framework.scm")
(load "foo.scm")
(test-with-cases foo
(list
'(( 1 1 ) 2)
'(( 10 5 ) 15)
| 1.9.3-p327 |