Scala
def factorial(n: Int) = {
def tailFactorial(n: Int, acc: Int): Int =
if (n == 0) acc else tailFactorial(n - 1, acc * n)
tailFactorial(n, 1)
final int frames = 30; | |
void setup(){ | |
size(500,500,P3D); | |
background(0); | |
} | |
void draw(){ | |
background(0); | |
final int fc = frameCount; |
If you need to restart VirtualBox. | |
This fixes an issue such as: | |
There was an error while executing `VBoxManage`, a CLI used by Vagrant | |
for controlling VirtualBox. The command and stderr is shown below. | |
Command: ["hostonlyif", "create"] | |
sudo /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh restart |
#!/bin/bash | |
# References | |
# http://www.computerhope.com/unix/nc.htm#03 | |
# https://github.com/daniloegea/netcat | |
# http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze | |
# http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982 | |
# http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip | |
# http://www.dest-unreach.org/socat/ | |
# http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES |
import javax.crypto.Cipher; | |
class Test { | |
public static void main(String[] args) { | |
try { | |
System.out.println("Hello World!"); | |
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES"); | |
System.out.println(maxKeyLen); | |
} catch (Exception e){ | |
System.out.println("Sad world :("); |