Giter Club home page Giter Club logo

-'s Introduction

-

leetcode 算法,以及其它

-'s People

Contributors

sonofspring2 avatar

Watchers

James Cloos avatar

-'s Issues

java 刷题用到的语法,API

custom sort

  1. implement Comparable<Class> and override public int compareTo(Class other).
    e.g.

PriorityQueue

默认情况是 从小到大的!
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

Map的API
containsKey(key): 查看有没有 key 在 map里
put:加一个元素
get:获取一个元素
getOrDefault(key,0):如果不存在的话,用0 代替。这个特别是在把元素放入整个Map的时候特别有用。

keySet():获得所有的 key 的 set

shell 编程笔记

进程管理

ps -l : 只有列出和目前相关的进程。
ps aux: 列出所有的进程哦,注意没有 -

test, && 和 ||

test 可以有个返回值哦。
&& 当前面的判断为真的时候,执行命令。
|| 当前面的判断为假的时候,执行命令。
&&||常常可以连在一起用。

test -e ./p1.log &&echo "exit" || echo "not exit"; touch p1.log

$() 和${}

$() 和原来的 ``一样,表示的要 evaluate 一下表达式的值。
${} 只是字符串的替换,或者变量的替换。

$(()) 和 (())

注意:
(()) 之间没有空格!!!!
但是它们中间的表达式可以有任意的空格。

declare 和普通的定义

declare 可以定义各种变量,比如整数。 -i选项。

$RANDOM

$RANDOM 可以得到内置的一个随机数哦。

system service

all system service is under /etc/init.d directory. d stands for daemon.
systemctl 可以管理 系统的service

systemctl COMMAND unit

SQL 笔记

Postgress is post ingress.
SQL 40 years.
Most DBMSs at least support SQL-92

SQL standard:

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

Aggregations + GroupBy

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`

String/Date/Time Operations

Output Control Redirection

Nested Queries

Common Table Expressions

Window Functions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.