上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 46 下一页

2016年11月28日

java selector

摘要: java selector使用select轮询注册到selector中的channel,如果有channel准备好注册的事件,select()返回,返回值为可以操作的channel的个数。通过selector.selectedKeys()返回选中的key的集合。遍历集合中所有的key,判断key的事 阅读全文

posted @ 2016-11-28 20:07 luckygxf 阅读(3316) 评论(1) 推荐(0) 编辑

2016年6月21日

Range Sum Query - Mutable

摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. The update(i, val) function modifies nums by upd 阅读全文

posted @ 2016-06-21 21:51 luckygxf 阅读(174) 评论(0) 推荐(0) 编辑

2016年6月19日

Increasing Triplet Subsequence

摘要: Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Your algorithm 阅读全文

posted @ 2016-06-19 11:14 luckygxf 阅读(195) 评论(0) 推荐(0) 编辑

2016年6月15日

Count Numbers with Unique Digits

摘要: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example:Given n = 2, return 91. (The answer should be the 阅读全文

posted @ 2016-06-15 10:28 luckygxf 阅读(363) 评论(0) 推荐(0) 编辑

2016年5月20日

ubuntu系统没有声音解决方法

摘要: 好像装了个放视频的软件,就没有声音了。后面网上搜到了一个简单粗暴的办法,效果很明显,改变权限后直接就有声音了。 搬运工分割线 阅读全文

posted @ 2016-05-20 21:48 luckygxf 阅读(13525) 评论(0) 推荐(0) 编辑

2016年4月3日

设计模式之职责链模式(JAVA实现)

摘要: 学习netty框架时,看到有人说netty用到了设计模式的职责链模式,学习一下职责链模式,主要参考大话设计模式。 主要场景: 小菜想要加薪,向经理提出加薪请求,经理没有权限,经理交由总监处理,总监也没有权限,交由总经理处理,最后,总经理处理了,不同意。 职责链的意思就是,如果没有处理该类请求的权限, 阅读全文

posted @ 2016-04-03 23:22 luckygxf 阅读(392) 评论(0) 推荐(0) 编辑

2015年11月3日

UDP client,UDP server, TCP server, TCP client

摘要: UDP server 1 import java.io.IOException; 2 import java.net.DatagramPacket; 3 import java.net.DatagramSocket; 4 import java.net.InetSocketAddress; 5 im... 阅读全文

posted @ 2015-11-03 22:38 luckygxf 阅读(1285) 评论(0) 推荐(0) 编辑

2015年11月2日

Java使用TCP聊天程序

摘要: 前面使用了UDP进行通信的聊天程序现在做一个用TCP进行通信的聊天程序原理:ServerSocket Socket1.开一个线程监听端口,准备接收消息2.不断接受消息发送到目的端口P.S.因为TCP是面向连接的所以中间要注意先后顺序,代码写得有点乱 1 import java.io.IOExcep... 阅读全文

posted @ 2015-11-02 15:59 luckygxf 阅读(654) 评论(0) 推荐(0) 编辑

Java使用UDP聊天程序

摘要: 主要想测试Java UDP通信。Java UDP使用DatagramSocket和DatagramPacket完成UDP通信主要思路:1.本机通信,ip地址为:127.0.0.12.开一个线程监听一个端口3.向端口发送消息4.运行程序java ChatWindow desport listenpor... 阅读全文

posted @ 2015-11-02 09:42 luckygxf 阅读(672) 评论(0) 推荐(0) 编辑

2015年10月30日

First Bad Version

摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c... 阅读全文

posted @ 2015-10-30 15:48 luckygxf 阅读(188) 评论(0) 推荐(0) 编辑

上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 46 下一页

导航