Today's topics:
########################################### | |
# serialization of indexes to byte arrays | |
########################################### | |
def serialize_index(index): | |
""" convert an index to a numpy uint8 array """ | |
writer = faiss.VectorIOWriter() | |
faiss.write_index(index, writer) | |
return faiss.vector_to_array(writer.data) |
Track: Careers
Product Manager: one of the least well-defined roles in the computer industry, although quite popular nowadays. No two companies have the same description for this job title, and it can even vary widely within one company. Are they the CEO of the product (bleargh!)? Are they project managers wearing sneakers and hipster glasses? What do they do all day? Is this a business, marketing or technology role? Is this someone with a degree in engineering, or an MBA? What can make a software engineer want to become a product manager?
% Example on how to get all Erlang formats from source code to disassembled bytecode | |
% Erlang Source --> Erlang AST --> Erlang Expanded AST --> Core Erlang --> BEAM Bytecode | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
%%% First the original module | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
-module(add). | |
-export([add/2]). |
# See https://codeship.com/documentation/docker/browser-testing/ | |
FROM myapp:base | |
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver | |
RUN apt-get install -y wget xvfb unzip | |
# Set up the Chrome PPA | |
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - | |
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list |
# this monit config goes in /etc/monit/conf.d | |
check process puma_master | |
with pidfile /data/myapp/current/tmp/puma.pid | |
start program = "/etc/monit/scripts/puma start" | |
stop program = "/etc/monit/scripts/puma stop" | |
group myapp | |
check process puma_worker_0 | |
with pidfile /data/myapp/current/tmp/puma_worker_0.pid |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
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 |