np问题

【转帖】处理器史话 | 小范围受众的专业处理器在生活中起到哪些作用?

一世执手 提交于 2019-12-03 22:25:18
处理器史话 | 小范围受众的专业处理器在生活中起到哪些作用? https://www.eefocus.com/mcu-dsp/377796/r0 专用型 CPU 是指那些为了某种特定的应用而设计的并为这些特殊应用而将内部体系结构与指令集作了专门优化的 CPU,如用于多媒体应用的媒体 CPU(Media Processor,MP),用于路由器等网络通讯产品的网络 CPU(Network Processor,NP),及用于网络安全保障,数据加密解密的安防 CPU(Security CPU),用于用来完成某种信号处理任务的处理器 (Digital Signal Processor,DSPs)等。这类 CPU 的特点是历史短,发展快,变化多,受专利保护、操作系统的限制少。其技术层次属于中高档,并非尖端,可用主流半导体工艺制成。 1. NP 网络处理器(Network Processor,简称 NP),根据国际网络处理器会议(Network Processors Conference)的定义:网络处理器是一种可编程器件,它特定的应用于通信领域的各种任务,比如包处理、协议分析、路由查找、声音 / 数据的汇聚、防火墙、QoS 等。 NP 是专门为处理数据包而设计的可编程处理器,能够直接完成网络数据处理的一般性任务。器件内部通常由若干个微码处理器和若干硬件协处理器组成

perl one-liner to keep only desired lines

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a text file (input.txt) like this: NP_414685 . 4 : 15 - 26 , 131 - 138 , 441 - 465 NP_418580 . 2 : 493 - 500 NP_418780 . 2 : 36 - 48 , 44 - 66 NP_418345 . 2 : NP_418473 . 3 : 1 - 19 , 567 - 1093 NP_418398 . 2 : I want a perl one-liner that keeps only those lines in file where ":" is followed by number range (that means, here, the lines containing "NP_418345.2:" and "NP_418398.2:" get deleted). For this I have tried: perl - ni - e "print unless /: \d/" - pi . bak input . txt del input . txt . bak But it shows exactly same

How to read corpus of parsed sentences using NLTK in python?

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working with the BLLIP 1987-89 WSJ Corpus Release 1 ( https://catalog.ldc.upenn.edu/LDC2000T43 ). I am trying to use NLTK's SyntaxCorpusReader class to read in the parsed sentences. I'm trying to get it to work with a simple example of just 1 file. Here is my code... from nltk.corpus.reader import SyntaxCorpusReader path = '/corpus/wsj' filename = 'wsj1' reader = SyntaxCorpusReader('/corpus/wsj','wsj1') I am able to see the raw text from the file. It returns a string of the parsed sentences. reader.raw() u"(S1 (S (PP-LOC (IN In)\n\t(NP

Extracting specific leaf value from nltk tree structure with Python

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have some questions about NLTK's tree functions. I am trying to extract a certain word from the tree structure like the one given below. test = Tree.parse('(ROOT(SBARQ(WHADVP(WRB How))(SQ(VBP do)(NP (PRP you))(VP(VB ask)(NP(DT a)(JJ total)(NN stranger))(PRT (RP out))(PP (IN on)(NP (DT a)(NN date)))))))') print "Input tree: ", test print test.leaves() (SBARQ (WHADVP (WRB How)) (SQ (VBP do) (NP (PRP you)) (VP (VB ask) (NP (DT a) (JJ total) (NN stranger)) (PRT (RP out)) (PP (IN on) (NP (DT a) (NN date))))))) ['How', 'do', 'you', 'ask', 'a',

Cython C++ wrapper operator() overloading error

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Connected with my previous question. Using Cython to wrap a C++ class that uses OpenCV types as parameters Now I'm stuck in another error. My cython wrapping code of the OpenCV type Matx33d looks like: cdef extern from "opencv2/core/core.hpp" namespace "cv": cdef cppclass Matx33d "cv::Matx<double, 3, 3>": Matx33d() Matx33d(double v0, double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8) double& operator()(int i, int j) Then I define a function to copy the Matx33d to a numpy array. cdef Matx33d2numpy(Matx33d

TA-Lib numpy “AssertionError: real is not double”

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have AssertionError using TA-Lib wrapper in python. Could you take a look at my code? I really appreciate your help. import numpy as np import talib #This works test_data = np.random.random(5) np_out = talib.SMA(test_data,3) print np_out #How come this does not work? I need to fix real_data = [135.01, 133.0, 134.0, 131.0, 133.0, 131.0] np_real_data = np.array(real_data,dtype=np.object) np_out = talib.SMA(np_real_data,3) print np_out error message: File "func.pyx", line 9200, in talib.func.SMA (talib/func.c:85610) AssertionError: real is

How to navigate a nltk.tree.Tree?

匿名 (未验证) 提交于 2019-12-03 01:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've chunked a sentence using: grammar = ''' NP: { *( | )* } NVN: { } ''' chunker = nltk.chunk.RegexpParser(grammar) tree = chunker.parse(tagged) print tree The result looks like: (S (NVN (NP The_Pigs/NNS) are/VBP (NP a/DT Bristol-based/JJ punk/NN rock/NN band/NN)) that/WDT formed/VBN in/IN 1977/CD ./.) But now I'm stuck trying to figure out how to navigate that. I want to be able to find the NVN subtree, and access the left-side noun phrase ("The_Pigs"), the verb ("are") and the right-side noun phrase ("a Bristol-based punk rock band"). How

Numberlink/Flow Game: How to spot NP-Complete problems?

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I was trying to find a way to solve the problem in the famous game Flow. http://moh97.us/flow/ After googling I find out that this is a NP-complete problem. A good solution would make use of heuristics and cuts. How can I spot a NP-complete problem easily? Sometimes when I block, I can't see the obvious solution. When this happens with an NP-complete, it's better to recognise it quickly and move on to the next problem. 回答1: When you have an explosion of objects (say objects whose count grows exponentially based on some parameter or

Error: setuid user id does not exist npm ERR! when npm install forever -g

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: os: debian 7 node.js is installed in the defalut folder . root@10-4-4-159:/usr/local# npm install forever -g npm ERR! Error: setuid user id does not exist npm ERR! at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:44:16 npm ERR! at ChildProcess.exithandler (child_process.js:635:7) npm ERR! at ChildProcess.EventEmitter.emit (events.js:98:17) npm ERR! at maybeClose (child_process.js:735:16) npm ERR! at Process.ChildProcess._handle.onexit (child_process.js:802:5) npm ERR! If you need help, you may report this log at: npm

Using Stanford Tregex in Python

匿名 (未验证) 提交于 2019-12-03 01:11:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm a newbie in NLP and Python. I'm trying to extract a subset of noun phrases from parsed trees from StanfordCoreNLP by using the Tregex tool and the Python subprocess library. In particular, I'm trying to find and extract noun phrases that match the following pattern: '(NP[$VP]>S)|(NP[$VP]>S\n)|(NP\n[$VP]>S)|(NP\n[$VP]>S\n)' in the Tregex grammar. For example, below is the original text, saved in a string named "text": text = ('Pusheen and Smitha walked along the beach. "I want to surf", said Smitha, the CEO of Tesla. However, she fell off