现在位置: 首页 > AbbyCorreia发表的所有文章
  • 06月
  • 15日
综合 ⁄ 共 1624字 评论关闭
注:本文适合对象需对java NIO API的使用及异步事件模型(Reactor模式)有一定程度的了解,主要讲述使用java原生NIO实现一个TCP监听绑定的过程及细节设计。 我们一开始设计了一个TCP接入服务类,这个类提供了一个API方法提供对本地一系列地址(端口)的监听绑定,类初始化后完成Selector的open操作如下: selector = Selector.open(); 提供的绑定API,其方法签名如下: /** * Binds to the specified local addresses and start to accept incoming connections. If any address binding failed then * rollback the alre......
阅读全文
  • 02月
  • 17日
综合 ⁄ 共 2017字 评论关闭
The number of steps Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述     Mary stands in a strange maze, the maze looks like a triangle(the first layer have one room,the second layer have two rooms,the third layer have three rooms …). Now she stands at the top point(the first layer), and the KEY of this maze is in the lowest layer’s leftmost room. Known that each room can only access to its left room and lower left and lower right rooms .If a room doesn’t ha......
阅读全文
  • 12月
  • 22日
综合 ⁄ 共 736字 评论关闭
题目链接:http://poj.org/problem?id=3311 Floyd + 状态压缩DP 题意是有N个城市(1~N)和一个PIZZA店(0),要求一条回路,从0出发,又回到0,而且距离最小。 状态:dp[S][v]表示从v出发访问剩余的所有顶点(集合S),最终回到顶点0的路径的权重总和最小值。 #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int maxn = 12; const int INF = 0x3f3f3f3f; int d[maxn][maxn]; int dp[1<<maxn][maxn]; int main() { int n; while(~scanf("%d", &n)){ i......
阅读全文
  • 09月
  • 15日
综合 ⁄ 共 3434字 评论关闭
在android设备上(where you have only 16MB memory available),如果使用Bitmap 先说之前提到过的一种方法:即将载入的图片缩小,这种方式以牺牲图片的质量为代价。在BitmapFactory中有一个内部类BitmapFactory.Options,其中当options.inSampleSize值>1时,根据文档: If set to a value > 1, requests the decoder to subsample the original image, returning a smaller image to save memory. (1 -> decodes full size; 2 -> decodes 1/4th size; 4 -> decode 1/16th size). Because you rarely need to s......
阅读全文
  • 06月
  • 10日
综合 ⁄ 共 4840字 评论关闭
1. 要點: l           核心服務通常在獨立的進程 (Process) 裡執行。 l           必須提供 IBinder 介面,讓應用程式可以進行跨進程的綁定 (Binding) 和呼叫。 l           因為共用,所以必須確保多線裎安全 (Thread-safe) 。 l           以 C++ 類別定義,誕生其物件,透過 SM 之協助,將該物件參考值傳給 IServiceManager::addService() 函數,就加入到 Binder Driver 裡了。 l           應用程式可透過 SM 之協助而遠距綁定該核心服務,此時 SM 會回傳 IBinder 介面給應用程式。 l           應......
阅读全文
  • 05月
  • 28日
综合 ⁄ 共 257字 评论关闭
weblogic默认控制台访问端口和应用访问端口一样,这样就暴露了控制台的访问地址,下面方法可设置WL控制台访问端口:  进入WebLogic控制台 http://IP:7001/console weblogic版本:10.3 一、使用现有地址进入控制台,下图为首页   二、点击右边区域的”Domain“   三、选中”Enable Administration Port“,并输入“Administration Port”,如下图 以上步骤完成后,点击”Save”,保存成功后weblogic将会跳转至9002端口,至此端口设置完成。
阅读全文
  • 03月
  • 18日
综合 ⁄ 共 2558字 评论关闭
问题描述 The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. They gather together in different groups, so that a Martian can have one parent as well as ten. Nobody will be surprised by a hundred of children. Martians have got used to this and their style of life seems to them natural. And in the Planetary Council the confusing genealogical system leads to some embarrassment. There meet the worthiest of Martians, and ther......
阅读全文
JavaSE 1.6提供了java.awt.SystemTray类用于方便地创建托盘图标.但在Windows平台下当explorer崩溃时托盘图标会丢失. 如果是本地代码或.Net平台的程序则可以很简单地获取TaskbarCreated消息并重新添加托盘图标. 但在Java程序中无法直接访问Windows消息. 解决方法是通过JNI调用本地代码安装消息钩子捕获TaskbarCreated消息并通知主程序重建图标. Java部分 package idv.takamachi660.platform.win; import java.util.ArrayList; import java.util.List; /** * 任务栏重建监视器 * * @author Takamachi660 * */ pu......
阅读全文
    奥巴马就任美国总统后,1月28日与美国工商业领袖举行了一次“圆桌会议”,作为仅有的两名代表之一,IBM首席执行官彭明盛首次提出“智慧的地球”这一概念,建议新政府投资新一代的智慧型基础设施,阐明其短期和长期效益。奥巴马对此给予了积极的回应:“经济刺激资金将会投入到宽带网络等新兴技术中去,毫无疑问,这就是美国在21世纪保持和夺回竞争优势的方式。”   此概念一经提出,即得到美国各界的高度关注,甚至有分析认为,IBM公司的这一构想极有可能上升至美国的国家战略,并在世界范围内引起轰动。   该战略认为,IT产业下一阶段的任......
阅读全文
  • 12月
  • 05日
综合 ⁄ 共 100字 评论关闭
罗技M545鼠标是不是垃圾鼠标中的战斗机?: 问题,我自己也买了这款鼠标,真的太难用了,定位不准确,有时移动鼠标,光标不动,白纸上都测试了,都不走,连几十块钱的杂牌鼠标都不如?大家有用这款M545的吗?
阅读全文
  • 11月
  • 30日
综合 ⁄ 共 3757字 评论关闭
WebPrint3.0的对象、属性和方法 一、对象     1.WebPrint对象 二、属性     1.defaultPrinterName     2.marginTop     3.marginLeft     4.marginRight     5.marginBottom     6.header     7.footer     8.copies     9.pageFrom     10.pageTo     11.selectedPages     12.currentPage     13.orientation     14.paperSize     15.paperSource     16.pageWidth     17.pageHeight   三、方法       1.InitPrint()     2.SetMarginMeasure(int units)     3.Preview......
阅读全文
  • 11月
  • 25日
综合 ⁄ 共 2829字 评论关闭
为了能有一个完善的体验过程,我自己安装了一遍centos和nginx、php,中间出了不少问题,记事留念。 第1步当然就是安装Vmware,这没啥好说的,一步步next就好了; 第2步是新建一个虚拟机,并加载ios镜像安装Centos6.3,这个也没啥好说的,网上很多图文教程, 注1:分区时,我增加了一个/home区,而且我没安装gui图形环境,按base server进行的安装; 注2:安装完成后,我选择的网络模式是NAT,在VmWare的菜单“编辑”里有一个“虚拟网络编辑器”,选择NAT模式,确定即可,然后再打开宿主Windows机的本地连接属性,打开“允许其他网络用户......
阅读全文