chmod 751 /usr/bin/docker-compose root用户执行如上命令后切换普通用户然后报错: [22633] Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg 网上查 ...
分类:
其他好文 时间:
2020-04-30 09:22:17
阅读次数:
69
# 类方法 class Foo: __only = None def __init__(self, name): self.name = name @classmethod def get_only(cls, *args, **kwargs): if cls.__only is None: cls. ...
分类:
其他好文 时间:
2020-04-29 16:40:49
阅读次数:
57
回溯法 思路: 通过回溯的思维,递归调用枚举出所有可能。 class Solution: def letterCombinations(self, digits): phone = {'2': ['a', 'b', 'c'], '3': ['d', 'e', 'f'], '4': ['g', 'h' ...
分类:
其他好文 时间:
2020-04-29 12:57:46
阅读次数:
64
AutoInt:基于Multi-Head Self-Attention构造高阶特征 本文介绍 2018年 发布在 arXiv 上文章《AutoInt: Automatic Feature Interaction Learning via Self-Attentive Neural Networks》 ...
分类:
其他好文 时间:
2020-04-29 11:12:43
阅读次数:
113
1 class Solution(object): 2 def isMonotonic(self, A): 3 """ 4 :type A: List[int] 5 :rtype: bool 6 """ 7 i = 1 8 while i < len(A): 9 if A[i] == A[i - 1 ...
分类:
其他好文 时间:
2020-04-29 11:01:43
阅读次数:
45
代码一:暴力超时。 class Solution(object): # 暴力超时 def sumEvenAfterQueries(self, A, queries): """ :type A: List[int] :type queries: List[List[int]] :rtype: List ...
分类:
其他好文 时间:
2020-04-29 10:56:55
阅读次数:
41
代码一: 1 class Solution(object): 2 def sortedSquares(self, A): 3 """ 4 :type A: List[int] 5 :rtype: List[int] 6 """ 7 ans=[] 8 for i in range(len(A)): 9 ...
分类:
编程语言 时间:
2020-04-29 10:50:17
阅读次数:
66
1 class Solution(object): 2 def transpose(self, A): 3 """ 4 :type A: List[List[int]] 5 :rtype: List[List[int]] 6 """ 7 hang = len(A) 8 lie = len(A[0]) ...
分类:
其他好文 时间:
2020-04-29 10:45:13
阅读次数:
45
为了代码的编写方便简洁,引入了类的定义;一般,使用 class 语句来创建一个新类,class之后为类的名称(通常首字母大写)并以冒号结尾,例如: class Ticket(): def __init__(self,checi,fstation,tstation,fdate,ftime,ttime) ...
分类:
编程语言 时间:
2020-04-29 01:29:11
阅读次数:
129
举个例子简单介绍怎么给类和对象添加成员方法 # ### 给类和对象添加成员方法(封装性) class MyClass1: def func1(self): print(">> 成员方法func1") def func2(): print(">> 自定义func2") def func3(obj): ...
分类:
其他好文 时间:
2020-04-28 23:07:17
阅读次数:
125