A very simple example of using a map of channels for pub/sub in go.
To run it go here http://play.golang.org/p/eXwppMgHR3
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from Crypto.Cipher import AES | |
import base64 | |
import random | |
import hashlib | |
import os | |
class AesCrypt256: |
A very simple example of using a map of channels for pub/sub in go.
To run it go here http://play.golang.org/p/eXwppMgHR3
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User | |
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User | |
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User | |
[ | |
{ | |
"button": "button1", | |
"count": 1, | |
"modifiers": ["ctrl"], | |
"press_command": "drag_select", |
#include <stdint.h> | |
#include <stdlib.h> | |
// assert(RAND_MAX >= 0x7fff) | |
float | |
random_0_to_1() { | |
union { | |
uint32_t d; | |
float f; | |
} u; |
# Check the alias | |
keytool -list -keystore ${MYKEY}.jks | |
# Export to PKCS12 | |
keytool -importkeystore -srckeystore ${MYKEY}.jks -destkeystore ${MYKEY}.pkcs -srcstoretype JKS -deststoretype PKCS12 -alias ${MYALIAS} | |
# Convert to PEM | |
openssl pkcs12 -in ${MYKEY}.pkcs -out ${MYKEY}.pem |
#!/usr/bin/env python3 | |
""" | |
VIEW COMPLETE CODE AT | |
===================== | |
* https://github.com/six519/libreoffice_convert | |
THANKS | |
====== |
violino:/home/software/leveldb> ./db_bench_mdb.vl32 | |
LMDB: version LMDB 0.9.14: (September 15, 2014) | |
Date: Thu Sep 18 20:52:49 2014 | |
CPU: 4 * Intel(R) Core(TM)2 Extreme CPU Q9300 @ 2.53GHz | |
CPUCache: 6144 KB | |
Keys: 16 bytes each | |
Values: 100 bytes each (50 bytes after compression) | |
Entries: 1000000 | |
RawSize: 110.6 MB (estimated) | |
FileSize: 62.9 MB (estimated) |
import comtypes.client | |
def PPTtoPDF(inputFileName, outputFileName, formatType = 32): | |
powerpoint = comtypes.client.CreateObject("Powerpoint.Application") | |
powerpoint.Visible = 1 | |
if outputFileName[-3:] != 'pdf': | |
outputFileName = outputFileName + ".pdf" | |
deck = powerpoint.Presentations.Open(inputFileName) | |
deck.SaveAs(outputFileName, formatType) # formatType = 32 for ppt to pdf |
Latency Comparison Numbers | |
-------------------------- | |
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 |