在这不况的时代,在任何时代,保全生命都是重要的。
看新闻有些人真是死的很离奇,比如 澳大利亚一名华裔男子遭人以钉枪向头颅发射34枚钉子杀害, 研究生做引体向上拉倒球门被砸身亡。
看看云,看看海,看看天空,活着每天应该心存感激。
2009年4月23日星期四
good practice for extend a open source item
In wikipedia, there is a language named "Simple English". Also, a productive program should be written in simple ways.
i want to dump database tables into csv files. i found scriptella etl. you should told it table names and column names in each tables, and it will do the left things for you.
but my csv files should seperated by comma, and no quots. csv with quot will make size *1.3, which is not good. if a comma appears in the content, the format will be broken. so i'd like to replace comma with `. it cannot meet my needs in obviuse ways. so i find it opensource, i should customize it.
csv output is about a "driver" named "csv". since the driver is found in the way of "String fullName = "scriptella.driver."+driverName+".Driver";" there is no config file needed. this is simple and smart. the foolish way is a config file and more foolish ones writes it in xml like what spring guys will do. so i forked a package using csv and make the changes.
And null items shows up as $column_name defaultly, i also forked a PropertiesSubstitutor.java to make it output a empty string. what i found is easy to do than dealing with other open source projects. and the reason should be,
*always public and donnt seal package. if you want be in simple smart way, forget the least permission priciple which fools invented.
* less interface or such things. maybe someone think himself consider problem in high abstraction. but in fact it will always be less abstracted in time of extension work.
* less dependency. it means less forking copy work.
after that, i export the new package into a jar file. and just copy it into lib dir. it works. because the bat file use:"for %%i in (*.jar) do set _SCRIPTELLA_CP=!_SCRIPTELLA_CP!;%%~fi" to include all jar insight.
i donnt know if it is a good way to solve the dump task. but the hack expierence is smooth because of its simply tone of programming.
i want to dump database tables into csv files. i found scriptella etl. you should told it table names and column names in each tables, and it will do the left things for you.
but my csv files should seperated by comma, and no quots. csv with quot will make size *1.3, which is not good. if a comma appears in the content, the format will be broken. so i'd like to replace comma with `. it cannot meet my needs in obviuse ways. so i find it opensource, i should customize it.
csv output is about a "driver" named "csv". since the driver is found in the way of "String fullName = "scriptella.driver."+driverName+".Driver";" there is no config file needed. this is simple and smart. the foolish way is a config file and more foolish ones writes it in xml like what spring guys will do. so i forked a package using csv and make the changes.
And null items shows up as $column_name defaultly, i also forked a PropertiesSubstitutor.java to make it output a empty string. what i found is easy to do than dealing with other open source projects. and the reason should be,
*always public and donnt seal package. if you want be in simple smart way, forget the least permission priciple which fools invented.
* less interface or such things. maybe someone think himself consider problem in high abstraction. but in fact it will always be less abstracted in time of extension work.
* less dependency. it means less forking copy work.
after that, i export the new package into a jar file. and just copy it into lib dir. it works. because the bat file use:"for %%i in (*.jar) do set _SCRIPTELLA_CP=!_SCRIPTELLA_CP!;%%~fi" to include all jar insight.
i donnt know if it is a good way to solve the dump task. but the hack expierence is smooth because of its simply tone of programming.
2009年4月17日星期五
2009年4月16日星期四
oop in ansi c
i searched net for the topic, and have a thought.
because c's function is static, when compiled, suppose, we have 2 object x and y.
when we call x.a() and y.a(), because a() is a static function, if infomation about x and y is not sent to the function, it will not know. think again..., no, it cannot. so "oop in c" is done on the base of a(self,args,...), such way.
the ooc.pdf is also in the base.
that hurts. say x.a(arg1).b(arg2).c(arg3) can never written in its way, instead, should be c(b(a(x, arg1),arg2),arg3) . think if you should write 1+2*3-4 in way of "- + 1 * 2 3 4 ", the same meaning.
that is language, a language can do anything in theory, but the way means.
because c's function is static, when compiled, suppose, we have 2 object x and y.
when we call x.a() and y.a(), because a() is a static function, if infomation about x and y is not sent to the function, it will not know. think again..., no, it cannot. so "oop in c" is done on the base of a(self,args,...), such way.
the ooc.pdf is also in the base.
that hurts. say x.a(arg1).b(arg2).c(arg3) can never written in its way, instead, should be c(b(a(x, arg1),arg2),arg3) . think if you should write 1+2*3-4 in way of "- + 1 * 2 3 4 ", the same meaning.
that is language, a language can do anything in theory, but the way means.
2009年4月15日星期三
2009年4月8日星期三
2009年4月3日星期五
github bug?
新使用了github, git第一次用,我怀疑git没用对,但是其实像是github的bug,新的branch显示不出来。 git 比svn好的地方就是commit不用每次传到remote,可以在需要的时候做, 提高的传输的速度。
2009年4月2日星期四
订阅:
评论 (Atom)