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 gevent | |
from gevent.monkey import patch_all; patch_all() | |
from gevent import server, event, socket | |
from multiprocessing import Process, current_process, cpu_count | |
""" | |
Simple multiprocess StreamServer that proxies messages between clients. | |
Avoids using a multiprocessing.Event since it blocks on a semaphore. |
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 ruby | |
couchdb = "http://localhost:5984/" | |
if ARGV[0] == 'admin' | |
couchdb = couchdb + '_utils/index.html' | |
exec 'open ' + couchdb | |
elsif ARGV[0] == 'wipe' | |
require 'couchrest' | |
cr = CouchRest.new('http://localhost:5984') |
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
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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 select | |
import gevent | |
def stdin_ready(): | |
infds, outfds, erfds = select.select([sys.stdin], [], [], 0) | |
if infds: | |
return True | |
else: | |
return False |
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
# IPython log file | |
from pyon.ion.stream import StandaloneStreamPublisher | |
from ion.services.dm.utility.granule_utils import time_series_domain | |
from ion.services.dm.utility.granule import RecordDictionaryTool | |
import numpy as np | |
import time | |
#params = ['time','temp'] |
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
# IPython log file | |
from ion.services.dm.utility.granule_utils import time_series_domain | |
from interface.services.dm.ipubsub_management_service import PubsubManagementServiceClient | |
from interface.services.dm.idataset_management_service import DatasetManagementServiceClient | |
from interface.services.dm.iingestion_management_service import IngestionManagementServiceClient | |
from interface.services.sa.idata_product_management_service import DataProductManagementServiceClient | |
from interface.services.dm.idata_retriever_service import DataRetrieverServiceClient | |
from ion.services.dm.inventory.dataset_management_service import DatasetManagementService | |
from interface.services.sa.idata_acquisition_management_service import DataAcquisitionManagementServiceClient |
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 | |
''' | |
@author Luke Campbell | |
''' | |
import gevent_profiler | |
import time | |
class TimeIt(object): | |
def __init__(self, message=''): |
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
# Fix the ipython path | |
project_path = '/Users/cmueller/Development/OOI/Dev/code/coi-services' | |
virtualenv_path = '/Users/cmueller/Development/OOI/Dev/virtenvs/clean27' | |
import IPython | |
IPython.sys.path = ['', | |
'{0}/eggs/gevent-0.13.7-py2.7-macosx-10.6-intel.egg'.format(project_path), | |
'{0}/eggs/coverage-3.5.2-py2.7-macosx-10.6-intel.egg'.format(project_path), | |
'{0}'.format(project_path), | |
'{0}/eggs/objgraph-1.7.2-py2.7.egg'.format(project_path), |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>python.supervisord</string> | |
<key>ProgramArguments</key> | |
<array> |
OlderNewer