??xml version="1.0" encoding="utf-8" standalone="yes"?>久久乐国产精品亚洲综合,成人久久免费网站,久久国产AVJUST麻豆http://www.shnenglu.com/jinq0123/archive/2022/04/24/229292.html金庆金庆Sun, 24 Apr 2022 06:01:00 GMThttp://www.shnenglu.com/jinq0123/archive/2022/04/24/229292.htmlhttp://www.shnenglu.com/jinq0123/comments/229292.htmlhttp://www.shnenglu.com/jinq0123/archive/2022/04/24/229292.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/229292.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/229292.htmlTortoiseGit is OK but GitExtensions fails

GitExtensions and Git fail:

      "git" pull --progress "origin"
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Done
Press Enter or Esc to exit...

    

But TortoiseGit is OK.

      git.exe pull --progress -v --no-rebase "origin"
From github.com:jinq0123/recastnavigation
= [up to date]      master      -> origin/master
= [up to date]      release-2.0 -> origin/release-2.0
Already up to date.

    

ssh -T shows that the reason is there is no id files:

      PS d:\github> ssh -vT git@github.com
OpenSSH_for_Windows
debug1: Connecting to github.com [20.205.243.166] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\jinqing/.ssh/id_rsa type -1
debug1: identity file C:\\Users\\jinqing/.ssh/id_xmss-cert type -1
debug1: Authenticating to github.com:22 as 'git'
debug1: Host 'github.com' is known and matches the ED25519 host key.
debug1: Found key in C:\\Users\\jinqing/.ssh/known_hosts:2
debug1: Will attempt key: C:\\Users\\jinqing/.ssh/id_rsa
debug1: Will attempt key: C:\\Users\\jinqing/.ssh/id_xmss
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\jinqing/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\jinqing/.ssh/id_xmss
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).
PS d:\github>

    

Copy my RSA key file rsa.ppk that TortoiseGit uses as ~/.ssh/id_rsa:

      PS D:\jinqing\github_jinq\recastnavigation> ssh -T git@github.com
Load key "C:\\Users\\jinqing/.ssh/id_rsa": invalid format
git@github.com: Permission denied (publickey).
PS D:\jinqing\github_jinq\recastnavigation>

    

Open TortoiseGit/bin/puttygen.exe, load rsa.ppk, then Convensionis->Export OpenSSH key as ~/.ssh/id_rsa:

      PS D:\jinqing\github_jinq\recastnavigation> ssh -T git@github.com
Hi jinq0123! You've successfully authenticated, ...

    

id_rsa begins with:

      -----BEGIN RSA PRIVATE KEY-----

    


金庆 2022-04-24 14:01 发表评论
]]>
命名http://www.shnenglu.com/jinq0123/archive/2020/12/31/217558.html金庆金庆Thu, 31 Dec 2020 01:45:00 GMThttp://www.shnenglu.com/jinq0123/archive/2020/12/31/217558.htmlhttp://www.shnenglu.com/jinq0123/comments/217558.htmlhttp://www.shnenglu.com/jinq0123/archive/2020/12/31/217558.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/217558.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/217558.html
摘自Q[警惕软g复杂度困局][1]

软g中的API、方法、变量的命名Q对于理解代码的逻辑、范围非帔R要,也是设计者清C达意囄关键?br />然而,在很多的目里我们没有给Naming /命名_的重视?br />
我们的代码一般会和一些项目关联,但是需要注意的是项目是抽象的,而代码是具体的?br />目或者品可以随意一些命名,如阿里云喜欢用中国古代神话(飞天、伏Ӏ女Ԍ命名pȝQ?br />K8s也是来自于希腊神话,q些都没有问题?br />而代码中的API、变量、方法不能这样命名?br />
一个不好的例子是前一D|们的Cluster API 被命名ؓTrident APIQ三叉戟Q,
设想一下代码中的对象叫TridentӞ我们如何理解在这个对象应该具备的行ؓQ?br />再对比一下K8s中的资源QPod, ReplicaSet, Service, ClusterIPQ?br />我们会注意到都是清晰、简单、直接符合其对象特征的命名。名实相W可以很大程度上降低理解该对象的成本?br />
有h?#8220;Naming is the most difficult part of software engineering”Q?br />或许也不完全是个玩笑话:Naming的难度在于对于模型的深入思考和抽象Q而这往往实是很隄?br />
需要注意的是:

QaQIntention vs what it is

需要避免用“是什?#8221;来命名,要用“for what / intention”?#8220;是什?#8221;来命名是会很Ҏ实现细节?br />比如我们?LeakedBarrel做rate limitingQ这个类最好叫 RateLimiterQ而不是LeakedBarrelQ?br />前者定义了意图Q做什么的Q,后?描述了具体实玎ͼ而具体实现可能会变化?br />再比?Cache vs FixedSizeHashMapQ前者也是更好的命名?br />
QbQ命名需要符合当前抽象的层

首先我们软g需要始l有清晰的抽象和分层?br />事实上我们Naming旉到困难,很多是因ؓ软g已经~Z明确的抽象和分层带来的表象而已?br />

[1]https://mp.weixin.qq.com/s?__biz=MzIzOTU0NTQ0MA==&mid=2247498895&idx=1&sn=35b1d00e367c18c3d4ed7d4b15b38996&chksm=e92ac180de5d4896fd5d789ffbe8c963986717b634f2dac09821c2b3ab2270a42f4a1c006ff5&scene=21#wechat_redirect

金庆 2020-12-31 09:45 发表评论
]]>
SVN重命名时不要更改内容http://www.shnenglu.com/jinq0123/archive/2019/09/20/216848.html金庆金庆Fri, 20 Sep 2019 06:45:00 GMThttp://www.shnenglu.com/jinq0123/archive/2019/09/20/216848.htmlhttp://www.shnenglu.com/jinq0123/comments/216848.htmlhttp://www.shnenglu.com/jinq0123/archive/2019/09/20/216848.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/216848.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/216848.html
(金庆的专?2019.9)

svn rename 某个文gq更改内容后提交Q历史就会丢失?br />如果 svn rename 后不改内容,立即提交Q就可以延箋原有历史?br />所以改名这L操作应该独立提交一ơ?br />
git 改名强大多了,会比较内容确定其原来的文件。但更改太多也会判断出错?br />

