H1 in article page – site title or article title?

Within an article-oriented page (such as a blog post), the <h1> element (level 1 heading) is commonly used to markup either: the blog title (i.e. the often-large site title at the top of the page, not to the <title> element), or the article title What is the best choice and why? To the site owner, … Read more

Is there a valid way to wrap a dt and a dd with an HTML element?

I wish HTML could do something semantically equivalent to this; <dl class=”main-list”> <definitionitem> <dt>Some Thing</dt> <dd>You know it!</dd> <dt>Another Thing</dt> <dd>Word.</dd> </definitionitem> <definitionitem> <dt>Stuff</dt> <dd>Alright!</dd> </definitionitem> </dl> However, since the closest I’ve come is something I’m not 100% satisfied with the semantics of; <div class=”redundant-wrapper”> <dl class=”main-list”> <dt>Some Thing</dt> <dd>You know it!</dd> <dt>Another Thing</dt> <dd>Word.</dd> … Read more

What does the colon dash “:-” mean in bash [duplicate]

This question already has answers here: Usage of :- (colon dash) in bash (2 answers) Closed 7 years ago. The result is the one desired; after a bit of trial and error. I don’t understand what the “2:-” and “3:-” do/mean. Can someone explain. #!/bin/bash pid=$(ps -ef | grep java | awk ‘ NR ==1 … Read more

Semantically, which is more correct: a in h2, or h2 in a?

I’m stuck deciding which to use as both seem to work. Should I be placing links <a> inside of <h2> elements? Or the other way around? What is the correct standard? Answer You can only place <h2> elements within <a> elements if you’re working with HTML5, which allows any other elements within <a> elements. Previous … Read more

Is there an algorithm that tells the semantic similarity of two phrases

input: phrase 1, phrase 2 output: semantic similarity value (between 0 and 1), or the probability these two phrases are talking about the same thing Answer You might want to check out this paper: Sentence similarity based on semantic nets and corpus statistics (PDF) I’ve implemented the algorithm described. Our context was very general (effectively … Read more

Specification for a Functional Reactive Programming language

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 … Read more

Are semantics and syntax the same?

What is the difference in meaning between ‘semantics’ and ‘syntax’? What are they? Also, what’s the difference between things like “semantic website vs. normal website”, “semantic social networking vs. normal social networking” etc. Answer Syntax is the grammar. It describes the way to construct a correct sentence. For example, this water is triangular is syntactically … Read more

How to properly use h1 in HTML5

Which of the following is the correct way to structure a page: 1) h1 only in header <header> <h1>Site title</h1> <nav>…</nav> </header> <section> <h2>Page title</h2> </section> If I use h1 exclusively inside header as the site’s title, every page will have the same content for the h1 tag. That doesn’t seem very informative. 2) h1 … Read more