This file contains 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 requests | |
from bs4 import BeautifulSoup | |
import base64 | |
payload = {} | |
res = requests.get('http://www.twse.com.tw/ch/trading/exchange/BWIBBU/BWIBBU_d.php') | |
res.encoding = 'big5' | |
soup = BeautifulSoup(res.text) | |
for input_tag in soup.select('input'): | |
if input_tag.get('type') == 'hidden': | |
payload[input_tag.get('name')] = base64.b64encode(input_tag.get('value').encode('utf-8')) |
This file contains 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 BeautifulSoup, requests | |
r=requests.post('http://www.twse.com.tw/ch/trading/exchange/BWIBBU/BWIBBU.php', {'STK_NO':2330, 'myear': 2016, 'mmon':2}) | |
soup = BeautifulSoup.BeautifulSoup(r.content) | |
table = soup.find('table', {'class':'board_trad'}) | |
with open('out2.csv', 'w') as f: | |
trs = table.findAll('tr') | |
for tr in trs: |
This file contains 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
# coding=utf-8 | |
# Goal: parse house information for each district from websites | |
# for each district, get 「土地區段位置或建物區門牌」,「建物型態」,「建物現況格局」,「坪數」,「屋齡」,「總價元」,「資料來源」into csv file | |
# Procedure: | |
# 1. get the number of page for each district by parsing first html content | |
# 2. for each district put all html page together, use htmlparser to parse content and save data into file | |
import sys | |
import math |
This file contains 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
# coding=utf-8 | |
# Goal: | |
# parse different city's website | |
# for each city, get 「土地區段位置或建物區門牌」,「建物型態」,「建物現況格局」,「坪數」,「屋齡」,「總價元」,「資料來源」into csv file | |
# step: | |
# 1. get number of page by parsing string | |
# 2. put all html page together, use htmlparser to get content | |
# 3. parsing content and save it |
This file contains 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
package hardware; | |
import java.util.ArrayList; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.location.Location; | |
import android.location.LocationListener; | |
import android.location.LocationManager; | |
import android.location.LocationProvider; |
This file contains 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 gdb | |
import string | |
class test_gdb_python_command(gdb.Command): | |
"test help" | |
def __init__(self): | |
super(test_gdb_python_command,self).__init__("test_gdb_python_command",gdb.COMMAND_USER) |
This file contains 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 gdb | |
import string | |
class test_gdb_python_command(gdb.Command): | |
"test help" | |
def __init__(self): | |
super(test_gdb_python_command,self).__init__("test_gdb_python_command",gdb.COMMAND_USER) |
This file contains 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
# Usage: | |
# Save this file as 'hello.s'. | |
# $ as -o hello.o hello.s | |
# $ ld -o hello hello.o | |
# $ ./hello | |
# | |
# How to call a system call | |
# 1) Set rax to the index of the system call. | |
# 2) Set rdi, rsi, rdx, ... to arguments in this order. | |
# 3) Call 'syscall'. |
This file contains 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
#include "Quaternion.h" | |
#include <cmath> | |
// http://content.gpwiki.org/index.php/OpenGL:Tutorials:Using_Quaternions_to_represent_rotation | |
// http://www.flipcode.com/documents/matrfaq.html | |
// http://db-in.com/blog/2011/04/cameras-on-opengl-es-2-x/ | |
// http://wiki.beyondunreal.com/Legacy:Quaternion | |
// http://clb.demon.fi/MathGeoLib/docs/float3x3.cpp_code.html#612 | |
// http://clb.demon.fi/MathGeoLib/docs/Quat_summary.php | |
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm |
OlderNewer