computer-science

What is the difference between Instruction Set and Instruction Set Architecture (ISA)?

我怕爱的太早我们不能终老 提交于 2020-01-25 22:08:29
问题 I am not able to understand the difference between Instruction set and Instruction set architecture. I know what is an instruction set . Instruction set just defines the possible instructions we can give to the processor and how the instruction are give ( therefore the instruction format ) to the processor. Now what is Instruction set architecture ? I have looked up wikipedia, it has a page on instruction set and inside it, on the first line there is a link to instruction set architecture

Finding the nth number of primes

倾然丶 夕夏残阳落幕 提交于 2020-01-25 07:39:25
问题 I can not figure out why this won't work. Please help me from math import sqrt pN = 0 numPrimes = 0 num = 1 def checkPrime(x): '''Check\'s whether a number is a prime or not''' prime = True if(x==2): prime = True elif(x%2==0): prime=False else: root=int(sqrt(x)) for i in range(3,root,2): if(x%i==0): prime=False break return prime n = int(input("Find n number of primes. N being:")) while( numPrimes != n ): if( checkPrime( num ) == True ): numPrimes += 1 pN = num print("{0}: {1}".format

Assembly Language - LDI

一个人想着一个人 提交于 2020-01-25 07:35:12
问题 I am having trouble figuring out weather to load a regisiter with the contents of the data in the regisiter or indirectly load the register with the address of the value when we execute LDI. Example: x3000 LDI R6, far x3001 ...(some command) x3002 ...(some command) x3003 far x6000 ... x6000 xf000 what is the data in R6 after excecuting x3000? 回答1: well take this for example .orig x3000 LDI R6, far ADD R0,R0,#0 ADD R0,R0,#0 far .fill x6000 .end assemble and dump hexdump -C test.obj 00000000 30

Using Paxos to synchronize a large file across nodes

爱⌒轻易说出口 提交于 2020-01-24 17:29:09
问题 I'm trying to use Paxos to maintain consensus between nodes on a file that is around 50MB in size, and constantly being modified at individual nodes. I'm running into issues of practicality. Requirements: Sync a 50MB+ file across hundreds of nodes Have changes to this file, which can be made from any node, and aren't likely to directly compete with each other, propagated across the network in a few seconds at most New nodes that join the network can within a few minutes (<1 hour) build up the

How does a 32bit computer work with large bit numbers? Ex. 512bit integers [closed]

六眼飞鱼酱① 提交于 2020-01-24 16:16:24
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have been reading an article on cryptography, and I thought to myself "How does a 32bit computer actually perform operations on a 512bit value, or even a 64 bit value?" Would anyone be able to point me in the

How does a 32bit computer work with large bit numbers? Ex. 512bit integers [closed]

白昼怎懂夜的黑 提交于 2020-01-24 16:16:23
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have been reading an article on cryptography, and I thought to myself "How does a 32bit computer actually perform operations on a 512bit value, or even a 64 bit value?" Would anyone be able to point me in the

Finding the transpose of a very, very large matrix

大兔子大兔子 提交于 2020-01-23 09:54:10
问题 I have this huge 2 dimensional array of data. It is stored in row order: A(1,1) A(1,2) A(1,3) ..... A(n-2,n) A(n-1,n) A(n,n) I want to rearrange it into column order A(1,1) A(2,1) A(3,1) ..... A(n,n-2) A(n,n-1) A(n,n) The data set is rather large - more than will fit on the RAM on a computer. (n is about 10,000, but each data item takes about 1K of space.) Does anyone know slick or efficient algorithms to do this? 回答1: Create n empty files (reserve enough space for n elements, if you can).

OpenCV-Python ImportError: DLL load failed: The specified module could not be found

偶尔善良 提交于 2020-01-16 09:43:05
问题 I am working on windows 10 with Python 3.6.0 (Anaconda3) and jupyter notebook. I have successfully installed and imported OpenCV-Python with the help of comments in this post. Now the problem is that If I am importing opencv (ijmport cv2) from the same command prompt where I installed the opencv, it is importing without any error. But if I am importing opencv from another command prompt, then it is giving me this error: ImportError: DLL load failed: The specified module could not be found. I

Get specific values from JSON column in Presto

老子叫甜甜 提交于 2020-01-16 08:17:12
问题 I have a table with a JSON column points with one of the rows as: {"0": 0.2, "1": 1.2, "2": 0.5, "15": 1.2, "20": 0.7} I want to get the values for keys "1" and "20" and store them as an alias like first and second in a query. What I've done till now is: SELECT points, k, v from rewards CROSS JOIN UNNEST(SPLIT_TO_MAP(points, ',', ':')) AS m(k,v) where name='John' But this query gives me all the rows of k, v. How do I select only those two values corresponding to "1" and "20"? 回答1: JSON

What is Big O Notation? [duplicate]

坚强是说给别人听的谎言 提交于 2020-01-12 18:45:55
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: Plain English explanation of Big O I know Big O notation is used to assess how efficient an algorithm is, but I do not understand how you read Big O notation or what exactly how efficient an algorithm is. Can somebody perhaps explain the basics of Big O notation? Thanks. 回答1: What is a plain English explanation of "Big O" notation? is a good explanation of what Big-O notation is and how to use it. 回答2: This page