一、栈 栈(stack),有些地方称为堆栈,但是不能叫堆,是一种容器,可存入数据元素、访问元素、删除元素,它的特点在于只能允许在容器的一端(称为栈顶端指标,英语:top)进行加入数据(英语:push)和输出数据(英语:pop)的运算。 没有了位置概念,保证任何时候可以访问、删除的元素都是此前最后存入 ...
分类:
编程语言 时间:
2020-05-11 01:13:09
阅读次数:
78
Learning Deep Structured Semantic Models for Web Search using Clickthrough Data 13年的DSSM模型,学习query到doc的相关性,用两个DNN模型将query和doc编码到相同维度的语义层,然后用cosine度量相关 ...
分类:
其他好文 时间:
2020-05-10 23:32:48
阅读次数:
109
题目描述: 提交:O(N) class Solution: def buildArray(self, target: List[int], n: int) -> List[str]: res = [] a = "Push" b = "Pop" index = 1 for i in target: w ...
分类:
编程语言 时间:
2020-05-10 23:30:32
阅读次数:
90
滑动窗口法 思路: 将要匹配的子串逐一和模式串比较。 ababcab abca 代码(利用Python自带字符串比对): class Solution: def strStr(self, haystack: str, needle: str) -> int: L, n = len(needle), ...
分类:
其他好文 时间:
2020-05-10 23:27:16
阅读次数:
89
Mac rust环境 rust安装: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rust更新: rustup update rust卸载: rustup self uninstall rust检查: rustc -- ...
分类:
其他好文 时间:
2020-05-10 22:58:23
阅读次数:
80
asyncio事件循环原理 1. 总体 1.1. 任务创建 任务创建使用create_task方法。 def create_task(self, coro): """Schedule a coroutine object. Return a task object. """ self._check_ ...
分类:
其他好文 时间:
2020-05-10 22:51:26
阅读次数:
73
__iter__()将对象转换为可迭代对象,__next__()返回实现迭代 #_*_coding:utf-8_*_ __author__ = 'Linhaifeng' class Foo: def __init__(self,x): self.x=x def __iter__(self): ret ...
分类:
其他好文 时间:
2020-05-10 19:32:08
阅读次数:
63
getattribute class Foo: def __init__(self,x): self.x=x def __getattr__(self, item): print('执行的是我') # return self.__dict__[item] f1=Foo(10) print(f1.x) ...
分类:
其他好文 时间:
2020-05-10 17:05:46
阅读次数:
55
继承 单继承 多继承 继承:继承实现代码的重用,相同的代码不需要重复的编写 class Anamal: def eat(self): print('吃') def drink(self): print('喝') def run(self): print('跑') def sleep(self): p ...
分类:
其他好文 时间:
2020-05-10 16:57:51
阅读次数:
69
__setitem__,__getitem,__delitem__ class Foo: def __init__(self,name): self.name=name def __getitem__(self, item): print(self.__dict__[item]) def __set ...
分类:
其他好文 时间:
2020-05-10 16:47:36
阅读次数:
68