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
# 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 |
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 |
A web-page, more-readable version of the code by praptak on https://news.ycombinator.com/item?id=4956101.