terminology

What does it mean for a data structure to be “intrusive”?

帅比萌擦擦* 提交于 2019-11-28 15:29:53
I've seen the term intrusive used to describe data structures like lists and stacks, but what does it mean? Can you give a code example of an intrusive data structure, and how it differs from a non-intrusive one? Also, why make it intrusive (or, non-intrusive)? What are the benefits? What are the disadvantages? An intrusive data structure is one that requires help from the elements it intends to store in order to store them. Let me reword that. When you put something into that data structure, that "something" becomes aware of the fact that it is in that data structure, in some way. Adding the

What does abstraction mean in programming?

痞子三分冷 提交于 2019-11-28 15:19:35
I'm learning python and I'm not sure of understanding the following statement : "The function (including its name) can capture our mental chunking, or abstraction, of the problem ." It's the part that is in bold that I don't understand the meaning in terms of programming. The quote comes from http://www.openbookproject.net/thinkcs/python/english3e/functions.html How to think like a computer scientist, 3 edition. Thank you ! Abstraction is a core concept in all of computer science. Without abstraction, we would still be programming in machine code or worse not have computers in the first place.

Difference between Mutable objects and Immutable objects [duplicate]

泪湿孤枕 提交于 2019-11-28 15:14:23
This question already has an answer here: What is meant by immutable? 17 answers Any one please give the diff between Mutable objects and Immutable objects with example. Ralph Mutable objects have fields that can be changed, immutable objects have no fields that can be changed after the object is created. A very simple immutable object is a object without any field. (For example a simple Comparator Implementation). class Mutable{ private int value; public Mutable(int value) { this.value = value; } //getter and setter for value } class Immutable { private final int value; public Immutable(int

What is “Orthogonality”?

眉间皱痕 提交于 2019-11-28 15:07:58
What does "orthogonality" mean when talking about programming languages? What are some examples of Orthogonality? C. Ross Orthogonality is the property that means "Changing A does not change B". An example of an orthogonal system would be a radio, where changing the station does not change the volume and vice-versa. A non-orthogonal system would be like a helicopter where changing the speed can change the direction. In programming languages this means that when you execute an instruction, nothing but that instruction happens (very important for debugging). There is also a specific meaning when

What's the difference between a word and byte?

随声附和 提交于 2019-11-28 15:07:31
I've done some research. A byte is 8 bits and a word is the smallest unit that can be addressed on memory. The exact length of a word varies. What I don't understand is what's the point of having a byte? Why not say 8 bits? I asked a prof this question and he said most machines these days are byte-addressable, but what would that make a word? Byte : Today, a byte is almost always 8 bit. However, that wasn't always the case and there's no "standard" or something that dictates this. Since 8 bits is a convenient number to work with it became the de facto standard. Word : The natural size with

What is an anti-pattern?

眉间皱痕 提交于 2019-11-28 14:59:00
I am studying patterns and anti-patterns. I have a clear idea about patterns, but I don't get anti-patterns. Definitions from the web and Wikipedia confuse me a lot. Can anybody explain to me in simple words what an anti-pattern is? What is the purpose? What do they do? Is it a bad thing or good thing? coobird Anti-patterns are certain patterns in software development that are considered bad programming practices. As opposed to design patterns which are common approaches to common problems which have been formalized and are generally considered a good development practice, anti-patterns are

What is the difference between a shim and a polyfill?

一笑奈何 提交于 2019-11-28 14:54:40
Both seem to be used in web development circles, see e.g. HTML5 Cross Browser Polyfills , which says: So here we're collecting all the shims, fallbacks, and polyfills... Or, there's the es5-shim project. In my current project we're using a number of these, and I want to stick them all in the same directory. So, what should I call this directory--- shims , or polyfills ? Arsalan Ahmed A shim is any piece of code that performs interception of an API call and provides a layer of abstraction. It isn't necessarily restricted to a web application or HTML5/CSS3. A polyfill is a type of shim that

How do Clojure futures and promises differ?

北慕城南 提交于 2019-11-28 14:49:26
问题 Both futures and promises block until they have calculated their values, so what is the difference between them? 回答1: Answering in Clojure terms, here are some examples from Sean Devlin's screencast: (def a-promise (promise)) (deliver a-promise :fred) (def f (future (some-sexp))) (deref f) Note that in the promise you are explicitly delivering a value that you select in a later computation ( :fred in this case). The future, on the other hand, is being consumed in the same place that it was

What is a domain specific language? Anybody using it? And in what way?

点点圈 提交于 2019-11-28 13:55:58
问题 I guess I am looking for some kind of intro and see if anybody have used it. Are there any particular advantages of using it? Wikipedia: domain-specific language (DSL) is a programming language or specification language dedicated to a particular problem domain, a particular problem representation technique, and/or a particular solution technique. Can anybody give any specific examples of how you have implemented it or how it can be useful in a given scenario? 回答1: A domain specific language

what are “virtualized controls” ? (mentioned in JavaFX documentation).

眉间皱痕 提交于 2019-11-28 13:51:26
from http://docs.oracle.com/javafx/2/api/javafx/scene/control/Cell.html : "The Cell API is used for virtualized controls such as ListView, TreeView, and TableView. A Cell is a Labeled Control, and is used to render a single "row" inside a ListView, TreeView or TableView." Why are they virtualized? When you have a lot of data to display in a Control such as a ListView , you need some way of virtualizing the Nodes created and used. Otherwise it will affect the memory footprint and consequently the time. For example, if you have 10 million data items, you don’t want to create 10 million Nodes. So