terminology

What is opinionated software?

我们两清 提交于 2019-11-26 12:49:19
问题 I often see people saying that certain software is \"very opinionated\" or that Microsoft tends to write \"un-opinionated\" frameworks. What does this actually mean? 回答1: If a framework is opinionated, it lock or guides you into their way of doing things. For example: some people believe that a template system shouldn't provide access to user defined methods and functions as it leaves the system open to returning raw HTML. So an opinionated framework developer only allows access to data

What is the difference between the kernel space and the user space?

拥有回忆 提交于 2019-11-26 12:49:15
问题 What is the difference between the kernel space and the user space? Do kernel space, kernel threads, kernel processes and kernel stack mean the same thing? Also, why do we need this differentiation? 回答1: The really simplified answer is that the kernel runs in kernel space, and normal programs run in user space. User space is basically a form of sand-boxing -- it restricts user programs so they can't mess with memory (and other resources) owned by other programs or by the OS kernel. This

What is the difference between tree depth and height?

旧时模样 提交于 2019-11-26 12:48:59
问题 This is a simple question from algorithms theory. The difference between them is that in one case you count number of nodes and in other number of edges on the shortest path between root and concrete node. Which is which? 回答1: I learned that depth and height are properties of a node : The depth of a node is the number of edges from the node to the tree's root node. A root node will have a depth of 0. The height of a node is the number of edges on the longest path from the node to a leaf. A

NULL permitted in Primary Key - why and in which DBMS?

有些话、适合烂在心里 提交于 2019-11-26 12:45:29
问题 Further to my question \"Why to use ´not null primary key´ in TSQL?\"... As I understood from other discussions, some RDBMS (for example SQLite, MySQL ) permit \"unique\" NULL in the primary key. Why is this allowed and how might it be useful? Background: I believe it is beneficial for communication with colleagues and database professionals to know the differences in fundamental concepts, approaches and their implementations in different DBMS. Notes MySQL is rehabilitated and returned to the

What is the difference between a “function” and a “procedure”?

时间秒杀一切 提交于 2019-11-26 12:40:00
Generally speaking, we all hear about the functions or procedures in programming languages. However, I just found out that I use these terms almost interchangeably (which is probably very wrong). So, my question is: What is the difference in terms of their functionality, their purpose and use? An example would be appreciated. A function returns a value and a procedure just executes commands. The name function comes from math. It is used to calculate a value based on input. A procedure is a set of command which can be executed in order. In most programming languages, even functions can have a

What is a practical use for a closure in JavaScript?

▼魔方 西西 提交于 2019-11-26 12:34:15
I'm trying my hardest to wrap my head around JavaScript closures. I get that by returning an inner function, it will have access to any variable defined in its immediate parent. Where would this be useful to me? Perhaps I haven't quite got my head around it yet. Most of the examples I have seen online don't provide any real world code, just vague examples. Can someone show me a real world use of a closure? Is this one, for example? var warnUser = function (msg) { var calledCount = 0; return function() { calledCount++; alert(msg + '\nYou have been warned ' + calledCount + ' times.'); }; }; var

What is a loop invariant?

ⅰ亾dé卋堺 提交于 2019-11-26 12:33:50
问题 I\'m reading \"Introduction to Algorithm\" by CLRS. In chapter 2, the authors mention \"loop invariants\". What is a loop invariant? 回答1: In simple words, a loop invariant is some predicate (condition) that holds for every iteration of the loop. For example, let's look at a simple for loop that looks like this: int j = 9; for(int i=0; i<10; i++) j--; In this example it is true (for every iteration) that i + j == 9 . A weaker invariant that is also true is that i >= 0 && i <= 10 . 回答2: I like

Isn&#39;t “package private” member access synonymous with the default (no-modifier) access?

二次信任 提交于 2019-11-26 12:24:00
问题 I am a little confused over the term \"package private\" that some of the documentation uses, along with the usage of \"default access.\" Aren\'t package-private and default access both synonymous with protected? 回答1: Yes, it's almost the same. The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition , by a subclass of its class in another package. 回答2: The "default" access modifier (the one where none of them are

What is this practice called in JavaScript?

和自甴很熟 提交于 2019-11-26 12:06:15
When you wrap your JavaScript code in a function like this: (function(){ var field = ...; function doSomthing(){... ... })(); I noticed that this fixes scoping problems for me on a lot of web pages. What is this practice called? palswim The pattern is called self-invocation , a self-invoking function . It can create a closure, but that is an effect of the pattern (perhaps the intended effect), not the pattern itself. Nick Craver To clarify a bit for the comments below, most of the time it's creating a closure , it keeps your variables scoped to that local closure, as to not create global

Why are two different concepts both called “heap”?

冷暖自知 提交于 2019-11-26 12:04:54
Why are the runtime heap used for dynamic memory allocation in C-style languages and the data structure both called "the heap"? Is there some relation? Donald Knuth says (The Art of Computer Programming, Third Ed., Vol. 1, p. 435): Several authors began about 1975 to call the pool of available memory a "heap." He doesn't say which authors and doesn't give references to any specific papers, but does say that the use of the term "heap" in relation to priority queues is the traditional sense of the word. They have the same name but they really aren't similar (even conceptually). A memory heap is