已经工作了接近一年的时间,工作之余也只能看看书,了解一下相关的技术细节,在网络设备公司不可避免的要和socket打交道,但通常都是调用公司封装好的接口,没有去考虑这些封装背后的工作,回过头来看真的觉得进步很小,我只能逼自己看看书,看看一些好的代码。
sendmsg和recvmsg这两个接口是高级套接口,这两个接口支持一般数据的发送和接收,还支持多缓冲区的报文发送和接收(readv和sendv...
分类:
其他好文 时间:
2014-05-13 13:56:17
阅读次数:
225
最近公司做项目需要用到jms消息服务,最终选择了apache的activemq这个开源消息总线,但是在activemq的官网没能找到既满足高可用又满足集群部署的方案,所以探索了其集群+高可用部署方案,经试用验证ok,这里和大家分享下。
一、架构和技术介绍
1、简介
ActiveMQ
是Apache出品,最流行的,能力强劲的开源消息总线。完全支持JMS1.1和J2EE 1.4规范的 JMS...
分类:
其他好文 时间:
2014-05-13 11:35:51
阅读次数:
944
工作也挺久了,不断的学习这编程知识,发现过一段时间后又失去目标,不断的思考,我们是该把精力放在学习技术上还是把直接把才华和精力放在赚钱这个目标上?
发现其实两者并不直接冲突,把控自己的财富观,保持对机会的嗅觉,顺势而为。
我工作那会,有位理财很厉害的朋友,在北京2008年前就买入了7、8套房,以至于到了2008年之后,房价猛涨的情况下,他把其中几套房子租出去,每月收到的房租竟然几倍于他...
分类:
其他好文 时间:
2014-05-13 15:04:50
阅读次数:
289
JAVA IO的 相关操作知识...
分类:
其他好文 时间:
2014-05-13 13:57:18
阅读次数:
236
queue分为两种: serialQueue (串行) 和 concurrentQueue (并行)
serialQueue中的task一个执行不完,另一个不会执行。即:task1执行完毕后,task2执行,task2执行完毕后,task3执行,以此类推
concurrentQueue特点:Queue中的task并发执行,task1现执行(无须执行完毕),task2开始执行之后(无需执...
分类:
其他好文 时间:
2014-05-13 13:22:25
阅读次数:
282
原来串口调试工具也可以这个样子的,你从未见过,很多神奇的想法是突然想到的,然后把自己原先的东西也否定了...
分类:
其他好文 时间:
2014-05-13 16:12:38
阅读次数:
408
Pat1044代码
题目描述:
Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the chain can...
分类:
其他好文 时间:
2014-05-13 14:33:08
阅读次数:
437
第一遍学完《大话设计模式》,顿感思考层次高了起来。让我们能站在山顶以更高的角度来俯视我们的设计。但是,我们也深知一遍的学习是远远不够的,今天先试着将自己目前的理解尽可能宏观的总结一下
,各位多多指教,不胜感激。
什么是设计模式
设计模式(Designpattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码、让代...
分类:
其他好文 时间:
2014-05-13 14:20:46
阅读次数:
283
题目地址:BZOJ 1036
题目大意:给出一棵树,每个点有一个权值,要求三种操作:1.修改某个点的权值,2.询问x到y路径上各点的权值最大值,3.询问x到y路径上各点的权值之和。
算法讨论:树链剖分模板题。
Code:
#include
#include
#define N 30000
#define oo 0x7f7f7f7f
using namespace std;
int...
分类:
其他好文 时间:
2014-05-13 15:45:57
阅读次数:
336
Problem Description
Acmers have been the Earth Protector against the evil enemy for a long time, now it’s your turn to protect our home.
There are 2 * n enemies in the map. Your task is to clear a...
分类:
其他好文 时间:
2014-05-13 11:29:40
阅读次数:
308
Robert is clipping his fingernails. But the nail clipper is old and the edge of the nail clipper is potholed.
The nail clipper's edge is N millimeters wide. And we use N characters('.' or '*') to rep...
分类:
其他好文 时间:
2014-05-13 15:05:54
阅读次数:
264
【网络基础】ICMP报文和ping指令...
分类:
其他好文 时间:
2014-05-13 15:48:00
阅读次数:
325
一. 检测对象变化的两种基本方式:
学过《微机原理》的人应该都了解这两种方式
1. 轮询
1) 每帧轮询
2) 定时轮询
按业务需求和性能问题选择
2. 中断(并非硬件中断,而是软件的事件通知方式)
两种模式:
1) 观察者模式
优点...
分类:
其他好文 时间:
2014-05-13 15:38:44
阅读次数:
278
简介
TCP协议要经过三次握手才能建立连接:
(from wiki)
于是出现了对于握手过程进行的攻击。攻击者发送大量的FIN包,服务器回应(SYN+ACK)包,但是攻击者不回应ACK包,这样的话,服务器不知道(SYN+ACK)是否发送成功,默认情况下会重试5次(tcp_syn_retries)。这样的话,对于服务器的内存,带宽都有很大的消耗。攻击者如果处于公网,可以伪造IP的话,对...
分类:
其他好文 时间:
2014-05-13 11:21:28
阅读次数:
435
Mahjong is a game of skill, strategy and calculation and involves a certain degree of chance. In this problem, we concentrate on Japanese Mahjong, a variation of mahjong. For brief, all of the word ma...
分类:
其他好文 时间:
2014-05-13 14:59:51
阅读次数:
356
Mahjong is a game of skill, strategy and calculation and involves a certain degree of chance. In this problem, we concentrate on Japanese Mahjong, a variation of mahjong. For brief, all of the word ma...
分类:
其他好文 时间:
2014-05-13 13:54:14
阅读次数:
463
Prime Ring Problem
Problem Description
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent...
分类:
其他好文 时间:
2014-05-13 11:54:17
阅读次数:
444
l and dished out an assist in the Blackhawks' 5-3 win over the Nashville Predators.Shaw said just playing with the Blackhawks was enough motivation for him."Positive,
I'm playing in the NHL," Shaw s...
分类:
其他好文 时间:
2014-05-13 13:46:10
阅读次数:
453
题目:幻方构造,给你n*n的方形,在里面填上连续的数字,使得每行、每列和对角线上的数字和是m。
分析:数学、构造。幻方的构造方法已经完全被解决,直接利用公式求解即可。
幻方的幻和为:p =(n*n+1)* n / 2
如果 m = k*n + p 则题目要求幻方可以构造成功,否则无法构造。
幻方的构造可分成三种情况:(...
分类:
其他好文 时间:
2014-05-13 15:29:37
阅读次数:
301
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie
Best Time to Buy and Sell Stock II
Total Accepted: 13030 Total
Submissions: 36467
Say you have an array for which the ith ...
分类:
其他好文 时间:
2014-05-13 14:08:39
阅读次数:
414