金庆 2019-09-20 14:45 发表评论
]]>
删除隐性的git submodulehttp://www.shnenglu.com/jinq0123/archive/2018/08/30/215889.html金庆金庆Thu, 30 Aug 2018 02:58:00 GMThttp://www.shnenglu.com/jinq0123/archive/2018/08/30/215889.htmlhttp://www.shnenglu.com/jinq0123/comments/215889.htmlhttp://www.shnenglu.com/jinq0123/archive/2018/08/30/215889.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/215889.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/215889.html删除隐性的git submodule

(金庆的专?2018.8)

正常的submodule会在 .gitmodule 文g中,TortoiseGit 会有 Submodule Update 菜单?br />q有一U隐性的 submodule, .gitmodule 文g中看不到它,无法 update.
golang开发中的vendor目录下经怼不小心添加一个带 .git 的目录,变成了一个假的submodule.
?Repo-browser 看这个目录是个submodule链接, clone 出来只有一个空目录?br />
删除q个submodule不能?git delete, 提交时会报错Q?br />
git.exe add -f [...]

fatal: pathspec 'src/vendor/github.com/grpc-ecosystem/grpc-opentracing' did not match any files

git did not exit cleanly (exit code 128)

git delete 父目录也无法提交?br />
但是可以直接删除Q不用git deleteQ? 然后提交qPush. 好像只有q个办法?br />




金庆 2018-08-30 10:58 发表评论
]]>
用docker stack开启redis集群http://www.shnenglu.com/jinq0123/archive/2017/10/26/215308.html金庆金庆Thu, 26 Oct 2017 04:08:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/10/26/215308.htmlhttp://www.shnenglu.com/jinq0123/comments/215308.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/10/26/215308.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/215308.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/215308.html用docker stack开启redis集群

(金庆的专?2017.10)

?个docker swarm节点Q开启redis cluster.
每个机器上开2个redis节点Q共10个redis节点?br />采用官方的redis:alpine镜像?br />
docker-stack.yml 如下Q?br />
version: "3"
services:
  redis001:
    image: redis:alpine
    volumes:
      - /home/redis/001/data:/data
      - /home/redis/001/conf:/conf
    command: redis-server --appendonly yes --cluster-enabled yes --cluster-config-file /conf/nodes.conf --cluster-announce-ip 10.240.79.8 --cluster-announce-port 7001 --cluster-announce-bus-port 17001
    ports:
      - "7001:6379"
      - "17001:16379"
    networks:
      - redisnet
    deploy:
      placement:
        constraints:
          - node.hostname == host-10-240-79-8

  redis002:
    image: redis:alpine
    volumes:
      - /home/redis/002/data:/data
      - /home/redis/002/conf:/conf
    command: redis-server --appendonly yes --cluster-enabled yes --cluster-config-file /conf/nodes.conf --cluster-announce-ip 10.240.79.9 --cluster-announce-port 7002 --cluster-announce-bus-port 17002
    ports:
      - "7002:6379"
      - "17002:16379"
    networks:
      - redisnet
    deploy:
      placement:
        constraints:
          - node.hostname == host-10-240-79-9

  redis003:
  ...
  redis010:
    ...
 
networks:
  redisnet:

数据保存文g?/home/redis/001/data
集群配置文g保存到 /home/redis/001/conf/nodes.conf  
各机器上目录需要预先创建,不然docker开启失败?br />q且需要设|目录权限,不然?Permission denied".
redis-server以用户uid=100(redis)q行Q所?br />    chown -R 100 /home/redis/

启动redis服务?
    docker stack deploy -c docker-stack.yml redis

redis-server启动后,q行 redis-trib.rb 来组?redis cluster:

    docker run --rm -it inem0o/redis-trib create --replicas 1 10.240.79.8:7001 10.240.79.9:7002 ... 10.240.79.12:7010

