This file contains hidden or 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
cd /home/hadoop/ | |
##Download Spark | |
hadoop fs -copyToLocal s3://prediction-data/spark-jobs/dist/0.9.1/spark-0.9.1-emr.tgz ./spark-0.9.1-emr.tgz | |
##Download Scala | |
wget http://www.scala-lang.org/files/archive/scala-2.10.4.tgz | |
tar -xvzf scala-2.10.4.tgz | |
tar -xvzf spark-0.9.1-emr.tgz |
This file contains hidden or 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
# Check java version | |
JAVA_VER=$(java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q') | |
if [ "$JAVA_VER" -lt 18 ] | |
then | |
# Download jdk 8 | |
echo "Downloading and installing jdk 8" | |
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.rpm" | |
# Silent install |
This file contains hidden or 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
breeze.NamingConvention.camelCase.setAsDefault(); | |
var mgr = new breeze.EntityManager('http://qrcampaign.azurewebsites.net/api/subscriptions'); |
This file contains hidden or 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
if (forceRemote) | |
query = query.using(breeze.FetchStrategy.FromServer); | |
else | |
query = query.using(...); |
This file contains hidden or 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
function init() { | |
return mgr.fetchMetadata(); | |
} |
This file contains hidden or 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
<section ...> | |
<h2 class="page-title" ...></h2> | |
<form> | |
<label>Description</label> | |
<input type="text" .../> | |
<label>Number of points before redeem</label> | |
<input type="text" .../> |
This file contains hidden or 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
function getCampaignById(id) { | |
return mgr.fetchEntityByKey('Campaign', id, true); | |
} |
This file contains hidden or 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
function showDetails(campaign) { | |
router.navigateTo('...' + campaign...); | |
} |
This file contains hidden or 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
<table class="table table-hover"> | |
<thead> | |
<tr> | |
<th>Campaign name</th> | |
<th>Number of points before redeem</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr> | |
<td></td> |
This file contains hidden or 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
protected void Application_Start() | |
{ | |
// Add the Breeze CORS handler | |
GlobalConfiguration.Configuration.MessageHandlers.Add(new BreezeSimpleCorsHandler()); | |
// All other code here | |
} |
NewerOlder