start new:
tmux
start new with session name:
tmux new -s myname
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...
| /* Useful celery config. | |
| app = Celery('tasks', | |
| broker='redis://localhost:6379', | |
| backend='redis://localhost:6379') | |
| app.conf.update( | |
| CELERY_TASK_RESULT_EXPIRES=3600, | |
| CELERY_QUEUES=( | |
| Queue('default', routing_key='tasks.#'), |
| #!/usr/bin/python3 | |
| # This can either be run from a command line with python3 alphabeta.py or imported with | |
| # from alphabeta import alphabeta | |
| # USAGE: | |
| # alphabeta(input, start, lower, upper) | |
| # | |
| # Where: | |
| # input is a list form input tree. See example in this file. |
| Three files are included: | |
| 1. `weighted_majority.py`: the weighted majority algorithm | |
| 2. `main.py`: the main program which takes a specific beta value and make a list of plots | |
| 3. `experiment.sh`: bash script that experiments on a list of beta values. This is a good entry of this gist. |
| import time | |
| def RateLimited(maxPerSecond): | |
| minInterval = 1.0 / float(maxPerSecond) | |
| def decorate(func): | |
| lastTimeCalled = [0.0] | |
| def rateLimitedFunction(*args,**kargs): | |
| elapsed = time.clock() - lastTimeCalled[0] | |
| leftToWait = minInterval - elapsed | |
| if leftToWait>0: |
| """Splay tree | |
| Logan Ingalls <log@plutor.org> | |
| Sept 3, 2012 | |
| Note that I only implemented insert and find. Delete is trivial, | |
| and isn't the interesting part of splay trees. Some of these | |
| algorithms would be simpler, but I chose to do this without parent | |
| links from the tree nodes. | |
| Example output on my desktop computer: |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
As configured in my dotfiles.
start new:
tmux
start new with session name: