现在位置: 首页 > HineHaugPlala发表的所有文章
  • 10月
  • 09日
综合 ⁄ 共 443字 评论关闭
在Activity的onCreate()或者onStart() ,调用AnimationDrawable.start()方法,动画是不会运行的解决办法: private Handler handler = new Handler(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.loading); ImageView line = (ImageView) findViewById(R.id.loading_line); handler.postDelayed(new Runnable() { public void run() { AnimationDrawable frameAnimation = ......
阅读全文
  • 08月
  • 12日
综合 ⁄ 共 22808字 评论关闭
From: http://blog.csdn.net/mjay1234/article/details/7684316 Windows Sockets在头文件winsock.h中定义了所有的错误码,它们包括以“WSA”打头的Windows Sockets实现返回的错误码和Berkeley Sockets定义的错误码全集。定义Berkeley Sockets错误码是为了确保原有软件的可移植性。 A.1 Windows Sockets错误码列表 表A.1列出了WSAGetLastError()函数返回的可能错误码和它们的解释,它们可分为四个部分。 错误码的第一部分是用来解决在不同的C编译中对标准C错误码的不一致的定义。错误码的第二部分是标准Berkeley Sockets错误码的Wind......
阅读全文
  • 04月
  • 10日
综合 ⁄ 共 7763字 评论关闭
原题: http://poj.org/problem?id=3002 Description Bill has found the perfect way to make money playing the slot machines. After months of careful research, he has finally figured out the mechanics behind how the machines operate. Now he is ready to make profit of his findings. But first an introduction to the game. A slot machine consists of a number of wheels, usually three or four, each with a number of symbols printed on it – cherries, oranges, bells, etc. – and will show one of its sy......
阅读全文
  • 07月
  • 28日
综合 ⁄ 共 2254字 评论关闭
一、挂起   当有电话进来或者锁屏,这时你的应用程会挂起,在这时,UIApplicationDelegate委托会收到通知,调用 applicationWillResignActive 方法,你可以重写这个方法,做挂起前的工作,比如关闭网络,保存数据。   C代码   1. - (void)applicationWillResignActive:(UIApplication*)application{    2.     3. }       当你的程序被挂起后他不会在后台运行。       二、复原   当程序复原时,另一个名为 applicationDidBecomeActive 委托方法会被调用,在此你可以通过之前挂起前保存的数据来恢复你的应用程序:   C代码 ......
阅读全文
  • 05月
  • 26日
综合 ⁄ 共 1415字 评论关闭
养成良好的编程习惯 1、代码片段: int a = 1; int b = 2; int c = a/b; System.out.println(c);结果为0 当有若干个变量参与运算时,结果类型取决于这些变量中表示范围最大的那个变量类型。 比如参与运算中有int、double、short,最终运算结果类型为double。 double a = 1; int b = 2; int c = a/b;错误,a/b结果为double,不能赋值给int类型变量。 代码片段: int a = 1; int b = 2; double c = (double)a / b; 上面的代码中,a与b都是整型,但是通过(double)a这种转换将a转换为一个匿名的变量,该变量的类型是double,但是要......
阅读全文
  • 05月
  • 25日
综合 ⁄ 共 2308字 评论关闭
//////////响应 #pragma mark - UIActionSheetDelegate - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { // the user clicked one of the OK/Cancel buttons if (buttonIndex == 0) { NSLog(@"ok"); } else { NSLog(@"cancel"); } } #pragma mark - UIAlertViewDelegate - (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { // use "buttonIndex" to decide your action // }     UIAlertView *alert = [[UIAlertView a......
阅读全文
  • 04月
  • 27日
综合 ⁄ 共 732字 评论关闭
        我们已经知道Ant脚本提供的的<property file="filename.properties"/>支持把prorperty信息写在单独的文本文件内,而import支持将其他的合法的ant脚本引入自己的xml文件中。这里介绍一个更为直观方便的方式来帮你你进行任务的调整和配置。         用本文介绍的方法,相当于从一个目标xml文件中直接把所有内容粘贴到你自己的用于ant的xml中指定的位置。而ant无需验证这个目标xml文件是否符合ant脚本的规则。 详细如下: 你的ant xml文件如下: <?xml version="1.0"?> <!DOCTYPE project [ <!EN......
阅读全文
  • 04月
  • 21日
综合 ⁄ 共 1167字 评论关闭
1.我们先来看一下IServiceManager.h class IServiceManager : public IInterface { public: DECLARE_META_INTERFACE(ServiceManager); /** * Retrieve an existing service, blocking for a few seconds * if it doesn't yet exist. */ virtual sp<IBinder> getService( const String16& name) const = 0; /** * Retrieve an existing service, non-blocking. */ virtual sp<IBinder> checkService( const String16& name) const = 0; ......
阅读全文
  • 04月
  • 12日
综合 ⁄ 共 1575字 评论关闭
uwsgi是什么:  /etc/uwsgi/apps-enabled/xxx.xml  主要告诉uwsgi建立一个socket,接收nginx的fast cgi并处理。 配置一个站点实例: <uwsgi id="monitor"> <socket>127.0.0.1:9090</socket> <master /> <home>/var/wsgi/</home> <chdir>/var/wsgi/monitor</chdir> <plugins>python</plugins> <wsgi-file>/var/wsgi/monitor/main.py</wsgi-file> <processes>2</processes> <workers>4</workers> ......
阅读全文
  • 03月
  • 29日
综合 ⁄ 共 9180字 评论关闭
 在Configuration对象设置xml文件源的时候,Configuration就调用了Xml解析器将xml文件的内容解析成为Bean描述提前放入了IOC容器,然后容器会根据这个描述来采用各种策略构造和管理Bean;   public Configuration setXmlString(String xmlString) { parse(new StringStreamInput(xmlString)); return this; } protected void parse(StreamInput streamSource) { isConfigured = true; JbpmConfigurationParser.getInstance() .createParse() .pushObject(this) .setStreamSource(streamSourc......
阅读全文
  • 02月
  • 02日
综合 ⁄ 共 1445字 评论关闭
文章目录 站点处理能力 计算能力 存储硬件 架构 其他信息 后记 应用服务器 作为电子商务领头羊的 eBay 公司,数据量究竟有多大? 很多朋友可能都会对这个很感兴趣。在这一篇 Web 2.0: How High-Volume eBay Manages Its Storage(从+1 GB/1 min得到的线索) 报道中,eBay 的存储主管 Paul Strong 对数据量做了一些介绍,管中窥豹,这些数据也给我们一个参考。 站点处理能力 平均每天的 PV 超过 10 亿 ; 每秒钟交易大约 1700 美元的商品 ; 每分钟卖出一辆车A ; 每秒钟卖出......
阅读全文
  • 01月
  • 21日
综合 ⁄ 共 3648字 评论关闭
如何你想要买电脑或组装一台电脑时,你首先要了解一些硬件知识,在本文中为大家具体介绍一下串口和并口硬盘,以及两者之间的区别。希望对各位有所帮助。   为了便于大家理解,可以这样来理解串口硬盘和并口硬盘的区别:   通俗的说,串口形容一下就是 一条车道,而并口就是有8个车道   同一时刻能传送8位(一个字节)数据。   但是并不是并口快,由于8位通道之间的互相干扰。传输受速度就受到了限制。而且当传输出错时,要同时重新传8个位的数据。串口没有干扰,传输出错后重发一位就可以了。所以快比并口快。串口硬盘就是......
阅读全文