Skip to content

Instantly share code, notes, and snippets.

@simoncos
simoncos / extract_url_id.py
Created Oct 9, 2017
recognize url in html and extract the id part
View extract_url_id.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
p = re.compile('("http://hk\.centadata\.com/ccichart/estate_info\.aspx\?id=)([0-9]+)')
s = '<a href="http://hk.centadata.com/ccichart/estate_info.aspx?id=008600" target="_top"> sdfasdfasd <a href="http://hk.centadata.com/ccichart/estate_info.aspx?id=05600" target="_top">'
for match in re.findall(p,s):
print(match[1])
View neu_feature_classification_sklearn.py
# -*- coding: utf-8 -*-
import json
import pandas as pd
from pandas.io.json import json_normalize
from sklearn import feature_extraction
from sklearn.ensemble import AdaBoostClassifier
# f = open("data/neu_features.txt")
# for line in f:
@simoncos
simoncos / miniconda_on_rpi.md
Last active Aug 2, 2020
Install Miniconda 3 on Raspberry Pi
View miniconda_on_rpi.md
@simoncos
simoncos / nodejs_on_rpi.md
Last active Jul 19, 2018
Install Nodejs 6.x on Raspberry Pi Raw
View nodejs_on_rpi.md

Remove old version nodejs and npm:

sudo apt-get remove nodered -y
sudo apt-get remove nodejs nodejs-legacy -y
sudo apt-get remove npm -y
sudo apt-get autoremove

Install nodejs 6.x:

@simoncos
simoncos / golang_on_rpi.md
Last active May 31, 2020 — forked from konradko/golang_on_rpi.md
Install Golang 1.9 on Raspberry Pi
View golang_on_rpi.md

Install Golang 1.9:

wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile

If already installed old golang with apt-get:

You can’t perform that action at this time.