上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 49 下一页

2013年7月26日

摘要: Atoms: There and Back AgainTime limit2secondsMemory limit256MbInputstdinOutputstdoutLegendYura and Roman got bored with the original “Atoms” board game and came up with a better game that uses the same playing set. The game starts with one group of atoms. On each step, a player chooses numberXand di 阅读全文

posted @ 2013-07-26 18:51 冰天雪域 阅读(291) 评论(0) 推荐(0) 编辑

摘要: 最近在学习Hibernate的基本内容,刚好在项目中有用到,基本上都是用到哪就学哪。今天看看六种方式实现hibernate查询.........分别是HQL查询,对象化查询Criteria方法,动态查询DetachedCriteria,例子查询,sql查询,命名查询。 如果单纯的使用hibernate查询数据库只需要懂其中的一项就可以完成想要实现的一般功能,但是 从一个点,让我们掌握6中方法,则提供了更多选择。每一种方法都有其适用的情况与前提。 HQL查询 HQL是hibernate自己的一套查询语言,于SQL语法不同,具有跨数据库的优点。示例代码:static void query(Stri 阅读全文

posted @ 2013-07-26 18:49 冰天雪域 阅读(277) 评论(0) 推荐(0) 编辑

摘要: 有时候我们需要在加载webview时,获取加载完成的内容,当然,WebView也是有可能包含javascript。通过以下操作,我们是可以获取到WebView加载的内容。1、自定义一个内部类,获取WebView加载的内容class Handler {public void show(String data) { // 这里的data就webview加载的内容,即使页面跳转页都可以获取到,这样就可以做自己的处理了 new AlertDialog.Builder(WebViewActivity.this).setMessage(data).create().show();}} 2、webview. 阅读全文

posted @ 2013-07-26 18:47 冰天雪域 阅读(1420) 评论(0) 推荐(0) 编辑

摘要: 1、使用数据库连接池优化程序性能2、数据库连接池编写原理分析(1)编写连接池需实现javax.sql.DataSource接口。DataSource接口中定义了两个重载的getConnection方法:ConnectiongetConnection()ConnectiongetConnection(Stringusername,Stringpassword)(2)实现DataSource接口,并实现连接池功能的步骤:在DataSource构造函数中批量创建与数据库的连接,并把创建的连接保存到一个集合对象中实现getConnection方法,让getConnection方法每次调用时,从集合对象 阅读全文

posted @ 2013-07-26 18:46 冰天雪域 阅读(657) 评论(0) 推荐(0) 编辑

摘要: 以下示例为API=11时本来就有ActionBar可以使用,所以不猜讨论范围之内今天Google发布了最新的API 18,包括众多新的性能,正好最近在研究ActionBarSherlock,看到最新的Support V7包也开始支持ActionBar了,就研究了一下使用方法,我把自己今天研究到的一个使用方法记录如下,希望可以抛砖引玉吧.1. 导入Support V7的包.更新SDK 18以后,会发现在\android-sdk\extras\android\support\v7目录下有三个子文件夹,分别是:appcompat\gridlayout\mediarouter,工作中比较常用的是app 阅读全文

posted @ 2013-07-26 18:44 冰天雪域 阅读(890) 评论(0) 推荐(0) 编辑

摘要: 平台:ubuntu11.10 一、下载源码包www.boa.org boa-0.94.13.tar.gz二、解压,在其src目录下生产makefile #tar xvfz boa-0.94.13.tar.gz -C /指定目录#cdboa-0.94.13/src #./config三、修改makefile 指定编译器CC = gccCPP = gcc -E改为:CC = arm-linux-gccCPP = arm-linux-gcc -E四、在make时可能会出现如下错误 错误:yacc -d boa_grammar.y make: yacc:命令未找到 make: *** [y... 阅读全文

posted @ 2013-07-26 18:42 冰天雪域 阅读(300) 评论(0) 推荐(0) 编辑

摘要: 以前好像是在UVa上貌似做过类似的,mod的剩余,今天比赛的时候受baofeng指点,完成了此道题此题题意:求sum(|i%A-i%B|)(0#include #include #include #include #define LL long longusing namespace std;LL abs(LL a,LL b){ return (a-b)>(b-a)?(a-b):(b-a);}LL gcd(LL a,LL b){ return b==0?a:gcd(b,a%b);}LL lcm(LL a,LL b){ return a/gcd(a,b)*b;}LL t[200... 阅读全文

posted @ 2013-07-26 18:39 冰天雪域 阅读(179) 评论(0) 推荐(0) 编辑

摘要: 要使精灵能够接收到触摸事件,无非要做三件事。注册触摸事件;接收触摸事件;处理触摸事件。下面就从这三点出发,来了解一下精灵如何响应触摸事件。1.注册触摸事件精灵类Poker继承Sprite和CCTargetedTouchDelegate,并重写CCTargetedTouchDelegate的三个函数ccTouchBegan,ccTouchMoved,ccTouchEnded同时加入辅助函数rect()和containTouchPoint(CCTouch* touch)用于后面的判断。poker.h文件:class Poker : public CCSprite ,public CCTargete 阅读全文

posted @ 2013-07-26 18:38 冰天雪域 阅读(653) 评论(0) 推荐(0) 编辑

摘要: Dancing Links解决Exact Cover问题.用到了循环双向十字链表.dfs. 论文一知半解地看了一遍,搜出一篇AC的源码,用注释的方法帮助理解. HIT ACM 感谢源码po主.链接如下:http://blog.csdn.net/yysdsyl/article/details/4266876#include #include using namespace std;const int INT_MAX = 2147483647;struct point { int L; int R; int U; int D;//四个方向的链表 int Sum; ... 阅读全文

posted @ 2013-07-26 18:36 冰天雪域 阅读(304) 评论(0) 推荐(0) 编辑

摘要: 在终端中输入如下命令: dpkg --get-selections|grep linux-image这时会列出系统中所有到内核。你可以使用uname -a 查看你当前使用到内核。然后用sudo apt-get remove --purge 你要删除到内核名--purge是彻底删除,连带配置信息注意:千万别删除你当前正在使用的内核!否则系统重启后不能使用 阅读全文

posted @ 2013-07-26 18:34 冰天雪域 阅读(208) 评论(0) 推荐(0) 编辑


上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 49 下一页

Copyright © 2024 冰天雪域
Powered by .NET 8.0 on Kubernetes