A sample batch file running a scala script with process to call external commands.
The same can be done for *nix systems.
| ## Java | |
| sudo apt-get update | |
| sudo apt-get install default-jdk | |
| ## Scala | |
| sudo apt-get remove scala-library scala | |
| sudo wget http://scala-lang.org/files/archive/scala-2.12.1.deb | |
| sudo dpkg -i scala-2.12.1.deb | |
| sudo apt-get update | |
| sudo apt-get install scala |
| (module | |
| (func $addTwo (param i32 i32) (result i32) | |
| (i32.add | |
| (get_local 0) | |
| (get_local 1))) | |
| (export "addTwo" (func $addTwo))) |
| package controllers; | |
| import com.google.gson.*; | |
| import com.google.gson.reflect.TypeToken; | |
| import play.*; | |
| import play.api.libs.json.JsValue; | |
| import play.api.libs.json.Json; | |
| import play.api.templates.*; | |
| import play.mvc.*; |
| /* Author: Francisco Aranda (farandal@gmail.com) */ | |
| package controllers; | |
| import org.apache.http.HttpHost; | |
| import org.apache.http.HttpResponse; | |
| import org.apache.http.NameValuePair; | |
| import org.apache.http.auth.AuthScope; | |
| import org.apache.http.auth.UsernamePasswordCredentials; | |
| import org.apache.http.client.entity.UrlEncodedFormEntity; |
A sample batch file running a scala script with process to call external commands.
The same can be done for *nix systems.
| #!/bin/bash | |
| # set -eux | |
| # This a simple script that builds static versions of Python and LibPython using musl-libc | |
| # Find the associated article at: http://general-purpose.io/2015/12/06/compiling-python-and-libpython-statically-using-musl-libc/ | |
| WORKING_DIR="/code/static-python" | |
| MUSL_PREFIX="/code/static-python/musl" | |
| PY_PREFIX="/code/static-python/python" |
| /** | |
| A super basic interactive console for haxe. | |
| Done because someone on the mailing list asked and I got distracted :) | |
| Consider this code Public Domain. | |
| Jason O'Neil | |
| Run using: | |
| haxe -lib hscript -x Console.hx | |
| (you will need hscript installed via haxelib) |
| class Main { | |
| static function parseProperties(text:String):Map<String, String> { | |
| var map:Map<String, String> = new Map(), | |
| ofs:Int = 0, | |
| len:Int = text.length, | |
| i:Int, j:Int, | |
| endl:Int; | |
| while (ofs < len) { | |
| // find line end offset: | |
| endl = text.indexOf("\n", ofs); |
| == Included Section | |
| Look, I came from out of the [blue]#blue#! | |
| -- | |
| I'm keepin' it open. | |
| An 'open block', like this one, can contain other blocks. | |
| It can also act as any other block. (TODO) |