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
library("httr") | |
library("xml2") | |
library("magrittr") | |
webGet = function(query=list(),file="search_for_02_dpt.php") { | |
url = paste("http://nol.ntu.edu.tw/nol/coursesearch/",file,sep="") | |
return (GET(url,query=query) %>% content(encoding="Big5")) | |
} | |
if(FALSE){ | |
# get all department |
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
from sympy import symbols, simplify, Function, integrate, Basic, \ | |
solve, linsolve, degree, LC, LT, expand, LM, plot | |
from sympy.printing.str import StrPrinter | |
class StepFunc(Function): | |
nargs = 2 | |
@classmethod |
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
from sympy import pi, cos, sin, sqrt, atan, atan2, N, oo | |
import matplotlib.pyplot as plt | |
import random | |
import time | |
from pprint import pprint | |
def getSum(arr, n): | |
pos = [0, 0] | |
for r, rho in arr[:n]: |
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
from sympy import pi, cos, sin, sqrt, atan, atan2, N, oo | |
import matplotlib.pyplot as plt | |
from pprint import pprint | |
def getSum(arr, n): | |
pos = [0, 0] | |
for r, rho in arr[:n]: | |
if rho == oo: | |
continue |
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
from sympy import pi, cos, sin, sqrt, atan, atan2, N, oo, symbols, solve | |
import matplotlib.pyplot as plt | |
import random | |
import time | |
from pprint import pprint | |
def getRange(arr): | |
leng = sum([a[0] for a in arr]) | |
return -leng / 2, leng / 2 |
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
from sympy import pi, cos, sin, sqrt, atan, atan2, N, oo | |
import matplotlib.pyplot as plt | |
from pprint import pprint | |
import math | |
def getSum(arr, n): | |
pos = [0, 0] | |
for r, rho in arr[:n]: | |
if rho == oo: |
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
const int pinarray[7] = {12,13,7,9,8,11,10}; | |
const int digitarray[10] = | |
{0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F}; | |
void setup() | |
{ | |
for(int i=0; i<7; ++i) | |
pinMode(pinarray[i], OUTPUT); | |
} |
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 <string.h> | |
const char *letter = "**ETIANMSURWDKGOHVF?L?PJBXCYZQ??"; | |
int letterlen = strlen(letter); | |
const char *want = "FOOT"; | |
char morse[1000]; | |
int morses = 0; | |
const int light = 5; | |
const int beepin = 6; | |
void setup() |
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
# scan wifi | |
sudo iwlist wlan0 scan | |
# modify file to auto connect to wifi | |
sudo vim /etc/network/interfaces | |
# change wlan0 like this | |
auto lo | |
iface lo inet loopback | |
iface eth0 inet manual |
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
# run script when boot | |
sudo vim /etc/rc.local | |
# add this line | |
su pi -c "tmux new-session -d 'python3 /home/pi/connect.py'" & | |
# when some website cannot connect | |
sudo vim /etc/resolv.conf | |
# comment all | |
# add this | |
nameserver 8.8.8.8 |
OlderNewer