2008年6月22日

Firefox在Linux下的后退按键是“Alt"+"<-",要同时按两个键,不如Windows下的Backspace一次按键方便。

要启用Backspace,只需将about:config里的“browser.backspace_action”由默认的2改为0


posted @ 2008-06-22 20:50 罗明 阅读(221) | 评论 (0)编辑 收藏

2008年6月20日

编辑工程的.project文件:

添加

<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>

<natures>

</natures>

 

eg.

例如将

<natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
</natures>

更改为:

<natures>
    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
    <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>

    <nature>org.eclipse.jdt.core.javanature</nature>
</natures>

posted @ 2008-06-20 17:14 罗明 阅读(330) | 评论 (2)编辑 收藏

2008年5月22日

应用python的pickle模块从序列化文件中构造对象,根据对象的构造解开谜题

详细描述 :

http://www.pythonchallenge.com/pc/def/peak.html

(peak hell连读发音类似pickle,谜题就是pickle模块的应用了)

 

解决方案代码:

import pprint,pickle,sys

pfile 
= open('banner.p')
data 
= pickle.load(pfile)
for row in data:
  
for item in row:
    
for index in range(item[1]):
      sys.stdout.write(item[0])
  
print ''
pfile.close()

输出的对象构造:


posted @ 2008-05-22 17:45 罗明 阅读(159) | 评论 (16)编辑 收藏

2008年5月16日

在网上找了很久才找到developerWorks上的一个解决方案:

在命令提示符里切换到目录“C:\Program Files\IBM\SDP70\jdk\jre\bin”,运行“java.exe -Xshareclasses:destroyAll”

这样就能正常启动RAD了! 

原因描述如下:

