select查询
mongodb使用find或者findOne来查询:
find批量查询。
findOne是查询一条记录。
find有两个参数: 第一个查询条件, 第二个查询返回的字段。
下面是mongodb与sql查询的对应关系表:...
分类:
数据库 时间:
2014-05-18 18:30:49
阅读次数:
311
这个问题最早有人报告说,在升级了10.9.3的机器上,用户目录(/Users)会在Finder中消失。但是很多人没有这个问题。经过多人的反复查证,最后锁定在iTunes 11.2更新上。如果用户打开了iCloud中的Find My Mac功能,那么安装了iTunes 11.2的更新后,就会产生这样的问题,而且用户目录/Users的权限会被改为777,也就是任何人都可以在里面读写删除。这个很危险!而...
分类:
其他好文 时间:
2014-05-18 15:35:54
阅读次数:
233
4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target....
分类:
其他好文 时间:
2014-05-18 13:49:09
阅读次数:
306
【题目】
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution.
For example, given array S = {...
分类:
其他好文 时间:
2014-05-18 10:37:57
阅读次数:
269
【题目】
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
Note:
Elements in a quadruplet (a,b,c,d) must be in non-descending ord...
分类:
其他好文 时间:
2014-05-18 08:46:04
阅读次数:
227
【题目】
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters.
For example, given:
S:...
分类:
其他好文 时间:
2014-05-18 08:31:48
阅读次数:
228
3SumClosest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution....
分类:
其他好文 时间:
2014-05-18 05:57:48
阅读次数:
244
【题目】
Write a function to find the longest common prefix string amongst an array of strings.
【题意】
求一组字符串的最长公共前缀
【思路】
使用归并思想求解
要求字符串[1,2,..,k,k+1,...n]的最大公共前缀,先分别求[1,2,...k]和[k+1,...,n]的公共前缀...
分类:
其他好文 时间:
2014-05-18 05:17:53
阅读次数:
232
[ grep简介: ]
grep是用来过滤含有特定字符的行
用法: grep 关键字 file
如: grep 'bbb' aaa.txt --color # 从文件aaa.txt中搜索关键词bbb, 并高亮显示。...
分类:
系统相关 时间:
2014-05-18 03:26:10
阅读次数:
357
【题目】
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
Elements in a triplet (a,b,c) must be in non-descending order. (ie, a ≤ b ≤ c)
The so...
分类:
其他好文 时间:
2014-05-18 03:15:50
阅读次数:
287