自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

caisense的专栏

诗和远方

  • 博客(307)
  • 收藏
  • 关注

原创 ZookeeperServiceRegistry deny register

ERROR 21208 — [ main] .s.c.d.ZookeeperServiceRegistryDecorator : ZookeeperServiceRegistry deny register cmp-na-app(http://192.168.8.105:8808) to 127.0.0.1:2181 cmp-pc解决:配置文件application.yml中设置了deny discovery: deny: #为了避免开发人员启动的服务注册到注

2021-01-28 10:28:48 304

原创 win10访问外网慢的原因

wifi连外网,usb网口连内网发现外网可以访问,但每次寻找主机都要半天查看ipv4路由:route print /4===========================================================================永久路由: 网络地址 网络掩码 网关地址 跃点数 0.0.0.0 0.0.0.0 192.168.8.1 默认=====================

2021-01-09 17:43:34 2070 1

原创 macOS 10.15设置静态路由

1.查看上网设备:networksetup -listallnetworkservices显示:iPad USBWi-FiBluetooth PAN*外网内网USB 10/100/1000 LANiPhone USB 2iPhone USB 32.选取要使用的上网设备,添加静态路由映射这里我们选“内网“networksetup -setadditionalroutes "内网" 10.0.0.0 255.0.0.0 192.168.8.1 132.0.0.0 255.0.0.0

2020-09-01 16:36:51 1120

原创 java.sql.SQLException: Access denied for user ‘xxx‘@‘localhost‘ (using password: YES)

所有方法都试过,包括先创建用户create user 'css'@'localhost' identified by '000';在授权GRANT ALL PRIVILEGES ON *.* TO 'css'@'localhost' WITH GRANT OPTION;修改hostupdate user set host = '%' where user ='css';刷新权限 FLUSH PRIVILEGES;结果都没用最后发现是密码不能太简单,例如000,八个0之类的..

2020-08-17 20:28:05 202

原创 字节跳动2019春招研发部分编程题汇总

1。万万没想到之聪明的编辑https://www.nowcoder.com/questionTerminal/42852fd7045c442192fa89404ab42e92import sysn = int(sys.stdin.readline()[:-1])input = []for i in range (n): input.append(sys.stdin.readlin...

2020-03-21 18:34:09 359

原创 微信小程序页面跳转用url传参

传参:torecord (val) { wx.navigateTo({url: '../hemodialysisrecord/main?activeIndex=' + val}) }接收:onLoad (options) { console.log(options.activeIndex) //输出:上面传的val,类型为string this...

2019-08-26 17:39:11 2242

原创 Class 与 Style 绑定总结

1.对象语法:单个对象:class="{'weui-bar__item_on': activeIndex == index}"weui-bar__item_on使用与否取决于后面的表达式是否为真2.对象语法:多个对象:class="{'iconxietouhuanzheduan-7': item.time==='早班', 'iconxietouhuanzheduan-8': item.t...

2019-08-26 14:29:28 213

转载 JavaScript LocalStorage

https://www.cnblogs.com/xiaowei0705/archive/2011/04/19/2021372.html

2019-07-15 21:36:24 203

原创 vue.js slot-scope 取值

错误:<template slot-scope="scope"> <!-- 取值必须用slot-scope --> <i class="scope.row.isWork === '是' ? 'el-icon-circle-check' : 'el-icon-circle-close'"></i></template>正确:i...

2019-07-11 16:00:14 4317 4

转载 Vue 消除router-link 的下划线

https://www.cnblogs.com/wayneliu007/p/10357647.html

2019-07-11 11:18:14 11511 2

原创 JavaScript笔记

1.数组创建1.直接创建,缺点是不能批量创建(如长度100) a = [1,2,3] console.log(a) //[ 1, 2, 3 ]2.用new方法创建只用一个参数,则该参数表示数组长度,数组元素为null a = new Array(1) console.log(a) //[ <1 empty item> ]若要批量创建,用fil...

2019-07-05 15:39:14 116

原创 move to gitbook

https://cai-sen-se.gitbook.io/leetcode/

2019-06-20 21:15:18 95

原创 无法import fastText

https://github.com/facebookresearch/fastText/issues/474#issuecomment-445430211

2019-03-29 16:07:55 1315

转载 mac设置python版本切换,和设置python默认版本

Mac中python多版本切换$ sudo vi ~/.bashrcshell中输入alias python2=’/Library/Frameworks/Python.framework/Versions/2.x/bin/python2.x’alias python3=’/Library/Frameworks/Python.framework/Versions/3.x/bin/...

2019-03-29 15:44:06 5566 1

原创 132. 分割回文串 II

https://leetcode-cn.com/problems/palindrome-partitioning-ii/comments/回溯(超时):class Solution: def minCut(self, s): """ :type s: str :rtype: int """ self.min...

2019-01-24 22:49:08 202

原创 131. 分割回文串

https://leetcode-cn.com/problems/palindrome-partitioning/submissions/class Solution: def partition(self, s): &quot;&quot;&quot; :type s: str :rtype: List[List[str]] &quot;&quot;&quot; s..

2019-01-23 12:27:19 118

原创 130. 被围绕的区域

https://leetcode-cn.com/problems/surrounded-regions/comments/两次遍历。第一次先遍历边界,dfs将所有与边界O相连的O置为‘-’。之后再遍历所有,将所有O变为X,所有’-‘变为Oclass Solution: def solve(self, board): """ :type board: Li...

2019-01-22 12:16:13 328

原创 129. 求根到叶子节点数字之和

https://leetcode-cn.com/problems/sum-root-to-leaf-numbers/submissions/# Definition for a binary tree node.# class TreeNode:# def __init__(self, x):# self.val = x# self.left = ...

2019-01-21 12:54:05 194

原创 128. 最长连续序列

https://leetcode-cn.com/problems/longest-consecutive-sequence/用哈希表存储每个端点值对应连续区间的长度若数已在哈希表中:跳过不做处理若是新数加入:取出其左右相邻数已有的连续区间长度 left 和 right计算当前数的区间长度为:cur_length = left + right + 1根据 cur_length 更新最大长...

2019-01-20 13:52:14 159

原创 433. 最小基因变化

https://leetcode-cn.com/problems/minimum-genetic-mutation/submissions/基本类似127题,bfsimport queueclass Solution: def minMutation(self, start, end, bank): """ :type start: str ...

2019-01-19 17:42:19 451

原创 127. 单词接龙

https://leetcode-cn.com/problems/word-ladder/思路和126差不多,区别在于只用bfs,每次访问一层,用一个map来存储访问过的结点以及与起点的距离,避免重复访问。最后输出map中的终点项即可import queueclass Solution: def ladderLength(self, beginWord, endWord, wordL...

2019-01-18 16:37:24 144

原创 126. 单词接龙 II

https://leetcode-cn.com/problems/word-ladder-ii/submissions/dfs+bfsimport queueclass Solution: def findLadders(self, beginWord, endWord, wordList): """ :type beginWord: str ...

2019-01-17 18:39:12 544

原创 125. 验证回文串

https://leetcode-cn.com/problems/valid-palindrome/comments/class Solution: def isPalindrome(self, s): """ :type s: str :rtype: bool """ #将s过滤,只保留数字和字母,再转为小...

2019-01-08 23:19:44 90

原创 124. 二叉树中的最大路径和

https://leetcode-cn.com/problems/binary-tree-maximum-path-sum/submissions/对于任意一个节点, 如果最大和路径包含该节点, 那么只可能是两种情况:1. 其左右子树中所构成的和路径值较大的那个加上该节点的值后向父节点回溯构成最大路径2. 左右子树都在最大路径中, 加上该节点的值构成了最终的最大路径。# Definiti...

2019-01-08 22:44:27 147

原创 123. 买卖股票的最佳时机 III

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iii/comments/dp1[i] = max(dp[i-1], prices[i] - minval) 从前往后遍历,表示第1天到第i天之间的最大利润(通过是否在第i天卖出确认);dp2[i] = max(dp[i+1], maxval - prices[i]...

2019-01-06 16:17:14 331

原创 122. 买卖股票的最佳时机 II

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/submissions/观察知,累加每两个相邻峰谷之间的差价即可class Solution(object): def maxProfit(self, prices): """ :type prices: List[in...

2019-01-04 16:42:46 91

原创 121. 买卖股票的最佳时机

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/solution/class Solution(object): def maxProfit(self, prices): """ :type prices: List[int] :rtype: int ...

2019-01-03 13:21:39 102

原创 120. 三角形最小路径和

https://leetcode-cn.com/problems/triangle/submissions/dp,自底向上class Solution: def minimumTotal(self, triangle): """ :type triangle: List[List[int]] :rtype: int """...

2018-12-30 23:14:51 97

原创 119. 杨辉三角 II

https://leetcode-cn.com/problems/pascals-triangle-ii/class Solution: def getRow(self, rowIndex): """ :type rowIndex: int :rtype: List[int] """ res...

2018-12-28 17:55:16 102

原创 118. 杨辉三角

https://leetcode-cn.com/problems/pascals-triangle/class Solution: def generate(self, numRows): """ :type numRows: int :rtype: List[List[int]] """ if numRow...

2018-12-28 17:53:08 116

原创 117. 填充同一层的兄弟节点 II

https://leetcode-cn.com/problems/populating-next-right-pointers-in-each-node-ii/和116一样层序import Queueclass Solution: # @param root, a tree link node # @return nothing def connect(self, r...

2018-12-28 17:51:26 151

原创 116. 填充同一层的兄弟节点

https://leetcode-cn.com/problems/populating-next-right-pointers-in-each-node/comments/# Definition for binary tree with next pointer.# class TreeLinkNode:# def __init__(self, x):# self...

2018-12-25 16:32:11 96

原创 114. 二叉树展开为链表

https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-list/submissions/class Solution: def flatten(self, root): """ :type root: TreeNode :rtype: void Do not retur...

2018-12-25 15:51:33 107

原创 113. 路径总和 II

https://leetcode-cn.com/problems/path-sum-ii/思路:回溯法。class Solution: def pathSum(self, root, sum): &quot;&quot;&quot; :type root: TreeNode :type sum: int :rtype: List[List[int]]...

2018-12-23 17:53:41 164

原创 112. 路径总和

https://leetcode-cn.com/problems/path-sum/思路:dfs,每次用sum减去当前节点的值,直到sum为0class Solution: def hasPathSum(self, root, sum): """ :type root: TreeNode :type sum: int :r...

2018-12-23 16:37:53 175

原创 111. 二叉树的最小深度

https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/思路1:dfs递归class Solution: def minDepth(self, root): """ :type root: TreeNode :rtype: int """ ...

2018-12-22 23:21:52 108

原创 110. 平衡二叉树

思路:后序遍历,对root的左右子树递归,每次计算root的左右子树高,然后计算root的高,为左右较高者+1.若左右之差大于1,全局flag为false# Definition for a binary tree node.# class TreeNode:# def __init__(self, x):# self.val = x# self....

2018-12-22 17:31:54 107

原创 为anaconda2中的python3安装numpy

jupyter默认的py3是用anaconda2安装的 ,一直提示没有numpy网上的numpy安装方式都是直接pip3 install numpy,然而对应的并不是anaconda中的py3.于是使用以下命令:source activate py36 #激活py3.6,之前将其命名为py36conda install numpy #在py3.6中安装numpy...

2018-11-12 23:19:16 1953

原创 python3安装numpy失败

pip3 install numpy报错: Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol versio...

2018-11-12 22:25:27 10527 1

原创 109. 有序链表转换二叉搜索树

https://leetcode-cn.com/problems/convert-sorted-list-to-binary-search-tree/description/思路:用一个全局变量node顺序遍历链表,然后用中序遍历方式递归构造树即可(画图比较好理解)# Definition for singly-linked list.# class ListNode:# def ...

2018-10-26 00:21:25 216

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除