(摘录自http://www-1.ibm.com/support/docview.wss?uid=swg21281393,并通过Google Translate转译,译文已作修改)

×××××××××××××××××××××××××××××××××××××

问题(摘要)
此说明解释如何解决错误“JVM的终止。退出代码= 1”。

起因
RAD自带的IBM JVM使用了一个高速缓存参数来提高性能。而因为JVM的崩溃,比如蓝屏,或断电,都可能造成Java高速缓存被损坏。 而JVM会拒绝连接到一个损坏的高速缓存。

解决问题
要解决这个问题,使用“-Xshareclasses:destroyAll”的Java选项将销毁所有的共享级缓存。这是一种实用工具选项,所以不会启动JVM 。如果您想要这么做,只要从命令提示符使用参数“-Xshareclasses:destroyAll”来运行RAD使用的java。

××××××××××××××××××××××××××××××××××××××

posted @ 2008-05-16 11:06 罗明 阅读(385) | 评论 (17)编辑 收藏

2008年5月9日

Follow the URL chain to get the result (the chain may contain over 300 URLs......)

谜题详细描述:http://www.pythonchallenge.com/pc/def/linkedlist.php

Python解决方案:
import urllib

nothing 
= "12345"
ii 
= 1
while ii<401:
  source 
= urllib.urlopen("http://www.pythonchallenge.com" 
    
+ "/pc/def/linkedlist.php?nothing="+nothing).read()
  nothing
=filter(str.isdigit, source)

  
print nothing
  
if source != "and the next nothing is " + nothing:
    
print "source is not: and the next nothing is " + nothing
    
print "source is: " + source
    nothing 
= raw_input("select which number?")
    
print "you set " + nothing + " as nothing"
  ii
+=1


posted @ 2008-05-09 14:32 罗明 阅读(121) | 评论 (27)编辑 收藏

2008年5月8日

从一大堆字母里找出两边都刚好有3个大写字母的小写字母
详细描述:http://www.pythonchallenge.com/pc/def/equality.html

解决方案:

Python:
>>> import re
>>> re.findall(r'[a-z][A-Z][A-Z][A-Z][a-z][A-Z][A-Z][A-Z][a-z]', text)

posted @ 2008-05-08 12:50 罗明 阅读(165) | 评论 (0)编辑 收藏

2008年5月7日

谜题描述:http://www.pythonchallenge.com/pc/def/ocr.html
从一大堆乱码中找出可以理解的信息(字母)

Java解决方案:
public class Test {

    
public static void main(String[] args) throws Exception {
        URL url 
= new URL("http://www.pythonchallenge.com"
           + "
/pc/def/ocr.html");
        BufferedReader reader 
= new BufferedReader(new
          
InputStreamReader(url.openStream()));
        StringBuffer sb = new StringBuffer();
        
int i = reader.read();
        
while(i != -1)
        {
            
if((i >= (int)'A' && i <= (int)'Z')
              
|| (i >= (int)'a' && i <= (int)'z'))
            {
                sb.append((
char)i);
            }
            i 
= reader.read();
        }
        reader.close();
        String source 
= sb.toString();
        
       
//页面源码中最后一个单词是below
        System.out.println(
          
source.substring(source.indexOf("below"+ 5)
        );
    }
}

附Python和Shell:

Python:
>>> text = """
             <copy and paste>
"""
>>> import string
>>> for i in text:
        
if i in string.ascii_letters:
        
print i,

Shell:
$ curl http://www.pythonchallenge.com/pc/def/ocr.html | grep -o [a-z]

posted @ 2008-05-07 16:11 罗明 阅读(191) | 评论 (28)编辑 收藏

2008年5月6日

谜题描述:http://www.pythonchallenge.com/pc/def/map.html

Java解决方案:
 1 public class Test {
 2     public static void main(String[] args) {
 3         String a = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq "
              + "
ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb "
              + "gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq "
              + "qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. "
              + "lmu ynnjw ml rfc spj.";
 4         char[] ac = a.toCharArray();
 5         int zi = (int)'z';
 6         int ai = (int)'a';
 7         for(int index=0; index<ac.length; index++)
 8         {
 9             int aci = (int)ac[index];
10             if(aci >= ai && aci <= zi)
11             {
12                 int aci2 = (int)ac[index] + 2;
13                 
14                 System.out.print((char)((aci2>zi)?(aci2%(zi+1)+ai):aci2));
15             }
16             else
17             {
18                 System.out.print((char)aci);
19             }
20         }
21     }
22 }

附上Python和Shell解决方案:

Python:
1 >>> import string
2 >>> text = """g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr
3  amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q
4   ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb.
5  lmu ynnjw ml rfc spj."""
6 >>> table = string.maketrans(
7    string.ascii_lowercase,
8    string.ascii_lowercase[2:]+string.ascii_lowercase[:2])

Shell:
$ tr [a-z] [c-za-b]

posted @ 2008-05-06 18:02 罗明 阅读(181) | 评论 (28)编辑 收藏

2008年1月27日

rt, 这个时候你发现不能退出卡巴斯基,也不能结束AVP进程,而且保护和杀毒任务也不能停止,CPU占用率100%,网也上不了了,想上网找个解决办法都不行。

这时你想着只能重启系统或注销机器了,如果你不小心按照正常的关机或注销来走(不正常关机指“瞬时关机”(Ctrl+关机)),那你就等吧,界面会停留在“保存个人设置”那里十来分钟,你不得不拔电源了,,,

现在我告诉你一招关闭卡巴斯基的办法:
控制面板-》管理工具-》服务-》找到卡巴斯基服务,停止该服务-》,,,,,世界清净了。(还是不行?那你“Ctrl+关机”吧-_-!)

世界清净后,你可以再试着启动卡巴斯基服务,应该就ok了(裸奔还是不安全滴^_^)


PS:可能是程序不兼容造成卡巴斯基异常的哦(在我这里是Intel的无线网卡管理软件PROSet)

posted @ 2008-01-27 22:26 罗明 阅读(876) | 评论 (28)编辑 收藏

2007年10月24日

刚才有朋友问我推荐几本学习Oracle的书,我想了想,以前学习还真没系统的看过书,基本都是项目过程中慢慢熟悉。

没什么书可推荐的,所以就给他提了几点建议^_^:

1、到网上找篇安装的文章,对照着装好,遇到问题就google错误信息,解决问题。

2、安装完后做个小项目,做的过程中遇到问题就google查资料,解决。

3、做完后想想有什么高级功能可以实现,添加功能,改进。
这个高级功能最好跟分析数据库信息,导出信息报表有关,这样会用到比较多的oracle特定的sql语句。

问:现在安装那个版本?10还是9?
答:9.2的好,网上资料多,现在用的也最多

不需要看书的,要买的话,随便找本介绍9.2的小书;

主要是实践,做项目,网上查资料!

posted @ 2007-10-24 16:21 罗明 阅读(362) | 评论 (30)编辑 收藏

2007年10月8日

     摘要: 在equinox的Server-Side application中添加JSF支持  阅读全文

posted @ 2007-10-08 15:05 罗明 阅读(855) | 评论 (25)编辑 收藏

2007年9月29日

     摘要: 硬盘小,所以经常需要清理清理垃圾,把看过的电影删掉,把旧的文档课件打包,,,等等。 其实我们也可以从另一方面着手,争取少占用硬盘空间,比如说: 在线网络应用  阅读全文

posted @ 2007-09-29 23:18 罗明 阅读(401) | 评论 (28)编辑 收藏

2007年9月17日

     摘要: 通过联系下面的成员公司可以获得OSGi的相关开发套件  阅读全文

posted @ 2007-09-17 22:13 罗明 阅读(389) | 评论 (28)编辑 收藏

     摘要: OSGi联盟由业界领先的技术创新公司和组织组成,通过构建有效成熟的OSGi服务平台和促进它的采用来保证它的组件集成平台的应用和服务的互操作能力。OSGi联盟成员资格的申请是向业界开放的,商业和非营利公司,政府组织,教育机构,以及支持OSGi联盟目标,政策和规程的任何其它公司都可以申请成为OSGi联盟成员。  阅读全文

posted @ 2007-09-17 22:12 罗明 阅读(279) | 评论 (29)编辑 收藏

2007年9月7日

     摘要: 以前在Firefox下装了Web Developer这个插件,一直没用它做点什么。今天想定制一下博客,就看了下,发现里面有个Edit CSS很好用,修改后即时可以看到网页的效果。  阅读全文

posted @ 2007-09-07 11:16 罗明 阅读(326) | 评论 (28)编辑 收藏

2007年8月29日

     摘要: 感谢您对北京2008年奥运会的关注并积极参与门票销售第一阶段申购活动。在对所有超额预订场次的申购人进行抽签后,我们很遗憾地通知您没有获得您所申购的门票,您也无需支付任何款项。  阅读全文

posted @ 2007-08-29 20:22 罗明 阅读(321) | 评论 (29)编辑 收藏

2007年8月27日

把你的shell换成bash就可以了。

怎么换成bash呢?

执行“bash”命令就可以了,如下:

[root@localhost andyluo]# bash

 


点评:是否支持tab来自动完成和“向上键”显示最近命令 都是看你用的shell支不支持,如果你当前的shell不能完成这些,那就换一个shell好了,这个不是系统的问题!

posted @ 2007-08-27 18:05 罗明 阅读(422) | 评论 (0)编辑 收藏

2007年8月26日

     摘要: 刚收到一个Google提醒,是关于一篇谈论OSGi的博客文章。文章作者Jilles van Gurp开篇便称赞OSGi,但随之抨击OSGi的一些工具。他不能忍受的关键,在于需要把包的导入一行一行的加到manifest,他还认为manifest的格式很糟糕。我不同意他的看法,因为Bnd完全可以满足他提到的需求。
  阅读全文

posted @ 2007-08-26 22:20 罗明 阅读(520) | 评论 (28)编辑 收藏

2007年8月17日

     摘要: A list of the 2007 Java Developer’s Journal Readers’ Choice Awards winners and finalists. The awards recognize the best products and tools for Java technologies.  阅读全文

posted @ 2007-08-17 09:47 罗明 阅读(711) | 评论 (28)编辑 收藏

2007年7月20日

复制下面的JavaScript代码并粘贴到地址栏。 看看效果  : )

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images ; DIL= DI.length; function A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5); void(0)


把代码中的images改成links再试试 : )

转载自http://weblogs.java.net/blog/kirillcool/archive/2007/07/a_silly_trick_w.html

posted @ 2007-07-20 09:33 罗明 阅读(612) | 评论 (28)编辑 收藏

仅列出标题  下一页