Tuesday, January 30, 2007

be careful when you are on #paludis

In my opinion, a good community should treat new comers well.
But some people think otherwise.
http://www.gentoo.org/news/en/gwn/20061002-newsletter.xml#doc_chap3

(zhllg) i think many people like the idea installation could resume automatically when failure occur, is it possible with paludis?
(mlangc) zhllg: http://www.paludis.org/faq.html#skipfirst
 mlangc maskd masterdriverz maxauthority midnite__ mzli
 mlangc maskd masterdriverz maxauthority midnite__ mzli
(zhllg) mlangc, i've seen that actually, just wonder why, is it difficult to implement technically?
(mlangc) i don't think so; as far as i know it is not implemented by __design__ - but you should better ask someone that actually works on paludis; i'm a simple user myself
(rbrown`) zhllg: er no. Too unreliable, too flaky and far too widely abused;
(zlin) zhllg: wouldn't it be much better to fix the packages that cause it to fail in the first place...
(zhllg) zlin, yeah, from a developer's perspective
* dleverton is now known as dleverton|class
(zhllg) but i remember there is a saying, "provide the mechanism, not the policy"
(edeca) To be fair, I often used skipfirst to ignore ebuilds with fetch restriction that I knew I didn't need
* chutzpah (n= chutz@gentoo/developer/chutzpah) has joined #paludis
(mlangc) zhllg: i guess this also makes some sense from a users perspective - you can do "--skip-first" by manipulating the resume command - but you have to be explicit and thus think about it; often it is better to just try another version of the package that fails inmo
 mlangc maskd masterdriverz maxauthority midnite__ mzli
(zhllg) mlangc, actually i use this script to update the system: "sudo emerge -tauvDN world || until sudo emerge --resume --skipfirst; do sudo emerge --resume --skipfirst; done
* jacekowski has quit (Read error: 104 (Connection reset by peer))
(rbrown`) then you're an idiot
(mlangc) i guess that it what the paludis devs are meaning by 'far too widely abused' ;-)
* jacekowski (n= jacekows@aaot198.neoplus.adsl.tpnet.pl) has joined #paludis
(zhllg) rbrown`, watch your tongue, please
(zlin) or just clueless..
 mlangc maskd masterdriverz maxauthority midnite__ mzli
 mlangc maskd masterdriverz maxauthority midnite__ mzli
(zhllg) rbrown`, zlin, mlangc how do you update your system?
(zhllg) may i ask?
(rbrown`) zhllg: or what? there's no policy against calling an idiot an idiot in this channel
(rbrown`) zhllg: paludis -i world
(spb) there's no real policy against calling anyone anything, really
(rbrown`) spb: I wanted to be clear that I was only calling him names that were appropriate
(zlin) zhllg: we tend to try to fix problems when we hit them rather than ignoring them without even noticing..
(zhllg) zlin, not everyone has the ability to fix problems, let's face this
(mlangc) zhllg: at least you should be aware of them so that another person might fix them for you
 mlangc maskd masterdriverz maxauthority midnite__ mzli
(mlangc) if your "update" script leaves your system unusable you would not even have a clue what went wrong ....
(zlin) zhllg: and actually the things you can do with emerge --skipfirst are far more limited than what you can do with the resume command from paludis.
(zhllg) mlangc, i can find which packages are broken
* beandog (n=sdibb@gentoo/developer/beandog) has joined #paludis
(zhllg) just run emerge -tavuDN world again immediately after running that script
(zlin) uhh..
(ciaranm) idiot is too mild a term for this one
(zhllg) idiot is not an appropriate term to call users
(rbrown`) but was that evident when I used it?
(zhllg) or potential users
(ciaranm) 'fucking retard'?
(zhllg) maybe for you ciaranm
(mlangc) well, i think there's no need to be unfriendly; if he breaks his system that is entirely his problem ...
(zhllg) mlangc, maybe, but my system runs well for nearly 3 years

Thursday, January 25, 2007

Interest and Open source

One of the great things about open source software is, of course, the fact that anyone can participate, so the pool of resources is limited not by an annual hiring budget, but by interest in the project. That means you can have any number of developers, but it also means that one person may be involved in several areas if he or she finds them interesting.

http://www-128.ibm.com/developerworks/opensource/library/os-ag-renegade11/?ca=dgr-lnxw04geronimo

Tuesday, January 16, 2007

续:有关gorg和gentoo网站镜像的问题

知道原因了
handbook-x86.xml本身没有问题
不过有一个它指向的文件,里面缺了个</p>
而且使用了非utf-8编码
...
怪我之前没说

检查语法错误,可以用
xmllint -valid -noout filename.xml

有关gorg和gentoo网站镜像的问题

什么是gorg?
http://gentoo.neysx.org/mystuff/gorg/gorg.xml

