niyue

Archive for 2005年5月|Monthly archive page

关于QuickSort的一些资料

In programming on 5月 27, 2005 at 11:49 上午

准备综合一些资料写一篇Quicksort方面的介绍文章,搜集到了以下一些感觉不错的资料:

Quicksort From Wikipedia, the free encyclopedia.

Quicksort is a well-known sorting algorithm developed by C. A. R. Hoare that, on average, makes Θ(n log n) comparisons to sort n items. However, in the worst-case, it makes Θ(n2) comparisons. Typically, quicksort is significantly faster in practice than other O(n log n) algorithms, because its inner loop can be efficiently implemented on most architectures, and in most real-world data it is possible to make design choices which minimize the possibility of requiring quadratic time.

  1. Quicksort or Samplesort Algorithm
  2. An elegant improvement of Quicksort
  3. Quicksort
  4. Quicksort algorithms with an early exit for sorted subfiles
  5. Data Structures and Algorithms: Quicksort

Visual Studio 2010概念IDE

In programming on 5月 27, 2005 at 1:37 上午

Visual Studio 2010 Concept IDE

刚看到这篇文章的时候还以为是MS官方的发文,没想仔细看一下到似乎只是一些fans写的文章(不过好像是高级fans^_^,连Allan Cooper都参与进来了),界面做的满清楚的,不过就是感觉太艳丽了.而且最关键的是,把若干个feature全部看完之后似乎没有什么特别的亮点,也都是现在一些已知甚至可以看到的东西,如果概念尚且如此,那实际又会有多少新想法呢?Eclipse发展到2010年不知道会是怎么样了…

Google API与yahoo API

In learningprogramming on 5月 23, 2005 at 2:18 下午

这几天在做Agent的课程设计,这个MAS的原型是一个RSS的搜索引擎,我主要是做前端的一些东西,如用户界面等,比较麻烦的地方是Agent与web环境的交互,尤其是并发的问题.

由于后端的搜索同学还没有做好,所以要测前端的界面的时候要Mock一些数据来显示.由于同样是搜索,最先想到的就是调用Google的API获取一些数据到前端来显示.其实满早以前就试玩过一下Google的API,所以Licence Key什么都已经有了,现在只要下载一下api的sdk就可以了.不过发现Google的API网站居然下载不了(后面使用的yahoo的api sdk也同样下载不了),考虑到是否有可能被Great Firewall给禁止的问题,用了一个香港的代理服务器,果然可以了,sigh~

不过事情还没有结束,尽管下载了Google的API,但是用的时候发现报Connection Timeout的异常,连不上Google的Web Service,就连Google的API demo也一样连不上,怀疑是不是又被GFW给喀嚓了,于是就放弃了这个打算.不过到了晚上看新闻的时候,突然想起来yahoo也公布了自己的api给开发者使用,就又有了试一试的想法.yahoo的api和google大致相同(我只用过java的),所以很快就上手了,三下五除二就搞定了一段简单的搜索代码,效果看上去还不错呵呵,就是有一个问题,怎么每次得到的都是10个搜索结果??

JADE 3.3的bug

In javaprogrammingsemanticweb on 5月 13, 2005 at 9:34 上午

这段在做一个Agent的原型系统,希望能够做成一个rss的搜索引擎.Agent的平台用的是JADE,现在已经出到3.3版了,应该算满成熟了吧,不过我使用的过程中发现似乎还是有bug.在创建Agent容器的时候发生错误:ContainerController containerController = runtime.createAgentContainer(profile);

一直想不出这里为什么会找不到主容器,看了JADE的源代码,发现这里可以把日志输出到文件,仔细看了一下才发现原来是JADE的url的解析似乎有些问题,目录中包含的空格被当作了url的分隔符~,解决方法:将目录中的空格去掉^_^

jade.core.IMTPException: RMI exception [nested RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: 5.5/webapps/agent/WEB-INF/classes/]

一分钟学习Morse代码

In other on 5月 8, 2005 at 2:51 上午

一分钟学习Morse代码原文: LEARN MORSE CODE in one minute !

Morse代码是一种代码听写工具。你可以用你的打印机将它打印出来。

当它说”START”的时候,将你的笔放好并开始听morse代码。

每次你听到”嘀”的一声(一个点)的时候,下移到右边。

每次你听到”哒”的一声(一个横线)的时候,下移到左边。

例如:你听到 哒嘀嘀的时候,就代表着一条横线,然后一个点,然后又一个点。

按照下图,你从听到”START”开始,听到一声”哒”然后向下并左移到T,然后你听到一声”嘀”,因此你向下并右移到N然后你又听到一声”嘀”,你就再次向下并右移并最后在D停下来。然后你就可以将D在你的代码记录纸上写下来,然后回到START重新开始准备听写你的下一个字符。

学习这一代码的关键在于听清楚代码并在你听到它的时候反应理解出这一代码所代表的字符。学习Morse代码的唯一的方式就是每天听上十分钟。

根据下图听代码的磁带或者电脑练习代码,一段时间后你会发现你自己可以根本不用这副图的帮助就立即写下对应的字符。

这副图带来了重复和识别,这是你从其他任何类型的代码练习帮助中所不能得到的。

HEAR slow morse code This code speed is slow enough to follow the chart above.
HEAR morse code at the speed that the FCC test is playedThis code speed is too fast to run down the chart so only practice with slow code until you know the letters without the aid of the chart.

CARC NIGHT OUT……….. Join us for a night of facinating demonstrations of HAM radio.

Goto DOWNLOADS page for hours of MP3 code practice
Goto LINKS page
Goto CARC Carbon County club
Goto BRAILLE page
email KB3BYT

Google Web Accelerator

In other on 5月 6, 2005 at 1:06 上午

昨天看到了Google Web Accelerator的出现,今天装了一下,还没什么感觉,大致看了一下GWA帮助中的一些东西.其中讲到了GWA的工作原理是怎么样的:

Google Web Accelerator uses various strategies to make your web pages load faster, including:

  • Sending your page requests through Google machines dedicated to handling Google Web Accelerator traffic.
  • Storing copies of frequently looked at pages to make them quickly accessible.
  • Downloading only the updates if a web page has changed slightly since you last viewed it.
  • Prefetching certain pages onto your computer in advance.
  • Managing your Internet connection to reduce delays.
  • Compressing data before sending it to your computer.

并且,在涉及隐私方面的时候,Google也说,其实GWA后台起的作用有点类似与ISP,用户在上网的时候会先连接到Google,再通过Google与Internet连接.这就让我联想到了前一段Google购买黑暗光纤的事情,两者联系起来,Google看来要取代将来的ISP的位置了.

DbUnit的相关资料

In javaprogramming on 5月 1, 2005 at 12:00 下午

用 DbUnit 和 Anthill 控制测试环境

Effective Unit Testing with DbUnit

用DbUnit进行SqlMap单元测试

雇用dbunit来维持你的数据环境稳定