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
import numpy as np | |
def ecdf(data): | |
n = len(data) | |
x = np.sort(data) | |
y = np.true_divide(np.arange(1, n+1), n) | |
return x, y |
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
import sys | |
import subprocess | |
from optparse import OptionParser | |
import json | |
parser = OptionParser() | |
parser.add_option("-l", "--language", dest="language", help="The language file to download.") | |
parser.add_option("-t", "--api-token", dest="api_token", help="poeditor api token.") | |
parser.add_option("-i", "--project-id", dest="project_id", help="poeditor project id.") | |
(options, args) = parser.parse_args() |
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
# Try to tap the screen until view open on screen | |
# x:: starting x value | |
# y:: starting y value | |
# x_delta:: Value to change in x direction | |
# y_delta:: Value to change in y direction | |
# query:: query to wait for the view | |
# number_of_tries:: number of tries | |
def touch_element_by_moving(x, y, x_delta, y_delta, query, number_of_tries=5) | |
i = 0 | |
begin |
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
final SurfaceView sv = (SurfaceView) findViewById(R.id.splash_surface); | |
MediaPlayer mp = new MediaPlayer(); | |
mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { | |
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) | |
@Override | |
public void onPrepared(MediaPlayer mp) { | |
mp.setVideoScalingMode(MediaPlayer.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING); | |
mp.setDisplay(sv.getHolder()); | |
mp.start(); |
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
[elasticsearch-1.0] | |
name=Elasticsearch repository for 1.0.x packages | |
baseurl=http://packages.elasticsearch.org/elasticsearch/1.0/centos | |
gpgcheck=1 | |
gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch | |
enabled=1 |
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
# Install rabbitmq | |
wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo | |
yum install erlang | |
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | |
rpm -Uvh http://www.rabbitmq.com/releases/rabbitmq-server/v3.2.3/rabbitmq-server-3.2.3-1.noarch.rpm |
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
# as root | |
echo -e "\ndeb http://www.rabbitmq.com/debian/ testing main" >> /etc/apt/sources.list | |
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | |
apt-key add rabbitmq-signing-key-public.asc | |
apt-get update |
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
VERSION=0.90.1 | |
sudo apt-get update | |
sudo apt-get install openjdk-6-jdk | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb | |
sudo dpkg -i elasticsearch-$VERSION.deb | |
# be sure you add "action.disable_delete_all_indices" : true to the config!! |
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
require 'optparse' | |
require 'ostruct' | |
require 'pp' | |
# Default settings | |
options = OpenStruct.new :file => '', :from => nil, :to => nil, :include_referrer => false | |
OptionParser.new do |opts| | |
opts.banner = """ |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
NewerOlder