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
@Grab(group = 'org.apache.mahout', module = 'mahout-core', version = '0.9') | |
import org.apache.mahout.cf.taste.impl.common.FastByIDMap | |
import org.apache.mahout.cf.taste.impl.common.FastIDSet | |
import org.apache.mahout.cf.taste.impl.model.file.FileDataModel | |
import org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender | |
import org.apache.mahout.cf.taste.impl.similarity.TanimotoCoefficientSimilarity | |
def mlDir = '/Users/rahulsomasunderam/Downloads/ml-100k' | |
def f = new File("$mlDir/u.data") |
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
package akihiro4chawon | |
class Main { | |
@Memoize | |
def fib(a) { | |
//a <= 1 ? a : fib(a - 2) + fib(a - 1) | |
if (a <= 1) return a | |
else return fib(a - 2) + fib(a - 1) | |
} |
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
JPEG2000 image files,00 00 00 0C 6A 50 20 20,JP2,Picture | |
3GPP multimedia files,00 00 00 14 66 74 79 70,3GP,Multimedia | |
MPEG-4 v1,00 00 00 14 66 74 79 70 69 73 6F 6D,MP4,Multimedia | |
3rd Generation Partnership Project 3GPP,00 00 00 14 66 74 79 70,3GG|3GP|3G2,Multimedia | |
Windows Disk Image,00 00 00 00 14 00 00 00,TBI,Windows | |
MPEG-4 video_1,00 00 00 18 66 74 79 70,3GP5|M4V|MP4,Multimedia | |
MPEG-4 video_2,00 00 00 1C 66 74 79 70,MP4,Multimedia | |
3GPP2 multimedia files,00 00 00 20 66 74 79 70,3GP,Multimedia | |
Apple audio and video,00 00 00 20 66 74 79 70 4D 34 41,M4A,Multimedia | |
3rd Generation Partnership Project 3GPP2,00 00 00 20 66 74 79 70,3GG|3GP|3G2,Multimedia |
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
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")) |
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
// We use the struct datatype to store the voter information. | |
struct voter { | |
address voterAddress; // The address of the voter | |
uint tokensBought; // The total no. of tokens this voter owns | |
uint[] tokensUsedPerCandidate; // Array to keep track of votes per candidate. | |
/* We have an array called candidateList initialized below. | |
Every time this voter votes with her tokens, the value at that | |
index is incremented. Example, if candidateList array declared | |
below has ["Rama", "Nick", "Jose"] and this | |
voter votes 10 tokens to Nick, the tokensUsedPerCandidate[1] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var socket = io.connect('http://socket.coincap.io'); | |
socket.on('trades', function (tradeMsg) { |
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
// Config | |
global.config = { | |
rpc: { | |
host: "localhost", | |
port: "8545" | |
} | |
} | |
// Load Libraries | |
global.solc = require("solc") |
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
contract CrowdFund { | |
address public beneficiary; | |
uint256 public goal; | |
uint256 public deadline; | |
struct Funder { | |
address addr; | |
uint256 contribution; | |
} |
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
// Private Key | |
var pKey = "..." | |
var pKeyx = new Buffer(pKey, "hex") | |
// Shared Message | |
var message = "..." | |
var messageHash = web3.sha3(message) | |
var messageHashx = new Buffer(messageHash.replace("0x", ""), "hex") | |
// Signed Hash |
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
// Running on Ubuntu 16.04 (64-bit) | |
// Do this first | |
sudo add-apt-repository -y ppa:ethereum/ethereum | |
sudo apt-get update | |
// Install Geth | |
sudo apt-get install ethereum | |
// Install Solc |
OlderNewer