Input file:
$ cat foo
qwe
123
bar
// Start by adding these | |
import scala.util.{ Try, Success, Failure } | |
/** | |
* Sample runs code that raises the exception: | |
* java.lang.ArithmeticException: / by zero | |
*/ | |
object Sample { | |
def main(args: Array[String]): Unit = { |
class Either | |
def self.pure(value) | |
Right.new(value) | |
end | |
class Left | |
def initialize(left) | |
@left = left | |
end |
Fire up ghci. Make the text real big. Always show the types for everything as you go!
Takes ~1 hour generally.
Note: if you object to "uncertainty" (evocative of data/value flow possibilities), consider wording like "simultaneously possible values". It's a reference to how the compiler won't know whether Maybe a
is a Just a
or a Nothing
statically. Don't blather at me about dependent types; I know.
Alternate verbiage for uncertainty: product - simultaneous altogetherness, sum - simultaneous singlehood. Also consider what the category theoretic diagrams look like. Can be instructive.
Suggestions taken under advisement.
... | |
module Helpers | |
# Replace standard input with faked one StringIO. | |
def fake_stdin(*args) | |
begin | |
$stdin = StringIO.new | |
$stdin.puts(args.shift) until args.empty? | |
$stdin.rewind | |
yield |
Writing a billing system in Haskell, using Stripe and Heroku | |
=== | |
*This post is written in literate Haskell, meaning the source can be turned | |
into a blogpost or a working program. You can view the [source][source]. | |
[source]: https://gist.github.com/gatlin/7754289 | |
Normally clients pay me with checks, but recently one informed me that they | |
really really really like *really really* super prefer some kind of online |
#Bosun unit file at /etc/systemd/system/bosun.service | |
[Unit] | |
Description=Bosun Service | |
After=network.target | |
After=docker.service | |
After=rsyslog.service | |
[Service] | |
Type=simple | |
User=root |
* See all current contexts | |
* For each context see all the jobs that are running | |
* History of past jobs for a given context. Actually this is not technically available via API; but history of past jobs | |
* Be able to see configuration for each job present or past (this is available via a tiny "C" link in current UI) | |
* Job results | |
* Link to Spark UI for detailed analysis |
diff --git a/vm_opts.h b/vm_opts.h | |
index b67e254..3e3935a 100644 | |
--- a/vm_opts.h | |
+++ b/vm_opts.h | |
@@ -18,8 +18,8 @@ | |
* Following definitions are default values. | |
*/ | |
-#define OPT_TRACE_INSTRUCTION 1 | |
-#define OPT_TAILCALL_OPTIMIZATION 0 |
var gulp = require( 'gulp' ), | |
server = require( 'gulp-develop-server' ); | |
// run server | |
gulp.task( 'server:start', function() { | |
server.listen( { path: './app.js' } ); | |
}); | |
// restart server if app.js changed | |
gulp.task( 'server:restart', function() { |