Skip to content

Instantly share code, notes, and snippets.

View brchiu's full-sized avatar

Bi-Ruei, Chiu brchiu

  • Taipei, Taiwan, Republic of China
View GitHub Profile
@brchiu
brchiu / gist:4baabaed0444b31cfcbf41f8d8bbac5f
Created March 8, 2020 09:17
simple proof of concept for parsing Fibonacci Number web page
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from lxml import html
import requests
r = requests.get('http://www.protocol5.com/Fibonacci/60.htm')
tree = html.fromstring(r.content.decode('utf8'))
li_elms = tree.xpath("//*[contains(@class, 'number-result')]/li")
for li in li_elms:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from lxml import html
import requests
r = requests.get('http://www.protocol5.com/Fibonacci/60.htm')
tree = html.fromstring(r.content.decode('utf8'))
li_elms = tree.xpath("//*[contains(@class, 'number-result')]/li")
for li in li_elms:
@brchiu
brchiu / gist:91aa4ac49f024b564d18b50bed2d492f
Last active March 8, 2020 11:08
simple proof of concept for parsing Fibonacci Number web page
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from lxml import html
import requests
def get_fibonacci(idx):
r = requests.get('http://www.protocol5.com/Fibonacci/' + str(idx) + '.htm')
t = html.fromstring(r.content.decode('utf8'))
li_elms = t.xpath("//*[contains(@class, 'number-result')]/li")
@brchiu
brchiu / gist:71bf87f51be35d6e334f4898b1ebd011
Last active February 20, 2023 20:02
first 500 Fibonacci numbers
0
1
1
2
3
5
8
13
21
34
@brchiu
brchiu / gist:0ec5f35282944af06ec07e9e1c4ee4f4
Last active March 10, 2022 16:01
大衍之數揲卦法的後半段
#!/usr/bin/python
# -*- coding: utf-8 -*-
import random
# import numpy as np
# fmt: off
# from 易經