semantics

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

青春壹個敷衍的年華 提交于 2019-11-30 12:17:37
问题 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.

Correct usage of HTML5 `figure` and `aside`

被刻印的时光 ゝ 提交于 2019-11-30 11:03:28
问题 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

Class or ID on Body Tag

我的未来我决定 提交于 2019-11-30 11:03:02
I've been applying an ID to the body tag of my HTML documents lately to allow greater CSS control (#9) . Recently the though occurred to me that I could do exactly the same thing by applying a class to the body tag. I want to know positives and negatives of each choice. If I have multiple pages where the body tag has the same ID, is it better to use a class? What do you think? Why? UPDATE: The class/ID is basically what I intend to use to identify to the stylesheet which page or type of page the stylesheet is being applied to. For example, is it the homepage, the contact page, one of many

Why does Python handle '1 is 1**2' differently from '1000 is 10**3'?

烂漫一生 提交于 2019-11-30 07:47:52
问题 Inspired by this question about caching small integers and strings I discovered the following behavior which I don't understand. >>> 1000 is 10**3 False I thought I understood this behavior: 1000 is to big to be cached. 1000 and 10**3 point to 2 different objects. But I had it wrong: >>> 1000 is 1000 True So, maybe Python treats calculations differently from 'normal' integers. But that assumption is also not correct: >>> 1 is 1**2 True How can this behavior be explained? 回答1: There are two

Double quotes vs single quotes in JavaScript [duplicate]

别来无恙 提交于 2019-11-30 05:42:12
Possible Duplicate: When to Use Double or Single Quotes in JavaScript Are there differences between ' and " I am wondering if there is a difference between using single quotes vs double quotes in JavaScript (JQuery selectors etc.). Both seem to work just fine, so is there a difference? The difference is that you don't need to escape single quotes in double quotes, or double quotes in single quotes. That is the only difference, if you do not count the fact that you must hold the Shift key to type " . BluesRockAddict It doesn't matter unless you're trying to write JSON, in which case you must

HTML time tag for duration

﹥>﹥吖頭↗ 提交于 2019-11-30 05:31:16
问题 I need to display the duration of a video. Should I use <time> or should it be used only for displaying time as in a clock? Example Is this correct HTML5? <p>Duration: <time>3:30 min</time>.</p> Or should <time> be used only on a situation like this? <p>Good morning. The actual time is: <time>9:45</time></p>. Docs MDN presents the following definition: The HTML element represents either a time on a 24-hour clock or a precise date in the Gregorian calendar (with optional time and timezone

How to extend ontology with other standard ontologies in Protégé?

落爺英雄遲暮 提交于 2019-11-30 04:56:29
问题 I am building an ontology using Protégé, but wan to extend it with other standard ontologies such as frbr, prov, and org. Is there a standard way to integrate our ontology with these standard ontologies or can we merge these ontologies with each other? I want to do these tasks using Protégé. 回答1: Unless I'm missing something about your question (which didn't really provide enough information to diagnose the problem that you're actually having), this is what owl:imports is for. You can import

Xcode 7 what is the view “semantic” storyboard setting?

血红的双手。 提交于 2019-11-30 04:16:00
I see that iOS9 and xCode7 introduced a new field called "semantic" into storyboard config. A google search did not reveal relevant results on top. What is the significance of the view semantic field? There is a new internationalization support in iOS 9, which enables flipping of the interface from left to right and vice versa depending on the current system language. You can choose Arabic language to test it. Arabic is read from right to left, so the interface is flipped. Here you can read the Apple's guide on it. The property "Semantic" in the storyboard is a rule which allows the iOS to

“Strictly positive” in Agda

自作多情 提交于 2019-11-30 03:18:31
I'm trying to encode some denotational semantics into Agda based on a program I wrote in Haskell. data Value = FunVal (Value -> Value) | PriVal Int | ConVal Id [Value] | Error String In Agda, the direct translation would be; data Value : Set where FunVal : (Value -> Value) -> Value PriVal : ℕ -> Value ConVal : String -> List Value -> Value Error : String -> Value but I get an error relating to the FunVal because; Value is not strictly positive, because it occurs to the left of an arrow in the type of the constructor FunVal in the definition of Value. What does this mean? Can I encode this in

Does an else if statement exist?

我是研究僧i 提交于 2019-11-30 02:53:24
问题 Some time ago after not standing anymore lines like this: if (arg) invk(test); else if (test) { alot(); stuff(); } I decided for my self its better for readability in our 1920x1200 times, to not omit the {} . So I wrote a tool that reformats my existing code. later I noticed a bug in that tool resulting in if (x) { ... } else if(y) { ... } else if(z) { ... } had been changed (wihtout obvisiously changing the behavior) into: if (x) { ... } else { if(y) { ... } else { if(z) { ... } } } This