semantics

A good usage of HTML5's “progress” or “meter”?

隐身守侯 提交于 2019-11-30 02:47:20
问题 Say you have a survey with 10 pages (one question per page). At the top of each page, you include the text, "Question 2 of 10". Is this kind of a thing a good candidate for "progress" or "meter"? Semantically speaking, "progress" initially seems like the best fit. But, the more I read and look at examples, I think "meter" may be more appropriate. <meter max="10" value="1">Question 1 of 10</meter> <progress max="10" value="1">Question 1 of 10</progress> 回答1: According to the latest HTML5

What's the difference between an Algorithm and a Design Pattern

六眼飞鱼酱① 提交于 2019-11-30 01:45:02
I was searching for "Undo/Redo algorithms" and found something marked as a duplicate, but the duplicate was a request for a "Undo Design Pattern". I'd really like an algorithm for this. I don't think I necessarily need a design pattern. Is there a fundamental difference between "Design Pattern" and "Algorithm" or is it OK that someone uses the two interchangeably? I'll hang up and take my answer off the air. Ok, forgive me for thinking design patterns were just abstractions of algorithms. Here's a little table of my findings from the answers which were all very good. Design Pattern | Algorithm

What does the HTML acronym “span” stands for?

不打扰是莪最后的温柔 提交于 2019-11-30 01:43:23
问题 I guess that <div> might actually stand for: "division" since it creates a division in the document by separating content before and after it. Am I right? But <span> is a little bit more obscure on its meaning. I made some googling on this and found some interesting options: "Super Passive Analyzer Node", "SPAce Node", "Simple Plain Access Node". Does anyone know the right acronym for <span> ? 回答1: Pretty hard to find out what was going on in the minds of the creators of HTML4, where SPAN

Why can an instance of a class access private fields of another instance of its own type?

主宰稳场 提交于 2019-11-30 00:57:36
问题 An instance of a class, in Java, can access private fields of a different instance of its own type, such as in the following listing: public class Foo { private int secret; public void bar(final Foo foo) { foo.secret = 100; } } What would be the argument for such semantics (when designing a language)? 回答1: Well, first you have to ask "why have private fields at all?" Private fields are primarily for encapsulation: a user of a a class shouldn't have to know the internals of that class'

Why does Django use tuples for settings and not lists?

我怕爱的太早我们不能终老 提交于 2019-11-30 00:46:40
问题 Quoting this answer: Apart from tuples being immutable there is also a semantic distinction that should guide their usage. Tuples are heterogeneous data structures (i.e., their entries have different meanings), while lists are homogeneous sequences. Tuples have structure, lists have order. This makes sense to me. But why does Django use tuples and not lists for settings? Example: INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django

AngularDart custom filter call() method required to be idempotent?

丶灬走出姿态 提交于 2019-11-29 23:33:12
问题 The main running example of the Angular Dart tutorial is a Recipe Book app . The exercise at the end of the Chapter 5 on filters and services suggests trying to " create a [custom] filter that will multiply all the amounts [of each ingredient listed] in the recipes " thus allowing a " user to double, triple, or quadruple the recipe ." E.g. an ingredient of "1/2 cup of flour" would become "1 cup of flour" when doubled. I have written such a custom filter: it takes a list of Ingredient s

Correct usage of HTML5 `figure` and `aside`

只谈情不闲聊 提交于 2019-11-29 23:06:00
I have a chunk of a page that looks semantically this: Heading A Textual information related to heading A. Blah blah blah blah blah. [image gallery related to heading A] I can think of a couple of ways to mark this up: Method 1: <section> <h1>Heading A</h1> <p>Textual information related to heading A.<br /> <p>Blah blah blah blah blah.</p> <figure> <img /> <figcaption>Image 1</figcaption> <img /> <figcaption>Image 2</figcaption> </figure> </section> Method 2: <section> <h1>Heading A</h1> <p>Textual information related to heading A.<br /> <p>Blah blah blah blah blah.</p> <figure> <img />

Semantics and Structure of Name-Value Pairs

可紊 提交于 2019-11-29 21:17:37
This is a question I have been struggling with for a while. What is the proper way to mark up name/value pairs? I'm fond of the <dl> element, but it presents a problem: There is no way to separate one pair from another - they have no unique container. Visually, the code lacks definition. Semantically, though, I think this is the correct markup. <dl> <dt>Name</dt> <dd>Value</dd> <dt>Name</dt> <dd>Value</dd> </dl> In the above code, it is difficult to properly offset the pairs visually, both in code and rendered. If I wanted to, for instance, but a border around each pair, that would be a

Wordnet SQL Explanation

耗尽温柔 提交于 2019-11-29 21:07:40
I'm trying to get a simple synonym database up and running, so I can find synonyms of words the user entered (nothing else!). For this I grabbed a copy of the Wordnet sql thesarus ( http://wnsql.sourceforge.net/ ), but now I'm presented with all these tables, and I can't find any simple explanation for their content anywhere: adjpositions adjpositiontypes casedwords lexdomains lexlinks linktypes morphmaps morphs postypes samples semlinks senses synsets vframemaps vframes vframesentencemaps vframesentences words Could someone tell me what these tables contain and which I need, since I cant

Does an algorithm exist to help detect the “primary topic” of an English sentence?

家住魔仙堡 提交于 2019-11-29 19:53:09
I'm trying to find out if there is a known algorithm that can detect the "key concept" of a sentence. The use case is as follows: User enters a sentence as a query (Does chicken taste like turkey?) Our system identifies the concepts of the sentence (chicken, turkey) And it runs a search of our corpus content The area that we're lacking in is identifying what the core "topic" of the sentence is really about. The sentence "Does chicken taste like turkey" has a primary topic of "chicken", because the user is asking about the taste of chicken. While "turkey" is a helper topic of less importance.