semantics

SMACSS, Semantic Class Names and Nested Elements

一笑奈何 提交于 2019-12-03 12:49:44
问题 I've just read Scalable and Modular Architecture for CSS and it's got me thinking about a few things. Snook's two principle tennets are: Increase the semantic value of a section of HTML and content Decrease the expectation of a specific HTML structure So this means using semantic class names rather than relying on unsemantic element types for targeting. For example rather than targeting .someClass h5 , I might target .someClass-title instead so that if the h5 is swapped out for something else

Why is exactly once semantics infeasible?

与世无争的帅哥 提交于 2019-12-03 12:25:53
问题 In RPC semantics where Erlang has hope for the best, SUN RPC with at-least once and Java RMI with at-most-once but no one has exactly once semantics. Why does it seem infeasible to have exactly once semantics? For example if the client keeps resending a uniquely tagged request until a reply is received and a server keeps track of all handled requests in order not to duplicate a request. Would that not be exactly once? 回答1: Consider what happens if the server crashes between carrying out the

Algorithm to understand meaning [closed]

混江龙づ霸主 提交于 2019-12-03 09:47:37
问题 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 8 years ago . I want to know if is there any specific algorithm that can be followed to understand the meaning of a word/sentence/paragraph. Basically, I want to write a program that will take text/paragraph as input and try

Why are generics called generics?

 ̄綄美尐妖づ 提交于 2019-12-03 09:27:11
问题 At the risk of becoming the village idiot, can someone explain to me why generics are called generics? I understand their usage and benefits, but if the definition of generic is "general" and generic collections are type safe, then why isn't this a misnomer? For example, an ArrayList can hold anything that's an object: ArrayList myObjects = new ArrayList(); myObjects.Add("one"); myObjects.Add(1); while a generic collection of type string can only hold strings: var myStrings = new List<string>

Friendly url scheme?

风格不统一 提交于 2019-12-03 08:47:15
One of the many things that's been lacking from my scraper service that I set up last week are pretty URLs. Right now the user parameter is being passed into the script with ?u= , which is a symptom of a lazy hack (which the script admittedly is). However, I've been thinking about redoing it and I'd like to get some feedback on the options available. Right now there are two pages, update and chart, that provide information to the user. Here are the two possibilities that I came up with. "1234" is the user ID number. For technical reasons the user name unfortunately cannot be used: http://< tld

Why does (x += x += 1) evaluate differently in C and Javascript?

陌路散爱 提交于 2019-12-03 08:19:44
问题 If the value of the variable x is initially 0, the expression x += x += 1 will evaluate to 2 in C, and to 1 in Javascript. The semantics for C seems obvious to me: x += x += 1 is interpreted as x += (x += 1) which is, in turn, equivalent to x += 1 x += x // where x is 1 at this point What is the logic behind Javascript's interpretation? What specification enforces such behaviour? (It should be noted, by the way, that Java agrees with Javascript here). Update: It turns out the expression x +=

Difference between “call stack” and “thread stack”

蹲街弑〆低调 提交于 2019-12-03 07:28:09
问题 Is there a semantic difference between the terms call stack and thread stack , in Java multithreading? 回答1: Each thread has its own call stack, "call stack" and "thread stack" are the same thing. Calling it a "thread stack" just emphasizes that the call stack is specific to the thread. Bill Venners calls this the Java stack: When a new thread is launched, the Java virtual machine creates a new Java stack for the thread. As mentioned earlier, a Java stack stores a thread's state in discrete

html5: using header or footer tag twice?

狂风中的少年 提交于 2019-12-03 06:26:36
问题 quick question: is it actually allowed to use the header tag twice? e.g. i have two important head-sections in my header.php where both could have header tag? 回答1: Yes, but with a catch. The W3 documents state that the tags represent the header and footer areas of their nearest ancestor section. I would recommend having as many as your want, but only 1 of each for each "section" of your page, i.e. body, section etc. From W3 A header element is intended to usually contain the section's heading

When is it better to use a Tuple versus a KeyValuePair?

冷暖自知 提交于 2019-12-03 06:26:15
问题 I've generally used the KeyValuePair<TKey,TValue> type whenever I have data that is pair-related in the sense that one is a key to the other. If the data is unrelated then the Tuple<T1,T2> type makes more sense and I'd go with that. Now I just read this article about why to generally avoid KeyValuePair<TKey,TValue> and prefer Tuple<T1,T2> . The primary argument being the performance benefit of Tuple<T1,T2> . Outside performance, is there any reason a KVP would be a better choice than a Tuple

Semantics of char a[]

倾然丶 夕夏残阳落幕 提交于 2019-12-03 06:01:18
问题 I recently embarrassed myself while explaining to a colleague why char a[100]; scanf("%s", &a); // notice a & in front of 'a' is very bad and that the slightly better way to do it is: char a[100]; scanf("%s", a); // notice no & in front of 'a' Ok. For everybody getting ready to tell me why scanf should not be used anyway for security reasons: ease up. This question is actually about the meaning of "&a" vs "a". The thing is, after I explained why it shouldn't work, we tried it (with gcc) and