Menu
  • HOME
  • TAGS

semantic error in code

c,list,struct,semantics

It seems that you are adding a local variable to your global procTable list. This happens in your interpretiere_pipeline function at line 83. pDesk is a local variable, and the C compiler puts those in the stack. When the current function returns, that memory frame will get deallocated and occupied...

What is the difference between class Foo; end & Foo = Class.new (And module/Module)?

ruby,semantics

class Foo; end is roughly the same as Foo = Class.new, but there are some key differences. All of these also hold true for module Bar; end vs. Bar = Module.new. class is a keyword whereas Class is simply a constant name like any other. Class.new allows creating anonymous (unnamed)...

Consequence of restrictions in ontology on SPARQL end results

rdf,sparql,semantics,owl,ontology

That's because you are querying the TBOX and ?p in your query translates to the bnode representing the anonymous class restriction. You are not binding to instances in the query, but the value/class used for the owl:allValuesFrom restriction. So http://purl.oclc.org/NET/ssnx/qu/dim#Temperature would be the result of your query. Had you wanted...

Using an ontology to produce semantic full information from the raw data

sparql,jena,semantics,ontology,rdfs

actually, this is a great use of D2RQ mapping language, and D2RQ server. Go install D2RQ, then start it up with a connection to your relational database. Then generate a mapping file using their generator that comes with the software. Then you'll have a mapping file -- edit that and...

The h1 in the structure of a page

html,html5,structure,semantics

The <h1> can be after other headlines, if the document structure need it. In this case I don't think you need to have there <h2>Menu</h2> - everyone see that the block of links is menu. If not, try to work on UX. Remember that no automatic code checker/validator can't tell...

PHP & Perl behavior when testing “0”, “-0”, “0.0”, “00”,

php,perl,testing,semantics

You are using the ternary operator which checks for the truthiness of the expression before the ?. The truthiness of values is described in the Booleans section: When converting to boolean, the following values are considered FALSE: the boolean FALSE itself the integer 0 (zero) the float 0.0 (zero) the...

What is Semantic Wiki?

php,semantics,wiki,semantic-web,semantic-mediawiki

Well, the Wikipedia article mentioned in the comments is quite theoretic. It starts with terms such as knowledge that need a few explanations. I take a deep breath and try to explain a few things... 1. What exactly is a Semantic Wiki? To make things simple, you probably know what...

Using both date and duration in html5 element's datetime attribute

html,html5,datetime,time,semantics

There does not appear to be a way to combine specific date strings or time strings with a duration string in a single <time> element. The spec suggests using two <time> elements instead: Code Example: The time element can be used to encode dates, for example in microformats. The following...

What are the values of a polymorphically encoded recursive algebraic data type?

haskell,recursion,polymorphism,semantics

In System F (AKA λ2), all inhabitants of ∀α.α→α→α are indeed λ-equal to K or K*. First, if M : ∀α.α→α→α then it has normal form N (since System F is normalizing) and by subject reduction theorem (see Barendregt: Lambda calculi with types) also N : ∀α.α→α→α. Let's examine how...

Getting “error LNK2019: unresolved external symbol … ”

c++,initialization,semantics

You'll get the link errors (not compilation errors) that you see if you, for instance, forget to add "Text.cpp" to your project so it doesn't get compiled and linked. There are two errors in the code - one is in the copy constructor, and one is in the assignment operator....

What's this Coffescript use of then?

syntax,coffeescript,semantics

Of course ... It calls the newcard.save().then function - thanks @rightfold - which is in the Angular.js promises api. Not immediately obvious out of context of that api which BTW is nicely explained here.

Using '&&' instead of 'if' for single instructions

php,semantics

Please don't. This is horribly unreadable. And it starts innocently enough, soon other "clever" developers would come and invent more "clever" ways of using this && operator to avoid those "horrible" ifs. Please... Don't. Functionally, yes, they will work the same....

MarkLogic 8 - SPARQL - Follow synonym chain

sparql,semantics,marklogic

