การเข้ารหัสรับประกันว่าผู้ใช้ทุกคนมีสิทธิ์การเข้าถึงที่เหมาะสม ข้อความนี้ผิด: แบนด์วิดท์ไม่ใช่ actual end-to-end throughput การเข้ารหัสไม่ได้ by itself ensure correct authorization or remove every security risk
import sqlite3
db = sqlite3.connect(":memory:")
db.executescript("""CREATE TABLE c(id INTEGER PRIMARY KEY);
CREATE TABLE o(id INTEGER PRIMARY KEY, cid INTEGER);
INSERT INTO c VALUES(1),(2),(3);
INSERT INTO o VALUES(10,1),(11,1),(12,3);""")
for kind in ["INNER", "LEFT"]:
sql = f"SELECT COUNT(*),COUNT(o.id) FROM c {kind} JOIN o ON c.id=o.cid"
print(kind, db.execute(sql).fetchone())
db.close()
def first_index(values, target):
for index, value in enumerate(values):
if value == target:
return index
return -1
print(first_index([4, 7, 4], 4))
print(first_index([4, 7, 4], 9))
print(first_index([], 4))
Abstract data type ระบุค่าและการดำเนินการโดยไม่ขึ้นอยู่กับ Implementation เฉพาะ Stack เป็น Last in First Out Queue เป็น First in First Out Collection interface ต้องการพฤติกรรมที่กำหนดสำหรับ Operation ที่ว่างและ Operation ที่ไม่ถูกต้อง
Known: เควอ A, B และ C แล้วดีควอสองครั้ง A และ B ออก; C คงอยู่ หลังจากเควอ D จะมีรายการรอสองรายการ คือ C แล้ว D การกด push เดียวกันบน stack จะเอา C ออกก่อนแล้วจึงเอา B ออก