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
arping("192.168.1.*") |
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
buildscript { | |
ext { | |
springBootVersion = '1.5.6.RELEASE' | |
} | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath "org.projectlombok:lombok:1.16.18" | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") |
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
class Solution: | |
def threeSum(self, nums): | |
""" | |
:type nums: List[int] | |
:rtype: List[List[int]] | |
""" | |
nums.sort | |
solutions = [] | |
d = {} | |
inx = 0 |
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
cfg = [] | |
ht = {} | |
class Token: | |
def __init__(self, val, is_term): | |
self.val = val | |
self.is_term = is_term | |
def __eq__(self, other): | |
return (self.val, self.is_term) == (other.val, other.is_term) |
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
def travel(root): | |
levels, level = [], [root] | |
while root and level: | |
levels.append([n.val for n in level]) | |
level = [k for n in level for k in (n.left, n.right) if k] | |
return levels |
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
public class Psychic { | |
private static FuckRandom fuckRandom = new FuckRandom(); | |
static { | |
fuckRandom.reverse(Math.random()); | |
} | |
public static double guess(){ | |
return fuckRandom.nextDouble(); |
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
docker ps|awk '{if (NR!=1) print $1}'| xargs docker stop |
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
class Graph | |
@adjlst | |
@v | |
@e | |
def initialize(size) | |
@adjlst = Array.new(size+1) { [] } | |
@v = size | |
end |
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
def isMonostoneInc(list): | |
return all(list[i], list[i+1] for i in range(len(list)-1)) |
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
""" | |
基本思想:利用层序遍历,浮标法记录最大值 | |
Node struct: | |
class Node: | |
def __init__(self, data, left, right): | |
self.data = data | |
self.left = left | |
self.right = right | |
""" |
NewerOlder