Skip to content

Instantly share code, notes, and snippets.

Batista Harahap tistaharahap

View GitHub Profile
from datetime import datetime
import csv
import pandas as pd
import matplotlib.pyplot as plt
fn = './redfin_2019-08-08-20-18-37.csv'
fn_mapped = './redfin_2019-08-08-20-18-37-mapped.csv'
df = []
with open(fn) as f:
View xl-iframe.html
<!DOCTYPE html>
&lt;meta http-equiv="refresh"content="0;URL=;j=0&amp;i=182324434&amp;s=I03025149477501061917&amp;a="/&gt;
<link href="" rel="stylesheet" type="text/css">
<script type="text/javascript" src=";j=2&amp;callback=ibn.jsonp313&amp;rnd=313&amp;;i=182324434&amp;s=I03025149477501061917"></script><style type="text/css">
:root #content > #center > .dose > .dosesingle,
:root #content > #right > .dose > .dosesingle
{ display: none !important; }</style><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="apple-mobile-web-app-capable" content="no"><title>LiveScore Soccer : Live Soccer Scores by</title><script type="text/javascript" src=";adsTransactionId=D0394775012212561&amp;orgUrl=http%3A%2F
View results.txt
$ python
**/ Benchmarking Handlersocket - START /**
Elapsed time: 9.35 seconds
Speed : 10693.14 queries/second
**/ Benchmarking Handlersocket - END /**
**/ Benchmarking MySQL - START /**
Elapsed time: 12.11 seconds
from pyhs import Manager
import MySQLdb
import time
def run_handlersocket(maximum):
hs = Manager() # Assuming that Handlersocket is available at
print '**/ Benchmarking Handlersocket - START /**\n'
from pyhs import Manager
def main():
hs = Manager() # Assuming that Handlersocket is available at
user = hs.find('fun', 'user', '>=', ['user_id', 'user_name', 'user_email', 'created'], ['tistaharahap'], 'usernames', 1)
print dict(user[0])
View create-index.sql
CREATE INDEX usernames ON `user` (user_name);
View hs.txt
$ python
{'user_name': 'tistaharahap', 'user_id': '1', 'user_email': '', 'created': '2016-09-06 15:00:00'}
from pyhs import Manager
def get_user_by_id(hs, user_id):
def main():
hs = Manager() # Assuming that Handlersocket is available at
View install-deps.txt
$ pip install -r requirements.txt
Collecting python-handler-socket (from -r deps (line 1))
Downloading python-handler-socket-0.2.4.tar.gz
Building wheels for collected packages: python-handler-socket
Running bdist_wheel for python-handler-socket ... done
Stored in directory: /Users/tista/Library/Caches/pip/wheels/48/7c/46/ee1c1e3dabc22527c8780ac7ae3ca7ba03a66e6720d5d1f481
Successfully built python-handler-socket
Installing collected packages: python-handler-socket
Successfully installed python-handler-socket-0.2.4
You can’t perform that action at this time.