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/env python | |
import random | |
import time | |
import uuid | |
import couchdbkit | |
def server(p): | |
return couchdbkit.Server("http://127.0.0.1:%s" % p) |
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
-module(proper_btree_tests). | |
-behaviour(proper_statem). | |
-include_lib("proper/include/proper.hrl"). | |
-include_lib("eunit/include/eunit.hrl"). | |
-export([ | |
initial_state/0, | |
command/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
get_priority(Channel, DiskSize, DataSize, Threshold, Dir) -> | |
MinSize = list_to_integer(smoosh_utils:get(Channel, "min_size", "0")), | |
MaxSize = case smoosh_utils:get(Channel, "max_size", infinity) of | |
infinity -> infinity; | |
Value -> list_to_integer(Value) | |
end, | |
ProjectedCapacity = projected_capacity(Dir, DataSize), | |
MaxCapacity = list_to_integer( | |
couch_config:get("smoosh", "max_capacity", "90")), | |
BadSize = DiskSize =< MinSize orelse DiskSize > MaxSize, |
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
{"ok":true} | |
{"ok":true} | |
{"ok":true,"id":"bar","rev":"1-967a00dff5e02add41819138abb3284d"} | |
{"ok":true,"id":"bar","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"} | |
{"ok":true,"id":"bar","rev":"3-7379b9e515b161226c6559d90c4dc49f"} | |
{"ok":true,"id":"bar","rev":"4-2c32ffda5905fe770af07314d0a4f93e"} |
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
-module(couch_events_kv_dyn). | |
-export([lookup/1]). | |
lookup(<<"channel_name_1">>) -> GenServerPid1; | |
lookup(<<"other_channel_name">>) -> OtherPidOfGenServer; | |
%% | |
%% couch_events_kv dynamically adds function clauses to this | |
%% dynamic module and then reloads it to update the KV | |
%% information. | |
%% |
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
-module(erlbork). | |
-export([start/0]). | |
start() -> | |
spawn(fun() -> restarts() end), | |
loop(). | |
restarts() -> | |
init:restart(), | |
timer:sleep(100), |
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/env python2 | |
import re | |
import sys | |
SHOW = """ | |
Siloxane SiO4 Si3O SiO3 | |
SiO2 SiO1 NBO FreeOH | |
H2O H3O SiOH SiOH2 Si2OH |
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
Traceback (most recent call last): | |
File "/usr/local/lib/python2.6/dist-packages/restkit-4.1.2-py2.6.egg/restkit/conn.py", line 48, in is_connected | |
r, _, _ = self.backend_mod.Select([self._s], [], [], 0.0) | |
ValueError: filedescriptor out of range in select() |
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
+wait_loop(Parent, Timeout, State) -> | |
% State transitions | |
% unset -> (updated | timeout | waiting) | |
% updated -> (updated | unset) | |
% timeout -> (unset | updated) | |
% waiting -> unset | |
receive | |
db_updated when State == waiting -> | |
Parent ! updated, | |
wait_loop(Parent, Timeout, unset); |
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
LoadQueue = fun(N) -> | |
lists:foreach(fun(_) -> | |
self() ! foo | |
end, lists:seq(1, N)) | |
end. | |
RunTest = fun() -> | |
lists:foreach(fun(_) -> | |
Ref = termsend:ref(), | |
receive Ref -> ok end |