简单了写了query和list的实现,特将代码放在这里,以备后续查看。
query:
QueryItem.h
#ifndef QUEUEITEM
#define QUEUEITEM
#include
using namespace std;
template class Queue;
template
ostream& operator &);
template
istream&...
分类:
其他好文 时间:
2015-01-15 14:16:38
阅读次数:
97
b = operator.itemgetter(1) 定义函数b,用于获取传入list的第1域的值
可以将b用于sort函数的key。作为排序的依据。
adn_app_data_map是个字典
for key, app_arr in adn_app_data_map.items():
app_arr.sort(key=operator.ite...
分类:
编程语言 时间:
2015-01-14 16:51:53
阅读次数:
205
Extension Method: Return another string if string is null or emptyJust a tiny little extension method. You may know the ?? operator for null checks:va...
分类:
其他好文 时间:
2015-01-13 23:00:25
阅读次数:
211
#includeusing namespace std;class String{ friend ostream& operator=0&&e<=strlen(m_data)) return m_data[e];}ostream& operator<<(ostream& os,String& str...
分类:
其他好文 时间:
2015-01-12 22:13:28
阅读次数:
159
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT. 1 public class Solution { 2 public ...
分类:
其他好文 时间:
2015-01-12 00:18:28
阅读次数:
293
1.BNF范式%token T_OBJECT_OPERATOR "-> (T_OBJECT_OPERATOR)"unticked_statement:| expr ';' { zend_do_free(&$1 TSRMLS_CC); }expr: r...
分类:
Web程序 时间:
2015-01-11 22:51:50
阅读次数:
366
这里是用 JavaScript 做的逆转序列(数组/字符串)的递归/尾递归实现。另外还尝鲜用了一下 ES6 的destructuring assignment + spread operator 做了一个更 functional 的版本(只支持数组)。正确性能通过测试(参见 放在我 Github 上...
分类:
编程语言 时间:
2015-01-11 06:12:23
阅读次数:
283
思想都在我的这篇博客里面。
呃,那道题懂差不多之后随便水水这道题就过了。
#include
#include
#include
#include
#define N 1010
using namespace std;
struct KSD
{
long long a;
int b;
bool operator d.a:b>d.b;}
}x[N];
long long ins[70...
分类:
其他好文 时间:
2015-01-10 08:52:23
阅读次数:
162
CSS Specificity As mentioned above, CSS styles follow an order of specificity and point values to determine(确定) when styles override(覆盖) one another or take precedence(优先). Nettuts recently h...
分类:
Web程序 时间:
2015-01-09 22:32:39
阅读次数:
386
Divide two integers without using multiplication, division and mod operator.
If it is overflow, return MAX_INT.
时间复杂度 log(n)
public class Solution {
public int divide(int dividend, int divi...
分类:
其他好文 时间:
2015-01-09 22:22:15
阅读次数:
248