Skip to content

Instantly share code, notes, and snippets.

View iladriano's full-sized avatar
👓
I may be slow to respond.

Adri Fernandez iladriano

👓
I may be slow to respond.
  • Sunnyvale
View GitHub Profile
@iladriano
iladriano / latency.txt
Created March 4, 2021 16:24 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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

Keybase proof

I hereby claim:

  • I am iladriano on github.
  • I am iladriano (https://keybase.io/iladriano) on keybase.
  • I have a public key whose fingerprint is 7AA8 8E4A 299B 63CD E88A 0401 F8F5 6B44 495D D40D

To claim this, I am signing this object:

@iladriano
iladriano / LogTable.java
Created December 1, 2012 16:35
Loop log entries
import java.util.*;
/**
* Created with IntelliJ IDEA.
* User: afernand
* Date: 11/30/12
* Time: 2:21 PM
* To change this template use File | Settings | File Templates.
*/
public class LogTable {
@iladriano
iladriano / Encoder.java
Created February 12, 2012 16:05
Short URL from a counter
package com.ghosthack.turismo.util;
public class Encoder
{
protected static final String DEFAULT_ALPHABET = "ed82j6rhkyf5amu9x4qbgpstn7vc3w1ioz";
protected static final int DEFAULT_BLOCK_SIZE = 22;
private String alphabet;
private int blockSize;
private int mask;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
public class GoogleDeveloperQuiz {
private static final String textA = "kmndqkc slzfmhd qkwv xjk jwqlfz vjjtqmz dsgrhfqb jqsklf dtkpzvsl khjrf ctmjsbnh vvtdl hvfv qqht xqzqrd wkqchmv qxbbz cngw kvlpmrf lztf kfdfmxx xqwjk ggnqwbk pmbln rfv tcfhxshl zpnzwhc xgmtmtjf zlzjls blljr dhcmh rrq rgwv mhvh qbt mbkfjtr ttrglct vzwf fpmffgq tjl snqvpsc xmtkfhdb lgzf crz xcpxk qfvnff nzlhwhph pdssgd wmj krgshq vktqx swzcvkbg djgmbkdl kkgk xrm nvmkwq pglvbvb xvqgsdxh rknr nlz xzcpvwt zsdxxsm pqk ggldqpjh zkjkbhr rlqpxksd jskbv tst sgvfdrwm pfjpqtd gjjfr sxr fpt sjqlm jcxx jssbf gfvclhx pzhkrdq rtv cjggkj hrgkkwj fck vwlxvmf ffblvq wzqbz kgl vxccw xtxvc hwgb qzmmpv fglprxrh hxrvqp dntlxtl jhcd vklv tjdw jxpwkg ssnhwxcz blshdfc vwsdjx zbqcsb snkkcqbh ckw hzdrvrd jhtnrrf vcgpn jnqvt cdqq kvfwqgx tjrhff xdxdk zvp rzsvd jqmx vqqjstt svfh bnvjtv zrdjnpnd rgwq xfgx gktxfz wlvldznn rhpcclkr hmqvktd npzlplr cjk djn txkkxpct
@iladriano
iladriano / indextank.js
Created June 13, 2011 17:04 — forked from francois2metz/indextank.js
indextank with Node and Spore
// mkdir indextank
// wget https://github.com/SPORE/api-description/blob/master/services/indextank.json
// install node and npm
// npm install spore underscore futures
// edit baseUrl, password and index var
// node indextank.js
var baseUrl = 'http://xxx.api.indextank.com';
var password = 'xxx';
var index = 'test_spore';
@iladriano
iladriano / gist:827110
Created February 15, 2011 04:54
test function_filters
>>> include
Traceback (most recent call last):
File "", line 1, in
NameError: name 'include' is not defined
>>> import indextank_client
>>> api = ApiClient('api url')
Traceback (most recent call last):
File "", line 1, in
NameError: name 'ApiClient' is not defined
>>> import indextank_client
@iladriano
iladriano / gist:757969
Created December 29, 2010 00:42
test docvar_filters
require 'rubygems'
require 'indextank'
api_client = IndexTank::Client.new 'api url'
index = api_client.indexes 'eurotrip'
index.document('post4').add({ :text => '4I need my Duke.4'}, :variables => { 0 => 1, 1 => 4 })
index.document('post5').add({ :text => '5Duke Nukem is awesome.5'}, :variables => { 0 => 2, 1 => 5 })
index.document('post6').add({ :text => '6People who love Duke Nukem6'}, :variables => { 0 => 3, 1 => 6 })
index.search('Duke')
index.document('post4').add({ :text => '4I need my Duke. 4'}, :variables => { 0 => 1, 1 => 4 })
index.search('Duke')