diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-27 18:40:32 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-27 18:40:32 -0700 |
| commit | 5f3fb9afece2125cbeba79d61a8d88460b7878d7 (patch) | |
| tree | b0e1e60bae9927a9449561bf7fe9431a54d12be9 /installer | |
| download | LegacyQBar-5f3fb9afece2125cbeba79d61a8d88460b7878d7.tar.gz LegacyQBar-5f3fb9afece2125cbeba79d61a8d88460b7878d7.tar.bz2 LegacyQBar-5f3fb9afece2125cbeba79d61a8d88460b7878d7.zip | |
initial commit
Diffstat (limited to 'installer')
| -rwxr-xr-x | installer/README.txt | 1 | ||||
| -rwxr-xr-x | installer/install.sh | 36 | ||||
| -rw-r--r-- | installer/qbar/lib/JavaCommon.jar | bin | 0 -> 28273 bytes | |||
| -rw-r--r-- | installer/qbar/lib/QBarInterpreter.jar | bin | 0 -> 102851 bytes | |||
| -rw-r--r-- | installer/qbar/lib/endorsed/io.jar | bin | 0 -> 40141 bytes | |||
| -rw-r--r-- | installer/qbar/lib/endorsed/mysql-connector-java-5.1.16-bin.jar | bin | 0 -> 786484 bytes | |||
| -rw-r--r-- | installer/qbar/lib/endorsed/mysql.jar | bin | 0 -> 11115 bytes | |||
| -rwxr-xr-x | installer/qbar/qbar.sh | 3 | ||||
| -rw-r--r-- | installer/qbar/qbar/io/BufferedReader.qbar | 62 | ||||
| -rw-r--r-- | installer/qbar/qbar/io/File.qbar | 10 | ||||
| -rw-r--r-- | installer/qbar/qbar/io/Reader.qbar | 24 | ||||
| -rw-r--r-- | installer/qbar/qbar/lang/Math.qbar | 84 | ||||
| -rw-r--r-- | installer/qbar/qbar/lang/Maybe.qbar | 16 | ||||
| -rw-r--r-- | installer/qbar/qbar/lang/System.qbar | 11 | ||||
| -rwxr-xr-x | installer/qbar_package.tgz | bin | 0 -> 902804 bytes |
15 files changed, 247 insertions, 0 deletions
diff --git a/installer/README.txt b/installer/README.txt new file mode 100755 index 0000000..b621bb5 --- /dev/null +++ b/installer/README.txt @@ -0,0 +1 @@ +To install it is very simple, just run installer.sh diff --git a/installer/install.sh b/installer/install.sh new file mode 100755 index 0000000..c0c47e3 --- /dev/null +++ b/installer/install.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +if [ `whoami` != root ] ; then + echo "Woah! Not so fast, need to be root!" + exit 1 +fi + +if [ -d /usr/lib/qbar ] ; then + echo "Wait, qbar is already installed, or at least the directory is still there (/usr/lib/qbar)" + + echo "Would you like to reinstall it? [Y/n]" + read input + + while [[ ($input != Y && $input != n) ]] ; do + echo "Y or n" + read input + done + + if [ $input == n ] ; then + exit 0 + else + rm -rv /usr/lib/qbar + rm -v /usr/bin/qbar + fi +fi + +tar -xzvf qbar_package.tgz +mv -v qbar/ /usr/lib/ + +# ---------- Time to install the binary into the right directory ------------ +cd /usr/bin + +# need to sym-link to qbar, then we should be good. +ln -sv /usr/lib/qbar/qbar.sh qbar +chmod +x qbar + diff --git a/installer/qbar/lib/JavaCommon.jar b/installer/qbar/lib/JavaCommon.jar Binary files differnew file mode 100644 index 0000000..604c670 --- /dev/null +++ b/installer/qbar/lib/JavaCommon.jar diff --git a/installer/qbar/lib/QBarInterpreter.jar b/installer/qbar/lib/QBarInterpreter.jar Binary files differnew file mode 100644 index 0000000..a95ecb1 --- /dev/null +++ b/installer/qbar/lib/QBarInterpreter.jar diff --git a/installer/qbar/lib/endorsed/io.jar b/installer/qbar/lib/endorsed/io.jar Binary files differnew file mode 100644 index 0000000..38cb62e --- /dev/null +++ b/installer/qbar/lib/endorsed/io.jar diff --git a/installer/qbar/lib/endorsed/mysql-connector-java-5.1.16-bin.jar b/installer/qbar/lib/endorsed/mysql-connector-java-5.1.16-bin.jar Binary files differnew file mode 100644 index 0000000..e62f2cb --- /dev/null +++ b/installer/qbar/lib/endorsed/mysql-connector-java-5.1.16-bin.jar diff --git a/installer/qbar/lib/endorsed/mysql.jar b/installer/qbar/lib/endorsed/mysql.jar Binary files differnew file mode 100644 index 0000000..023d025 --- /dev/null +++ b/installer/qbar/lib/endorsed/mysql.jar diff --git a/installer/qbar/qbar.sh b/installer/qbar/qbar.sh new file mode 100755 index 0000000..31d7033 --- /dev/null +++ b/installer/qbar/qbar.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +java -jar /usr/lib/qbar/lib/QBarInterpreter.jar -p /usr/lib/qbar $@ diff --git a/installer/qbar/qbar/io/BufferedReader.qbar b/installer/qbar/qbar/io/BufferedReader.qbar new file mode 100644 index 0000000..0b5c382 --- /dev/null +++ b/installer/qbar/qbar/io/BufferedReader.qbar @@ -0,0 +1,62 @@ +Import qbar/io/Reader.qbar;
+Import qbar/lang/Maybe.qbar;
+Import qbar/lang/System.qbar;
+
+Namespace BufferedReader {
+ Incorporate Reader;
+
+ Struct BufferedReader extends Reader {
+ let new BufferedReader( reader ) = do {
+ this.init( reader );
+
+ if reader isa Reader {
+ this.reader <- reader;
+ } else {
+ this.reader <- new Reader( reader );
+ }
+
+ this.buffer <- [];
+ this.bufSize <- 4096;
+ this.bufCur <- 0;
+ this.dbg <- 1;
+
+ System.printStrLn( "START" );
+
+ this.readBuffer();
+ }
+
+ let read = do {
+ if this.bufCur == this.bufSize {
+ this.readBuffer();
+ this.bufCur <- 0;
+ }
+
+ yeild <- this.buffer#this.bufCur;
+ this.bufCur <- this.bufCur + 1;
+
+ return yeild;
+ }
+
+ let readBuffer = do {
+ System.printStrLn( "Reading Buffer " ++ this.dbg );
+ this.buffer <- this.readBytes( this.bufSize );
+ this.dbg <- this.dbg + 1;
+ }
+
+ let readLine = do {
+ str <- "" ++ "";
+
+ i <- 0;
+ while ( i <- this.read() ) != 10 {
+ if i == -1 {
+ return if str.length == 0 then Maybe.new Null()
+ else Maybe.new Maybe( str );
+ }
+
+ str +< i as Character;
+ }
+
+ return Maybe.new Maybe(str);
+ }
+ }
+}
\ No newline at end of file diff --git a/installer/qbar/qbar/io/File.qbar b/installer/qbar/qbar/io/File.qbar new file mode 100644 index 0000000..3f848aa --- /dev/null +++ b/installer/qbar/qbar/io/File.qbar @@ -0,0 +1,10 @@ +-{
+ This namespace has several native methods
+ that are used to help dealing with file operations.
+}-
+Namespace File {
+ -{
+ Incorporates com.modulus.qbar.io.IOTools class
+ }-
+ Incorporate Native com.modulus.qbar.io.IOTools;
+}
\ No newline at end of file diff --git a/installer/qbar/qbar/io/Reader.qbar b/installer/qbar/qbar/io/Reader.qbar new file mode 100644 index 0000000..3522adf --- /dev/null +++ b/installer/qbar/qbar/io/Reader.qbar @@ -0,0 +1,24 @@ +Namespace Reader {
+ Struct Reader {
+ -- some kind of instream
+ let new Reader( instream ) = this.init( instream );
+
+ let init( instream ) = this.instream <- instream;
+
+ let close = this.instream.close();
+
+ let mark = this.instream.mark();
+
+ let reset = this.instream.reset();
+
+ let read = this.instream.read();
+
+ let readBytes(n) = this.instream.readBytes(n);
+
+ let skip(n) = this.instream.skip();
+
+ let available = this.instream.available();
+
+ let nextChar = this.read() as Character;
+ }
+}
\ No newline at end of file diff --git a/installer/qbar/qbar/lang/Math.qbar b/installer/qbar/qbar/lang/Math.qbar new file mode 100644 index 0000000..965c123 --- /dev/null +++ b/installer/qbar/qbar/lang/Math.qbar @@ -0,0 +1,84 @@ +-{
+ Math namespace, this holds many
+ useful functions for anytime
+ math computations.
+
+ This namespace includes aliases
+ of all the functions in java.lang.Math
+ and also includes some extra series
+ functions.
+ }-
+Namespace QBMath {
+
+ -- need to include the native java class
+ Incorporate Native java.lang.Math;
+
+ -{
+ The constructor of QBMath creates some
+ of the basic series that QBMath uses.
+ }-
+ let construct = do {
+
+
+ -- the `this` is negated all too often
+ -{
+ The series list for pascal's
+ triangle.
+ }-
+ this.pascalSeries <- [ n | if n <= 0 then [1]
+ else if n == 1 then [ 1, 1 ]
+ else QBMath.pascalTriangle( this#(n-1) ) ];
+
+ -{
+ The series list for the fibonacci
+ series
+ }-
+ this.fibonacciSeries <- [ n | if n < 2 then n
+ else this#( n - 1 ) + this#(n - 2) ];
+
+ -{
+ The series list for the
+ factorial series.
+ }-
+ this.factorialSeries <- [ n | if n <= 1 then 1
+ else n * this#(n - 1) ];
+ }
+
+ -{
+ The pascal function takes
+ a list and uses that list
+ to generate what would be
+ the next list in the pascal
+ series.
+ }-
+ let pascalTriangle( lastList ) = do {
+ ret <- [1];
+
+ for [ 0 .. lastList.length - 2 ] -> n {
+ ret +< lastList#n + lastList#(n+1);
+ }
+
+ ret +< 1;
+ return ret;
+ }
+
+ -{
+ Directly accesses the factorialSeries
+ get function.
+
+ @return the factorial of `n` (`n!`)
+ }-
+ let factorial( n ) = this.factorialSeries # n;
+
+ -{
+ @return the `n`<sup>th</sup> number
+ in the fibonacci series.
+ }-
+ let fibonacci( n ) = this.fibonacciSeries # n;
+
+ -{
+ @return the `n`<sup>th</sup> list in
+ pascal's triangle list.
+ }-
+ let pascal( n ) = this.pascalList # n;
+}
\ No newline at end of file diff --git a/installer/qbar/qbar/lang/Maybe.qbar b/installer/qbar/qbar/lang/Maybe.qbar new file mode 100644 index 0000000..5b4e37d --- /dev/null +++ b/installer/qbar/qbar/lang/Maybe.qbar @@ -0,0 +1,16 @@ +Import qbar/lang/System.qbar;
+
+Namespace Maybe {
+ Struct Maybe {
+ let new Null = this.null <- 1;
+
+ let new Maybe( obj ) = do {
+ this.obj <- obj;
+ this.null <- 0;
+ }
+
+ let isNull = this.null;
+
+ let getObj = this.obj;
+ }
+}
\ No newline at end of file diff --git a/installer/qbar/qbar/lang/System.qbar b/installer/qbar/qbar/lang/System.qbar new file mode 100644 index 0000000..6b04d59 --- /dev/null +++ b/installer/qbar/qbar/lang/System.qbar @@ -0,0 +1,11 @@ +
+-{
+ This namespace holds many raw and basic
+ functions that the user may want to use.
+
+ This Namespace is for the most part native.
+ }-
+Namespace System {
+ -- incorporate the native QBSystem class
+ Incorporate Native com.modulus.qbar.lang.QBSystem;
+}
\ No newline at end of file diff --git a/installer/qbar_package.tgz b/installer/qbar_package.tgz Binary files differnew file mode 100755 index 0000000..2d6d4a6 --- /dev/null +++ b/installer/qbar_package.tgz |