Python bin()
bin(10) // 0b1010
type(bin(10)) // <class 'str'>
bin(10)[2:] // 1010
bin(10) // 0b1010
type(bin(10)) // <class 'str'>
bin(10)[2:] // 1010
public class Quadratic {
public static double root1(double a, double b, double c) {
double determinant = determinant(a, b , c);
return (-b + Math.sqrt(determinant)) / (2*a);
}
public static double root2(double a, double b, double c) {
double determinant = determinant(a, b , c);
return (-b - Math.sqrt(determinant)) / (2*a);
}
private static double determinant(double a, double b, double c) {
return b*b - 4*a*c;
}
}
// Copyright 2011-2019 The Bootstrap Authors
// Copyright 2011-2019 Twitter, Inc.
// Returns an instance of the Responder being tested.
protected abstract Responder responderInstance();
// This is our best attempt to get a race condition
// by creating large number of threads.
// Don't run unless you
// have some time to kill
// SimpleDateFormat is not thread safe,
// so we need to create each instance independently
與這個參數有關的問題 - boolean fileExits("Myfile")
對這個參數做某種操作,然後回傳 - InputStream fileOpen("Myfile")
事件,利用參數去修改系統狀態 - passwordAttemptFailedNtimes(int attempts)
Circle makeCircle(double x, double y, double radius);
Circle makeCircle(point center, double radius);
public boolean set(String attribute, String value);
if(set("username", "unclebob"))...
所以讀者看到此段 if 會容易產生誤解且疑惑,所以要將查詢與指令分開
if(attributeExists("username")){
setAttribute("username", "unclebob");
...
}
getHtml() - 高層次
parsePath() - 中層次
.append("\n") - 低層次
SELECT * FROM 成績單 LIMIT 3 // 取成績單前三筆資料
SELECT * FROM 成績單 ORDER BY 分數 DESC LIMIT 3 // 取分數前三名的資料
SELECT * FROM 成績單 ORDER BY 分數 DESC LIMIT 3, 7 // 取第四名到第十名的資料
SELECT * FROM 成績單 LIMIT 100000, 1 // 大 Offset
SELECT * FROM 成績單 WHERE id >= (SELECT id FROM 成績單 LIMIT 100000, 1) LIMIT 1