#include int
main(int argc, char **argv)
{
union {
short s;
char c[sizeof(short)];
} un; un.s = 0x0102;
if (sizeof(short) == 2) {
if (un.c[0] == 1 && un.c...
分类:
其他好文 时间:
2015-05-23 00:04:24
阅读次数:
114
Fragment在《暗黑3天梯榜》中使用的场景在《Android编程权威指南》中采用了一种激进的态度来对待Fragment,即“总是使用fragment原则”。《Android编程权威指南》英文名称是《Android Programming the big nerd ranch guide》,很多技术文章都是基于这本书的,在还不是很了解的情况下,我盲目的遵循了这个激进的观点。开发出了我的这个App《...
分类:
其他好文 时间:
2015-05-23 00:05:53
阅读次数:
152
身处在互联网这个行业,有时也在想,什么是互联网精神。这次因为业务关系,去了趟六祖的故乡,六祖在...
分类:
其他好文 时间:
2015-05-23 00:04:14
阅读次数:
202
Problem 2111 Min Number
Accept: 586 Submit: 1139
Time Limit: 1000 mSec Memory Limit : 32768 KB
Problem Description
Now you are given one non-negative integer n in 10-base notation, ...
分类:
其他好文 时间:
2015-05-23 00:04:53
阅读次数:
149
解决enq: TX - index contention的常用方法...
分类:
其他好文 时间:
2015-05-23 00:03:42
阅读次数:
200
Zookeeper应用场景:
分布式队列
FIFO(先进先出)
Barrier(同步队列)
共享锁
集群管理
leader选举
命名服务
分布式应用配置项的管理等
FIFO设计思路
1.在/queue-fifo的目录下创建 SEQUENTIAL 类型的子目录 /x(i),这样就能保证所有成员加入队列时都是有编号的。
2.出队列时通过 getChildr...
分类:
其他好文 时间:
2015-05-23 00:03:00
阅读次数:
219
Rotate Image
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
解题思路:
题目要求原地算法。假设坐标轴如上所示。顺时针...
分类:
其他好文 时间:
2015-05-23 00:05:24
阅读次数:
212
链接 :
??
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18888
题意 : 一个有向图,如果从0点出发到达某一点必须经过某些点 题目就是求出这些点。
点数不多 可以删点然后dfs搜索,之前能搜到的点 但是删了该点之后搜不到了 那么这个删点就是从起始点搜不到的必经之路。
#include
#...
分类:
其他好文 时间:
2015-05-23 00:03:07
阅读次数:
217
链接:
??
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=22649
题意就是求有多少联通的块。(一开始自己脑补成双联通 然后死也过不了样例。
这道题目的读入也是挺恶心的。
#pragma comment(linker, "/STACK:10240000,10240000")
#include
...
分类:
其他好文 时间:
2015-05-23 00:03:03
阅读次数:
150
There are n coins in a line. Two players take turns to take a coin from one of the ends of the line until there are no more coins left. The player with the larger amount of money wins.
Could you pl...
分类:
其他好文 时间:
2015-05-23 00:02:42
阅读次数:
646
一、 RPC(remote procedure call)
不同java进程间的对象方法的调用。
一方称作服务端(server),一方称作客户端(client)。
server端提供对象,供客户端调用的,被调用的对象的方法的执行发生在server端。
RPC是hadoop框架运行的基础。
二、通过rpc小例子获得的认识
1.服务端提供的对象必须是一个接口,接...
分类:
其他好文 时间:
2015-05-23 00:02:53
阅读次数:
177
在使用servlet上传文件时,使用DiskFileItemFactory(在使用struts时利用InputStream和OutputStream)将请求消息实体中的每一个项目封装成单独的DiskFileItem (FileItem接口的实现) 对象的任务由 org.apache.commons....
分类:
其他好文 时间:
2015-05-23 00:01:00
阅读次数:
206
例会的时间地点:5月22日,宿舍走廊例会人员:谢洪跃,李泳江,邵家文例会内容:讨论如何在这两天完成好列表任务编号名称时间已用时间是否完成1画出算法流程图4小时2.5小时没有2界面设计5小时2小时没有3做题目设计调研12小时11小时完成4背景设计5小时2小时没有
分类:
其他好文 时间:
2015-05-23 00:01:45
阅读次数:
332
知识点 类应该对扩展开放,对修改封闭。案例 (本故事纯属虚构) 某日早上,流年刚把新开发的游戏项目提交给经理1 public abstract class Role2 {3 public virtual string RoleName { get; privat...
分类:
其他好文 时间:
2015-05-23 00:01:31
阅读次数:
335
也许是因为简单,这次的思路很清晰。class Solution {private: vector res; string str; int left=0; int right=0;public: bool isValid(const char Par,int Pnum...
分类:
其他好文 时间:
2015-05-23 00:01:31
阅读次数:
385
很多软件在正式发布前都会发布一些预览版或者测试版,一般都叫“beta版”或者 “rc版”,特别是开源软件,甚至有“alpha版”,下面来解释一下各个版本的意思。alpha版:内部测试版。α是希腊字母的第一个,表示最早的版本,一般用户不要下载这个版本,这个版本包含很多BUG,功能也不全,主要是给开发人...
分类:
其他好文 时间:
2015-05-22 23:57:48
阅读次数:
313
公式啊,公式啊。。。。TAT杭电题解。。。。。高中生。。。。。。对于卢卡斯定理,由于p较大,所以不可能按一般的来算,n,m较小,循处理出n!的逆元对p的,然后可以按照卢卡斯定理,降低,对后面的就可以直接运用组合数公式来求了。#include#include#include#include#inclu...
分类:
其他好文 时间:
2015-05-23 00:00:17
阅读次数:
408