To use SPARQL, you would need to represent this data as triples. Someone who knows ontologies better would come up with better IRIs, but something like (as represented inside MarkLogic): <triple> <subject>http://marklogic.com/scope#cat</subject> <predicate>http://marklogic.com/term</predicate> <object>cat</object> </triple> <triple> <subject>http://marklogic.com/scope#cat</subject> <predicate>http://marklogic.com/synonym</predicate>...

Semantically and syntactically redundant curly braces change compiler error message [duplicate]

java,syntax,semantics

I think you mean that the second fails and the first does not. When you have int a=5 you are declaring a new variable a. That variable is only valid inside the scope in which it is declared, in both these cases that means inside the if block. When you...

Is it semantically correct to put a table row inside an tag?

html,semantics

If you apply a link to the <tr> element, clicking anywhere on the row will send the user to the link. This includes space that isn't a table cell, like the cell borders. The same applies to the <td> element. Putting it inside links the text only, putting it on...

HTML - How to properly mark a phrase

html5,semantics

<blockquote> doesn't demand a cite, it's optional. Don't overthink it. <blockquote> without cite is what you're looking for.

Swift: Default property vs setting in initializer

swift,methods,properties,semantics

The only downside is that default property values are set every time an instance of the object is created, even if a property is subsequently overwritten in one or more initializers. This probably isn't an issue if you're just assigning default numeric values, but if there's a class that is...

Virtuoso 37000 Error SP030

sparql,semantics,semantic-web,virtuoso

The query you've shown us might not be the same as the query you're actually running. First, the fact that the error message says "line 1" makes me wonder whether you've actually got the query run all onto one line. That can make it easy to get typo problems. When...

Using
to group sample content in home page (e.g. “Portfolio”, “About”)

html,html5,seo,semantics

IMHO: Yes. <section> should contain content that may have its own header and is semantically connected with each other. Preview of the content (e.g. title and one paragraph of article on articles list) meets this definition. No, use <div> instead. <section> is absolutely not a generic container element. See more...

What is the semantic HTML tag to display for URLs that are not links?

html,html5,url,tags,semantics

