semantics

Correct markup for headers

六月ゝ 毕业季﹏ 提交于 2019-11-28 01:38:12
How do I semanticly markup the headers in the article as presented in the picture below? I often run into this problem; where I have a header that is visually first, but is a subheading, intro header or less important then the main header. I could put it after the main header and move it above with CSS, but that isn't always a ideal solution. Another question: is there any special way to markup lead paragraphs? Not allowed? <article> <h2>New prodcut</h2> <h1>Launching our new x-series</h1> <p class="lead">Lorem ipsum dolor sit amet...</p> <p>Integer varius, turpis sit amet accumsan...</p> ...

What should come first in HTML, an anchor or a header? [duplicate]

主宰稳场 提交于 2019-11-27 23:12:40
问题 This question already has an answer here: Which is more correct: <h1><a>…</a></h1> OR <a><h1>…</h1></a> 7 answers I'm wondering which of the following two orders is semantically correct in HTML: 1. <h1><a>Header</a></h1> 2. <a><h1>Header</h1></a> 回答1: <h1><a>Header</a></h1> <h1> is a block-level element and <a> is not, it is syntactically invalid HTML to have block level elements inside inline elements (at least until HTML5) which is how the other way would be. 回答2: This answer on a duplicate

How to semantically tag poem text?

ⅰ亾dé卋堺 提交于 2019-11-27 20:11:39
What to use for poem? pre blockquote code something else? unor Don't use code (unless computer code is part of the poem). Don't use blockquote (unless you quote a poem). white space / line breaks: pre or br You may use the pre element . The spec gives an (informative) example: The following shows a contemporary poem that uses the pre element to preserve its unusual formatting, which forms an intrinsic part of the poem itself. <pre> maxling it is with a heart heavy that i admit loss of a feline so loved a friend lost to the unknown (night) ~cdr 11dec07</pre> However, I'd only use the pre

when to use UL or OL in html?

流过昼夜 提交于 2019-11-27 19:34:26
Seems interchangable? UL means "unordered list". OL means "ordered list". UL gets you bullet points. OL gets you numbers. Definitely not interchangable. In math terms (hey, why not?), an <ol> represents a sequence, whereas <ul> represents a set. Rearranging the items in an ordered list changes the list's meaning. Rearranging them in an unordered list does not. This is a good rule-of-thumb for which type of list to use. If changing the order of the items makes the list incorrect, you want to use <ol> . If the order doesn't matter, use <ul> . With <ol> the order of the data is important and will

LSA - Latent Semantic Analysis - How to code it in PHP?

泄露秘密 提交于 2019-11-27 19:11:31
I would like to implement Latent Semantic Analysis (LSA) in PHP in order to find out topics/tags for texts. Here is what I think I have to do. Is this correct? How can I code it in PHP? How do I determine which words to chose? I don't want to use any external libraries. I've already an implementation for the Singular Value Decomposition (SVD) . Extract all words from the given text. Weight the words/phrases, e.g. with tf–idf . If weighting is too complex, just take the number of occurrences. Build up a matrix: The columns are some documents from the database (the more the better?), the rows

Computed read-only property vs function in Swift

廉价感情. 提交于 2019-11-27 17:33:45
In the Introduction to Swift WWDC session, a read-only property description is demonstrated: class Vehicle { var numberOfWheels = 0 var description: String { return "\(numberOfWheels) wheels" } } let vehicle = Vehicle() println(vehicle.description) Are there any implications to choosing the above approach over using a method instead: class Vehicle { var numberOfWheels = 0 func description() -> String { return "\(numberOfWheels) wheels" } } let vehicle = Vehicle() println(vehicle.description()) It seems to me that the most obvious reasons you would choose a read-only computed property are:

Python: Semantic similarity score for Strings [duplicate]

ε祈祈猫儿з 提交于 2019-11-27 17:20:24
This question already has an answer here: How to compute the similarity between two text documents? 8 answers Are there any libraries for computing semantic similarity scores for a pair of sentences ? I'm aware of WordNet's semantic database, and how I can generate the score for 2 words, but I'm looking for libraries that do all pre-processing tasks like port-stemming, stop word removal, etc, on whole sentences and outputs a score for how related the two sentences are. I found a work in progress that's written using the .NET framework that computes the score using an array of pre-processing

Specification for a Functional Reactive Programming language

﹥>﹥吖頭↗ 提交于 2019-11-27 16:35:32
I am looking at messing around with creating a functional reactive framework at some point. I have read quite a lot about it and seen a few examples but I wanted to get a clear idea of what this framework would HAVE to do to be considered an FRP extension/dsl. I'm not really concerned with implementation problems or specifics etc but more as to what would be desired in a perfect world situation. What would be the key operations and qualities of an ideal functional reactive programming language? Conal I'm glad you're starting by asking about a specification rather than implementation first.

What are the benefits of using semantic HTML?

廉价感情. 提交于 2019-11-27 14:23:44
Are there some noticeable outcomes in terms of performance or other aspects to follow semantic HTML? Thanks Nathan Long Not about performance Semantic markup isn't about performance, it's about meaning. Let's imagine two parallel universes. In Dumb HTML World , there is only one tag: <thing> . How would you specify where styles should be applied? How would browsers know how to render the page? How would screen readers for the blind differentiate between headlines and text and footnotes and menu items? You'd have to add all kinds of awkward attributes. Meanwhile, in Detailed HTML World , there

Is “map” a loop?

◇◆丶佛笑我妖孽 提交于 2019-11-27 13:26:50
问题 While answering this question, I came to realize that I was not sure whether Perl's map can be considered a loop or not? On one hand, it quacks/walks like a loop (does O(n) work, can be easily re-written by an equivalent loop, and sort of fits the common definition = "a sequence of instructions that is continually repeated"). On the other hand, map is not usually listed among Perl's control structures, of which loops are a subset of. E.g. http://en.wikipedia.org/wiki/Perl_control_structures