start new:
tmux
start new with session name:
tmux new -s myname
def mode(array) | |
counter = Hash.new(0) | |
# this creates a new, empty hash with no keys, but makes all defalt values zero. it will be used to store | |
# the information from the array, such that the keys will be each unique number from the array (IOW, if there | |
# are two or more 4's in the array, there will just be one key that is a 4), and the value for each key will | |
# be the number of times that integer appears in the array. | |
array.each do |i| | |
counter[i] += 1 | |
end | |
# this interates throught the array, and for each element it creates a key for that integer (if it hasn't been |
import sys | |
from urllib import urlencode | |
import requests | |
from urlparse import urlparse, parse_qs | |
from random import choice | |
import re | |
self_id = None # your facebook id here | |
utc_bday = None # utc timestamp of your birthday |
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
Typing vagrant
from the command line will display a list of all available commands.
Be sure that you are in the same directory as the Vagrantfile when running these commands!
vagrant init
-- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.vagrant init <boxpath>
-- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64
.vagrant up
-- starts vagrant environment (also provisions only on the FIRST vagrant up)import scala.collection.JavaConversions._ // for propertiesAsScalaMap function | |
sc.addSparkListener(new SparkListener() { | |
override def onJobStart(jobStart: SparkListenerJobStart) { | |
println("ADAPT: INSIDE Job Start Listener "); | |
var props = propertiesAsScalaMap(jobStart.properties) | |
if (props.contains("spark.rdd.scope")) | |
{ | |
val propsMap = // Convert props to propsMap | |
if ( propsMap.contains("name") && propsMap("name") == "checkpoint") |
function sdiff() { | |
wdiff <(echo "$1") <(echo "$2") | colordiff | |
} |