使用mbstring先转换成UTF-8编码 mb_convert_encoding(Input::get('tags'),'UTF-8')mbstring用法参考http://php.net/manual/zh/book.mbstring.php
分类:
Web程序 时间:
2015-07-07 10:42:59
阅读次数:
152
运用场景:在当前目录下查找,比如代码目录,不需要在.svn目录下,以及ctags生成的tags文件中查找: grep的--exclude-dir=参数就是为了排除某个目录的,即不包含等号后面的目录; grep的--exclude=参数是为了排除某个特定的文件的,即不包含等号后面的文件; gre...
分类:
系统相关 时间:
2015-07-06 15:57:24
阅读次数:
142
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Hide Tags: Tree ,Depth-first Search/**
* D...
分类:
其他好文 时间:
2015-07-06 12:29:01
阅读次数:
112
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.Hide Tags :Tree ,De...
分类:
其他好文 时间:
2015-07-06 12:25:10
阅读次数:
114
ctags -R 根目录下生成tags在.vimrc中添加set tags=/.../.../tagsCtrl+] 跳转gCtrl+] 跨目录跳转:ts 列出所有:tp 跳转到前一个:tn 跳转到下一个Tlist安装到http://www.vim.org/scripts/script.php?scr...
分类:
系统相关 时间:
2015-07-05 14:55:51
阅读次数:
178
Given an index k, return the kth row of the Pascal’s triangle.For example, given k = 3,
Return [1,3,3,1].Note:
Could you optimize your algorithm to use only O(k) extra space?Hide Tags : Array
题目:返回帕...
分类:
其他好文 时间:
2015-07-04 15:36:11
阅读次数:
119
Implement a trie with insert, search, and startsWith methods.Note:
You may assume that all inputs are consist of lowercase letters a-z.Hide Tags Data Structure Trie实现一棵Trie树以及实现查询的功能,根据上一篇文章中的分析和伪代码可以...
分类:
其他好文 时间:
2015-07-03 17:35:14
阅读次数:
111
在vim的世界中,当查看源代码的时候,使用ctags工具可以实现函数方法的跳转,若要在源码中找到对应方法在哪些地方进行了调用或在哪儿定义的,只有使用grep命令进行查找得到,这样需要另起一个终端或在同一个终端中使用:!grep fucname ./* -rn | grep tags, 这样的切换对于ssh到远程操作的并不那么方便,那有没有更好的插件工具能够直接完成以上的这个功能需求呢? 那么就使用...
分类:
系统相关 时间:
2015-07-03 10:43:57
阅读次数:
1261
67 Add Binary链接:https://leetcode.com/problems/add-binary/
问题描述:
Given two binary strings, return their sum (also a binary string).For example,
a = “11”
b = “1”
Return “100”.Hide Tags Math String求两...
分类:
其他好文 时间:
2015-07-03 10:42:39
阅读次数:
126
50 Pow(x, n)链接:https://leetcode.com/problems/powx-n/
问题描述:
Implement pow(x, n).Hide Tags Math Binary Search实现pow函数。这个问题可以用递归解决,联想到到 Binary Search,我的解决方案是每次让指数缩小两倍,当指数为技术的时候需要特别处理。还有指数为负的情况需要注意。class...
分类:
其他好文 时间:
2015-07-01 10:12:27
阅读次数:
104