文章列表
在学习的过程中看到下面的一条语句:
count_if ( vec.begin() , vec.end() , not1 ( bind2nd ( less_equal<int>() , 10 )));
对于泛型算法count_if它的实现如下:
Template<class InputIterator, class Predicate>
Typename iterator_traits<InputIterator>::difference_type
Count_if ( InputIterator first , InputIterator la ...
今天需要在Java代码中启动之前导出的一个应用产品,即exe文件,查看网上资料,起初使用了如下的方式:
Runtime.getRuntime().exec(wkspacePth + "/ReaderDevice.exe");
这个可能是最通用的方式了,但启动的过程那是相当的慢,相等上十几,几十秒才有个动静。后来也不知道出了什么问题,测量调用的时候,总是弹出个框,说缺少什么companion library 然后就罢|工不启动了。
无奈到网上找到另外的一种方式:
Runtime.getRuntime().exec("cmd.exe /c start D:/ ...
使用Eclipse开发RCP的时候,需要引用配置文件config.xml,而该配置文件放在了当前工程下,则通过如下的代码引用:
Bundle bundle = Platform.getBundle(PLUGIN_ID);
URL pluginUrl = Platform.find(bundle,
new org.eclipse.core.runtime.Path("plugin.xml"));
URL pluginFileUrl = Platform.asLocalURL(pluginUrl);
org.eclipse.core.runtime. ...
本人是Ubuntu9.10+win7双系统,由于在9.10中使用的是grub2.0,修复起来相较于第一版的要麻烦许多。
首先使用的是Ubuntu9.10的安装光盘修复,使用光盘起动后,选择第一个“try ubuntu without any change to your computer",进入后,打开terminal,输入如下的命令,
sudo fdisk -l
打印出的结果如下:
Device Boot Start End Blocks Id System
/dev/sda1 1 154 ...
在Eclipse中遇到了如下的错误:
引用Access restriction: The method XXX from the type [A Class] is not accessible due to restriction on required library [A package].
用如下的方法就可以解决:
引用Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and trstricted API -> Forbidden reference ...
从外部导入了几个jar包发现工程上出现红叉,但展开又没有详细的指明任何错误,可能过如下几步:
1.检查Build Path中的各个依赖jar及library是否有warning的标志,若有,处理之;
2.clean 工程;
3.右键找到pde tools下的update classpath;
4.一般有什么问题都会在视图Problems中显示,所以可以在其中查找问题,今天我遇到的就是A cycle was detected in the build path of project ,这样我们可以如下引用window->preference->java->complier-> ...
早上写了两段代码,一个是使用jdk中的JDBC连接数据库,代码如下:
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con=java.sql.DriverManager.getConnection("jdbc:mysql://localhost/books?useUnicode=true&characterEncoding=GBK","root","weishenme2");
Statement st ...
Hello World!
开这篇博客完全是让自己学习过程中遇到的难题,或者有趣的想法一一记录在案,以免未来的我掉到同一个坑中。所以,有时候语言会很简洁,甚至不会有言语,直接上代码,全都是以我自己明白的方式表述,故,若有童鞋通过引擎不小心误入本地,千万不要当成是特务用暗语传机密呢。