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
#!/bin/sh | |
# Build Gaudi | |
pkg="org/stpettersens/gaudi" | |
jarF="Gaudi.jar" | |
echo "Compiling..." | |
scalac -classpath ./lib -verbose -deprecation -unchecked -d bin src/$pkg/*.scala | |
echo "Packaging..." |
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
#!/bin/bash | |
# Build Gaudi | |
sep=";" # Initially use Windows, ";" | |
# For Linux, Unix/xBSD - use ":" | |
if [[ `uname` =~ .*n.*x|.+BSD ]]; then | |
sep=":" | |
fi |
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
/* | |
Hello World in Scala | |
*/ | |
object HelloWorld { | |
def main(args: Array[String]) { | |
println("Hello World!") | |
} | |
} | |
- OR - |
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
#!/bin/bash | |
echo "y/n?" | |
read yesno | |
if [[ $yesno -eq "y" ]]; then | |
echo "You said yes :)" | |
else | |
if [[ $yesno -eq "n" ]]; then | |
echo "You said no :(" | |
fi |
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
// Begins a line comment | |
# as used in preprocessor definitions, e.g. #include <io> | |
() as used in function calls, function definitions, etc. | |
e.g. | |
int add(int num1, int num 2) { | |
return num 1 + num2; | |
} |
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
/* | |
Groovy class inheritence demonstration | |
*/ | |
class Ancestor { | |
def name | |
Ancestor() { | |
name = "Homo erectus" | |
} | |
def speak() { | |
println "I am " + name |
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
sPerson.scala: | |
class sPerson extends jPerson { | |
def getName(): String = "Sammy Saint" | |
} | |
jPerson.java: | |
public interface jPerson { | |
public String getName(); |
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 GaudiUILogic { | |
Void invokeGaudi(Str params) { | |
Process gaudi := sys::Process() | |
gaudi.command = ["gaudi", params] | |
gaudi.run() | |
} | |
} |
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
/* | |
Traffic lights finite state machine (FSM) | |
as programmed in C. | |
*/ | |
#include <stdio.h> // For stdout | |
#include "xplatform.h" // For cross-platform xsleep() and xcls() | |
void goToState(void); // Prototype | |
// Define states (enumerated types - like ints) |
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
/* | |
Cross-platform header | |
for functions that need to work on | |
more than just Windows | |
*/ | |
#include <stdlib.h> | |
#ifdef _WIN32 | |
#include <windows.h> | |
#else | |
#include <unistd.h> |
OlderNewer