{
-
- // Show a spinning dialog
- ProgressDialog pd = ProgressDialog.show(StartExecution.this, "Working...",
- "Measuring the DL overhead...", true, false);
-
- @Override
- protected Void doInBackground(Void... params) {
- // SSL_NO_REUSE makes sense only for the connection test.
- // Once the connection is setup it works exactly like SSL.
- // Since I am going to show only the results for 4 bytes, 1KB, and 1MB measure the energy only
- // for these sizes
- COMM_TYPE[] commTypes = {COMM_TYPE.CLEAR, COMM_TYPE.SSL};
- String[] stringCommTypes = {"CLEAR", "SSL"};
- int[] nrTests = {200, 100, 10};
- int[] bytesToReceiveSize = {4, 1024, 1024 * 1024};
- String[] bytesSizeToReceiveString = {"4B", "1KB", "1MB"};
-
- // int[] nrTests = {5};
- // int[] bytesToReceiveSize = {1 * 1024 * 1024};
- // String[] bytesSizeToReceiveString = {"1MB"};
-
- // Measure the increase of data size due to encryption strategies.
- File bytesLogFile = new File(Constants.TEST_LOGS_FOLDER + "receive_bytes_test_size.csv");
- BufferedWriter buffBytesLogFile = null;
-
- try {
- bytesLogFile.delete();
- bytesLogFile.createNewFile();
- buffBytesLogFile = new BufferedWriter(new FileWriter(bytesLogFile, true));
- } catch (IOException e2) {
- e2.printStackTrace();
- }
-
- // Sleep 10 seconds before starting the energy measurement experiment to avoid the errors
- // introduced by pressing the button
- sleep(10 * 1000);
-
- for (int bs = 0; bs < bytesToReceiveSize.length; bs++) {
- try {
- buffBytesLogFile.write(bytesSizeToReceiveString[bs] + "\t");
- } catch (IOException e2) {
- e2.printStackTrace();
- }
-
- for (int ct = 0; ct < commTypes.length; ct++) {
-
- publishProgress("DL test of " + bytesToReceiveSize[bs] + " bytes in " + commTypes[ct]);
-
- File logFile = new File(Constants.TEST_LOGS_FOLDER + "receive_" + bytesToReceiveSize[bs]
- + "_bytes_test_" + stringCommTypes[ct] + "_" + dfe.getConnectionType() + ".csv");
-
- try {
- logFile.delete();
- logFile.createNewFile();
- BufferedWriter buffLogFile = new BufferedWriter(new FileWriter(logFile, true));
-
- double totalRxBytes = 0;
- int nrSuccessTests = 0;
- for (int i = 0; i < nrTests[bs]; i++) {
-
- Log.i(TAG, "Receiving " + bytesToReceiveSize[bs] + " bytes using "
- + stringCommTypes[ct] + " connection");
-
- try {
- // Change the connection to the new communication protocol
- dfe.testConnection(commTypes[ct], null);
- totalRxBytes += dfe.testReceiveBytes(bytesToReceiveSize[bs], buffLogFile);
- nrSuccessTests++;
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- }
- totalRxBytes = (nrSuccessTests > 0) ? totalRxBytes /= nrSuccessTests : -1;
-
- buffBytesLogFile.write(totalRxBytes + ((ct == commTypes.length - 1) ? "\n" : "\t"));
- buffLogFile.close();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- sleep(1 * 1000);
- }
- sleep(1 * 1000);
- }
-
- try {
- buffBytesLogFile.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- @Override
- protected void onProgressUpdate(String... progress) {
- Log.i(TAG, progress[0]);
- if (pd != null) {
- pd.setMessage(progress[0]);
- }
- }
-
- @Override
- protected void onPostExecute(Void result) {
- Log.i(TAG, "Finished measuring the DL overhead...");
- if (pd != null) {
- pd.dismiss();
- }
- }
-
- }
-
- private void sleep(int millis) {
- try {
- Thread.sleep(millis);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- public void vmConnectionStatusUpdate() {
- new Thread(new VmConnectionStatusUpdater()).start();
- }
-}
diff --git a/Rapid-DemoApp/src/eu/project/rapid/queens/NQueens.java b/Rapid-DemoApp/src/eu/project/rapid/queens/NQueens.java
deleted file mode 100644
index 0d61b84..0000000
--- a/Rapid-DemoApp/src/eu/project/rapid/queens/NQueens.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2015, 2016 RAPID EU Project
- *
- * This library is free software; you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation; either version
- * 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License along with this library;
- * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *******************************************************************************/
-package eu.project.rapid.queens;
-
-import java.lang.reflect.Method;
-
-import android.util.Log;
-import eu.project.rapid.ac.DFE;
-import eu.project.rapid.ac.Remote;
-import eu.project.rapid.ac.Remoteable;
-import eu.project.rapid.ac.utils.Utils;
-
-public class NQueens extends Remoteable {
-
- private static final long serialVersionUID = 5687713591581731140L;
- private static final String TAG = "NQueens";
- private int N = 8;
- private int nrClones;
- private transient DFE dfe;
-
- /**
- * @param dfe The execution dfe taking care of the execution
- * @param nrClones In case of remote execution specify the number of clones needed
- */
- public NQueens(DFE dfe, int nrClones) {
- this.dfe = dfe;
- this.nrClones = nrClones;
- }
-
- /**
- * @param dfe The execution dfe taking care of the execution
- */
- public NQueens(DFE dfe) {
- this(dfe, 1);
- }
-
- @Override
- public void prepareDataOnClient() {
-
- }
-
- /**
- * Solve the N-queens problem
- *
- * @param N The number of queens
- * @return The number of solutions found
- */
- public int solveNQueens(int N) {
- this.N = N;
- Method toExecute;
- Class>[] paramTypes = {int.class};
- Object[] paramValues = {N};
-
- int result = 0;
- try {
- toExecute = this.getClass().getDeclaredMethod("localSolveNQueens", paramTypes);
- result = (Integer) dfe.execute(toExecute, paramValues, this);
- } catch (SecurityException e) {
- // Should never get here
- e.printStackTrace();
- throw e;
- } catch (NoSuchMethodException e) {
- // Should never get here
- e.printStackTrace();
- } catch (Throwable e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return result;
- }
-
- @Remote
- public int localSolveNQueens(int N) {
-
- byte[][] board = new byte[N][N];
- int countSolutions = 0;
-
- int start = 0, end = N;
-
- if (Utils.isOffloaded()) {
- // cloneId == 0 if this is the main clone
- // or [1, nrClones-1] otherwise
- int cloneId = Utils.readCloneHelperId();
- int howManyCols = (int) ((N) / nrClones); // Integer division, we may
- // loose some columns.
- start = cloneId * howManyCols; // cloneId == 0 if this is the main clone
- end = start + howManyCols;
-
- // If this is the clone with the highest id let him take care
- // of the columns not considered due to the integer division.
- if (cloneId == nrClones - 1) {
- end += N % nrClones;
- }
- }
-
- Log.i(TAG, "Finding solutions for " + N + "-queens puzzle.");
- Log.i(TAG, "Analyzing columns: " + start + "-" + (end - 1));
-
- for (int i = start; i < end; i++) {
- for (int j = 0; j < N; j++) {
- for (int k = 0; k < N; k++) {
- for (int l = 0; l < N; l++) {
- if (N == 4) {
- countSolutions += setAndCheckBoard(board, new int[] {i, j, k, l});
- continue;
- }
- for (int m = 0; m < N; m++) {
- if (N == 5) {
- countSolutions += setAndCheckBoard(board, new int[] {i, j, k, l, m});
- continue;
- }
- for (int n = 0; n < N; n++) {
- if (N == 6) {
- countSolutions += setAndCheckBoard(board, new int[] {i, j, k, l, m, n});
- continue;
- }
- for (int o = 0; o < N; o++) {
- if (N == 7) {
- countSolutions += setAndCheckBoard(board, new int[] {i, j, k, l, m, n, o});
- continue;
- }
- for (int p = 0; p < N; p++) {
- countSolutions += setAndCheckBoard(board, new int[] {i, j, k, l, m, n, o, p});
- }
- }
- }
- }
- }
- }
- }
- }
-
- Log.i(TAG, "Found " + countSolutions + " solutions.");
- return countSolutions;
- }
-
- /**
- * When having more than one clone running the method there will be partial results which should
- * be combined to get the total result. This will be done automatically by the main clone by
- * calling this method.
- *
- * @param params Array of partial results.
- * @return The total result.
- */
- public int localSolveNQueensReduce(int[] params) {
- int solutions = 0;
- for (int i = 0; i < params.length; i++) {
- Log.i(TAG, "Adding " + params[i] + " partial solutions.");
- solutions += params[i];
- }
- return solutions;
- }
-
- private int setAndCheckBoard(byte[][] board, int... cols) {
-
- clearBoard(board);
-
- for (int i = 0; i < N; i++)
- board[i][cols[i]] = 1;
-
- if (isSolution(board))
- return 1;
-
- return 0;
- }
-
- private void clearBoard(byte[][] board) {
- for (int i = 0; i < N; i++) {
- for (int j = 0; j < N; j++) {
- board[i][j] = 0;
- }
- }
- }
-
- private boolean isSolution(byte[][] board) {
-
- int rowSum = 0;
- int colSum = 0;
-
- for (int i = 0; i < N; i++) {
- for (int j = 0; j < N; j++) {
- rowSum += board[i][j];
- colSum += board[j][i];
-
- if (i == 0 || j == 0)
- if (!checkDiagonal1(board, i, j))
- return false;
-
- if (i == 0 || j == N - 1)
- if (!checkDiagonal2(board, i, j))
- return false;
-
- }
- if (rowSum > 1 || colSum > 1)
- return false;
- rowSum = 0;
- colSum = 0;
- }
-
- return true;
- }
-
- private boolean checkDiagonal1(byte[][] board, int row, int col) {
- int sum = 0;
- int i = row;
- int j = col;
- while (i < N && j < N) {
- sum += board[i][j];
- i++;
- j++;
- }
- return sum <= 1;
- }
-
- private boolean checkDiagonal2(byte[][] board, int row, int col) {
- int sum = 0;
- int i = row;
- int j = col;
- while (i < N && j >= 0) {
- sum += board[i][j];
- i++;
- j--;
- }
- return sum <= 1;
- }
-
-
- private void printBoard(byte[][] board) {
- for (int i = 0; i < N; i++) {
- StringBuilder row = new StringBuilder();
- for (int j = 0; j < N; j++) {
- row.append(board[i][j]);
- if (j < N - 1)
- row.append(" ");
- }
- Log.i(TAG, row.toString());
- }
- Log.i(TAG, "\n");
- }
-
- public void setNumberOfClones(int nrClones) {
- this.nrClones = nrClones;
- }
-
- @Override
- public void copyState(Remoteable state) {
-
- }
-}
-
diff --git a/Rapid-DemoApp/src/eu/project/rapid/sudoku/Sudoku.java b/Rapid-DemoApp/src/eu/project/rapid/sudoku/Sudoku.java
deleted file mode 100755
index 87866db..0000000
--- a/Rapid-DemoApp/src/eu/project/rapid/sudoku/Sudoku.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2015, 2016 RAPID EU Project
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *******************************************************************************/
-package eu.project.rapid.sudoku;
-
-import java.lang.reflect.Method;
-
-import eu.project.rapid.ac.DFE;
-import eu.project.rapid.ac.Remote;
-import eu.project.rapid.ac.Remoteable;
-
-/**
- * The Sudoku
class povides a static main
method allowing it to be called
- * from the command line to print the solution to a specified Sudoku problem.
- *
- *
- * The following is an example of a Sudoku problem:
- *
- *
- * -----------------------
- * | 8 | 4 2 | 6 |
- * | 3 4 | | 9 1 |
- * | 9 6 | | 8 4 |
- * -----------------------
- * | | 2 1 6 | |
- * | | | |
- * | | 3 5 7 | |
- * -----------------------
- * | 8 4 | | 7 5 |
- * | 2 6 | | 1 3 |
- * | 9 | 7 1 | 4 |
- * -----------------------
- *
- *
- * The goal is to fill in the missing numbers so that every row, column and box contains each of the
- * numbers 1-9
. Here is the solution to the problem above:
- *
- *
- * -----------------------
- * | 1 8 7 | 4 9 2 | 5 6 3 |
- * | 5 3 4 | 6 7 8 | 9 1 2 |
- * | 9 6 2 | 1 3 5 | 7 8 4 |
- * -----------------------
- * | 4 5 8 | 2 1 6 | 3 9 7 |
- * | 2 7 3 | 8 4 9 | 6 5 1 |
- * | 6 1 9 | 3 5 7 | 4 2 8 |
- * -----------------------
- * | 8 4 1 | 9 6 3 | 2 7 5 |
- * | 7 2 6 | 5 8 4 | 1 3 9 |
- * | 3 9 5 | 7 2 1 | 8 4 6 |
- * -----------------------
- *
- *
- * Note that the first row 187492563
contains each number exactly once, as does the
- * first column 159426873
, the upper-left box 187534962
, and every other
- * row, column and box.
- *
- *
- * The {@link #main(String[])} method encodes a problem as an array of strings, with one string
- * encoding each constraint in the problem in row-column-value format. Here is the problem again
- * with the indices indicated:
- *
- *
- * 0 1 2 3 4 5 6 7 8
- * -----------------------
- * 0 | 8 | 4 2 | 6 |
- * 1 | 3 4 | | 9 1 |
- * 2 | 9 6 | | 8 4 |
- * -----------------------
- * 3 | | 2 1 6 | |
- * 4 | | | |
- * 5 | | 3 5 7 | |
- * -----------------------
- * 6 | 8 4 | | 7 5 |
- * 7 | 2 6 | | 1 3 |
- * 8 | 9 | 7 1 | 4 |
- * -----------------------
- *
- *
- * The 8
in the upper left box of the puzzle is encoded as 018
(
- * 0
for the row, 1
for the column, and 8
for the value). The
- * 4
in the lower right box is encoded as 874
.
- *
- *
- * The full command-line invocation for the above puzzle is:
- *
- *
- * % java -cp . Sudoku 018 034 052 076 \
- *
- * 113 124 169 171 \
- *
- * 209 216 278 284 \
- *
- * 332 341 356 \
- *
- * 533 545 557 \
- *
- * 608 614 677 685 \
- *
- * 712 726 761 773 \
- *
- * 819 837 851 874 \
- *
- *
- *
- *
- * See Wikipedia: Sudoku for more information on
- * Sudoku.
- *
- *
- * The algorithm employed is similar to the standard backtracking
- * eight queens algorithm.
- *
- * @version 1.0
- * @author Bob Carpenter
- */
-public class Sudoku extends Remoteable {
-
- private static final long serialVersionUID = -3962977915411306215L;
-
- private transient DFE dfe;
-
- private int[][] matrix;
-
- private String[] input =
- {"006", "073", "102", "131", "149", "217", "235", "303", "345", "361", "378", "422", "465",
- "514", "521", "548", "582", "658", "679", "743", "752", "784", "818", "883"};
-
- public Sudoku(DFE dfe) {
- this.dfe = dfe;
- matrix = parseProblem(input);
- }
-
- @Remote
- public boolean localhasSolution() {
- return solve(0, 0, matrix);
- }
-
- public boolean solve(int i, int j, int[][] cells) {
- if (i == 9) {
- i = 0;
- if (++j == 9)
- return true;
- }
- if (cells[i][j] != 0)
- return solve(i + 1, j, cells);
- for (int val = 1; val <= 9; ++val) {
- if (legal(i, j, val, cells)) {
- cells[i][j] = val;
- if (solve(i + 1, j, cells))
- return true;
- }
- }
- cells[i][j] = 0;
- return false;
- }
-
- private boolean legal(int i, int j, int val, int[][] cells) {
- for (int k = 0; k < 9; ++k)
- if (val == cells[k][j])
- return false;
- for (int k = 0; k < 9; ++k)
- if (val == cells[i][k])
- return false;
- int boxRowOffset = (i / 3) * 3;
- int boxColOffset = (j / 3) * 3;
- for (int k = 0; k < 3; ++k)
- for (int m = 0; m < 3; ++m)
- if (val == cells[boxRowOffset + k][boxColOffset + m])
- return false;
- return true;
- }
-
- static int[][] parseProblem(String[] input) {
- int[][] problem = new int[9][9];
- for (int n = 0; n < input.length; ++n) {
- int i = Integer.parseInt(input[n].substring(0, 1));
- int j = Integer.parseInt(input[n].substring(1, 2));
- int val = Integer.parseInt(input[n].substring(2, 3));
- problem[i][j] = val;
- }
- return problem;
- }
-
- @Override
- public void copyState(Remoteable state) {}
-
- public boolean hasSolution() {
- Method toExecute;
- Class>[] paramTypes = null;
- Object[] paramValues = null;
- boolean result = false;
- try {
- toExecute = this.getClass().getDeclaredMethod("localhasSolution", paramTypes);
- result = (Boolean) dfe.execute(toExecute, paramValues, this);
- } catch (SecurityException e) {
- // Should never get here
- e.printStackTrace();
- throw e;
- } catch (NoSuchMethodException e) {
- // Should never get here
- e.printStackTrace();
- } catch (Throwable e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return result;
- }
-}
diff --git a/Rapid-DemoApp/src/eu/project/rapid/synthBenchmark/JniTest.java b/Rapid-DemoApp/src/eu/project/rapid/synthBenchmark/JniTest.java
deleted file mode 100755
index 451d1dc..0000000
--- a/Rapid-DemoApp/src/eu/project/rapid/synthBenchmark/JniTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2015, 2016 RAPID EU Project
- *
- * This library is free software; you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation; either version
- * 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License along with this library;
- * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *******************************************************************************/
-package eu.project.rapid.synthBenchmark;
-
-import java.lang.reflect.Method;
-
-import android.util.Log;
-import eu.project.rapid.ac.DFE;
-import eu.project.rapid.ac.Remoteable;
-
-public class JniTest extends Remoteable {
-
- /**
- *
- */
- private static final long serialVersionUID = 7407706990063388777L;
-
- private transient DFE dfe;
-
- public int temp = 0;
-
- public JniTest(DFE dfe) {
- this.dfe = dfe;
- }
-
- /*
- * A native method that is implemented by the 'hello-jni' native library, which is packaged with
- * this application.
- */
- public native String stringFromJNI();
-
- static {
- try {
- System.loadLibrary("hello-jni");
- } catch (UnsatisfiedLinkError e) {
- Log.i("JniTest", "Could not load native library, maybe this is running on the clone.");
- }
- }
-
- public String jniCaller() {
- Method toExecute;
- String result = null;
- try {
- toExecute = this.getClass().getDeclaredMethod("localjniCaller", (Class[]) null);
- result = (String) dfe.execute(toExecute, this);
- } catch (SecurityException e) {
- // Should never get here
- e.printStackTrace();
- throw e;
- } catch (NoSuchMethodException e) {
- // Should never get here
- e.printStackTrace();
- } catch (Throwable e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return result;
- }
-
- public String localjniCaller() {
- return stringFromJNI();
- }
-
- @Override
- public void copyState(Remoteable arg0) {
- // TODO Auto-generated method stub
- }
-}
diff --git a/Rapid-DemoApp/src/eu/project/rapid/synthBenchmark/TestRemoteable.java b/Rapid-DemoApp/src/eu/project/rapid/synthBenchmark/TestRemoteable.java
deleted file mode 100755
index 35757cb..0000000
--- a/Rapid-DemoApp/src/eu/project/rapid/synthBenchmark/TestRemoteable.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2015, 2016 RAPID EU Project
- *
- * This library is free software; you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation; either version
- * 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License along with this library;
- * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *******************************************************************************/
-package eu.project.rapid.synthBenchmark;
-
-import java.lang.reflect.Method;
-import java.util.Random;
-
-import eu.project.rapid.ac.DFE;
-import eu.project.rapid.ac.Remoteable;
-
-/**
- * Simple class that tests offloading for trivial applications.
- */
-public class TestRemoteable extends Remoteable {
- private static final long serialVersionUID = 1L;
-
- public transient DFE dfe;
-
- public TestRemoteable(DFE dfe) {
- this.dfe = dfe;
- }
-
- public String cpuLoader1() {
- Method toExecute;
- String result = "";
- try {
- toExecute = this.getClass().getDeclaredMethod("localCpuLoader1", (Class[]) null);
- result = (String) dfe.execute(toExecute, this);
- } catch (SecurityException e) {
- e.printStackTrace();
- throw e;
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- } catch (Throwable e) {
- e.printStackTrace();
- }
- return result;
- }
-
- public String localCpuLoader1() {
- for (int i = 0; i < 10000; i++) {
- }
- return "cpuLoader1 finished";
- }
-
- public String cpuLoader2() {
- Method toExecute;
- String result = "";
- try {
- toExecute = this.getClass().getDeclaredMethod("localCpuLoader2", (Class[]) null);
- result = (String) dfe.execute(toExecute, this);
- } catch (SecurityException e) {
- // Should never get here
- e.printStackTrace();
- throw e;
- } catch (NoSuchMethodException e) {
- // Should never get here
- e.printStackTrace();
- } catch (Throwable e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return result;
- }
-
- public Long cpuLoader3(int seed) {
- Method toExecute;
- Class>[] paramTypes = {int.class};
- Object[] paramValues = {seed};
- Long result = null;
- try {
- toExecute = this.getClass().getDeclaredMethod("localCpuLoader3", paramTypes);
- result = (Long) dfe.execute(toExecute, paramValues, this);
- } catch (SecurityException e) {
- // Should never get here
- e.printStackTrace();
- throw e;
- } catch (NoSuchMethodException e) {
- // Should never get here
- e.printStackTrace();
- } catch (Throwable e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return result;
- }
-
- public String localCpuLoader2() {
- for (int i = 0; i < 500000; i++) {
- }
- return "cpuLoader2 finished";
- }
-
- public Long localCpuLoader3(int seed) {
- Random rand = new Random(seed);
- return rand.nextLong();
- }
-
- @Override
- public void copyState(Remoteable state) {
- // No fields to restore
- }
-}
diff --git a/Rapid-DemoApp/src/eu/project/rapid/virus/VirusScanning.java b/Rapid-DemoApp/src/eu/project/rapid/virus/VirusScanning.java
deleted file mode 100644
index bf5c8ee..0000000
--- a/Rapid-DemoApp/src/eu/project/rapid/virus/VirusScanning.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2015, 2016 RAPID EU Project
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *******************************************************************************/
-package eu.project.rapid.virus;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-import android.content.Context;
-import android.util.Log;
-import eu.project.rapid.ac.DFE;
-import eu.project.rapid.ac.Remote;
-import eu.project.rapid.ac.Remoteable;
-import eu.project.rapid.ac.utils.Constants;
-import eu.project.rapid.ac.utils.Utils;
-import eu.project.rapid.ac.utils.ZipHandler;
-
-/**
- * The virus scanning application.
- */
-public class VirusScanning extends Remoteable {
-
- private static final long serialVersionUID = -1839651210541446342L;
-
- private static final String TAG = "VirusScanning";
-
- private transient String[] signatureDB;
- private byte[] zippedFolder;
- private static final int SIGNATURE_SIZE = 1024;
- private int lastFileOnPhone = -1;
- private double localFraction;
-
- protected transient DFE dfe;
- protected int nrClones = 1;
- private char[] fileBuffer;
- private char[] fileHeaderBuffer = new char[SIGNATURE_SIZE];
-
- public VirusScanning(Context ctx, DFE dfe, int nrClones) {
- this.dfe = dfe;
- this.nrClones = nrClones;
- }
-
- /**
- * Get the fraction of data that should be processed by the phone and split the input in two
- * parts: (S_P0, S_P1) such that S_P0 + S_P1 = S_app.
- * This should be implemented by the developer. In the virus scanning case we split the files in
- * two groups.
- *
- * @param localFraction The fraction of data input that will be processed locally on the phone.
- */
- public void prepareData(double localFraction) {
-
- this.localFraction = localFraction;
-
- Log.i(TAG, "Started folder compression");
-
- File zippedFile = null;
- File folderToScan = new File(Constants.VIRUS_FOLDER_TO_SCAN);
- String[] fileNames = folderToScan.list();
-
- // The first files should be scanned on phone.
- lastFileOnPhone = (int) (localFraction * fileNames.length);
- Log.i(TAG, "localFraction: " + localFraction + "\nfl: " + fileNames.length
- + "\nlastFileOnPhone: " + lastFileOnPhone);
-
- if (localFraction == 1) {
- Log.w(TAG, "No need to prepare the data. All execution is going to be local.");
- return;
- } else {
- long s = System.currentTimeMillis();
- try {
- ZipHandler.zipFolder(Constants.VIRUS_FOLDER_TO_SCAN, Constants.VIRUS_FOLDER_ZIP,
- lastFileOnPhone, fileNames.length);
- } catch (Exception e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- Log.d(TAG, "Time to zip the files: " + (System.currentTimeMillis() - s) + " ms");
-
- // Read the zip folder to make it ready for remote processing
- zippedFile = new File(Constants.VIRUS_FOLDER_ZIP);
- }
-
- FileInputStream in = null;
- try {
- in = new FileInputStream(zippedFile);
- int length = (int) zippedFile.length();
- int read = 0;
- int totalRead = 0;
- zippedFolder = new byte[length];
- while (read != -1 && totalRead < length) {
- read = in.read(zippedFolder, totalRead, length - totalRead);
- totalRead += read;
- Log.i(TAG, "Read " + totalRead);
- }
- } catch (IOException e) {
- Log.e(TAG, "Cannot find the zip file to send on the remote side" + e);
- } catch (Exception e) {
- Log.e(TAG, "Cannot find the zip file to send on the remote side" + e);
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- Log.e(TAG, "Could not close the FileStream of the zipped folder");
- }
- }
-
- Log.i(TAG, "Finished folder compression");
- }
-
- /**
- * The method that starts the scanning process using the DFE.
- *
- * @return Number of viruses found.
- */
- public int scanFolder() {
- int nrVirusesFound = 0;
-
- Method toExecute;
- Class>[] paramTypes = null;
- Object[] paramValues = null;
-
- try {
- toExecute = this.getClass().getDeclaredMethod("localScanFolder", paramTypes);
- nrVirusesFound = (Integer) dfe.execute(toExecute, paramValues, this);
- } catch (SecurityException e) {
- // Should never get here
- e.printStackTrace();
- throw e;
- } catch (NoSuchMethodException e) {
- // Should never get here
- e.printStackTrace();
- } catch (Throwable e) {
- e.printStackTrace();
- }
-
- return nrVirusesFound;
- }
-
- @Remote
- public int localScanFolder() {
-
- Log.i(TAG, "Scan folder");
-
- Log.i(TAG, "Started signature initialization from folder: " + Constants.VIRUS_DB_PATH);
- initSignatureDB(Constants.VIRUS_DB_PATH);
- Log.i(TAG, "Finished signature initialization. Number of signatures: " + signatureDB.length);
-
- boolean isOffloaded = Utils.isOffloaded();
-
- Log.i(TAG, "Scanning folder: " + Constants.VIRUS_FOLDER_TO_SCAN);
- File folderToScan;
- File[] filesToScan;
-
- int start = 0;
- int end = 0;
-
- if (isOffloaded) {
- Log.i(TAG, "isOffloaded true");
-
- int cloneHelperId = Utils.readCloneHelperId();
-
- // We know we are on the remote side and we have a zipped folder
- // containing the files to be scanned.
- extractZippedFiles();
- folderToScan = new File(Constants.VIRUS_FOLDER_TO_SCAN);
- filesToScan = folderToScan.listFiles();
-
- Log.i(TAG, "Number of files in folder: " + filesToScan.length);
-
- // Integer division, some files may be not considered
- int howManyFiles = (int) ((filesToScan.length) / nrClones);
- start = cloneHelperId * howManyFiles; // cloneHelperId starts from 0
- // (the main clone)
- end = start + howManyFiles;
-
- // If this is the clone with the highest id let him take care
- // of the files not considered due to the integer division.
- if (cloneHelperId == nrClones - 1) {
- end += filesToScan.length % nrClones;
- }
-
- } else {
- Log.i(TAG, "isOffloaded false");
-
- folderToScan = new File(Constants.VIRUS_FOLDER_TO_SCAN);
- filesToScan = folderToScan.listFiles();
-
- // The first files are scanned on the phone the last ones remotely
- // (in case of data partition)
- start = 0;
- end = lastFileOnPhone;
- }
-
- int nrVirusesFound = 0;
- Log.i(TAG, "Nr files to scan: " + (end - start));
- Log.i(TAG, "Checking files: " + start + "-" + (end - 1));
- for (int i = start; i < end; i++) {
- // Log.i(TAG, "Checking file: " + filesToScan[i]);
- if (checkIfFileVirus(filesToScan[i])) {
- // Log.i(TAG, "Virus found");
- nrVirusesFound++;
- }
- }
-
- Log.i(TAG, "Number of viruses found: " + nrVirusesFound);
- return nrVirusesFound;
- }
-
- /**
- * When having more than one clone running the method, we will obtain partial results that should
- * be combined to get the final result. This will be done automatically by the main clone when
- * calling this method.
- *
- * @param params Array of partial results.
- * @return The total result.
- */
- public int localScanFolderReduce(int[] params) {
- int nrViruses = 0;
- for (int i = 0; i < params.length; i++) {
- nrViruses += params[i];
- }
- return nrViruses;
- }
-
- private void extractZippedFiles() {
-
- try {
- File f = new File(Constants.VIRUS_FOLDER_ZIP);
-
- FileOutputStream out = new FileOutputStream(f);
- out.write(zippedFolder);
- out.close();
-
- // Delete the old directory containing the files we have scanned in
- // previous runs
- File temp = new File(Constants.VIRUS_FOLDER_TO_SCAN);
- if (!temp.exists()) {
- temp.mkdir();
- } else {
- Utils.executeAndroidShellCommand(TAG,
- "rm " + Constants.VIRUS_FOLDER_TO_SCAN + File.separator + "*", false);
- }
-
- long s = System.currentTimeMillis();
- ZipHandler.extractFolder(Constants.VIRUS_FOLDER_ZIP);
- Log.i(TAG, "Time to extract the files: " + (System.currentTimeMillis() - s) + " ms");
-
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Check all the subsequences of length SIGNATURE_SIZE for the virus signature.
- *
- * @param fileToScan
- * @return
- */
- private boolean checkIfFileVirus(File fileToScan) {
- MessageDigest md;
-
- try {
- md = MessageDigest.getInstance("SHA-1");
-
- int length = (int) fileToScan.length();
-
- if (fileBuffer == null || fileBuffer.length != length)
- fileBuffer = new char[length];
- // Log.i(TAG, "Checking file " + fileToScan.getName());
- // Log.i(TAG, "Length of file " + length);
-
- FileReader currentFile = new FileReader(fileToScan);
- int totalRead = 0;
- int read = 0;
- do {
- totalRead += read;
- read = currentFile.read(fileBuffer, totalRead, length - totalRead);
- } while (read > 0);
- currentFile.close();
-
- if (totalRead > 0) {
- for (int i = 0; i < 100; i++) {
- System.arraycopy(fileBuffer, i, fileHeaderBuffer, 0, SIGNATURE_SIZE);
- String signature = new String(fileHeaderBuffer);
- signature = Utils.bytesToHex(md.digest(signature.getBytes()));
- if (isInVirusDB(signature)) {
- return true;
- }
- }
- }
- } catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return false;
- }
-
- private boolean isInVirusDB(String signature) {
- for (int i = 0; i < signatureDB.length; i++) {
- if (signature.equals(signatureDB[i]))
- return true;
- }
- return false;
- }
-
- private void initSignatureDB(String pathToSignatures) {
- try {
- MessageDigest md = MessageDigest.getInstance("SHA-1");
- File signatureFolder = new File(pathToSignatures);
- File[] demoViruses = signatureFolder.listFiles();
-
- signatureDB = new String[demoViruses.length];
- char[] buffer = new char[SIGNATURE_SIZE];
-
- int i = 0;
- for (File virus : demoViruses) {
-
- FileReader signatureFile = new FileReader(virus);
- int totalRead = 0;
- int read = 0;
- while (totalRead != SIGNATURE_SIZE) {
- read = signatureFile.read(buffer, totalRead, buffer.length - totalRead);
- totalRead += read;
- }
- if (totalRead > 0)
- signatureDB[i++] = Utils.bytesToHex(md.digest(new String(buffer).getBytes()));
- signatureFile.close();
- }
-
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (NoSuchAlgorithmException e) {
- Log.e(TAG, "NoSuchAlgorithmException " + e.getMessage());
- } catch (Exception e) {
- e.printStackTrace();
- Log.e(TAG, "Exception " + e.getMessage());
- }
- }
-
- @Override
- public void copyState(Remoteable state) {
-
- }
-
- public void setNumberOfClones(int nrClones) {
- this.nrClones = nrClones;
- }
-}
-
diff --git a/images/bg_hr.png b/images/bg_hr.png
new file mode 100644
index 0000000..514aee5
Binary files /dev/null and b/images/bg_hr.png differ
diff --git a/images/blacktocat.png b/images/blacktocat.png
new file mode 100644
index 0000000..e160053
Binary files /dev/null and b/images/blacktocat.png differ
diff --git a/images/icon_download.png b/images/icon_download.png
new file mode 100644
index 0000000..5a793f1
Binary files /dev/null and b/images/icon_download.png differ
diff --git a/images/sprite_download.png b/images/sprite_download.png
new file mode 100644
index 0000000..f9f8de2
Binary files /dev/null and b/images/sprite_download.png differ
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..e8cce3c
--- /dev/null
+++ b/index.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+ Rapid - Android Offloading Framework
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rapid mission
+
+
+RAPID targets a novel heterogeneous CPU-GPU multi- level Cloud acceleration focusing on applications running on embedded systems of low-power devices.
+The project takes advantage of abundant mobile computation power and ubiquitous high-speed networks to provide a distributed heterogeneous acceleration infrastructure that can change the future of mobile applications.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/javascripts/main.js b/javascripts/main.js
new file mode 100644
index 0000000..d8135d3
--- /dev/null
+++ b/javascripts/main.js
@@ -0,0 +1 @@
+console.log('This would be the main JS file.');
diff --git a/params.json b/params.json
new file mode 100644
index 0000000..4128868
--- /dev/null
+++ b/params.json
@@ -0,0 +1 @@
+{"name":"Rapid - Android Offloading Framework","tagline":"","body":"### This project is part of the [Rapid Project](http://www.rapid-project.eu)\r\n## Rapid mission\r\n>RAPID targets a novel heterogeneous CPU-GPU multi- level Cloud acceleration focusing on applications running on embedded systems of low-power devices.\r\n>The project takes advantage of abundant mobile computation power and ubiquitous high-speed networks to provide a distributed heterogeneous acceleration infrastructure that can change the future of mobile applications.","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
\ No newline at end of file
diff --git a/stylesheets/github-light.css b/stylesheets/github-light.css
new file mode 100644
index 0000000..872a6f4
--- /dev/null
+++ b/stylesheets/github-light.css
@@ -0,0 +1,116 @@
+/*
+ Copyright 2014 GitHub Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+*/
+
+.pl-c /* comment */ {
+ color: #969896;
+}
+
+.pl-c1 /* constant, markup.raw, meta.diff.header, meta.module-reference, meta.property-name, support, support.constant, support.variable, variable.other.constant */,
+.pl-s .pl-v /* string variable */ {
+ color: #0086b3;
+}
+
+.pl-e /* entity */,
+.pl-en /* entity.name */ {
+ color: #795da3;
+}
+
+.pl-s .pl-s1 /* string source */,
+.pl-smi /* storage.modifier.import, storage.modifier.package, storage.type.java, variable.other, variable.parameter.function */ {
+ color: #333;
+}
+
+.pl-ent /* entity.name.tag */ {
+ color: #63a35c;
+}
+
+.pl-k /* keyword, storage, storage.type */ {
+ color: #a71d5d;
+}
+
+.pl-pds /* punctuation.definition.string, string.regexp.character-class */,
+.pl-s /* string */,
+.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */,
+.pl-sr /* string.regexp */,
+.pl-sr .pl-cce /* string.regexp constant.character.escape */,
+.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */,
+.pl-sr .pl-sre /* string.regexp source.ruby.embedded */ {
+ color: #183691;
+}
+
+.pl-v /* variable */ {
+ color: #ed6a43;
+}
+
+.pl-id /* invalid.deprecated */ {
+ color: #b52a1d;
+}
+
+.pl-ii /* invalid.illegal */ {
+ background-color: #b52a1d;
+ color: #f8f8f8;
+}
+
+.pl-sr .pl-cce /* string.regexp constant.character.escape */ {
+ color: #63a35c;
+ font-weight: bold;
+}
+
+.pl-ml /* markup.list */ {
+ color: #693a17;
+}
+
+.pl-mh /* markup.heading */,
+.pl-mh .pl-en /* markup.heading entity.name */,
+.pl-ms /* meta.separator */ {
+ color: #1d3e81;
+ font-weight: bold;
+}
+
+.pl-mq /* markup.quote */ {
+ color: #008080;
+}
+
+.pl-mi /* markup.italic */ {
+ color: #333;
+ font-style: italic;
+}
+
+.pl-mb /* markup.bold */ {
+ color: #333;
+ font-weight: bold;
+}
+
+.pl-md /* markup.deleted, meta.diff.header.from-file */ {
+ background-color: #ffecec;
+ color: #bd2c00;
+}
+
+.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ {
+ background-color: #eaffea;
+ color: #55a532;
+}
+
+.pl-mdr /* meta.diff.range */ {
+ color: #795da3;
+ font-weight: bold;
+}
+
+.pl-mo /* meta.output */ {
+ color: #1d3e81;
+}
+
diff --git a/stylesheets/stylesheet.css b/stylesheets/stylesheet.css
new file mode 100644
index 0000000..3da3485
--- /dev/null
+++ b/stylesheets/stylesheet.css
@@ -0,0 +1,425 @@
+/*******************************************************************************
+Slate Theme for GitHub Pages
+by Jason Costello, @jsncostello
+*******************************************************************************/
+
+@import url(github-light.css);
+
+/*******************************************************************************
+MeyerWeb Reset
+*******************************************************************************/
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font: inherit;
+ vertical-align: baseline;
+}
+
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+
+ol, ul {
+ list-style: none;
+}
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+/*******************************************************************************
+Theme Styles
+*******************************************************************************/
+
+body {
+ box-sizing: border-box;
+ color:#373737;
+ background: #212121;
+ font-size: 16px;
+ font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif;
+ line-height: 1.5;
+ -webkit-font-smoothing: antialiased;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ margin: 10px 0;
+ font-weight: 700;
+ color:#222222;
+ font-family: 'Lucida Grande', 'Calibri', Helvetica, Arial, sans-serif;
+ letter-spacing: -1px;
+}
+
+h1 {
+ font-size: 36px;
+ font-weight: 700;
+}
+
+h2 {
+ padding-bottom: 10px;
+ font-size: 32px;
+ background: url('../images/bg_hr.png') repeat-x bottom;
+}
+
+h3 {
+ font-size: 24px;
+}
+
+h4 {
+ font-size: 21px;
+}
+
+h5 {
+ font-size: 18px;
+}
+
+h6 {
+ font-size: 16px;
+}
+
+p {
+ margin: 10px 0 15px 0;
+}
+
+footer p {
+ color: #f2f2f2;
+}
+
+a {
+ text-decoration: none;
+ color: #007edf;
+ text-shadow: none;
+
+ transition: color 0.5s ease;
+ transition: text-shadow 0.5s ease;
+ -webkit-transition: color 0.5s ease;
+ -webkit-transition: text-shadow 0.5s ease;
+ -moz-transition: color 0.5s ease;
+ -moz-transition: text-shadow 0.5s ease;
+ -o-transition: color 0.5s ease;
+ -o-transition: text-shadow 0.5s ease;
+ -ms-transition: color 0.5s ease;
+ -ms-transition: text-shadow 0.5s ease;
+}
+
+a:hover, a:focus {text-decoration: underline;}
+
+footer a {
+ color: #F2F2F2;
+ text-decoration: underline;
+}
+
+em {
+ font-style: italic;
+}
+
+strong {
+ font-weight: bold;
+}
+
+img {
+ position: relative;
+ margin: 0 auto;
+ max-width: 739px;
+ padding: 5px;
+ margin: 10px 0 10px 0;
+ border: 1px solid #ebebeb;
+
+ box-shadow: 0 0 5px #ebebeb;
+ -webkit-box-shadow: 0 0 5px #ebebeb;
+ -moz-box-shadow: 0 0 5px #ebebeb;
+ -o-box-shadow: 0 0 5px #ebebeb;
+ -ms-box-shadow: 0 0 5px #ebebeb;
+}
+
+p img {
+ display: inline;
+ margin: 0;
+ padding: 0;
+ vertical-align: middle;
+ text-align: center;
+ border: none;
+}
+
+pre, code {
+ width: 100%;
+ color: #222;
+ background-color: #fff;
+
+ font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
+ font-size: 14px;
+
+ border-radius: 2px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+}
+
+pre {
+ width: 100%;
+ padding: 10px;
+ box-shadow: 0 0 10px rgba(0,0,0,.1);
+ overflow: auto;
+}
+
+code {
+ padding: 3px;
+ margin: 0 3px;
+ box-shadow: 0 0 10px rgba(0,0,0,.1);
+}
+
+pre code {
+ display: block;
+ box-shadow: none;
+}
+
+blockquote {
+ color: #666;
+ margin-bottom: 20px;
+ padding: 0 0 0 20px;
+ border-left: 3px solid #bbb;
+}
+
+
+ul, ol, dl {
+ margin-bottom: 15px
+}
+
+ul {
+ list-style-position: inside;
+ list-style: disc;
+ padding-left: 20px;
+}
+
+ol {
+ list-style-position: inside;
+ list-style: decimal;
+ padding-left: 20px;
+}
+
+dl dt {
+ font-weight: bold;
+}
+
+dl dd {
+ padding-left: 20px;
+ font-style: italic;
+}
+
+dl p {
+ padding-left: 20px;
+ font-style: italic;
+}
+
+hr {
+ height: 1px;
+ margin-bottom: 5px;
+ border: none;
+ background: url('../images/bg_hr.png') repeat-x center;
+}
+
+table {
+ border: 1px solid #373737;
+ margin-bottom: 20px;
+ text-align: left;
+ }
+
+th {
+ font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
+ padding: 10px;
+ background: #373737;
+ color: #fff;
+ }
+
+td {
+ padding: 10px;
+ border: 1px solid #373737;
+ }
+
+form {
+ background: #f2f2f2;
+ padding: 20px;
+}
+
+/*******************************************************************************
+Full-Width Styles
+*******************************************************************************/
+
+.outer {
+ width: 100%;
+}
+
+.inner {
+ position: relative;
+ max-width: 640px;
+ padding: 20px 10px;
+ margin: 0 auto;
+}
+
+#forkme_banner {
+ display: block;
+ position: absolute;
+ top:0;
+ right: 10px;
+ z-index: 10;
+ padding: 10px 50px 10px 10px;
+ color: #fff;
+ background: url('../images/blacktocat.png') #0090ff no-repeat 95% 50%;
+ font-weight: 700;
+ box-shadow: 0 0 10px rgba(0,0,0,.5);
+ border-bottom-left-radius: 2px;
+ border-bottom-right-radius: 2px;
+}
+
+#header_wrap {
+ background: #212121;
+ background: -moz-linear-gradient(top, #373737, #212121);
+ background: -webkit-linear-gradient(top, #373737, #212121);
+ background: -ms-linear-gradient(top, #373737, #212121);
+ background: -o-linear-gradient(top, #373737, #212121);
+ background: linear-gradient(top, #373737, #212121);
+}
+
+#header_wrap .inner {
+ padding: 50px 10px 30px 10px;
+}
+
+#project_title {
+ margin: 0;
+ color: #fff;
+ font-size: 42px;
+ font-weight: 700;
+ text-shadow: #111 0px 0px 10px;
+}
+
+#project_tagline {
+ color: #fff;
+ font-size: 24px;
+ font-weight: 300;
+ background: none;
+ text-shadow: #111 0px 0px 10px;
+}
+
+#downloads {
+ position: absolute;
+ width: 210px;
+ z-index: 10;
+ bottom: -40px;
+ right: 0;
+ height: 70px;
+ background: url('../images/icon_download.png') no-repeat 0% 90%;
+}
+
+.zip_download_link {
+ display: block;
+ float: right;
+ width: 90px;
+ height:70px;
+ text-indent: -5000px;
+ overflow: hidden;
+ background: url(../images/sprite_download.png) no-repeat bottom left;
+}
+
+.tar_download_link {
+ display: block;
+ float: right;
+ width: 90px;
+ height:70px;
+ text-indent: -5000px;
+ overflow: hidden;
+ background: url(../images/sprite_download.png) no-repeat bottom right;
+ margin-left: 10px;
+}
+
+.zip_download_link:hover {
+ background: url(../images/sprite_download.png) no-repeat top left;
+}
+
+.tar_download_link:hover {
+ background: url(../images/sprite_download.png) no-repeat top right;
+}
+
+#main_content_wrap {
+ background: #f2f2f2;
+ border-top: 1px solid #111;
+ border-bottom: 1px solid #111;
+}
+
+#main_content {
+ padding-top: 40px;
+}
+
+#footer_wrap {
+ background: #212121;
+}
+
+
+
+/*******************************************************************************
+Small Device Styles
+*******************************************************************************/
+
+@media screen and (max-width: 480px) {
+ body {
+ font-size:14px;
+ }
+
+ #downloads {
+ display: none;
+ }
+
+ .inner {
+ min-width: 320px;
+ max-width: 480px;
+ }
+
+ #project_title {
+ font-size: 32px;
+ }
+
+ h1 {
+ font-size: 28px;
+ }
+
+ h2 {
+ font-size: 24px;
+ }
+
+ h3 {
+ font-size: 21px;
+ }
+
+ h4 {
+ font-size: 18px;
+ }
+
+ h5 {
+ font-size: 14px;
+ }
+
+ h6 {
+ font-size: 12px;
+ }
+
+ code, pre {
+ min-width: 320px;
+ max-width: 480px;
+ font-size: 11px;
+ }
+
+}