View uri.js
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
View ConcatenateArray.cpp
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
#include <array> // std::array | |
#include <algorithm> // std::copy | |
using std::array; | |
/** | |
* Concatenates array. | |
* | |
* @tparam T Type of data stored in array. | |
* @tparam D1 Dimension of first array. |
View CustomSTLContainer.cpp
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
template <class T, class A = std::allocator<T> > | |
class X { | |
public: | |
typedef A allocator_type; | |
typedef typename A::value_type value_type; | |
typedef typename A::reference reference; | |
typedef typename A::const_reference const_reference; | |
typedef typename A::difference_type difference_type; |
View f1-results.py
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
#!/usr/bin/python | |
import sys | |
import urllib2 | |
import time | |
import json | |
def get_results(output_dir): | |
for year in range(1950, 2017 + 1): | |
for rnd in range(1, 50): |
View OverallTeamRaceResultMapper.java
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 HadoopF1.OverallTeamRaceResult; | |
import java.io.IOException; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.LongWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.Mapper; | |
import HadoopF1.ResultsRecord; |
View OverallTeamRaceResultReducer.java
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 HadoopF1.OverallTeamRaceResult; | |
import java.io.IOException; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.Reducer; | |
public class OverallTeamRaceResultReducer extends Reducer<Text, IntWritable, Text, IntWritable> { |
View hadoop.sh
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
# Hadoop | |
export HADOOP_HOME=/opt/hadoop/hadoop-2.7.4 | |
export PATH=$PATH:$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin |
View hadoop-service.sh
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 | |
start() { | |
source "/etc/profile.d/hadoop.sh" | |
start-dfs.sh | |
start-yarn.sh | |
} | |
stop() { |
View hadoop.service
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
[Unit] | |
Description=Hadoop start/stop | |
[Service] | |
User=hadoop | |
Group=hadoop | |
Type=oneshot | |
ExecStart=/opt/hadoop/hadoop-service.sh start | |
ExecStop=/opt/hadoop/hadoop-service.sh stop | |
RemainAfterExit=yes |
View interfaces
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
auto eth0 | |
iface eth0 inet static | |
address 192.168.1.1 | |
netmask 255.255.0.0 | |
gateway 192.168.0.1 | |
dns-nameservers 8.8.8.8 8.8.4.4 |
OlderNewer