现在位置: 首页 > pail发表的所有文章
  • 07月
  • 26日
综合 ⁄ 共 719字 评论关闭
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example:Given the below binary tree and sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ \ 7 2 1 return true, as there exist a root-to-leaf path 5->4->11->2 which sum is 22. 思路:典型的二叉树数据结构方法。非递归方式,可用两个栈,S和total......
阅读全文
  • 05月
  • 25日
综合 ⁄ 共 51字 评论关闭
链接oracle的url:jdbc:oracle:thin:@127.0.0.1:1521:数据库名称
阅读全文
  • 10月
  • 19日
综合 ⁄ 共 812字 评论关闭
1、http://www.boost.org/,下载1.54 2、解压20分钟 3、bootstrap 然后 bjam.exe一个小时。有人说要先装zlib、python等,暂时没装,不知道行不行。中间提示iso8859-1.hpp文件编码不是unicode。 4、http://hi.baidu.com/vc_net/item/3dc5d0d9f07741e955347f45 5、编译sgd  H:\boost>bjam --tolset=msvc-10.0 architecture=x86 --build-type=complete  link=static runtime-link=s tatic threading=multi stage 6、release程序需要 -s  debug需要-sgd的库 其他参考: bjam参数 --build-dir=<builddir> 编译的临时文件......
阅读全文
  • 08月
  • 28日
综合 ⁄ 共 670字 评论关闭
今天发现了construtor-arg和property的一点不同之处,详述如下。(Spring版本2.5.6) 对于int类型的属性: property的value可以指定某个类的public static变量,而construtor-arg的value则不能。 比如: 这个是没有问题的 <bean id="transport"         class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">         <property name="staticField">             <value>com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP</value>         </property> </bean>   而这个......
阅读全文
本文由 伯乐在线 - CuGBabyBeaR 翻译自 codecapsule。欢迎加入技术翻译小组。转载请参见文章末尾处的要求。 在这部分,我以独立的简单段落的形式总结了其它部分的内容。每个段落概括了其他部分一节或几节的内容,这样可以让读者在每个主题下能够得到更多细节。 基础 1. 存储单元类型 固态硬盘(SSD)是基于闪存的数据存储设备。每个比特都存储在存储单元中,而存储单元分为三类:每个单元1比特(单层单元,SLC),每个单元2比特(多层单元,MLC),每个单元3比特(三层单元,TLC)。 >> 详见第1.1节 2. 寿命限制 ......
阅读全文
  • 05月
  • 12日
综合 ⁄ 共 4767字 评论关闭
首先实现UIScrollViewDelegate协议: [plain] view plaincopy #import <UIKit/UIKit.h>      @interface Activity01ViewController : UIViewController<UIScrollViewDelegate>{       UIScrollView *myscrollview;   }   @property (nonatomic,retain) UIScrollView *myscrollview;   @end   实现协议的下列方法: [plain] view plaincopy #import <UIKit/UIKit.h>      @interface Activity01ViewController : UIViewController<UIScrollViewDelegate>{       UISc......
阅读全文
  • 05月
  • 08日
综合 ⁄ 共 6793字 评论关闭
在Windows程序中,各个进程之间常常需要交换数据,进行数据通讯。WIN32 API提供了许多函数使我们能够方便高效的进行进程间的通讯,通过这些函数我们可以控制不同进程间的数据交换.     进程间通讯(即:同机通讯)和数据交换有多种方式:消息、共享内存、匿名(命名)管道、邮槽、Windows套接字等多种技术。“共享内存”(shared memory)可以定义为对一个以上的进程是可见的内存或存在于多个进程的虚拟地址空间。例如:如果两个进程使用相同的DLL,只把DLL的代码页装入内存一次,其他所有映射这个DLL的进程只要共享这些代码页就可以......
阅读全文
  • 04月
  • 05日
综合 ⁄ 共 960字 评论关闭
方法一:View.post(Runnable action) public void onClick( View v ) { new Thread( new Runnable() { public void run() { // 耗时操作 doLongOperation(); myText.post(new Runnable() { myText.setText( 来自网络的信息); }); } }).start(); } 方法二:Activity.runOnUiThread(Runnable action)     与view.post()方法类似 public void onClick( View v ) { new Thread(new Runnable() { public void run() { // 耗时操作 doLongOperation(); Activity.runOnUiThread(new Runnable() ......
阅读全文
  • 02月
  • 19日
综合 ⁄ 共 2029字 评论关闭
    前天要做一个对C++ STL的vector容器做一个排序操作,之前一直把vector当做一个容量可自动变化的数组,是的,数组,所以打算按照对数组进行排序的方法:用快速排序或是冒泡排序等算法自己写一个排序的函数。后来觉得STL这么强大,应该有它自己的排序方法(没有好好学习啊),然后就去google了一下,果然有,而且可以自定义排序的函数,太强大了(而且效率应该比我自己写的要好吧)。 [cpp] view plaincopyprint? // VectorSort.cpp : Defines the entry point for the console application.   //      #include ......
阅读全文
  • 02月
  • 10日
综合 ⁄ 共 1012字 评论关闭
相信不少朋友都遇见过类似问题,现在介绍一个JUNIT4的测试方法。 首先在已经集成好SSH的环境中 添加 junit4.jar     spring-test.jar 接着在项目中新建一个source folder,名为test 一般测试类的起名规范为 XXXTest @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "classpath:applicationContext.xml") public class TalkTest extends AbstractJUnit4SpringContextTests { @Resource TalkDao talkDaoImpl ; @Resource StudentDao studentDaoImpl; @Test public void getOneTalk(){ Talk ......
阅读全文
  • 01月
  • 24日
综合 ⁄ 共 514字 评论关闭
powerDesigner 反向工程mysql有两种方式: 方法一:使用odbc数据源(推荐) 1、首先要安装32位的Mysql odbc,下载下来mysql-connector-odbc-5.2.2-win32.msi 并安装,网址: http://dev.mysql.com/downloads/connector/odbc/ ; (MySQL的官网下载地址) 2、控制面板>数据源... 添加数据源(如下图) 3、启动pd,建立反向工程, 方法二:使用jdbc数据源(貌似有问题) 1、首先新建一个“PhysicalDataModel”类型的文件,然后点击“Database”->"Configure  Connections",弹出窗口“Configure Data Connections”, 并选择"Connection P......
阅读全文
  • 01月
  • 23日
综合 ⁄ 共 45字 评论关闭
http://linux.maruhn.com/sec/glibc-static.html
阅读全文