⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
package com.nextinstruction; | |
import org.eclipse.jetty.server.Connector; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.server.nio.SelectChannelConnector; | |
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector; | |
import org.eclipse.jetty.util.ssl.SslContextFactory; | |
import org.eclipse.jetty.webapp.WebAppContext; | |
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
# Creating a new plot with no spacing | |
fig, axes = plt.subplots(2, 2, sharex=True, sharey=True) for i in range(2): | |
for j in range(2): | |
axes[i, j].hist(randn(500), bins=50, color='k', alpha=0.5) | |
plt.subplots_adjust(wspace=0, hspace=0) | |
# useful bar graph | |
series.value_counts().plot(kind='bar/barh') |
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
{ | |
"metadata": { | |
"name": "Random Walks" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
/** | |
* Write key and value to baseOutputPath using the namedOutput. | |
* | |
* @param namedOutput the named output name | |
* @param key the key | |
* @param value the value | |
* @param baseOutputPath base-output path to write the record to. | |
* Note: Framework will generate unique filename for the baseOutputPath | |
*/ | |
@SuppressWarnings("unchecked") |
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
package examples.mapred.partitioning; | |
import org.apache.commons.lang.time.DateUtils; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.Partitioner; | |
import java.util.Calendar; | |
import java.util.TimeZone; | |
public class PartitionFunctionSnippet { |
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
#!/bin/bash | |
##################################################################### | |
# Script to ensure that a cmd does not have parallel executions. | |
##################################################################### | |
unset LOCKFILE | |
while getopts l: flag; do | |
case $flag in | |
l) |
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
#!/usr/bin/python | |
############################################################################# | |
# This script finds the "leftover records" between files containing arbitrary | |
# linesplits of a very large sorted CSV file. These types of files would exist | |
# if for example, one ran the UNIX 'split' program (breaking on line boundaries) | |
# on a large sorted CSV file to break it into smaller sorted CSV files but did | |
# not bother to ensure that no logical records (assumming records can span text lines) | |
# were split across files. Generally, it's impossible for a generic utility | |
# like 'split' to make such application-specific decisions at the time the |
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
(* helper functions *) | |
exception AssertionFailure; | |
fun println(msg) = print(msg ^ "\n"); | |
fun printStatusWithWidth(label, msg, width) = println("\t- " ^ (StringCvt.padRight #" " width msg) ^ label); | |
fun printStatus(label, msg) = printStatusWithWidth(label,msg,80) | |
fun msg_pass(msg) = printStatus("[ PASS ]", msg); | |
fun msg_fail(msg) = printStatus("[ FAIL ]", msg); |