注意 inem0o/redis-trib 的说明中Q命令示例缺?"-it", 会报错退出:
Can I set the above configuration? (type 'yes' to accept): : undefined method `chomp' for nil:NilClass (NoMethodError)
        from /usr/bin/redis-trib:1295:in `create_cluster_cmd'
        from /usr/bin/redis-trib:1701:in `<main>'

q行 redis-cli 试Q?-c" 参数表示集群Q可q接L机器?001-7010L端口Q?br />[root@host-10-240-79-9 ~]# docker run -it --rm redis:alpine redis-cli -h 10.240.79.8 -p 7006 -c
10.240.79.8:7006> get a
-> Redirected to slot [15495] located at 10.240.79.10:7003
(nil)

用swarm mode开启redis服务比较方便?br />但是Z性能考虑Q应该禁?swarm 的NAT转发和负载均衡?br />研究了下Q暂时还没学会?br />


金庆 2017-10-26 12:08 发表评论
]]>
Lua区分公有U有接口http://www.shnenglu.com/jinq0123/archive/2017/08/18/215169.html金庆金庆Fri, 18 Aug 2017 10:51:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/08/18/215169.htmlhttp://www.shnenglu.com/jinq0123/comments/215169.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/08/18/215169.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/215169.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/215169.htmlLua区分公有U有接口

(金庆的专?2017.8)

Lua语言没有提供public, private的概念,所有模块或cM的接口都是公有的?br />
可以通过注释来区分公有私有接口?br />
ldoc 提供了一?@section 标签Q可用作此功?br />
--- Test module.
-- @module my_mod
local M = {}

--- Public functions
-- @section public

--- foo.
-- @int a a test input
-- @treturn int result
function M.foo(a)
    return a + 1
end

--- Private functions
-- @section private

--- goo.
-- @int a a test input
-- @treturn int result
function M.goo(a)
    return a + 2
end

return M

ldoc 生成文档后是q样的:

金庆 2017-08-18 18:51 发表评论
]]>
Lua53 premakehttp://www.shnenglu.com/jinq0123/archive/2017/02/18/214686.html金庆金庆Sat, 18 Feb 2017 14:18:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/02/18/214686.htmlhttp://www.shnenglu.com/jinq0123/comments/214686.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/02/18/214686.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214686.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214686.htmlLua53 premake

(金庆的专?2017.2)

参考:用premake5创徏lua532工程
      http://blog.csdn.net/jq0123/article/details/51242780

-- premake5.lua
--[[
Usage examples:
   for windows: premake5.exe --os=windows vs2015
   fot linux:   premake5.exe --os=linux gmake
]]

workspace "lua53"
   configurations { "Debug", "Release" }
   targetdir "bin/%{cfg.buildcfg}"

   language "C++"
   -- Force VS to compile as C++.
   -- https://github.com/premake/premake-core/issues/142
   filter "action:vs*"
      buildoptions "/TP"

   filter "system:windows"
      defines { "LUA_BUILD_AS_DLL" }

   filter "configurations:Debug"
      defines { "DEBUG" }
      flags { "Symbols" }

   filter "configurations:Release"
      defines { "NDEBUG" }
      optimize "On"

project "lua53"
   kind "ConsoleApp"
   files { "src/lua.c" }
   links { "lua53_shared_lib" }   

project "luac53"
   kind "ConsoleApp"
   files { "src/luac.c" }
   links { "lua53_static_lib" }  -- Link error on Windows if link lua53 shared lib.   

project "lua53_shared_lib"
   kind "SharedLib"
   targetname "lua53"
   files { "src/*.h", "src/*.c" }
   removefiles { "src/lua.c", "src/luac.c" }

project "lua53_static_lib"
   kind "StaticLib"
   targetname "lua53"
   filter "system:windows"
      targetprefix "lib"  -- liblua53.lib
   filter {}
   files { "src/*.h", "src/*.c" }
   removefiles { "src/lua.c", "src/luac.c" }
      
更改之处Q?br />* VS强制按C++~译
* 创徏动态库和静态库
* lua53.exe 链接动态库Qluac53.exe 链接静态库
  因ؓ luac53.exe 链接动态库~?个函数未导出?br />* d?LUA_BUILD_AS_DLLQ不?lua53.dll 不会生成 lua53.lib   
 

金庆 2017-02-18 22:18 发表评论
]]>
ejabberd开发和部vhttp://www.shnenglu.com/jinq0123/archive/2016/10/31/214369.html金庆金庆Mon, 31 Oct 2016 09:13:00 GMThttp://www.shnenglu.com/jinq0123/archive/2016/10/31/214369.htmlhttp://www.shnenglu.com/jinq0123/comments/214369.htmlhttp://www.shnenglu.com/jinq0123/archive/2016/10/31/214369.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214369.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214369.html

ejabberd开发和部v


(金庆的专?2016.10)


搭徏了自qejabberd集群Q然后少量更Ҏ码,实现定制的XMPP服务器?/p>

从github fork ejabberd 库,定ؓ master 分支跟踪原始?master 分支Q版本升U时从原库合q一ơ?/p>

?6.09版本分一?dev 分支Q自q代码在q个 dev 分支上写?/p>

服务器从源码~译安装?/p>

代码更改后,make install, 然后 ejabberd restart, 或?ejabberd update all.

如果有配|更改,则还要更?/etc/ejabberd/ejabberd.yml.

未来d版本升后,可重新开个dev2分支Q将dev的更改合q到dev2.




金庆 2016-10-31 17:13 发表评论
]]>
Windowsq行GitStatshttp://www.shnenglu.com/jinq0123/archive/2016/05/31/213614.html金庆金庆Tue, 31 May 2016 03:51:00 GMThttp://www.shnenglu.com/jinq0123/archive/2016/05/31/213614.htmlhttp://www.shnenglu.com/jinq0123/comments/213614.htmlhttp://www.shnenglu.com/jinq0123/archive/2016/05/31/213614.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/213614.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/213614.htmlWindowsq行GitStats

(金庆的专?

GitStats - git history statistics generator
http://gitstats.sourceforge.net/

GitStats是gitl计工具?br />只是一个python脚本Q?gnuplot d?br />Windows下运行需要安?python, git, gnuplot.
需要设|path, 使这些工具可以在命o行中使用?br />q需要用?wc 工具Q我?“Git for Windows” 正好有个 sh.exe, 其中带了 wc,
所以打开 git ?sh.exe, q入 GitStats 目录Q按说明q行脚本Q?br />
jinqing@ZT-2203857 MINGW64 /e/git/gitstats (master)
$ python gitstats /e/server_master /e/temp/server_master

会出?import gitstats 错误Q需要先?gitstats 复制?gitstats.py.

l果?index.html?br />
因ؓ无法qo文gQ所以统计中都是些其他文Ӟ
例如无法Lua文g排除Q无法排除依赖库?br />
提供的参数有如下:
jinqing@ZT-2203857 MINGW64 /e/git/gitstats (master)
$ python gitstats

Usage: gitstats [options] <gitpath..> <outputpath>

Options:
-c key=value     Override configuration value

Default config values:
{'project_name': '', 'processes': 8, 'max_domains': 10, 'commit_begin': '', 'max
_ext_length': 10, 'commit_end': 'HEAD', 'linear_linestats': 1, 'style': 'gitstat
s.css', 'max_authors': 20, 'authors_top': 5, 'start_date': ''}

Please see the manual page for more details.


金庆 2016-05-31 11:51 发表评论
]]>
CMake搜烦Boost1.57p|及解?/title><link>http://www.shnenglu.com/jinq0123/archive/2015/01/20/209584.html</link><dc:creator>金庆</dc:creator><author>金庆</author><pubDate>Tue, 20 Jan 2015 04:18:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2015/01/20/209584.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/209584.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2015/01/20/209584.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/209584.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/209584.html</trackback:ping><description><![CDATA[<div><div class="nzhfvhd" id="article_content"> <p>CMake更新?.1.0QBoost更新?.57Q结果CMake搜烦Boostp|Q?/p><p><span style="color:#FF0000;">  Unable to find the Boost header files.  Please set BOOST_ROOT to the root<br />  directory containing Boost or BOOST_INCLUDEDIR to the directory containing<br />  Boost's headers.<br /></span>  <br />已设|环境变?BOOST_ROOT = C:\Boost</p><p>查看 FindBoost.cmake 脚本Q发现它仅搜索已知的版本Q而最新版 1.57 q未dQ?br /></p><p><span style="color:#990000;">  set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}<br />    "1.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54"<br />    "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"<br />    "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1"<br /><br /></span>d “1.57” 后即成功?/p><p>FindBoost.cmake 应该d Boost 未来版本才好?/p><p><br /></p> </div></div><img src ="http://www.shnenglu.com/jinq0123/aggbug/209584.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">金庆</a> 2015-01-20 12:18 <a href="http://www.shnenglu.com/jinq0123/archive/2015/01/20/209584.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CMake讄FOLDERp|及解?/title><link>http://www.shnenglu.com/jinq0123/archive/2014/12/07/209051.html</link><dc:creator>金庆</dc:creator><author>金庆</author><pubDate>Sun, 07 Dec 2014 15:11:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2014/12/07/209051.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/209051.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2014/12/07/209051.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/209051.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/209051.html</trackback:ping><description><![CDATA[<div>CMake可以讄FOLDER属性,用来分目录组lVC中的多个工程?br /><ul><li><strong><code>FOLDER</code></strong>: Set the folder name. Use to organize targets in an IDE.<br /><p>Targets with no FOLDER property will appear as top level entities in IDEs like Visual Studio. Targets with the same FOLDER property value will appear next to each other in a folder of that name. To nest folders, use FOLDER values such as 'GUI/Dialogs' with '/' characters separating folder levels.</p></li></ul><p><br /></p><p>Ҏ如下Q?/p><p><div><span style="color: #333300;">Add this to the top level CMakeLists.txt</span><br /><span style="color: #333300;">#Use solution folders.</span><br /><span style="color: #333300;">set_property(GLOBAL PROPERTY USE_FOLDERS ON)</span><br /><br /><span style="color: #333300;"># Then in some target add this to put the target in the Development folder.</span><br /><span style="color: #333300;">set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Development)</span></div><br /></p>不过VcExpress因ؓ不支持工E目录,所以FOLDER属性无效?p><br /></p><p>因ؓ机器上同时安装了VC和VcExpressQCMakeL判断为Express版,所以FOLDER讄L无效?/p><p>最l打开sln文g看到了头部的q行才找到问题原因:</p><p><span style="color:#660000;"># Visual C++ Express</span></p><p><br /></p><p>然后在CMake源码中找CExpress版本代码:</p><p><span style="font-family:Courier New;color:#660000;">  this->ExpressEdition = cmSystemTools::ReadRegistryValue(<br />    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\14.0\\Setup\\VC;"<br />    "ProductDir", vc14Express, cmSystemTools::KeyWOW64_32);<br /></span></p>删除该注册表就不会被判为Express版了QFOLDER讄成功?/div><img src ="http://www.shnenglu.com/jinq0123/aggbug/209051.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">金庆</a> 2014-12-07 23:11 <a href="http://www.shnenglu.com/jinq0123/archive/2014/12/07/209051.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>代码那些事之命名http://www.shnenglu.com/jinq0123/archive/2014/11/04/208774.html金庆金庆Tue, 04 Nov 2014 13:00:00 GMThttp://www.shnenglu.com/jinq0123/archive/2014/11/04/208774.htmlhttp://www.shnenglu.com/jinq0123/comments/208774.htmlhttp://www.shnenglu.com/jinq0123/archive/2014/11/04/208774.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/208774.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/208774.html

摘自Q代码那些事之命?#8203;——《可M码的艺术》读后感

http://bj007.blog.51cto.com/1701577/1309002

选择具体的词

比如GetPage函数命名?/span>Get比较空泛,可能有几U情况,比如从文件读取、去q处获取、去数据库查询、或者就是简单地从返回成员变量,如果一切都?/span>Get需要扒开具体实现才可能确定到底用哪种方式。如果我们可以选择更具体的词,比如文gd?/span>Read或?/span>Load、远E获取用Fetch、数据库查询?/span>Query、简单返回成员变量时候采?/span>GetQƈ且整个项目保持一_可能仅仅看到名字可以闪现出对应的场景。将信息塞进名字中的一部分是选择很具体、避免空泛的一些词?/span>


避免误解?/span>

被误解是很受伤的一件事Q但是我们的命名尝别误解Q而且q常常是整个意思反q来了。因此在查名字的时候就是主动问下自?#8220;别h对于q个名字是否有不同的解读Q?#8221;。比如如下代码:

results = Database.all_objects.filter("year <= 2011")

其中Q?/span>results会包含什么呢Q?/span>问题出?/span>filter上,可能是过滤掉、也可能是过滤出。徏议就是如果要qo出,select()会更好,如果要过滤掉Q?/span>exclude()会更好?/p>




金庆 2014-11-04 21:00 发表评论
]]>
TSVN客户端复制文?/title><link>http://www.shnenglu.com/jinq0123/archive/2014/08/17/208041.html</link><dc:creator>金庆</dc:creator><author>金庆</author><pubDate>Sun, 17 Aug 2014 01:44:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2014/08/17/208041.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/208041.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2014/08/17/208041.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/208041.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/208041.html</trackback:ping><description><![CDATA[<div><p>TSVN客户端复制文?/p><p><br /></p><p>代码重构中,可能需要将一个大文g拆分?个小文gQ同时要保证拆分后的文件承原来的SVN历史记录?br /></p><p>TSVN客户端只有Rename功能Q没有Copy功能?/p><p>可进入Browser界面Q直接在服务器文件列表中复制Q但是服务器端复制会产生一个版本,q个版本多半是无法构建的?/p><p>用Rename-Revert可在客户端生文件复Ӟq保留历史记录?/p><p>1. Rename到新的文件。此时旧文g会被删除?/p><p>2. Revert被删除的文g。注意新增的文g不要Revert。之后旧文g被恢复?/p></div><img src ="http://www.shnenglu.com/jinq0123/aggbug/208041.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">金庆</a> 2014-08-17 09:44 <a href="http://www.shnenglu.com/jinq0123/archive/2014/08/17/208041.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CMake生成版本?/title><link>http://www.shnenglu.com/jinq0123/archive/2012/08/15/187268.html</link><dc:creator>金庆</dc:creator><author>金庆</author><pubDate>Wed, 15 Aug 2012 04:30:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2012/08/15/187268.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/187268.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2012/08/15/187268.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/187268.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/187268.html</trackback:ping><description><![CDATA[<div>CMake生成版本?br /><br />Q金庆的专栏Q?br /><br />原来的CMake需要用shell脚本生成SVN版本P再作为cmake参数传入?br /><br />CMake调用脚本CZQ?br /><br /><span style="font-family:Courier New;color:#660000;">#!/bin/sh<br /># cmake.sh<br /><br />ServerCodeRoot=~/Code/Server<br />CodeRevNum=`svn info ${ServerCodeRoot} | grep Revision | awk -F' ' '{ print $2 }'`<br />cmake S{ServerCodeRoot} -DCMAKE_BUILD_TYPE=Release -DVERSION_REVISION=S{CodeRevNum}<br /></span><br />CMakeLists.txt中如下配|:<br /><span style="font-family:Courier New;color:#660000;">configure_file(<br />  "Version.h.in"<br />  "Version.h"<br />)</span><br /><br />Version.h.in如下Q?br /><br /><span style="font-family:Courier New;color:#660000;">#include <string><br />const std::string VERSION_MAJOY("1");<br />const std::string VERSION_MINOR("0");<br />const std::string VERSION_REVISION("@VERSION_REVISION@");<br /></span><br />Linux下执行cmake.sh会自动替换SVN版本受?br /><br />现改为用FIND_PACKAGE(Subversion)方式Q不必用shell脚本生成SVN版本P<br />q且在Windows上也可以生成版本? cmake调用时不必传VERSION_REVISION参数?br /><br />CMakeLists.txt改ؓQ参考了开源网游ryzom的CMakeQ:<br /><br /><span style="font-family:Courier New;color:#660000;">SET(ROOT_DIR ${PROJECT_SOURCE_DIR})<br />IF(EXISTS "${ROOT_DIR}/.svn/")<br />  FIND_PACKAGE(Subversion)<br /><br />  IF(SUBVERSION_FOUND)<br />    Subversion_WC_INFO(${ROOT_DIR} Project)<br />    SET(VERSION_REVISION ${Project_WC_REVISION})<br />  ENDIF(SUBVERSION_FOUND)<br />ENDIF(EXISTS "${ROOT_DIR}/.svn/")<br /><br />CONFIGURE_FILE(<br />  "Version.h.in"<br />  "Version.h"<br />)</span><br /><br />如果不是SVN, 而是用Hg, 可用如下脚本Q?br /><span style="font-family:Courier New;color:#660000;">IF(EXISTS "${ROOT_DIR}/.hg/")<br />  FIND_PACKAGE(Mercurial)<br /><br />  IF(MERCURIAL_FOUND)<br />    Mercurial_WC_INFO(${ROOT_DIR} ER)<br />    SET(REVISION ${ER_WC_REVISION})<br />    SET(CHANGESET ${ER_WC_CHANGESET})<br />    SET(BRANCH ${ER_WC_BRANCH})<br />  ENDIF(MERCURIAL_FOUND)<br />ENDIF(EXISTS "${ROOT_DIR}/.hg/")<br /></span></div><img src ="http://www.shnenglu.com/jinq0123/aggbug/187268.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">金庆</a> 2012-08-15 12:30 <a href="http://www.shnenglu.com/jinq0123/archive/2012/08/15/187268.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CMake区分debug、release版本http://www.shnenglu.com/jinq0123/archive/2012/03/27/169143.html金庆金庆Tue, 27 Mar 2012 05:56:00 GMThttp://www.shnenglu.com/jinq0123/archive/2012/03/27/169143.htmlhttp://www.shnenglu.com/jinq0123/comments/169143.htmlhttp://www.shnenglu.com/jinq0123/archive/2012/03/27/169143.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/169143.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/169143.html

摘自Q?http://www.shnenglu.com/tx7do/archive/2010/08/19/124000.html


建立debug/release两目录,分别在其中执行cmake -DCMAKE_BUILD_TYPE=DebugQ或ReleaseQ,需要编译不同版本时q入不同目录执行make卛_Q?/p>

Debug版会使用参数-gQRelease版?O3 –DNDEBUG



金庆 2012-03-27 13:56 发表评论
]]>
数据库的版本控制是必ȝhttp://www.shnenglu.com/jinq0123/archive/2012/03/08/167395.html金庆金庆Thu, 08 Mar 2012 06:17:00 GMThttp://www.shnenglu.com/jinq0123/archive/2012/03/08/167395.htmlhttp://www.shnenglu.com/jinq0123/comments/167395.htmlhttp://www.shnenglu.com/jinq0123/archive/2012/03/08/167395.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/167395.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/167395.html

摘自Q程序员开发利器:源代码管理的十条

Q?nbsp;http://tech.it168.com/a2012/0307/1321/000001321198_1.shtml Q?/p>


数据库的版本控制是必ȝ

q是有很多h惛_Q但是觉得很困难而做不到的一炏V这里的问题是,很多应用没有数据库根本无法运行。所以如果你不把数据库加入版本控制的话,你的应用是不完整的?br />
大部分的版本控制pȝ只针Ҏ件系l工作,例如 HTMLQCSSQ图片,配置文g{等M保存在文件系l中的东ѝ但是对于数据库中的数据却无能ؓ力?br />
不过现在也有一些数据库版本控制工具Q例?Red Gate 出品?SQL Source Control。关于这个工h曄写过很详l的文章 Rocking your SQL Sourc Control world with Red GateQ我在这里就不赘qC。MQ数据库的版本控制也很容易了!

金庆 2012-03-08 14:17 发表评论
]]>
MySQL无法本地q接http://www.shnenglu.com/jinq0123/archive/2011/10/21/158831.html金庆金庆Fri, 21 Oct 2011 08:27:00 GMThttp://www.shnenglu.com/jinq0123/archive/2011/10/21/158831.htmlhttp://www.shnenglu.com/jinq0123/comments/158831.htmlhttp://www.shnenglu.com/jinq0123/archive/2011/10/21/158831.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/158831.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/158831.htmlMySQL无法本地q接

Q金庆的专栏Q?br />
Linux重启后,发现不知怎么的MySQL无法本地q接?br />
l果phpMyAdmin, Zentao都无法正常工作了?br />
q程的连接用了TCP是正常的Q本地连接用了本地socket, 有问题?br />
本地q行mysql客户端会报错Q?br />Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

重启mysql服务也报错:
# service mysql restart
MySQL server PID file could not be found!
Starting MySQL... ...The server quit without updating PID file (/var/lib/mysql/localhost/localdomain.pid)

?pid文g不存在。所以无法关闭mysql. 正在q行的mysql服务一直无法关闭?br />
参考:http://zhujipi.com/vps/109.html
说明QMysql的进E卡MQ这时用p把这些卡ȝq程都关闭?br />
mysql服务重启成功后恢复正常?br />

金庆 2011-10-21 16:27 发表评论
]]>
讑֮“svn:needs-lock”属?/title><link>http://www.shnenglu.com/jinq0123/archive/2011/10/12/158128.html</link><dc:creator>金庆</dc:creator><author>金庆</author><pubDate>Wed, 12 Oct 2011 06:33:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2011/10/12/158128.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/158128.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2011/10/12/158128.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/158128.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/158128.html</trackback:ping><description><![CDATA[<div><p>摘自Q?http://www.cnblogs.com/LittleFox/archive/2009/04/08/1431781.html</p><p><br /></p><p><span id="comment_body_1498206">讑֮“svn:needs-lock”属?br />使用命o行锁?#8220;介绍.doc”Q?br /><br />svn propset svn:needs-lock 'x' 介绍.doc<br /><br />q?行这个命令后Q?#8220;介绍.doc”已l是讄?#8220;svn:needs-lock ”Q但Z使之生效q要q行“svn commit”Q之后其他用户update的时候就会发现这个文件已l是只读的了。需要注意的是我们设|的属性值是“x”Q实际上L值都可以Q? Subversion会忽略其内容?br /><br />使用TortoiseSVN讑֮属性也很简单:<br /><br />“介绍.doc”右键选中- >属?>Subversion选项?>properties->addQ然后在弹出的窗口中的property name选择“svn:needs-lock”QgQ意,然后选择OK。之后再提交“介绍.doc”卛_?/span><br /></p></div><img src ="http://www.shnenglu.com/jinq0123/aggbug/158128.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">金庆</a> 2011-10-12 14:33 <a href="http://www.shnenglu.com/jinq0123/archive/2011/10/12/158128.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>lVS2005的编辑器d双界线http://www.shnenglu.com/jinq0123/archive/2011/09/19/156235.html金庆金庆Mon, 19 Sep 2011 07:53:00 GMThttp://www.shnenglu.com/jinq0123/archive/2011/09/19/156235.htmlhttp://www.shnenglu.com/jinq0123/comments/156235.htmlhttp://www.shnenglu.com/jinq0123/archive/2011/09/19/156235.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/156235.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/156235.html

转自Q?http://www.cnblogs.com/duzouzhe/archive/2009/08/05/1539292.html


 

好的代码风格是生成高质量软g的基Q其中有一点就是代码的每行不能太长Q一般徏议每行不过80个字W?br /> VS2005里面有个隐藏的功能是可以讄~辑器的边界Uѝ创Z个VS2005_Guideline.reg文gQ内容ؓQ?br />
Windows Registry Editor Version 5.00
QHKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text EditorQ?br /> "Guides"="QԌQ?128,0,0) 80, 120"

然后其导入注册表,重启VS2005后就看到我们创徏的两条边界线Q分别在80?20的地方(如果只需创徏一条边界线Q可以把",120"LQ。用上面的技巧我们在写代码时可以很直观地看C码是否超q每行规定的边界了?/div>


金庆 2011-09-19 15:53 发表评论
]]>
svn日志qhttp://www.shnenglu.com/jinq0123/archive/2011/08/08/152762.html金庆金庆Mon, 08 Aug 2011 03:12:00 GMThttp://www.shnenglu.com/jinq0123/archive/2011/08/08/152762.htmlhttp://www.shnenglu.com/jinq0123/comments/152762.htmlhttp://www.shnenglu.com/jinq0123/archive/2011/08/08/152762.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/152762.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/152762.htmlsvn日志q

Q金庆的专栏Q?br />
Windows上用TortoiseSVN提交, 在Linux上查看日志时昄的是q.
中文字符变成了一个问号和一?q制? ? ?\227?br />
日志输Zؓxml: svn log -r 123456 --xml > log.xml
然后用iconv手工转成GB2312昄:
iconv -f utf8 -t GB2312 log.xml
可以发现iconv报告: 未知 nn 处的非法输入序列.

此处是一个横? "—", GB2312码ؓ0xa1aa, utf8码ؓ0xe28094,
iconvsvn日志uft8转GB2312时失? 所以才昄Zؕ?

iconv 可以?0xa1aa 转成 0xe28094, 但是不能反向?
q有一个稍短点的横? 0xe28095, GB2312码ؓ0xa844,
iconv可以从GB2312转成utf8, 但是utf8转GB2312p|.

不知有没有办法让svn忽略无法转换的字W? q样整条日志q是可以看到.

在linux上svn直接提交的长横杠昄是正常的,
GB码是0xa1aa, xml日志中utf8码是0xe28095.


金庆 2011-08-08 11:12 发表评论
]]>
|游更新安全W一http://www.shnenglu.com/jinq0123/archive/2010/05/19/115822.html金庆金庆Wed, 19 May 2010 09:51:00 GMThttp://www.shnenglu.com/jinq0123/archive/2010/05/19/115822.htmlhttp://www.shnenglu.com/jinq0123/comments/115822.htmlhttp://www.shnenglu.com/jinq0123/archive/2010/05/19/115822.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/115822.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/115822.htmld某个功能或修正某一个错误时Q应该将变更的范围尽量控制在最范围?
量不要造成对其他现有功能的影响?nbsp; 阅读全文

金庆 2010-05-19 17:51 发表评论
]]>
C++试框架的选择http://www.shnenglu.com/jinq0123/archive/2010/04/13/112430.html金庆金庆Tue, 13 Apr 2010 02:53:00 GMThttp://www.shnenglu.com/jinq0123/archive/2010/04/13/112430.htmlhttp://www.shnenglu.com/jinq0123/comments/112430.htmlhttp://www.shnenglu.com/jinq0123/archive/2010/04/13/112430.html#Feedback1http://www.shnenglu.com/jinq0123/comments/commentRss/112430.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/112430.html阅读全文

金庆 2010-04-13 10:53 发表评论
]]>
圈复杂度和代码覆盖率http://www.shnenglu.com/jinq0123/archive/2010/03/09/109242.html金庆金庆Tue, 09 Mar 2010 01:42:00 GMThttp://www.shnenglu.com/jinq0123/archive/2010/03/09/109242.htmlhttp://www.shnenglu.com/jinq0123/comments/109242.htmlhttp://www.shnenglu.com/jinq0123/archive/2010/03/09/109242.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/109242.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/109242.html阅读全文

金庆 2010-03-09 09:42 发表评论
]]>
如何保持软g开发团队的E_?/title><link>http://www.shnenglu.com/jinq0123/archive/2010/01/20/106061.html</link><dc:creator>金庆</dc:creator><author>金庆</author><pubDate>Wed, 20 Jan 2010 05:18:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2010/01/20/106061.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/106061.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2010/01/20/106061.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/106061.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/106061.html</trackback:ping><description><![CDATA[     摘要: 保持团队的稳定性说来容易,其实对于每一个优U的研发经理和公司CEO都非常具有挑战性,其是员工很多时候ƈ不能意识到这一点和理解领导层的压力。就好比单n汉不能理解父亲的心情一栗?nbsp; <a href='http://www.shnenglu.com/jinq0123/archive/2010/01/20/106061.html'>阅读全文</a><img src ="http://www.shnenglu.com/jinq0123/aggbug/106061.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">金庆</a> 2010-01-20 13:18 <a href="http://www.shnenglu.com/jinq0123/archive/2010/01/20/106061.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>随机数生成器应该如何单元试Q?/title><link>http://www.shnenglu.com/jinq0123/archive/2010/01/09/105236.html</link><dc:creator>金庆</dc:creator><author>金庆</author><pubDate>Sat, 09 Jan 2010 04:24:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2010/01/09/105236.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/105236.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2010/01/09/105236.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/105236.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/105236.html</trackback:ping><description><![CDATA[     摘要: 有个随机数生成函敎ͼ按以下分布随机生??-100的整敎ͼ90%概率?-50Q?0%概率?1-100. <br>单元试应该如何q行呢? <br>生成10000个数然后计算分布比例应该可以Q只要在90%上下q通过?<br>但是仍有极小可能产生试p|的可能?<br>如何做一个具有确定性结论的试用例Q?  <a href='http://www.shnenglu.com/jinq0123/archive/2010/01/09/105236.html'>阅读全文</a><img src ="http://www.shnenglu.com/jinq0123/aggbug/105236.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">金庆</a> 2010-01-09 12:24 <a href="http://www.shnenglu.com/jinq0123/archive/2010/01/09/105236.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>你愿意别人更改你的代码吗?http://www.shnenglu.com/jinq0123/archive/2009/11/21/101550.html金庆金庆Sat, 21 Nov 2009 04:55:00 GMThttp://www.shnenglu.com/jinq0123/archive/2009/11/21/101550.htmlhttp://www.shnenglu.com/jinq0123/comments/101550.htmlhttp://www.shnenglu.com/jinq0123/archive/2009/11/21/101550.html#Feedback2http://www.shnenglu.com/jinq0123/comments/commentRss/101550.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/101550.html( http://hi.baidu.com/kidcdf/blog/item/2cefd85c9d13f449fbf2c09f.html )
最后一? 没有一个h喜欢看着自己辛辛苦苦做的东西被反复删掉重?

个h觉得别h更改自己写的代码是我乐意接受? 不知大家有什么想?

你愿意别人更改你的代码吗?
A) 代码一旦提? 是大家公有的代? 无所谓谁改谁的代?
B) 很乐意有人愿意更改自q代码.
C) l不允许别h更改自己的代?
D) 看到自己的代码被人改?感到很受打击.

q有其他别的感受?  阅读全文

金庆 2009-11-21 12:55 发表评论
]]>
函数参数的理想个?/title><link>http://www.shnenglu.com/jinq0123/archive/2009/08/03/92059.html</link><dc:creator>金庆</dc:creator><author>金庆</author><pubDate>Mon, 03 Aug 2009 09:35:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2009/08/03/92059.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/92059.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2009/08/03/92059.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/92059.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/92059.html</trackback:ping><description><![CDATA[摘译? <br><br>Clean Code<br>A Handbook of Agile<br>Software Craftsmanship<br>Robert C. Martin<br><br><br>Function Arguments<br><br>The ideal number of arguments for a function is<br>zero (niladic). Next comes one (monadic), followed<br>closely by two (dyadic). Three arguments (triadic)<br>should be avoided where possible. More than three<br>(polyadic) requires very special justification—and<br>then shouldn’t be used anyway.<br><br>函数参数<br><br>函数参数的理想个数是零个Q零元)?br>其次是一个(一元)Q?br>紧接下来是两个(二元Q?br>三个参数Q三元)应尽可能地避免?br>三个以上的参敎ͼ多元Q需要非常特D的理由<br>————否则无论如何都不应该?br><br>Q{载请注明来源于金庆的专栏Q?br><br> <br><img src ="http://www.shnenglu.com/jinq0123/aggbug/92059.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">金庆</a> 2009-08-03 17:35 <a href="http://www.shnenglu.com/jinq0123/archive/2009/08/03/92059.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SVN中邪恶的replacehttp://www.shnenglu.com/jinq0123/archive/2009/06/18/87977.html金庆金庆Thu, 18 Jun 2009 06:53:00 GMThttp://www.shnenglu.com/jinq0123/archive/2009/06/18/87977.htmlhttp://www.shnenglu.com/jinq0123/comments/87977.htmlhttp://www.shnenglu.com/jinq0123/archive/2009/06/18/87977.html#Feedback8http://www.shnenglu.com/jinq0123/comments/commentRss/87977.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/87977.html
Q{载请注明来源于金庆的专栏Q?br>
用TSVN客户端删除一个文? 然后再新Z个同名文?
可以看到该文件上的图标被打上了TSVN的小U叉.
然后Add, Commit, ׃出现一条replace记录.
replace的操作会有个提示, 是Add(as replacement)...命o与普通的Add不同Q?br>
意思应该是该文件被替换?

邪恶之处是以前的更改日志昄不出来了.
用revision graph可以看到所有历? 只是在replace处是断裂?
也就是说替换的效果是重新开启一个文件的更改记录, 隐藏之前的记?
我想不出什么情况下需要这U功?

更邪恶的? revert changes from this revision会失?TSVN 1.4.3).
错误原因是该文g的上个版本不存在.
好像所有的Add操作都是无法revert, 应该是个缺陷吧?

Zq原该替换,d除该文g, 然后revert changes from this revision.




金庆 2009-06-18 14:53 发表评论
]]>
试替n(Test Double)的定?/title><link>http://www.shnenglu.com/jinq0123/archive/2009/05/18/83306.html</link><dc:creator>金庆</dc:creator><author>金庆</author><pubDate>Mon, 18 May 2009 10:52:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2009/05/18/83306.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/83306.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2009/05/18/83306.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/83306.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/83306.html</trackback:ping><description><![CDATA[摘自Qhttp://blog.vsharing.com/wooley/A801453.html<br><br> <p>  <strong>试替n</strong>(Test Double)<strong>的定?/strong> </p> <p> </p> <table class="MsoNormalTable" style="border: medium none ; width: 100%; border-collapse: collapse;" width="100%" border="1" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="border: 1pt dotted lightgrey; padding: 0.35pt;"> <p><strong>试替n型别</strong><strong></strong></p> </td> <td style="border-style: dotted dotted dotted none; border-color: lightgrey lightgrey lightgrey -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0.35pt;"> <p><strong>描述</strong><strong></strong></p> </td> </tr> <tr> <td style="border-style: none dotted dotted; border-color: -moz-use-text-color lightgrey lightgrey; border-width: medium 1pt 1pt; padding: 0.35pt;" valign="top"> <p>Dummy</p> </td> <td style="border-style: none dotted dotted none; border-color: -moz-use-text-color lightgrey lightgrey -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0.35pt;" valign="top"> <p>最单、最原始的测试替w型别。Dummy 没有实作Q最常用于需要参数g不用它的情cNull 可视为是 DummyQ但真的 Dummy 是接口或基类的衍生,且完全不包含实作?/p> </td> </tr> <tr> <td style="border-style: none dotted dotted; border-color: -moz-use-text-color lightgrey lightgrey; border-width: medium 1pt 1pt; padding: 0.35pt;" valign="top"> <p>Stub</p> </td> <td style="border-style: none dotted dotted none; border-color: -moz-use-text-color lightgrey lightgrey -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0.35pt;" valign="top"> <p>Dummy 的上一U,Stub 是接口或基类的最低限度实作。会传回 Void 的方法通常完全不包含实作,而会传回值的Ҏ通常会传回硬式编码的倹{?/p> </td> </tr> <tr> <td style="border-style: none dotted dotted; border-color: -moz-use-text-color lightgrey lightgrey; border-width: medium 1pt 1pt; padding: 0.35pt;" valign="top"> <p>Spy</p> </td> <td style="border-style: none dotted dotted none; border-color: -moz-use-text-color lightgrey lightgrey -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0.35pt;" valign="top"> <p>试 Spy cM StubQ但除了提供客户端可叫用成员的实例,Spy q会记录叫用了哪些成员,好让单元试验证所叫用的成员是否符合预期?/p> </td> </tr> <tr> <td style="border-style: none dotted dotted; border-color: -moz-use-text-color lightgrey lightgrey; border-width: medium 1pt 1pt; padding: 0.35pt;" valign="top"> <p>Fake</p> </td> <td style="border-style: none dotted dotted none; border-color: -moz-use-text-color lightgrey lightgrey -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0.35pt;" valign="top"> <p>Fake 包含更复杂的实作Q通常涉及所l承型别之不同成员之间的互动。虽然不是完整的生实作Q但 Fake 与生产实作很怼Q尽它会采取一些快h式?/p> </td> </tr> <tr> <td style="border-style: none dotted dotted; border-color: -moz-use-text-color lightgrey lightgrey; border-width: medium 1pt 1pt; padding: 0.35pt;" valign="top"> <p>Mock</p> </td> <td style="border-style: none dotted dotted none; border-color: -moz-use-text-color lightgrey lightgrey -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0.35pt;" valign="top"> <p>Mock 是由 Mock 链接库动态徏?(其他通常是由试开发h员用程序代码来产生)。测试开发h员永q看不到实作接口或基cȝ实际E序代码Q但是可以设?Mock 以提供传回倹{预期要叫用的特定成?..{等。视其中的设定而定QMock 的行为可能会?Dummy、Stub ?Spy?/p> </td> </tr> </tbody> </table>   <br><br><img src ="http://www.shnenglu.com/jinq0123/aggbug/83306.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">金庆</a> 2009-05-18 18:52 <a href="http://www.shnenglu.com/jinq0123/archive/2009/05/18/83306.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>解决TSVN的diff昄中文件不全的问题http://www.shnenglu.com/jinq0123/archive/2009/02/14/73780.html金庆金庆Sat, 14 Feb 2009 05:30:00 GMThttp://www.shnenglu.com/jinq0123/archive/2009/02/14/73780.htmlhttp://www.shnenglu.com/jinq0123/comments/73780.htmlhttp://www.shnenglu.com/jinq0123/archive/2009/02/14/73780.html#Feedback5http://www.shnenglu.com/jinq0123/comments/commentRss/73780.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/73780.html阅读全文

金庆 2009-02-14 13:30 发表评论
]]>
ƷŮþþ| þҹɫƷav| 㽶þҹɫƷ| 97Ʒ˾þþô߽97| һһþaþۺϾƷ| ƷþavĻ| ݺ޾þþþþۺ| Ʒþþһ| þþƷ99þ㽶| þƵ| 㽶þþƷ| ŷþһwwwwww.| þۺ㽶AV| þ˳ƷCAOPOREN| þݺҹҹվ | þþƷŷպƷ| ƷѾþþþӰԺ| þþƷ| þþþ99ƷƬëƬ | ũ帾ŮëƬƷþ| þĻavŮ| þþ99ƷƬĻ| 뾫ƷþþӰ| þٸ۲AV| þӰ㶮| ޾ƷþþþĻһڣ | þù㽶һƷ| þùƷþþƷ| ޹Ʒ˾þ| ƷþþþþþþþӰԺ| 999þþùƷ| þþþۺþ| ˺ݺۺϾþ88| 97þ㽶߿ۿ| 97þóƷɰ| Сڵþþþþ | Ʒ˾Ʒþþ| ŷ޹Ʒþѿ| 99þֻоƷ| þùƷ | ձձȾþþƷ|