difference between ISA and IS [duplicate] - cpu-architecture

This question already has answers here:
What is the difference between Instruction Set and Instruction Set Architecture (ISA)?
(3 answers)
Difference between Instruction set and Instruction set architecture?
(1 answer)
What is the definition of instruction set architecture?
(2 answers)
Closed 4 months ago.
I have been learning about computer arcitecture.
Other parts of what i learned is no problem, but i had a little of question.
The question is what the difference between instruction set architecture and instruction set is?
If what i understand is right, ISA is architecture, that just defines interface between SW and HW, but not define specific implementation. and Microarchitecture has instruction set that implements ISA. so instruction set is in microarchitecture.
but I'm not sure that is right. is it right?

Related

Repeatable random data generation in Swift 4 [duplicate]

This question already has answers here:
Swift - Seeding arc4random_uniform? Or alternative?
(2 answers)
ios Swift: looking for a cross compatible method to Java's Random() PRNG that has identical output
(3 answers)
Closed 4 years ago.
I'm writing tests in Swift 4. I want to generate thousands of rows of test input data. I want the test input data to be random.
But I want my tests to be repeatable: the same data needs to be generated for each run of all tests.
How is this achieved in Swift? In Java I've always relied on the Apache commons RandomDataGenerator. I've explored arc4random and drand48, but these don't seem to provide the repeatability I require.
Swift has no native random number generation capabilities. You can call C library functions from Swift, though. Any page on C random number library functions will describe them to you.
For example, you could just seed srand48 with the same constant every time and call drand48 to get your numbers.
(1...3).forEach {_ in
srand48(100)
(1...3).forEach {_ in print(drand48())}
}
/*
// spot the repetition:
0.25105890266514
0.208948404851498
0.940927909958315
0.25105890266514
0.208948404851498
0.940927909958315
0.25105890266514
0.208948404851498
0.940927909958315
*/
Some other C library functions are unavailable from Swift so you'd have to write that part of the code in C. No big deal.

If Switch Statements breaks SOLID Principles as Uncle Bob states (in Clean Code), should I be using them at all with OO Languages? [duplicate]

This question already has answers here:
Large Switch statements: Bad OOP?
(14 answers)
Switch statements are bad? [closed]
(8 answers)
Closed 5 years ago.
In Clean Code, Uncle Bob states that switch statements almost always break Single Responsibility and Open/Closed Principles. So does this mean that I should rarely (the only case he proposes is when switch is buried in an Abstract Factory to create polymorphic objects) use Switch Statements and therefore Enumerations? This brings the question that are Switch Statements really necessary to have in an OO Language?
Swift language for instance seems to favour enumerations (they can carry data and so on). Minimising their usage would be a major decision. Swift being an OO Language, do the same rules apply?

What is the difference between should and must in scala testing? [duplicate]

This question already has an answer here:
In ScalaTest is there any difference between `should`, `can`, `must`
(1 answer)
Closed 6 years ago.
Both scalatest and Specs2 have separate matchers for should and must.
However, I cannot find any explanation for why you would use one or the other.
What exactly is the difference?
There is no difference, this is purely a syntactic preference. I personally prefer to use must in specs2 because I think that should can make people think that an expectation is optional.

Objective C - Difference Between VARType* vt and VARType *vt [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Placement of the asterisk in Objective-C
What is the differenct between the following:
(Assume we have a class calculator)
Calculator* calc;
Calculator *calc;
Also what is the need for pointers? Is it not possible to omit the star?
There is no difference between those two declarations, you could also do Calculator * calc if you're feeling adventurous.
As far as if you can omit the star, no, you cannot. It is a carry over from C and shows that calc is a pointer to a Calculator, and not a Calculator itself.
There is no difference between the 2 declaration is just an preference for typing.
Every thing on computers uses pointers. You need pointers java, c#, etc use pointers.
No is not posible to omit the star.

What does the new scala Dynamic type do? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Practical uses of a Dynamic type in Scala
It has just been tweeted that Martin Odersky has just added Dynamic into trunk. Apparently, this is HUGE. Why?
Dynamic adds developer driven dynamic binding (dynamic dispatch) and gives a subset of the features of dynamic typing to Scala.
See this pastie from Jorge Ortiz:
http://pastie.org/1469174