首先是,我终于可以运行独立的gorg服务器了。
neysx给了我一个提示:
TW, you do not need to use the stand-alone web server, but if you want to, it
seems something changed in webrick (ruby's www server) and the default bound
address (0.0.0.0) does not work anymore. Edit www.rb and add the :BindAddress
param:

s = WEBrick::HTTPServer.new( :BindAddress => "127.0.0.1",
:AccessLog=>access_log, :Logger => $Log, :Port => $Config["port"], :CGIPathEnv
=> ENV["GORG_CONF"])

其次,我发现
http://localhost/doc/en/handbook/2006.1/handbook-x86.xml?part=1&chap=5
这样的连接打不开,也就是后面带&chap=5的
后来发现和libxml2和libxslt的版本有关,分别降到2.6.26和1.1.17,就行了
但问题根源应该在于一些xsl不够规范

现在,还剩一个问题
http://localhost/doc/zh_cn/handbook/2006.1/handbook-x86.xml
这个文件打不开
但是除了x86以外的其他handbook,都没有问题
把它放到上级目录也没有问题
错误的提示是sections tag不全,但这个文件里又没有sections这个tag

Tuesday, January 09, 2007

=media-sound/audacious-1.3.0_alpha1

If your mp3's id3 tag conforms to id3v2.4, which means probably you have disabled chardet, then pay attention to your fallback encoding setting, leave it alone, don't set it. trust me!

Monday, January 08, 2007

the default brower of xchat 2.8

The logic to find default brower is changed from xchat 2.6.8 to 2.8.
The 2.8 xchat will call xdg-open to open brower, in KDE, xdg-open will call konqueror unless you have set KDE's default brower to others.
I like firefox, and older version of xchat used to call firefox for me.
So I set KDE's default brower in kcontrol: KDE components-> Component chooser -> Web brower.

不明白audacious那帮人脑子里在想什么?

alpha(audacious-1.3.0-alpha1)的东西就放到~x86里
upstream maintainer和ebuild maintainer为同一个人看来是有些问题……

而且本来好好的东西偏偏要胡乱改
这个audacious/strings.c文件里,本来str_to_utf8()函数里的顺序是对的
也就是先判断是否已经为utf8,如果是,则马上返回。
结果现在先做的不是这个判断,结果,已经是utf8的还要再转码,就成了乱码……

Saturday, January 06, 2007

regexec(3)'s usage:Match Results with Subexpressions

http://www.gnu.org/software/libc/manual/html_node/Regexp-Subexpressions.html#Regexp-Subexpressions
An example program:
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>

/* 取子串的函数 */
static char* substr(const char*str,
                unsigned start, unsigned end)
{
        unsigned n = end - start;
        static char stbuf[256];
        strncpy(stbuf, str + start, n);
        stbuf[n] = 0;
        return stbuf;
}
/* 主程序 */
int main(int argc, char** argv)
{
        int x, z, lno = 0, cflags = REG_EXTENDED;
        char ebuf[128], lbuf[256];
        regex_t reg;
        regmatch_t pm[10];
        const size_t nmatch = 10;
        /* 编译正则表达式*/
        z = regcomp(&reg, "(reg|regular)[ ]?(ex|expression)", cflags);
        /* 逐行处理输入的数据 */
        while(fgets(lbuf, sizeof(lbuf), stdin))
        {
                ++lno;
                if ((z = strlen(lbuf)) > 0 && lbuf[z-1]
                                == '\n')
                        lbuf[z - 1] = 0;
                /* 对每一行应用正则表达式进行匹配 */
                z = regexec(&reg, lbuf, nmatch, pm, 0);
                if (z == REG_NOMATCH) continue;
                else if (z != 0) {
                        regerror(z, &reg, ebuf, sizeof(ebuf));
                        fprintf(stderr, "%s: regcom('%s')\n",
                                        ebuf, lbuf);
                        return 2;
                }
                /* 输出处理结果 */
                for (x = 0; x < nmatch && pm[x].rm_so != -1; ++ x)
                {
                        if (!x) printf("%04d: %s\n", lno, lbuf);
                        printf(" $%d='%s'\n", x, substr(lbuf, pm[x].rm_so,
                                                pm[x].rm_eo));
                }
        }
        /* 释放正则表达式 */
        regfree(&reg);
        return 0;
}
Run the program
$ ./a.out
regex
0001: regex
 $0='regex'
 $1='reg'
 $2='ex'
regular expresion
0002: regular expresion
 $0='regular ex'
 $1='regular'
 $2='ex'
regular expression
0003: regular expression
 $0='regular expression'
 $1='regular'
 $2='expression'


Monday, January 01, 2007

sed处理多行技巧的应用

sed -i -e  '
#找到有下面这段字的行
/在这段时间内被修正或解决的bug/ {
#读入下面一行
N
#如果下面一行以</ul>开头
/\n<\/ul>/ {
#就替换一下
s/在这段时间内被修正或解决的bug/bug在这段时间被标记为重复/
}
}' *