Category Archives: Program

有意思的一篇文章:[译稿]为什么我们不要 .NET 程序员

文章地址:[译稿]为什么我们不要 .NET 程序员 有些观点我比较赞同: 用 .NET 进行编程就像是在麦当劳做烹饪。那里有全套神奇的设备能够自动的造出所有的东西。只有你按一下正确的按钮,跟着提示灯的指示,你就可以批量的制造出完美无缺的1.6盎司的汉堡,比地球上的任何其他人都要快。 然而,如果你想做出一个1.7盎司的汉堡,很抱歉,你做不到。很简单,没有这样的按钮。 馅饼是预先做成了那样的尺寸。它们做出来之后就被冷冻,所有你无法把它们揉到一起做成其它尺寸,解冻机和烹饪机是一体的,你没有办法在它们之间进行拦截。 麦当劳的厨房产出的食品精确的和麦当劳的菜单保持一致的——这种模式使你的大脑不需要任何的思考。可是,它不能偏离菜单,对烹饪机器的任何你妄想的压挤变 形都会导致它停止工作,而被送回返厂维修。

Posted in Program | Tagged | Leave a comment

ubuntu oneiric apache2.2 tomat7 mod_jk geonetwork

在一台新服务器上安装了ubuntu oneiric 11.10中安装apache2.2 tomcat7,现在想通过mod_jk把二者桥接起来。 1. 首先安装 sudo apt-get install tomcat7 apache2 libapache2-mod-jk 2. 修改workers.properties sudo nano /etc/libapache2-mod-jk/workers.properties 把其中一行: workers.tomcat_home=/usr/share/tomcat6 替换为: workers.tomcat_home=/usr/share/tomcat7 3. 配置tomcat7 sudo nano /etc/tomcat7/server.xml 把port 8009这行的默认注释给去掉: <Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ /> 并添加host中添加自己的应用: <Context path=”/geonetwork” docBase=”/var/www/xining/geonetwork/web/geonetwork/” crossContext=”false” debug=”0″ reloadable=”false” … Continue reading

Posted in Linux, Program | Tagged , , , , , , | Leave a comment

bluefish 2.2.0发布了

bluefish是我现在进行php编程的ide工具,其最新版本2.2.0发布了,最大的变化是支持gtk-3了。 就是不知道什么时候ubuntu能有更新包出来,估计等不及就要自己编译了。

Posted in Linux, Program | Tagged , | Leave a comment

postgresql中从多表中进行update

有时候,需要根据其他表的数据对某表的数据进行更新,这是就可以用到多表更新的功能: update metadata m set source=s.uuid from source s right join datasource d on s.id=d.sourceid where m.uuid=d.uuid

Posted in Program | Tagged , , | Leave a comment

bing api json中文搜索有乱码

系统中使用bing api json进行查询后发现搜索结果有乱码,网上搜索后发现是一个返回高亮的问题: bing api默认的请求参数是上面这样的。后面经发现’Options’=>’EnableHighlighting’,有问题。如果指定 Bing Search API时如果指定Options=EnableHighlighting(如下),则返回的Jason字符串中在关键字两边会有全角空格字符,而全角空格字符在IE下显示为很长的空格,在Firefox上显示为乱码。 最终解决方方案:在查询請求中去除Options=EnableHighlighting的参数设置后正常。

Posted in Program | Tagged | Leave a comment

colorbox vs thickbox

As it has been compared in this website, we test the two js script for ‘box’ in our site too, colorbox is chosen finally. The reason: colorbox support an image url without image extension, use the photo:”true” option, in thickbox … Continue reading

Posted in Program | Tagged , , | Leave a comment

odtphp: A nice library to output openoffice odt file

Recently, I want to add a function in our data center website(Which is only Chinese version now, an English version is preparing): “output the geographic metadata to openoffice odt format”. So, the odtphp project came into my sight. After download … Continue reading

Posted in Program | Tagged , , , , | Leave a comment

C++矩阵库比较

同化系统中要大量使用矩阵类,现在使用的是之前有我们自己发展的纯C++的一个矩阵类,而后又引入了IT++类的支持,现在回头来看,又有很多新的C++矩阵类库发展出来,并且有很好的特性。今天就用了几个测试代码在我的DELL T7400工作站进行了测试,主要比较的是我们自己的矩阵类、armadillo、IT++(参考文献中还有和其他矩阵类的比较)。

Posted in Program | Tagged , , , | Leave a comment

实现了一个SCAR的zotero translator

SCAR: Science of Cold and Arid Regions 是所里新办的一个期刊,看了几篇文章,打算摘录下来,zotero却不支持,需要自己再写一个转换器(translator),花了一下午的时间,终于搞出来了,暂时不支持搜索功能。 把下面的代码保存到zotero下的translator目录,给个名字,如SCAR.js,然后重新启动一下FIREFOX,应该就可以使用了。 { “translatorID”:”d5770df3-b41a-45cb-bb3a-261948c9af49″, “translatorType”:4, “label”:”SCAR”, “creator”:”Liangxu Wang<wangliangxu@gmail.com>”, “target”:”http://www.scar.ac.cn/hhkxen/ch/reader”, “minVersion”:”1.0″, “maxVersion”:”", “priority”:100, “inRepository”:true, “lastUpdated”:”2009-5-27 22:33:00″ } function detectWeb(doc, url) { var articleRe = /view_abstract.aspx/; var s = articleRe.exec(url); if(s) { return “journalArticle”; } … Continue reading

Posted in Program, RS | Tagged , , , | Leave a comment

cout float的显示问题

在c++,使用cout直接显示float类型的数据,在不同系统上显示方式可能有所不同。 测试代码: #include <iostream> using namespace std; int main() { float t=0.000000277; cout<<t<<endl; return 0; } 在LINUX上: 2.77e-07 而在WINDOWS上结果如下: 2.77e-007

Posted in Linux, Program | Tagged , , , | Leave a comment