首先要指出的是:DisplayObject 实例的属性<x, y> 与 graphics.draw*(x, y, ...) 的参数<x, y>没有关系。 在原生的 Canvas 中有 <x, y> 的概念,例如:ctx.rect(x, y, width, height)。于是我天真地以为 Displ ...
分类:
其他好文 时间:
2020-05-08 13:35:04
阅读次数:
83
Matrix-Tree 定理作用:给定 n 个点 m 条边的无向图,求图的生成树个数。 定义矩阵K[i][j]=D[i][j]-A[i][j],(其中D为度数矩阵(即当i==j时,D[i][j]=节点 i 的度数,其余为0),A为邻接矩阵,有边相邻即为1,其余为0) 结论:对于已经得出的基尔霍夫矩阵 ...
分类:
其他好文 时间:
2020-05-08 13:10:58
阅读次数:
132
Spring的@EnableCaching注解 https://segmentfault.com/a/1190000011069802 @EnableCaching注解是spring framework中的注解驱动的缓存管理功能。自spring版本3.1起加入了该注解。如果你使用了这个注解,那么你就 ...
分类:
编程语言 时间:
2020-05-07 20:14:30
阅读次数:
148
一、0/1 背包 ? 你背着一个背包闯入一家珠宝店,店里有林林总总的格式珠宝,各不重样。每一个珠 宝都有重量和价值。但是你的书包有承载上限。 ? 想成为江湖老大,你需要找到一种装包方法使得包内物品的重量不超过其限定值且使 包内物品的价值最大 def knapSack(W, wt, val, n): ...
分类:
其他好文 时间:
2020-05-07 13:23:32
阅读次数:
62
import numpy as np import matplotlib.pyplot as plt from scipy import stats from sklearn import datasets from sklearn.semi_supervised import LabelSprea ...
分类:
其他好文 时间:
2020-05-06 22:02:37
阅读次数:
93
1.核心容器模块:提供spring的基本功能,包括Core,Beans,Context,EL模块 Core:封装了框架依赖的最底层部分,包括资源访问,类型转换及一些常用工具类。 Bean:主要组件是BeanFactory,它是工厂模式的实现。 Context:是一个配置文件模块,向Spring提供上 ...
分类:
编程语言 时间:
2020-05-06 11:54:20
阅读次数:
211
```python from collections import defaultdict from gensim import corpora import jieba from gensim import similarities import re class Similarity: def ... ...
分类:
其他好文 时间:
2020-05-06 01:08:10
阅读次数:
52
Find them, Catch them Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 62172 Accepted: 18837 Description The police office in Tadu City deci ...
分类:
其他好文 时间:
2020-05-05 20:30:04
阅读次数:
53
题目: 解答: 方法一:会超时间 1 class Solution { 2 public: 3 void rotate(vector<vector<int>>& matrix) 4 { 5 // 思路是: 转置 + 反转每一行 6 7 int len = matrix.size(); 8 9 // ...
分类:
编程语言 时间:
2020-05-05 20:09:54
阅读次数:
66
题目: 解答: 按杨氏矩阵的方法求解,时间复杂度为O(m+n),其中m为矩阵的行数,n为矩阵的列数。 1 class Solution { 2 public: 3 bool searchMatrix(vector<vector<int>>& matrix, int target) 4 { 5 if( ...
分类:
其他好文 时间:
2020-05-05 12:37:47
阅读次数:
47