原文地址:http://blog.csdn.net/lidiansheng/article/details/8651512注:因为我们要在MSIE和其他浏览器下运行,Firefox和其他浏览器用event.pageX和event.pageY来表示鼠标相对于文档的位置,如果你有一个500*500的窗口...
分类:
Web程序 时间:
2015-01-13 17:24:15
阅读次数:
150
Channels are the repositories where the events are staged on a agent. Source adds the events and Sink removes it.
通道就是事件暂存的地方,source负责往通道中添加event,sink负责从通道中移出event
flume1.5.2内置的通道有:内存,文件,jdbc
1、内...
分类:
Web程序 时间:
2015-01-13 16:02:38
阅读次数:
734
外层div元素 内层span元素 外层div元素$(function(){ // 为span元素绑定click事件 $('span').bind("click",function(event){ var txt = $('#msg').html()...
分类:
其他好文 时间:
2015-01-13 13:57:02
阅读次数:
203
比如有个div其id为body,实现在div外点击隐藏,div内点击不隐藏,采用jQuery实现如下:
$("#body").click(function(e) {
$(this).show();
e.stopPropagation();
});
$(document).click(function(event) {
$("#body").hide();
});
...
分类:
Web程序 时间:
2015-01-13 12:31:14
阅读次数:
140
多路复用技术意在可以将一个event根据配置信息发送特定的channel上。
A source instance can specify multiple channels, but a sink instance can only specify one channel.
Flume supports fanning out the flow from one source
to m...
分类:
Web程序 时间:
2015-01-13 10:29:07
阅读次数:
1361
转载请注明出处:
在玩QQ的时候,我们会看到这样的效果,可以滑动删除消息,下面就模拟一下这样的效果。
1.创建一个类ListViewCompat,继承ListView。
重写其OnTouchEvent事件。
@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAc...
分类:
其他好文 时间:
2015-01-12 19:25:25
阅读次数:
363
epoll异步精髓(ET模式):
2个epoll初始化片段:
epoll_event ev;
ev.events = EPOLLIN | EPOLLET;
ev.data.fd = fd;
int ret = epoll_ctl(_epfd, EPOLL_CTL_ADD, fd, &ev);
_pEvents = new epoll_event[EPOLL_SIZE - 1];
i...
分类:
其他好文 时间:
2015-01-12 17:38:26
阅读次数:
311
本人新手,最近下了Android L的源码,正在研究手势识别,能力有限,现总结如下:Android识别触摸屏手势使得用户体验大大提高。在View类中有个View.OnTouchListener内部接口,通过重写他的onTouch(View v, MotionEvent event)方法,我们可以处理...
分类:
移动开发 时间:
2015-01-12 16:19:24
阅读次数:
132
事件总线框架针对事件提供统一订阅,发布以达到组件间通信的解决方案。原理观察者模式。EventBus和Otto先看EventBus的官方定义:Android optimized event bus that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better...
分类:
移动开发 时间:
2015-01-12 14:46:03
阅读次数:
258
//禁止按回车提交$(document).ready(function(){$("input[@type='text']").each(function(){$(this).keypress(function(e){varkey=window.event?e.keyCode:e.which;if(k...
分类:
Web程序 时间:
2015-01-12 14:33:18
阅读次数:
165