小编Yaf*_*sky的帖子

VS Installer Solution 警告错误:编译期间“DLL 文件受 Windows 系统文件保护”

我正在用 C# 为 VS 项目构建安装程序解决方案。在编译过程中我得到以下信息warnings

WARNING: 'System.Linq.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Linq\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Linq.dll' is under Windows System File Protection.
WARNING: 'System.Net.Http.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll' is under Windows System File Protection.
WARNING: 'System.Collections.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Collections\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Collections.dll' is under Windows System File Protection.
WARNING: 'System.Runtime.Serialization.Primitives.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization.Primitives\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Serialization.Primitives.dll' is under Windows System File Protection.
WARNING: 'System.Diagnostics.Debug.dll' should be excluded because …
Run Code Online (Sandbox Code Playgroud)

c# dll compilation compiler-warnings vs-installer-project

5
推荐指数
0
解决办法
1506
查看次数

mongodb使用forEach更新所有文档的密钥

我想在Mongo“订单”字段中更新所有文档,因此它们将是1..2..3..4 .... 34。

运行此命令后,它们都具有“ order”:“ 34”。我究竟做错了什么?

var i = 1;
db.images.find().forEach(function() {
db.images.update(
        {},
        { "$set": {"order": NumberInt(i)} },
        { multi: true }
    );
    i++;
})
Run Code Online (Sandbox Code Playgroud)

foreach loops mongodb

3
推荐指数
1
解决办法
3383
查看次数

使用嵌套列表解压缩python的值太多了

list_a = [['name1', 4.12]]
list_b = [['name2', 2, 'name4', 4, 'name4', 1, 'name4', 6, 'name2', 6]]

def data_sums(matrix):
  sums = defaultdict(int)

  for name, value in matrix:
    sums[name] += value 

  result = [[k,v] for k,v in sums.items()]
  return result
Run Code Online (Sandbox Code Playgroud)

当我传递list_adata_sums它时,它返回[['name1', 4.12]](对于这个特定的情况,它没有任何总和).

当我传递list_bdata_sums它时,它返回一个错误:

对于名称,矩阵中的值:ValueError:要解压缩的值太多

我试图理解为什么会发生这种情况,但这两个列表的嵌套结构看起来完全相同.

python items nested-lists

2
推荐指数
1
解决办法
680
查看次数

在python中使用IfcOpenShell提取元素数量

我正在尝试ifc使用IfcOpenShellPython读取文件中对象的最深层次的数量。到目前为止,我有:

import ifcopenshell

path = r'D:\ifcos_1\slab.ifc'
ifc_file = ifcopenshell.open(path)

geometries = ifc_file.by_type("IfcProduct")

for geometry in geometries:
    if geometry.is_a("IfcSlab"):
        print geometry
        test = geometry.IfcPhysicalQuantity()
        print test
Run Code Online (Sandbox Code Playgroud)

我研究了定义

无论我尝试为 放置哪种类型的函数test = geometry.X(),我都会收到错误消息:

File "C:\Python27\lib\site-packages\ifcopenshell\entity_instance.py", line 48, in __getattr__
   "entity instance of type '%s' has no attribute '%s'" % (self.wrapped_data.is_a(), name))
AttributeError: entity instance of type 'IfcSlab' has no attribute 'IfcPhysicalQuantity'
Run Code Online (Sandbox Code Playgroud)

不知道如何解决这个问题,希望得到帮助。

编辑:

获得平板和进一步参考的进一步工作:

for geometry in geometries:
    if geometry.is_a("IfcSlab"):
        print geometry
        definedBy = geometry.IsDefinedBy

        print …
Run Code Online (Sandbox Code Playgroud)

python ifc

1
推荐指数
1
解决办法
4804
查看次数