Skip to content

Instantly share code, notes, and snippets.

View mlouielu's full-sized avatar
🎯
floating

Louie Lu mlouielu

🎯
floating
View GitHub Profile
import requests
URL = 'http://www.twse.com.tw/exchangeReport/MI_INDEX?response=csv&date=20181218&type=ALL'
def main(url):
r = requests.get(url)
with open('test.csv', 'w') as f:
f.write(r.text)
import requests
URL = 'http://www.twse.com.tw/exchangeReport/MI_INDEX?response=csv&date=20181218&type=ALL'
def main(url):
r = requests.get(url)
with open('test.csv', 'w') as f:
f.write(r.text)
#include <stdio.h>
#include <stdlib.h>
int c = 0xffffeeee;
int main() {
int a = 0x12345678;
int b = 0xdeadbeaf;
int *d = malloc(sizeof(int));
int *e = malloc(sizeof(int));
printf("%p %p %p %p %p\n", &a, &b, &c, d, e);
@mlouielu
mlouielu / paging_features_cpuid.c
Created October 15, 2018 04:30
Get Intel 64/IA-32 architecture paging features by CPUID
/*
* Get Intel 64/IA-32 architecture paging features by CPUID
*
* Ref: Intel® 64 and IA-32 architectures software developer's manual
* combined volumes 3A, 3B, 3C, and 3D: System programming guide,
* pp.Vol. 3A 4-5 (Section 4.1.4 Enumeration of Paging Features by CPUID
*/
#include <stdio.h>
#include <stdlib.h>
From bdd191931f8948c80020138c06aaebd10ca9ffcb Mon Sep 17 00:00:00 2001
From: Louie Lu <git@louie.lu>
Date: Sun, 7 Oct 2018 12:36:47 +0800
Subject: [PATCH] ath: Bypass EEPROM regd
---
drivers/net/wireless/ath/regd.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
import requests
from lxml import etree
r = requests.post('http://mops.twse.com.tw/mops/web/ajax_t93sc01_1', {'encodeURIComponent': 1, 'step': 1, 'firstin': 1, 'off': 1, 'TYPEK': 'sii'})
r.encoding = 'utf-8'
root = etree.HTML(r.text)
for r in root.xpath('//tr')[2:]:
print(list(r.itertext()))
$ ls
360_0926.MP4 gear360pano spatial-media tmp
# 將影片轉為魚眼圖片
$ ffmpeg -y -i 360_0926.MP4 -q:v 2 tmp/image%05d.jpg
# 將魚眼圖片轉為拼接圖片
$ find tmp -type f -name '*.jpg' | parallel --load 99% --noswap --memfree 500M --bar "gear360pano/gear360pano.sh -r -m -o tmp {} gear360pano/gear360video4096.pto"
# 將拼接圖片轉為影片
while True:
w, v = input().split(',')
if w.find('-') ^ v.find('-'):
break
print('input error')
1. Hakkert, A. S., Braimaister, L., & Van Schagen, I. (2002). The uses of exposure and risk in road safety studies (Vol. 2002, No. 12). SWOV Institute for Road Safety.
網址:https://www.swov.nl/sites/default/files/publicaties/rapport/r-2002-12.pdf
功能:pp.25, 不可能讓不同種類的用路人風險相同,不符合實際情況以及經濟成本。
「實際上,不同用路人型態會有不同的風險,想要將安全風險降到「相等」是幾乎不可行、也無法以合理的經濟成本達成的事情5。機車就是會有比起汽車更高的風險、行人在車禍中比起汽車也會有更高的死亡風險、市區道路有比高速公路更高的車禍率等等。而Hakkert在2002年的研究便已指出,「我們該做的事,是在可行(不論是經濟成本或是方法)的範圍內,採取讓該個群體風險降低的措施」。至於這措施是什麼?至少禁絕絕非好主意。、
2. Department for transport (2016).Reported Road CasualtiesGreat Britain: 2016 Annual Report.
網址:https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/668504/reported-road-casualties-great-britain-2016-complete-report.pdf
1. Hakkert, A. S., Braimaister, L., & Van Schagen, I. (2002). The uses of exposure and risk in road safety studies (Vol. 2002, No. 12). SWOV Institute for Road Safety.
網址:https://www.swov.nl/sites/default/files/publicaties/rapport/r-2002-12.pdf
功能:pp.25, 不可能讓不同種類的用路人風險相同,不符合實際情況以及經濟成本。
「實際上,不同用路人型態會有不同的風險,想要將安全風險降到「相等」是幾乎不可行、也無法以合理的經濟成本達成的事情5。機車就是會有比起汽車更高的風險、行人在車禍中比起汽車也會有更高的死亡風險、市區道路有比高速公路更高的車禍率等等。而Hakkert在2002年的研究便已指出,「我們該做的事,是在可行(不論是經濟成本或是方法)的範圍內,採取讓該個群體風險降低的措施」。至於這措施是什麼?至少禁絕絕非好主意。、
2. Department for transport (2016).Reported Road CasualtiesGreat Britain: 2016 Annual Report.
網址:https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/668504/reported-road-casualties-great-britain-2016-complete-report.pdf