duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
#!/bin/bash | |
# Pull this file dowm, make it executable and run it with sudo | |
# wget https://raw.github.com/gist/1603037/build-erlang-r15b.sh | |
# chmod u+x build-erlang-r15b.sh | |
# sudo ./build-erlang-r15b.sh | |
if [ $(id -u) != "0" ]; then | |
echo "You must be the superuser to run this script" >&2 | |
exit 1 | |
fi |
rq = read.table("~/Downloads/request_times.txt", header=FALSE)$V1 | |
run_simulation = function(router_mode = "naive", reqs_per_minute = 9000, simulation_length_in_minutes = 5, dyno_count = 100) { | |
if(!(router_mode %in% c("naive", "intelligent"))) { | |
return("router_mode must be one of 'naive' or 'intelligent'") | |
} | |
reqs_per_ms = reqs_per_minute / 60000 | |
simulation_length_in_ms = simulation_length_in_minutes * 60000 | |
# you can make a text file of request times (in ms, one number per line) and import it here, or you can use a probability distribution to simulate request times (see below where setting req_durations_in_ms) | |
# rq = read.table("~/Downloads/request_times.txt", header=FALSE)$V1 | |
# argument notes: | |
# parallel_router_count is only relevant if router_mode is set to "intelligent" | |
# choice_of_two, power_of_two, and unicorn_workers_per_dyno are only relevant if router_mode is set to "naive" | |
# you can only select one of choice_of_two, power_of_two, and unicorn_workers_per_dyno | |
run_simulation = function(router_mode = "naive", | |
reqs_per_minute = 9000, |
run_simulation = function(router_mode = "naive", | |
reqs_per_minute = 9000, | |
simulation_length_in_minutes = 5, | |
dyno_count = 100, | |
choice_of_two = FALSE, | |
power_of_two = FALSE, | |
unicorn_workers_per_dyno = 0, | |
track_dyno_queues = FALSE) { | |
if(!(router_mode %in% c("naive", "intelligent"))) { |
(* This works *) | |
module W = struct | |
type a | |
type b | |
type (_, _) t = | |
| AA : (a, a) t | |
| AB : (a, b) t | |
| BB : (b, b) t |
#!/bin/bash | |
W=`xdotool getactivewindow` | |
S1=`xprop -id ${W} |awk -F '"' '/WM_CLASS/{print $4}'` | |
echo "$S1" >> /tmp/log.txt | |
if [ "$S1" = "Firefox" ]; then | |
xdotool keydown --window ${W} Ctrl+t | |
fi |
-module(systemd). | |
% This is what you need to adopt systemd in erlang | |
% | |
% Do whatever you want license. If you want, you can take this code under terms of MIT license. | |
-export([ready/0, reloading/0, stopping/0, watchdog/0]). | |
-export([start_link/0]). | |
-export([init/1, handle_info/2, terminate/2]). |
#define _XOPEN_SOURCE 700 | |
#include <signal.h> | |
#include <unistd.h> | |
int main() | |
{ | |
sigset_t set; | |
int status; | |
if (getpid() != 1) return 1; |