首页 \ 问答 \ 是否适合使用产品架构进行服务?(Would it be Appropriate to use the Product Schema for Services?)

是否适合使用产品架构进行服务?(Would it be Appropriate to use the Product Schema for Services?)

我感兴趣的是标记具有所有服务的页面。

我的特定行业Schema不提供span itemprop="itemOffered" 。 因此,我是否应该使每个服务页面反映产品架构而不是行业特定的项目类型,或者最好在服务页面上指定产品架构,然后在各个产品页面上使用行业特定的项目类型并列出产品使用makesoffer


I am interested in tagging the page that features all the services.

My particular industry Schema doesn't offer the span itemprop="itemOffered". Thus, should I make each the services page reflect the Product Schema rather than the industry specific itemtype, Or is it best to specify on the services page the product Schema and then on the individual product pages use the industry-specific itemtype and list the product using makesoffer?


原文:https://stackoverflow.com/questions/19231346
更新时间:2023-08-18 18:08

最满意答案

这里的例子是你可以适应和运作的:

https://docs.python.org/2/library/multiprocessing.html

您是否使用管理器对象来在进程之间共享内存。

在您的示例中,您使用管理器创建了一个字典,但是您使用正常字典将其删除

manager = Manager()
d = manager.dict()   # correct
d = dict([(c, 0) for c in C])  # d is not a manager.dict: no shared memory

而是这样做(测试,编译)

d = manager.dict([(c, 0) for c in C])

Example here that you could adapt and which works:

https://docs.python.org/2/library/multiprocessing.html

You have you use a manager object to be able to share memory between processes.

In your example you create a dictionary using the manager but you kill it with a normal dictionary the line after

manager = Manager()
d = manager.dict()   # correct
d = dict([(c, 0) for c in C])  # d is not a manager.dict: no shared memory

Instead do this (tested, compiles)

d = manager.dict([(c, 0) for c in C])

相关问答

更多
  • 我过去所做的是创建一个处理数据条目的“工人类”。 然后我将启动X个线程,每个线程运行一个worker类的副本。 数据集中的每个项目都会被推送到工作线程正在观察的队列中。 当队列中没有更多项目时,线程停转。 使用这种方法,我能够在大约3秒内使用5个线程处理10,000多个数据项。 当应用程序只有单线程时,这将花费更长的时间。 查看: http : //docs.python.org/library/queue.html What I've done in the past is to create a "wo ...
  • 由于您正在创建进程池,因此命令实际上是按顺序启动的,但您无法保证首先完成哪个进程。 您会注意到,每次运行代码时订单都会有所不同。 Since you are creating a pool of processes, the commands are actually started sequentially, but you have no guarantee on which process is going to finish first. You will notice that the order ...
  • 试试是: import geocoder import multiprocessing as mp import pandas as pd def reverse_gecode(coordinates): return geocoder.google(coordinates, method = 'reverse').postal if __name__ == '__main__': gps = pd.DataFrame({'lat': [27.950575, 40 ...
  • pd.DataFrame.from_dict可能就是您所需要的。 myStates = pd.DataFrame.from_dict(states, orient='index').reset_index() myStates.columns = ['a', 'b'] myStates.head(5) # a b # 0 OH Ohio # 1 KY Kentucky # 2 AS American Samoa # 3 N ...
  • 这两个例子对我来说都很好 - 也许你误解了它们应该如何工作? 在第一个例子中,当主线程运行时,它启动子进程并发送12.然后它等待加入子进程。 在那一刻,一切都停滞不前,因为孩子正在等待“退出”。 但是如果你按ctrl-C然后发送'exit',则子进程退出,第二次连接成功: > python3.3 example1.py 12 ...
  • 这里的例子是你可以适应和运作的: https://docs.python.org/2/library/multiprocessing.html 您是否使用管理器对象来在进程之间共享内存。 在您的示例中,您使用管理器创建了一个字典,但是您使用正常字典将其删除 manager = Manager() d = manager.dict() # correct d = dict([(c, 0) for c in C]) # d is not a manager.dict: no shared memory ...
  • 您不必自己实现并行性,有比urllib更好的库,例如请求[0]和使用线程或期货的一些衍生产品[1]。 我想你需要检查自己哪一个是最快的。 由于少量的依赖关系,我最喜欢请求 - 期货,这里我使用十个线程实现你的代码。 如果你相信或者发现它在某种程度上更好,那么图书馆甚至会支持流程: import pandas as pd import numpy as np import urllib import time import json from concurrent.futures import ThreadP ...
  • 使用pd.Series.to_dict方法 frame.groupby('A').B.median().to_dict() {'1': 6, '2': 5, '3': 2} Use the pd.Series.to_dict method frame.groupby('A').B.median().to_dict() {'1': 6, '2': 5, '3': 2}
  • #use from_dict and set orient to index and then transpose in the end. pd.DataFrame.from_dict(dictio,orient='index').T Out[263]: a c b 0 abc prq zyx #use from_dict and set orient to index and then transpose in the end. pd.DataFrame.from_dict ...
  • 你的问题是,make_slices返回一个字典,而不是一个列表,并且pool.map()不喜欢那个。 它只是将你的字典键传递给你的工作人员,这意味着他们是字符串(尝试打印你收到的inputDict )。 它不是字典,而是钥匙。 def make_slices(files, df): outlist = [] for item in files: data = df + item outlist.append({item: data}) return o ...

相关文章

更多

最新问答

更多
  • 如何检索Ember.js模型的所有属性(How to retrieve all properties of an Ember.js model)
  • maven中snapshot快照库和release发布库的区别和作用
  • arraylist中的搜索元素(Search element in arraylist)
  • 从mysli_fetch_array中获取选定的值并输出(Get selected value from mysli_fetch_array and output)
  • Windows Phone上的可用共享扩展(Available Share Extensions on Windows Phone)
  • 如何在命令提示符下将日期设置为文件名(How to set file name as date in command prompt)
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • 从iframe访问父页面的id元素(accessing id element of parent page from iframe)
  • linux的常用命令干什么用的
  • Feign Client + Eureka POST请求正文(Feign Client + Eureka POST request body)
  • 怎么删除禁用RHEL/CentOS 7上不需要的服务
  • 为什么Gradle运行测试两次?(Why does Gradle run tests twice?)
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在android中的活动之间切换?(Switching between activities in android?)
  • Perforce:如何从Depot到Workspace丢失文件?(Perforce: how to get missing file from Depot to Workspace?)
  • Webform页面避免运行服务器(Webform page avoiding runat server)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 内存布局破解(memory layout hack)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • 我们可以有一个调度程序,你可以异步添加东西,但会同步按顺序执行吗?(Can we have a dispatcher that you can add things todo asynchronously but will be executed in that order synchronously?)
  • “FROM a,b”和“FROM a FULL OUTER JOIN b”之间有什么区别?(What is the difference between “FROM a, b” and “FROM a FULL OUTER JOIN b”?)
  • Java中的不可变类(Immutable class in Java)
  • bat批处理文件结果导出到txt
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • 德州新起点计算机培训学校主要课程有什么?
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • “latin1_german1_ci”整理来自哪里?(Where is “latin1_german1_ci” collation coming from?)