This file contains 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
Public Function nbrVoituresSurCercle(ByVal i As Long) As Long | |
nbrVoituresSurCercle = i | |
End Function | |
Public Function nbrVoituresTotal(ByVal i As Long) As Long | |
If i = 1 Then | |
nbrVoituresTotal = nbrVoituresSurCercle(1) | |
Else | |
nbrVoituresTotal = nbrVoituresSurCercle(i) + nbrVoituresTotal(i - 1) | |
End If |
This file contains 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
// `unit` is `return` from Haskell | |
// `bind` is `>>=` from Haskell, or `flatMap` from Scala | |
var None = { | |
bind: function (fn) { return this; }, | |
unit: function (v) { return Option(v); }, | |
getOrElse: function (elseValue) { return elseValue; } | |
}; | |
var Some = function (value) { |
This file contains 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 akka.actor.ActorRef | |
/** | |
* Handle global reference to actor | |
* | |
* Usage: | |
* object MyGlobal extends GlobalActorRef(Actor.registry.actorFor[MyActor]) | |
* object MyGlobal extends GlobalActorRef(Some(Actor.remove.actorFor[MyActor])) | |
* | |
* @author teamon |
This file contains 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
## octave --version | |
## GNU Octave, version 3.6.1 | |
## file: @triangle/triangle.m | |
function t = triangle (p1, p2, p3) | |
if (nargin == 3) | |
if (isvector(p1) && isreal(p1) && length(p1) == 3 && | |
isvector(p2) && isreal(p2) && length(p2) == 3 && |
This file contains 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
;; Sandbox | |
(def ^:dynamic *sb* nil) | |
(defn make-sb [] | |
(def ^:dynamic *sb* (sandbox (conj secure-tester-without-def :timeout 2000)) | |
;; Define some functions within the sandbox | |
(*sb* '(defn jump [] (str "JUMP")))) | |
;; Swank | |
(def ^:dynamic *swank* nil) | |
(defn -startSwank [] |
This file contains 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
Exception in thread "main" java.lang.reflect.InvocationTargetException | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | |
at java.lang.reflect.Method.invoke(Method.java:597) | |
at com.simontuffs.onejar.Boot.run(Boot.java:340) | |
at com.simontuffs.onejar.Boot.main(Boot.java:166) | |
Caused by: java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader), compiling:(NO_SOURCE_PATH:0) | |
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232) | |
at java.util.concurrent.FutureTask.get(FutureTask.java:91) |
This file contains 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
In clojail.clj: | |
(ns ca.gsimard.spacecraft.client.clojail | |
(:use [clojail core testers]) | |
(:gen-class | |
:name ca.gsimard.spacecraft.client.clojail | |
:methods [#^{:static true} [epadEval [String] String] | |
#^{:static true} [getAction [] String]])) | |
In main.java: |
This file contains 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
var entitiesMap = Map[Int,Entity]() | |
private val randEntityId = new scala.util.Random(0) | |
def uniqueEntityId() = { | |
var id = 0; | |
do { | |
id = randEntityId.nextInt() | |
} while (entitiesMap.contains(id)) |
This file contains 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 Cube(val size: Float = 1.0f, var pos: Vector3 = Vector3(0f, 0f, 0f), val texture: Array[Int] = Array(32,32,32,32,32,32)) { | |
def this(size: Float, pos: Vector3, texture: Int = 32) = this(size,pos,Array(texture,texture,texture,texture,texture,texture)) | |
} | |
Description Resource Path Location Type | |
type mismatch; found : Int(32) required: Array[Int] Error occurred in an application involving default arguments. |
This file contains 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
// application.conf | |
server { | |
akka { | |
actor { | |
provider = "akka.remote.RemoteActorRefProvider" | |
} | |
remote { | |
transport = "akka.remote.netty.NettyRemoteTransport" | |
netty { | |
hostname = "127.0.0.1" |