All consumers consuming over 1K queues, growing from 1 to 1K messages.
import pika
import threading
import sys
import time
GET /render?target=x | |
^ | |
| | | |
| | | |
| | | |
+--|---------------------------+ | |
| | | | | |
| | +--------------+ | | |
| | | consolidation| | | |
| | +--------------+ | |
Whisper data base format | |
------------------------ | |
Byte Map of whisper file format | |
+------------------+ | |
| Aggregation func | 4 bytes - Type of allocate strategies for file | |
+------------------+ * Use of fallocate if it is available, book the disk space | |
| Max time | * Use of sparse, fragmented, if it is configured. | |
| retention | 4 bytes * Booking whole space writing zeros over there |
Whisper example of update value | |
------------------------------- | |
Have a look to Whisper data format map to learn how it is https://gist.github.com/pfreixes/1b4c9f0cf1c2bd19edf9 | |
Network packets : ts value | |
+------------------+ | |
| 1401614544 10.0 | packet 1 |
"""Programs not ported to Python 3 that they are using specific | |
operations with strings could raise undesirable bugs""" | |
>>> title = "Open binary file with python 3" | |
>>> fd = open("/tmp/wut.png", "rb") | |
>>> b = fd.read() | |
>>> type(b) | |
<class 'bytes'> | |
>>> b[0] == "\x89" | |
False |
List of available events and their topics used by | |
rabbitmq-event-exchange. | |
queue.* | |
consumer.* | |
user.* | |
permission.* | |
channel.* | |
policy.* | |
vhost.* |
> db.test.find().count() | |
13 | |
> db.test.find() | |
{ "_id" : "01-02" } | |
{ "_id" : "01-01" } | |
{ "_id" : "01-03" } | |
{ "_id" : "02-01" } | |
{ "_id" : "02-02" } | |
{ "_id" : "02-03" } | |
{ "_id" : "03-01" } |
Boolean are integers, integers are immutable and immutable objects are shared along the life cycle of your programm. Then it comes true | |
>>> False is False | |
True | |
>>> 123 is 123 | |
True | |
>>> [1] is [1] | |
False |
#!/usr/bin/env python | |
UPPER_ITERATIONS = 10000000 | |
def fac(n): | |
if n == 0: | |
return 1 | |
return n * fac(n - 1) | |
N = 100000 | |
# First approximation, brute force | |
def is_prime(number): | |
if number == 2: | |
return True | |
for x in range(2, number/2+1): | |
if number % x == 0: | |
return False | |
return True |