leetcode 算法,以及其它
sonofspring2 / - Goto Github PK
View Code? Open in Web Editor NEWleetcode 算法,以及其它
leetcode 算法,以及其它
Comparable<Class>
and override public int compareTo(Class other)
.默认情况是 从小到大的!
PriorityQueue
的API
poll()
: get the first element, the smallest one in the pq, and remove it;
peek()
: only get the smallest one.
offer()
: put one element in the pq.
Map
的API
containsKey(key)
: 查看有没有 key 在 map里
put
:加一个元素
get
:获取一个元素
getOrDefault(key,0)
:如果不存在的话,用0 代替。这个特别是在把元素放入整个Map
的时候特别有用。
keySet()
:获得所有的 key 的 set
ps -l
: 只有列出和目前相关的进程。
ps aux
: 列出所有的进程哦,注意没有 -
。
test
可以有个返回值哦。
&&
当前面的判断为真的时候,执行命令。
||
当前面的判断为假的时候,执行命令。
&&
和||
常常可以连在一起用。
test -e ./p1.log &&echo "exit" || echo "not exit"; touch p1.log
$() 和原来的 ``一样,表示的要 evaluate 一下表达式的值。
${} 只是字符串的替换,或者变量的替换。
注意:
((
和 ))
之间没有空格!!!!
但是它们中间的表达式可以有任意的空格。
declare
可以定义各种变量,比如整数。 -i
选项。
$RANDOM
可以得到内置的一个随机数哦。
all system service is under /etc/init.d
directory. d
stands for daemon.
systemctl
可以管理 系统的service
systemctl COMMAND unit
Postgress is post ingress.
SQL 40 years.
Most DBMSs at least support SQL-92
SQL:2016 JSON, polymorphic tables
SQL:2011 Temporal DBs, Pipelined DML
SQL:2008 TRUNCATE, Fancy ORDER
SQL:2003 XML, windows, sequences, auto-generated IDs
SQL:1999 Regex, triggers, OO
Aggregation: Functions that return a single value from a bag of tuples
AVG(col) MIN(col) MAX(col)
Aggregate functions can only be used in the SELECT
output list.
Get # of students with a "@cs" login:
SELECT COUNT(login) AS cnt
FROM student WHETER login LIKE `%@cs`
或者,第一个 login 可以省略,因为我们不关心到底是对什么 count
SELECT COUNT(*) AS cnt
FROM student WHETER login LIKE `%@cs`
又或者,可以用1代替
SELECT COUNT(1) AS cnt
FROM student WHETER login LIKE `%@cs`
可以 multiple aggregation:
SELECT AVG(gpa), COUNT(sid) AS cnt
FROM student WHETER login LIKE `%@cs`
distinct aggregates:
SELECT COUNT(DISTINCT sid) AS cnt
FROM student WHETER login LIKE `%@cs`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.