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
object Calculator { | |
def props = Props(new Calculator) | |
} | |
class Calculator extends Actor{ | |
val log = Logging(context.system, this) | |
context.watch(sender) | |
def receive = { | |
case Matrix(rows) => { | |
sender ! rows.flatten.sum |
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
warn(<<-EOF.gsub(/^\s+/, '').gsub(/\n/, ' ')) | |
xxxxxxxxxxxxxxxxxxxxx | |
#xxxxxxxxx | |
xxxx xxxx xxxx xxxx | |
EOF |
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
# USAGE | |
# python ball_tracking.py --video ball_tracking_example.mp4 | |
# python ball_tracking.py | |
# import the necessary packages | |
from collections import deque | |
import numpy as np | |
import argparse | |
import imutils | |
import cv2 |
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 ConcurrentHashMap<String, TNonblockingTransport> open_connections = new ConcurrentHashMap<String, TNonblockingTransport>(); | |
private ConcurrentHashMap<String, KeyValueService.AsyncClient> open_clients = new ConcurrentHashMap<String, KeyValueService.AsyncClient>(); | |
private TNonblockingTransport getConnection(Integer server) throws TException, IOException { | |
String threadKey = server.toString() + Thread.currentThread().getId(); | |
if(open_connections.containsKey(threadKey)) | |
return open_connections.get(threadKey); | |
String host = StorageNode.hosts.get(server); | |
Integer port = StorageNode.ports.get(server); |
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 | |
queue_file='/tmp/nbody.queue' | |
cmd="./test_cmd" | |
lock_file="/tmp/nbody.lock" | |
remove_first_in_queue() { | |
tail -n +2 "$queue_file" > "$queue_file.tmp" && mv "$queue_file.tmp" "$queue_file" | |
} |
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 | |
function ask() { | |
while true; do | |
if [ "${2:-}" = "Y" ]; then | |
prompt="Y/n" | |
default=Y | |
elif [ "${2:-}" = "N" ]; then | |
prompt="y/N" | |
default=N |
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
diff --git c/DEBIAN/config w/DEBIAN/config | |
index 85ed5fd..116aa19 100755 | |
--- c/DEBIAN/config | |
+++ w/DEBIAN/config | |
@@ -3,7 +3,7 @@ | |
#'alternatives'. This sets the java as default, and you can switch your | |
#default java with update-java-alternatives | |
# | |
-#Copyright 2012 Bruce.Ingalls at gmail & Alin Andrei <webupd8@gmail.com> | |
+#Copyright 2017 Bruce.Ingalls at gmail & Alin Andrei <webupd8@gmail.com> |
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/env ruby | |
require 'yaml' | |
def get_inward_dependencies_from(filename, pkg) | |
shitlist = YAML.load_file(filename) | |
shitlist[pkg] | |
end | |
def save_to_file(pkg, aggregate) |
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
# Use vim bindings | |
setw -g mode-keys vi | |
set-option -g default-shell /bin/zsh | |
# unbind-key -a | |
unbind C-m | |
unbind C-b | |
unbind C-a |
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
-- paths.lua | |
local hardlink_cmd = "cp -val" | |
local mv_cmd = "mv" | |
local function split(source, sep) | |
local result, i = {}, 1 | |
while true do | |
local a, b = source:find(sep) | |
if not a then break end |
OlderNewer