If I understand you correctly, you want the url to be a link but also display as a url. To do this put the url in the a tag twice, like so: This can then be style as desired by the destination page. <style> a { color: blue; text-decoration: underline;...

Date modelling using ontology concepts

rdf,semantics,owl,ontology,protege

If i understand your question correctly, you're essentially asking if you should "duplicate" existing classes and properties from other ontologies into your own one. The clear answer is: no. The semantic web / linked data lives of the re-use of existing vocabularies, so [...] it's best to not re-invent any...

Should I be using nofollow links in reference website?

html,html5,seo,semantics,nofollow

I mention this now as a webmaster for one of these websites actually approached me saying they were penalised by Google due to invalid links through to their site. First off, that webmaster will have no evidence to show that it was because of you linking to their site....

semantically replacing unordered list (UL) free text

html,html5,semantics

According to me Yes using figure within your code to full fill the purpose is correct... According to w3c:- The element(figure) can thus be used to annotate illustrations, diagrams, photos, code listings, etc, that are referred to from the main content...... Go to HTML5 validation service provider and enter the...

Conflicting layouts prevents semantic html

html,css,html5,semantics

Passing your non-semantic snippet to the W3 HTML Validator reveals that it is valid HTML, apart from the missing title tag, which is not your doing. As for semantic validity, this is a really opinion-based question, but I'll try to explain the reason behind my opinions. I never even really...

Get geographical coordinates of a particular place from DbPedia

sparql,semantics,ontology,dbpedia

Have a look at the N3/TTL serialization of the data for Mumbai. Note that the foaf:name value has a language tag: foaf:name "Mumbai"@en. You need to use "Mumbai"@en, with the language tag, in the query. Additionally, doing dbo:Place 'Mumbai' doesn't make any sense. You might instead want to ask for...

Why can an instance of a class access private fields of another instance of its own type?

java,semantics,dsl

Well, first you have to ask "why have private fields at all?" Private fields are primarily for encapsulation: a user of a a class shouldn't have to know the internals of that class' implementation. In fact, they shouldn't know, because if they relied on those specifics, then the implementer would...

OWL. How to express that siblings has common parent?

rdf,semantics,semantic-web,owl

Dave is father of Mary and Mary sister of Jack. I want reason that Dave have two childs Jack and Mary. If you ignore the possibility of siblings having different parents (e.g., a parent in common and a different parent), then you can do this with subproperty chains. If...

Describe a film (entity and attribute) using the first order logic

logic,semantics,semantic-web,first-order-logic

To state that an object has a certain property you would use a single place predicate. For example, to state that x is a film you could write Film(x). If you want to attribute some value to an object you can use two (or more) place predicate. Using your example...

How to structure a conversation in html, as in a novel?

html5,semantics,dialogue

Choose what you love! See this : http://gabrieleromanato.name/how-to-mark-up-chats-and-conversations-in-html5/ Sure you can use odd , even css selectors to style it floating left and right like whatsapp style....

Semantic Credits with Photos on a site

html,html5,semantics

I'd recommend the small element. See http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-small-element

signal local to process scope

vhdl,grammar,semantics

Is there any reason inherent to the design of the VHDL language, why the following can not be done? process (clk) variable b : std_logic_vector(15 downto 0); -- This would be nice, but is not permitted: signal c : std_logic_vector(15 downto 0); begin (Declare a signal in a process.)...

Javascript if statement if (ball.style.left === '0px') {

javascript,css,if-statement,equals,semantics

The problem is really simple. I came upon it when I was coding a snake in javascript. When you want to test where the ball is located don't use ball.style.left but ball.offsetLeft. In the demo you'll notice ball.style.left doesn't return anything while the offsetLeft does. Only use ball.style.left when you...

do we need to check the inheritance graph of a single-inherited language for loops?

inheritance,graph,compiler-construction,semantics

Consider the following two classes: class A extends B {} class B extends A {} In some languages, most notably C++, the above would be illegal because you can't refer to B before its declaration and you can't inherit from a class that has only been forward-declared. So in such...

What does it mean to “code against” or “resolve against” something?

java,oop,struts2,programming-languages,semantics

"against" is not used here as "in oposition" but rather as "supported by", "backed up by", "provided by", "based on". One of the accepted meanings of the word "against" (Oxford dictionary) is In or into physical contact with (something), typically so as to be supported by or collide with it...

Material Design: Button or Edit Text?

android,android-edittext,semantics,android-button,material-design

You can use both approach but if you will use Linear layout that will be good. For material design you can follow below link: https://github.com/navasmdc/MaterialDesignLibrary#flat-button https://github.com/keithellis/MaterialWidget https://github.com/tekinarslan/AndroidMaterialDesignToolbar https://github.com/madcyph3r/AdvancedMaterialDrawer I hope, It will help....

R: Parsing ConceptNet5 syntax into Data frame

r,semantics

You can read in the csv file using read.table, with space as a separator. This will give you a data frame with a number of columns. However, you can throw away every column except for the first one, since the first one contains all the information you need to build...

Add my defined anntation to an individual in owl

semantics,owl,owl-api

In order to use any annotation property you wish to use, the snippet above must be modified this way: OWLAnnotation Movie_Name = factory.getOWLAnnotation( factory.getOWLAnnotationProperty(IRI.create("full iri for your property here")), lbl); OWLAxiom axiomAA = factory.getOWLAnnotationAssertionAxiom(Cast.asOWLNamedIndividual().getIRI(), label); manager.applyChange(new AddAxiom(ontology, axiom)); ...

how to create and pass rdf graphs from memory to DOTNETRDF [closed]

rdf,sparql,semantics,dotnetrdf

In fact I tried to implement the IGraph interface in way I defined a data structure for passing the triples , but it seems that the only way to apply sparql engine is by storing these triples in a triple store You can put any IGraph implementation in the...

Protege Equivalent to query

sparql,semantics,semantic-web,protege4

This is a bit complicated, but if you look into the ontology everything that is defined as a :MealCourse is an owl:equivalentClass, so you need to first find all owl:equivalentClass and then if you look into the result you will see that they are made of owl:intersectionOf parts. Then you...

Is using a HTML Label to wrap elements semantic?

html,html5,validation,semantics

Pasting the following code in the W3 HTML Validator yields two errors <!DOCTYPE html> <html> <head> <title>Test</title> </head> <body> <label for="test1"> <h3>Label Heading</h3> <p>Label Description</p> </label> <input id="test1" name="test" type="radio"/> </body> </html> Element h3 not allowed as child of element label in this context. Element p not allowed as child...

Semantically correct way to define an empty anchor [duplicate]

javascript,html,semantics

All options are correct in HTML5: http://www.w3.org/TR/html-markup/a.html If you want to cover different angles of the question, check a bit accessibility (people with disabilities) guidelines: http://www.w3.org/TR/WCAG20-TECHS/SCR35.html ...

Algorithm to colorize C-like /* comment blocks */ [closed]

c,algorithm,parsing,semantics

First of all notice that C supports multiline strings, so you already had this problem, just not addressed it. Your parser engine has a state. You have to know whether you're inside a literal string or a C like comment, etc. Store this state for the starting position of each...

Ambiguity in the standard on undefined behaviour of out of range pointer

c++,c++11,language-lawyer,semantics,undefined-behavior

The paragraph you're quoting refers to pointer arithmetic, not to evaluation of pointers. It states that the only time pointer addition p + i is defined is if (treating subtraction of i as equivalent to addition of -i) p points to an element of an array object or one past...

Why is `i` commonly used for indices and other variable name choices? [closed]

variables,naming-conventions,semantics

According to resources that have turned into dust -- this tradition goes back to the early version of FORTRAN where certain variables were either integer or real, depending on their starting letter. i was the first integer, and so it made sense for loops. This is also explains the old...

Advanced way to get related articles (semantics)

sql,semantics

TL,DR Check about TF*IDF on wiki, then about Cosine similarity. Long Answer (with examples) What is TF*IDF TF*IDF stand for Term Frequency * Inverse Document Frequency. It's one the way to method to create good tag for a document inside a large group. The idea behind it is the extract...

How do I extract the offset of a WordNet synset give a synset in Python NLTK?

python,nlp,nltk,semantics,wordnet

>>> from nltk.corpus import wordnet as wn >>> ss = wn.synset('dog.n.01') >>> offset = str(ss.offset()).zfill(8) + '-' + ss.pos() >>> offset u'02084071-n' ...

If key in dictionary returning false when key exists

python,if-statement,semantics

Probably it grabs the newline character, so in order for your code to work you should trim the choices variable. Alternatively if your dict keys would be ints instead of strings, you could just perform casting operation. EDIT: your last comment proves my point because of the [49, 13] numbers...

None being printed in middle of program?

python,semantics,nonetype

A function that doesn't have a return statement actually returns None. print 'Current hand: ', display_hand(hand) The line above prints "Current hand: ", then executes display_hand(hand) which prints things as a side-effect, then finally prints the return value of the function which is None To prevent this, run display_hand(hand) outside...

Semantics - creating grammar in NLTK

python,nltk,semantics,context-free-grammar

There is no subject or VP in the relevant structure. Try writing a rule for and when used to conjoin sentences. What is it? Sentence1 and Sentence2 gets the interpretation <Sentence1> & <Sentence2> I.e., take the meanings of the two sentences and conjoin them with &. In the notation of...

What does ''except Exception as e'' mean in python?

python,python-2.7,python-3.x,exception-handling,semantics

except Exception as e, or except Exception, e (Python 2.x only) means that it catches exceptions of type Exception, and in the except: block, the exception that was raised (the actual object, not the exception class) is bound to the variable e. As for finally, it's a block that always...

Computed read-only property vs function in Swift

methods,properties,semantics,swift

It seems to me that it's mostly a matter of style: I strongly prefer using properties for just that: properties; meaning simple values that you can get and/or set. I use functions (or methods) when actual work is being done. Maybe something has to be computed or read from disk...

Why does my python pig latin program output word+way every time?

python,logic,semantics,python-3.4

This line is incorrect, as it will always evaluate to true: elif word[0] == 'a' or 'e' or 'i' or 'o' or 'u': What you meant to write was: elif word[0] == 'a' or word[0] == 'e' or word[0] == 'i' or word[0] == 'o' or word[0] == 'u': You...

Understanding Operational semantics

semantics,operational

Every operational semantics is different and the question specifies no context, so I can only guess at the answer. I would parse if b then c; w else skip as if b then {c; w} else skip, that is, the second interpretation from the question. The derivation seems to be...

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

bash,shell,syntax,semantics

It's a parameter expansion, it mean if the third argument is null or unset, replace it with what's after :- $ x= $ echo ${x:-1} 1 $ echo $x $ There's also another similar PE that assign the value if the variable is null: $ x= $ echo ${x:=1} 1...

When should tuples be used instead of objects and vice versa?

object,tuples,semantics,swift

According to the book on Swift, Tuples are useful for temporary groups of related values. They are not suited to the creation of complex data structures. They define "temporary" through the scope of the data: if a piece of data never leaves the scope of a single method, or a...

How to determine the corresponding language of a grammar?

semantics,context-free-grammar,syntactic-sugar

The grammar is the "comprehensive mathematical formula". :) However, in the current case, it is easy to give an alternate description. Your grammar will generate strings of the form a^nb^m where s^i stands for "repeat the substring s i times", and 2n <= m <= 3n n can also be...

understanding copy and mutable copy

objective-c,copy,semantics,mutable

Short answer Yes. No memory corruption, and no compile error if the iVar is accessible. Same as 1. Long answer Mutable and immutable copy is one of the core concepts found in the Apple's Foundation classes, such as NSString or NSArray. As stated in NSCopying protocol, the class that has...

SPDY on shared host & SEO Sematics

seo,semantics,shared-hosting,spdy,http2

how about SEO sematics, will it harm my ranking? It won't. are there any better solutions for this problems? It is not a problem. can i use ipv6 to mask the port somehow? No....

Difference between Semantic Web and NLP?

nlp,terminology,semantics,semantic-web

These are two separate subject areas but they do overlap in some places. Because documents, regardless of their format are made up of heterogenous syntax and semantics, the goal is to represent information that is understandable to a machine and not just a human being. This is a common goal...

Using or not using const on methods that modify / allow the modification of referenced values without touching the fields themselves

c++,class,methods,const,semantics

It is a matter of your design decision. Constness is intended to be used as a design concept. It is supposed to help you to implement a higher-level concept of what you consider "modifying" and "non-modifying" access. By properly using const on your class methods you can make the property...

How to notate that the parameter value doesn't matter in a JUnit test?

java,junit,tdd,semantics,hamcrest

There is a feature called JUnit Theories. @Test and Theory have a different focus on testing: a Test is input-output-related (on some input, expect some output) a Theory is algorithm related, i.e. it makes assertions on the behaviour of the called function, accepting a large set of input parameters (being...

HTML semanctics Can elements come before heading tag in sectioning element?

html5,semantics

Yes. The header is what it contains and not where it's placed in the structure. http://developers.whatwg.org/sections.html#the-header-element The header element represents a group of introductory or navigational aids. A header element is intended to usually contain the section's heading (an h1–h6 element or an hgroup element), but this is not required....

Does CSS affects HTML sematics?

html,css,html5,semantics

No, CSS does not affect HTML semantics. There may have been some historic semantic differences between a <ul> and an <ol> besides just what the default numbering is for each type of list item (some claim a <ul> is supposed to represent an unordered set while a <ol> is supposed...

include semantic images with php if view port is larger than 1024px

php,html,image,include,semantics

The best way to do this is by checking the user agent that is making the request. This is not a fool proof but you could solve the majority of your use cases with it. Something like this from the PHP docs: <?php echo $_SERVER['HTTP_USER_AGENT'] . "\n\n"; $browser = get_browser(null,...