This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var longTable = make(map[string]DBStruct) | |
func LoadFromDB(db) { | |
rows, err := db.Query("SELECT * FROM 4millionrowTable") | |
for rows.Next() { | |
st := DBStruct{} | |
rows.Scan( | |
&st.FieldOne, | |
&st.FieldTwo, // until Field14 | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GOPATH="$HOME/.go" | |
_gopath_auto_activate() { | |
if [ -e "main.go" ]; then | |
# Check to see if already activated to avoid redundant activating | |
FINDED=false | |
PWD=$(pwd -P) | |
array=(${GOPATH//:/ }) | |
for p in "${!array[@]}"; do | |
if [[ "${array[p]}" == "$PWD" ]]; then | |
FINDED=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(.env)timu@chewie:~/workspace/video-ad-server/viads$ python t.py | |
[+] retopy bloom filter time show | |
[*] create takes 0.000977039337158 | |
[*] adding takes 0.000410795211792 | |
[*] checking 1000 times, takes 0.409878969193 | |
[*] geting bloom filter takes 0.0404479503632 | |
[*] deleting bloom filter takes 0.000898122787476 | |
[*] putting bloom filter takes 0.026750087738 | |
[*] all together takes 0.480618000031 | |
(.env)timu@chewie:~/workspace/video-ad-server/viads$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from gredis.client import AsyncRedis | |
import tempfile | |
import ketama | |
class AsyncRedisClient(object): | |
def __init__(self, settings={}): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
// bootstrap ve jquery bağlantıları buraya gelecek | |
</head> | |
<body> | |
<script> | |
// cevap listemizi oluşturalım, her satırda bir cevap | |
var cevap_listesi = [ | |
'Bir cevap', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HashDest = ['1BmAYKGsnUT27VkMGoxYX3nZZgb43rbNQz', '17upfEPmdZuvNHnXjb5GBy74n25pgey5Ti', '1Pyrx4QjipfVTPnYTe5TfAqnYyxtcmx4Wv', '13Nko1GZgnqAGn5XkEtJS3oGu42z7zo3JR', '1G7Q7YSpaNAfBXujeUFpxBPnm6ewnB3cuE', '1JFne3ge5Rg87ZUmnURvxRrsNkH3yjRkzY', '157k51kHGXeHaL7N2cgsymU2ab3rXcD1Rt', '16RqmQYpDrDYLxGzD6N2ftWSc2ebtwVz88', '1AR9eQU1ZPL3gJcUVAEVjbQWKghG8vsD3e', '18EK3QZdYmAFmWPvckEZ6GkGnLbBXSRCmb', '15h8imbeAKx1ZLHJi7WMT5tW99ATyzrQaV', '1Ba7omDUyMQMvPjh7NL2Kw85CDGuCXEekd', '1GYXKk9wahuTZnTUJBGUxBPUk3uXSLTBMT', '1EQ5TTdTQx1w3nDdeG2Vq8YZwX3PevT2jA', '1Dd2eVUoiYC5KV7dkJFxgo2jsK6Y1Bc1pK', '1NFzAkA4QAtzdNYTm2M98i9zhwT2eJ5qB5', '1E38cFUdPU7BSgddXub17eB3nTxaxY6mZc', '1HhSuEMZyNgWFYZHepsBNbTNs3Wv5ABakC', '1LPZes1tVBfWPRsMqcZvNZt93s1KQW3D4x', '1MaUiURfN7pytCTC1FnHRSZ13N6AzXVszp', '17pAtDVLAS72ay6bHaqk1TC3pyDmkDkjMw', '1Ctuhj1ajD6hzRFvtM2mWhtxRXybADixGL', '18tcqFp65FqgSbQqQE18wt81xFWEHRSE3m', '1BRsrZPa5w44pJRmiKFFiTYujWi3sdi5TW', '1KGFmskMdjSi7dByNwQozDtmT6U62EiZ7N', '18FFWdnEjZRhJFhdAzE5hNoSXmV1B8WjNL', '18JmdLf6QLEtY8jD552 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def sifir_zarar(satis_fiyati, komisyon): | |
anapara = satis_fiyati - (satis_fiyati * komisyon) | |
# komisyondan sonra kalan para | |
anapara = float("{0:.2f}".format(anapara)) | |
sifir_zararli_fiyat = satis_fiyati + (satis_fiyati * komisyon) | |
return anapara, sifir_zararli_fiyat | |
print sifir_zarar(float(sys.argv[1]), sys.argv[2] if len(sys.argv) > 3 else 0.006) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import solr | |
# create a connection to a solr server | |
s = solr.SolrConnection('http://foo/bar/:8180/solr') | |
# get all documents, | |
response = s.query('*:*') | |
# start to loop for delete all data | |
while response: | |
for hit in response.results: |