网站域名已经改为www.atoi.cn,原域名hsboy.com不再使用,请留意

Monday, March 31. 2008

安装oracle 10g后,oracle自带的jre会影响eclipse启动

我安装的eclipse是最新版,需要jdk1.5及以上才能运行。oracle安装后会修改环境变量PATH,把它自己相关的几个目录加在最前面。

Friday, August 31. 2007

Confluence破解方法 (zt)

为了方便文档的管理,最近装了Atlassian的Confluence,虽说是开源项目,但是仍需购买License才能长久使用,好奇心起,在网上搜索了一下破解之法,发现大多写得模棱两可,害人不浅,最后几经折腾终于破解成功。为了给后来人提供一点儿方便,发扬互联网共享之精神,决定整理一下,破解过程如下:

1) 首先在官方网站上下载并安装了JIRA和confluence:
atlassian-jira-enterprise-3.6.5-standalone.tar.gz
confluence-2.2.10.tar.gz

2) 启动后,可以看到页面下面有一条醒目的红色提醒,说明是Evaluation版本,用admin登录在License Details页面输入官方提供的试用版的License number(可在网站上得到),此时可以正常使用了。

3) 解压confluence-2.2.10.tar.gz包,反编译下列几个文件:
confluence-2.2.10\confluence\WEB-INF\classes\com\atlassian\confluence\upgrade\impl\DefaultUpgradeManager.class(c1)
confluence-2.2.10\confluence\WEB-INF\lib\atlassian-extras-0.7.20.jar(j1)中的:
atlassian-extras-0.7.20\com\atlassian\license\DefaultLicense.class
(c2)
atlassian-extras-0.7.20\com\atlassian\license\LicenseManager.class
(c3)
atlassian-extras-0.7.20\com\atlassian\license\LicenseUtils.class(c4)

4) 分别得到的四个Java文件,修改其中与Expire、License等有关的方法,然后再编译得到相应的class,分别替换原来的class,然后将(c1)(j1)拷贝到安装目录的相应位置下(替换之前最好原文件先备份)。

5) 重启服务,红色提醒不见了,登陆进去,可看到License Details页面信息更新如下:

Organisation KFC
Date Purchased Feb 10, 3906
License Type Confluence: Commercial Server
Licensed Users Unlimited
Support Period Your commercial Confluence support and updates are available until Oct 10, 3911.
License ID (Atlassian sales or support may ask you to provide this ID)
License Partner Cocacola


附: 上述反编译的几个文件修改之处如下(只陈列了修改的部分):
(c1):
    public boolean isUpgradeAllowed()
    {
        return true;
    }

(c2):
 
   public boolean isExpired()
    {
        return false;
    }

    public Date getExpiryDate()
    {
        return null;
    }
(c3):
    private static final Category log = Category.getInstance("com/atlassian/license/LicenseManager");

    public boolean hasValidLicense(String licenseKey)
    {
        return true;
    }

    public License getLicense(String applicationName)
    {
        Date dateCreated = new Date(2007, 1, 10);
        Date datePurchased = new Date(2006, 1, 10);
        License license = new DefaultLicense(dateCreated, datePurchased, "KFC", ConfluenceLicenseTypeStore.FULL_LICENSE, 10000, "Cocacola");
        return license;
    }

    public License setLicense(String license, String applicationName)
    {
        return null;
    }
    public LicensePair getLicensePair(String applicationName)
    {
        return null;
    }

(c4):
    public static long getSupportPeriodEnd(License license)
    {
        return (new Date(2010, 9, 9)).getTime() + 0x75cd78800L;
    }

    public static boolean isLicenseTooOldForBuild(License license, Date buildDate)
    {
        return false;
    }

    public static boolean confirmExtendLicenseExpired(Date dateConfirmed)
    {
        return false;
    }

    public static boolean confirmExtendLicenseExpired(String dateConfirmed)
        throws NumberFormatException
    {
        return false;
    }

    private static long getNewBuildWithOldLicenseExpiryDate(Date dateConfirmed)
    {
        return dateConfirmed.getTime() + 0x9a7ec800L;
    }

    public static long getNewBuildWithOldLicenseExpiryDate(String dateConfirmed)
    {
        return getNewBuildWithOldLicenseExpiryDate(new Date(Long.parseLong(dateConfirmed)));
    }

    public static long getSupportPeriodAlmostExpiredDate(License license)
    {
        return getSupportPeriodEnd(license) - 0xd84b1800L;
    }


Tuesday, August 7. 2007

subversion的svn命令行显示乱码的解决(zt)

更多内容…

Saturday, March 31. 2007

SQL COUNT function performance tuning

FROM: http://www.techonthenet.com/sql/count.php

Since the COUNT function will return the same results regardless of what NOT NULL field(s) you include as the COUNT function parameters (ie: within the brackets), you can change the syntax of the COUNT function to COUNT(1) to get better performance as the database engine will not have to fetch back the data fields.

For example, based on the example above, the following syntax would result in better performance:

SELECT department, COUNT(1) as "Number of employees"
FROM employees
WHERE salary > 25000
GROUP BY department;

Now, the COUNT function does not need to retrieve all fields from the employees table as it had to when you used the COUNT(*) syntax. It will merely retrieve the numeric value of 1 for each record that meets your criteria.

Saturday, September 3. 2005

wc - Word, line and byte/character count

wc命令非常简单。一共有4个参数:

  • "-l"统计输入中有多少行: wc -l a.sh则输出"13 a.sh",表示a.sh中有13行
  • "-m"统计输入中有多少个字符: wc -m a.sh则输出"163 a.sh",表示a.sh中有163个字符
  • "-c"统计输入中有多少个字节: wc -c a.sh输出"163 a.sh",表示a.sh中有163个字节
  • "-w"统计输入中有多少个单词:wc -w a.sh输出"32 a.sh",表示a.sh中有32个单词(统计办法仅仅是以空格分割,并非真正的单词数)

几点注意:

  1. 可以同时指定多个参数来统计多项值,但是输出的格式始终按照line, byte, word, filename的顺序,不管参数的顺序如何给出;
  2. "-m"和"-c"参数的区别在于,在有些地区中可能使用多字节字符,所以多个字节可能被认做一个字符。如果当前locale不支持多字节字符,那么这两个参数的效果是一样的。
(Page 1 of 2, totalling 10 entries) » next page

Categories

All categories

Archives

Syndicate This Blog

XML RSS 1.0 feed
XML RSS 2.0 feed

Calendar

« 2008 年 October
Mon Tue Wed Thu Fri Sat Sun
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Quicksearch

友情链接

Blog Administration

Open login screen

Top Referrers

访问统计

Locations of visitors to this page
The articles in this sites are copyrighted, except those marked as reshipped
MII Record: 05029638