semantics

What do ‘value semantics’ and ‘pointer semantics’ mean?

ε祈祈猫儿з 提交于 2019-11-28 23:21:38
What is meant by ‘value semantics’, and what is meant by ‘implicit pointer semantics’? Java is using implicit pointer semantics for Object types and value semantics for primitives. Value semantics means that you deal directly with values and that you pass copies around. The point here is that when you have a value, you can trust it won't change behind your back. With pointer semantics, you don't have a value, you have an 'address'. Someone else could alter what is there, you can't know. Pointer Semantics in C++ : void foo(Bar * b) ... ... b->bar() ... You need an * to ask for pointer semantics

Is “map” a loop?

假如想象 提交于 2019-11-28 21:04:20
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#Loops So, what I'm looking for is a formal reason to be convinced of one side vs. the other. So far,

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

≡放荡痞女 提交于 2019-11-28 21:01:49
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> </dl> <dl class="another-main-list"> <dt>Stuff!</dt> <dd>Alright!</dd> </dl> </div> I was

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

痞子三分冷 提交于 2019-11-28 19:10:50
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:(NSManagedObjectContext *)context { if ([self respondsToSelector:@selector(entityInManagedObjectContext:)]) {

Semantics and Structure of Name-Value Pairs

帅比萌擦擦* 提交于 2019-11-28 16:56:42
问题 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

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

吃可爱长大的小学妹 提交于 2019-11-28 15:39:30
问题 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",

What is the semantic web? [closed]

喜夏-厌秋 提交于 2019-11-28 15:35:13
I've heard a lot about the semantic web but I'm still not exactly sure what it is. How will it be different to the web we know now? How will it be different to the web we know now? Right now the HTML+CSS is centered more on structure and presentation. Semantics is about the meaning of the information. In semantic web you use shared ontologies to establish meaning (semantic) of the object and meaning of relations between the objects. Best known ontologies are: FOAF and Dublin Core . Typically semantics would be expressed in specialized language, such as RDF or OWL . RDF can be embedded within

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

情到浓时终转凉″ 提交于 2019-11-28 13:38:56
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> ? The HTML 5 spec does not prohibit you from using the section element inside of an aside element. The aside

cudaMemset() - does it set bytes or integers?

放肆的年华 提交于 2019-11-28 10:11:17
From online documentation: cudaError_t cudaMemset (void * devPtr, int value, size_t count ) Fills the first count bytes of the memory area pointed to by devPtr with the constant byte value value. Parameters: devPtr - Pointer to device memory value - Value to set for each byte of specified memory count - Size in bytes to set This description doesn't appear to be correct as: int *dJunk; cudaMalloc((void**)&dJunk, 32*(sizeof(int)); cudaMemset(dJunk, 0x12, 32); will set all 32 integers to 0x12, not 0x12121212. (Int vs Byte) The description talks about setting bytes. Count and Value are described

Should the cursor property be set in a rule with or without the :hover pseudo-class?

故事扮演 提交于 2019-11-28 07:25:22
问题 Say you, or I, have coded an HTML element... <a id='hydrogen' href='#'>H</a> ...and some :hover CSS... #hydrogen:hover { background:red; } ...and now we want to put a fancy hand cursor when hovering. There's two options for this: apply to stateless element: #hydrogen { cursor:pointer; } or, apply to :hover state. #hydrogen:hover { color:red; cursor:pointer; } My question: is there any reason(s) why one way is decisively better than the other? ...or is it tomato, tomato? 回答1: Compatibility: