tcp/ip实验需要在指定的时间查看结果,为了实验方便,做了一个定时器。使用方法是:
在命令行输入:timer 分钟数
时间到了之后会有3声蜂鸣,并显示Time is up!
程序如下:
timer.cpp:
// g++ timer.cpp -o timer.exe -lboost_system-mgw48-1_56 -lws2_32 -static
#include
#includ...
分类:
其他好文 时间:
2014-11-14 10:48:06
阅读次数:
171
首先,先了解传统的网络配置命令: 1. 使用ifconfig命令配置并查看网络接口情况 示例1: 配置eth0的IP,同时激活设备: # ifconfig eth0 192.168.4.1 netmask 255.255.255.0 up 示例2: 配置eth0别名设备 eth0:1 的IP,并添加...
分类:
其他好文 时间:
2014-11-13 22:26:26
阅读次数:
293
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-11-13 22:21:29
阅读次数:
215
关于WinIO.DLL的键盘输入模拟 最近在找键盘模拟的方式,最后在网上找到了一个WinIO.DLL的IO键盘模拟按键的方式。但是居然那个方法是有问题的。我造了全局的hook监视键盘信息,发现它只是有keyDown和keyPress的消息,keyUp的信息是up了一个zoom的键。 搞了2天终于.....
今天大概的学习了一下 VelocityTracker,用来监控手势速度的,在View移动过程中,可以有个缓冲的移动。我觉得初步的使用起来是很简单的。首先移动依靠的是Scroller类,Scroller中有个fling的方法,将MotionEvent的Up之后检测的手势速度提供给scroller之后,...
分类:
移动开发 时间:
2014-11-13 16:27:25
阅读次数:
267
Cow BowlingDescriptionThe cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up ...
分类:
其他好文 时间:
2014-11-13 14:33:03
阅读次数:
270
Intel的内置显卡工具总是注册全局的快捷键,而且还是常用的(比如?Sublime Text,?PyCharm等工具的默认按键绑定),如下: Ctrl + Shift + Up Ctrl + Shift + Down Ctrl + Shift + Left Ctrl + Shift + Right 这...
分类:
其他好文 时间:
2014-11-13 13:07:46
阅读次数:
139
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up:Can you solve it without using extra space?怎...
分类:
其他好文 时间:
2014-11-13 00:20:11
阅读次数:
281
Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with摘要Linux系统下安装完MySQL,启动MySQL报错:Neither host 'localhost.loc...
分类:
数据库 时间:
2014-11-12 22:43:20
阅读次数:
302
题意:给一个长度为n的序列,问每个数关于序列的LIS(longest increasing sequence)是什么角色。这里分了三种:
1、此数没有出现在任意一条LIS中
2、此数出现在至少一条但是不是全部的LIS中
3、此数出现在所有的LIS中
解法:nlgn的LIS算法可以求出以每个i位置结束的LIS长度up[i]。出现在L...
分类:
其他好文 时间:
2014-11-12 19:45:28
阅读次数:
214