semantics

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

≯℡__Kan透↙ 提交于 2019-11-27 12:39:28
问题 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

Should I fix Xcode 5 'Semantic issue: undeclared selector'?

穿精又带淫゛_ 提交于 2019-11-27 12:20:45
问题 I'm trying to upgrade my app with Xcode5 but encountered a number of 'Semantic issues' in a third party library (being MagicalRecord). The quickest way to 'fix' this might be using the: #pragma GCC diagnostic ignored "-Wundeclared-selector" (from: How to get rid of the 'undeclared selector' warning) compiler directive, but my gut-feeling says this is not the appropriate way to do this. A small code sample with the above error: + (NSEntityDescription *) MR_entityDescriptionInContext:

What does “in-place” mean?

懵懂的女人 提交于 2019-11-27 12:14:17
问题 Reverse words in a string (words are separated by one or more spaces). Now do it in-place. What does in-place mean? 回答1: In-place means that you should update the original string rather than creating a new one. Depending on the language/framework that you're using this could be impossible. (For example, strings are immutable in .NET and Java, so it would be impossible to perform an in-place update of a string without resorting to some evil hacks.) 回答2: In-place algorithms can only use O(1)

How to properly use h1 in HTML5

て烟熏妆下的殇ゞ 提交于 2019-11-27 10:50:23
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 in header and section , for both site and page title <header> <h1>Site title</h1> <nav>...</nav> </header> <section> <h1>Page title</h1> </section> I've also seen examples of using h1 more than once, in both header and section tags. However, isn't it wrong to have

Why would R use the “L” suffix to denote an integer?

柔情痞子 提交于 2019-11-27 09:24:00
In R we all know it is convenient for those times we want to ensure we are dealing with an integer to specify it using the "L" suffix like this: 1L # [1] 1 If we don't explicitly tell R we want an integer it will assume we meant to use a numeric data type... str( 1 * 1 ) # num 1 str( 1L * 1L ) # int 1 Why is "L" the preferred suffix, why not "I" for instance? Is there a historical reason? In addition, why does R allow me to do (with warnings): str(1.0L) # int 1 # Warning message: # integer literal 1.0L contains unnecessary decimal point But not.. str(1.1L) # num 1.1 #Warning message: #integer

When to use <br> line breaks vs CSS positioning?

三世轮回 提交于 2019-11-27 08:15:26
I've often wondered about the proper use of a <br> line break. Seems that often they are incorrectly used for positioning or clearing content where CSS should instead be used. W3schoools.org says to use <br> for blank lines, but not for creating or separating paragraphs. Looking over W3C HTML5 spec draft , it's a little clearer that the <br> would be used when content requires a line break such as lines of an address or blank lines in poetry, where intended by the author. But I'm still interested in any further clarification or input anyone else. I often find myself opting not to use <br> tags

Shall I use <section> tags inside <aside>?

我是研究僧i 提交于 2019-11-27 07:44:33
问题 Having a markup like this: <aside> <div class="widget"> <h2>Latest news</h2> <ul>...</ul> <a>more news</a> </div> <div class="widget"> <h2>Choose site theme</h2> <input type="select" /> </div> <div class="widget"> <h2>Newsletter subscription</h2> <form>...</form> </div> <div class="widget"> <h2>Related articles</h2> <ul>...</ul> </div> </aside> Which tag is more appropriate here: <div> or <section> ? Is section supposed to be used only inside <article> tag and never inside <aside> ? 回答1: The

Java: Not a statement

点点圈 提交于 2019-11-27 06:46:21
问题 I suppose this is more a question about language theory than anything else. Why is the first statement in main legal, when the second is not? Don't they evaluate to be the same thing? public class Main { public static void main(String[] args) { foo(); 0; } public static int foo(){ return 0; } } 回答1: Java restricts the types of expressions that are allowed in so-called "expression statements". Only meaningful expressions that have potential side effects are allowed. It disallows semantically

boolean in an if statement

狂风中的少年 提交于 2019-11-27 05:58:04
Today I've gotten a remark about code considering the way I check whether a variable is true or false in a school assignment. The code which I had written was something like this: var booleanValue = true; function someFunction(){ if(booleanValue === true){ return "something"; } } They said it was better/neater to write it like this: var booleanValue = true; function someFunction(){ if(booleanValue){ return "something"; } } The remark which I have gotten about the "=== true" part was that it was not needed and could create confusion. However my idea is that it is better to check whether the

Semantic Diff Utilities [closed]

杀马特。学长 韩版系。学妹 提交于 2019-11-27 05:52:58
I'm trying to find some good examples of semantic diff/merge utilities. The traditional paradigm of comparing source code files works by comparing lines and characters.. but are there any utilities out there (for any language) that actually consider the structure of code when comparing files? For example, existing diff programs will report "difference found at character 2 of line 125. File x contains v-o-i-d, where file y contains b-o-o-l". A specialized tool should be able to report "Return type of method doSomething() changed from void to bool". I would argue that this type of semantic