Visual Studio的CopyLocal设置

这里看到一个老外也碰到了同样问题,明明在IDE里看到CopyLocal=true,却发现没有拷贝过去,“took me a while to figure out that Visual Studio 2008 is adirty liar when it comes to CopyLocal.”

真正有效的是<Private>True</Private>,如果没有它,就不保险一定会拷贝过去。

因为IDE里的CopyLocal碰到没有<private>设置的,就就…It turns out that the default for the CopyLocal setting is… something not quite True and not quite False.

是个三值的东西,

而具体决定它取什么实际值的是根据这里

这样,就有可能出现一台机器Ok,另一台机器不行的情况,因为里面有一条If the assembly is found in the global assembly cache, the value is false.

一个work around就是保证每个CopyLocal=true对应的csproj里都确实写着<Private>True</Private>,无论是通过文本编辑的方式,还是通过修改成false再改成true的方式。这样才能放之四海而皆准,每台机器的输出都一样。

如何减小SqlServer数据库文件大小

分两个部分:

1.log 文件,ldf.对老的sql server版本,用

BACKUP LOG BlogEngine WITH TRUNCATE_ONLY

如果新版的不支持该命令,用

BACKUP LOG BlogEngine TO DISK = ‘NUL:’

替代,参考来源是这里

但是这样缩小的log文件不会小于其初始尺寸,这个可以在管理工具里调整,应该也有命令行,懒得查了。

log size   2.主文件,mdf。 DBCC SHRINKDATABASE (数据库名,TRUNCATEONLY), Releases all free space at the end of the file to the operating system but does not perform any page movement inside the file. The data file is shrunk only to the last allocated extent. DBCC SHRINKDATABASE (数据库名,10),把空余的文件内部空间释放到仅留10%的待增长空间。 参考:微软官方文档

chmod 4755 中的4是啥意思

很多中文的文章都不愿意说清楚。或者只说后面三位。然后稍微提一下第一位。

http://en.wikipedia.org/wiki/Setuid

还是上述文章写得清晰:

The setuid and setgid bits are normally set with the command chmod by setting the high-order octet to 4 (for setuid) or 2 (for setgid). `chmod 6711` will set the setuid and setgid bit (6) make the file read/write/executable for the owner (7) and executable by the group (first 1) and others (second 1). All chmod flags are octal, and the least significant bit of the high-order octal digit is used for a special mode known as the sticky bit.