standards

How should the return value of JavaScript <href> links be handled?

纵然是瞬间 提交于 2019-12-11 08:18:28
问题 According to standards , what's the correct way to handle the return value of javascript protocol href links? Some examples: <a href='javascript:"Hello World";'> Click </a> <!-- return a String --> <a href='javascript:ThisFunctionReturnsString();'> Click </a> <a href='javascript:12345;'> Click </a> <!-- Number --> <a href='javascript:[1, 2, 3, 4, 5];'> Click </a> <!-- Array --> <a href='null;'> Click </a> <!-- null--> <a href='undefined;'> Click </a> <!-- undefined--> <a href='javascript:{};'

Lucene Prefix Search for Indexed data through Standard Analyzer

北战南征 提交于 2019-12-11 08:08:51
问题 I am creating index using Lucene 3.6.0 for Java. They are built using Standard Analyzer. Is there any way I can perform prefix search with lucene i.e. i want the results to start with the specified search string without changing the analyzer used for indexing? Many thanks 回答1: If you mean queries like "work*" to find "work", "worker", "working", etc. you can already perform those queries using text analyzed with the Standard Analyzer. documented here: http://lucene.apache.org/core/3_6_0

Why is passing this kind of variable-size parameter by value impossible?

让人想犯罪 __ 提交于 2019-12-11 07:29:26
问题 We have a structure like below: template<size_t size> class Container{ public: char characters[size]; }; And we have a function like below: template <size_t size> void function(Container<size> input,size_t Size){ //all instances do exactly same thing and with regard to Size that determines the size of object } Now in C++ for every value of size, a different instance of function will be created and apparently that's not right in this case since all instances do the same thing, to avoid this

Do I need to define `operator==` to use my class with standard containers?

亡梦爱人 提交于 2019-12-11 07:08:19
问题 I'd like clarification on the C++ standard, specifically where it says (my interpretation) in section 20.1.3 that "for class T and an instance of class T called x, T(x) must be equivalent to x" for the class to work with standard containers. I couldn't find a definition of 'equivalent'. Does this mean that I have to define operator== as a member of my class, so that T(x) == x returns true? 回答1: Equivalent is purposefully vague. (To avoid things like implying operator== must be defined; it

Where is the mutability of Objects defined in ECMAScript?

断了今生、忘了曾经 提交于 2019-12-11 06:25:14
问题 In this question about the passing of arguments in JavaScript functions, we learn that everything is passed by value in JavaScript. In Mozilla documents, it is mentioned that the primitive types are immutable, and objects are. Although I came from the procedural and structured programming school, I was able to quickly pick up the concepts. In the ECMAScript standard, it is defined that "An Object is 'logically' a collection of properties". The standard also defines how objects may be compared

Why does “template argument deduction for class templates” not work on a plain struct?

依然范特西╮ 提交于 2019-12-11 06:02:02
问题 C++17 supports template argument deduction for class templates . Please see www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0091r3.html for detailed background information. However, the code below doesn't work as expected; #include <utility> template<typename T> struct A { T x; }; int main() { auto p = std::pair{ 1, 2 }; // ok, as expected. auto a = A{ 0 }; // // error : no viable constructor or deduction guide // for deduction of template arguments of 'A' // } My compiler is clang 5.0 with

regarding security concerns, are browser providers excusable for allowing cross site cookies?

我的未来我决定 提交于 2019-12-11 06:02:01
问题 Regarding security concerns, are browser-providers excusable for allowing cross-site cookies ? Does any important use of it do justify the existance of this dangerous mechanism? See this reference 回答1: No. Webmasters can ask (modern) browser to only sent cookies when first-party with the SameSite attribute: Set-Cookie: key=value; HttpOnly; SameSite=strict https://www.sjoerdlangkemper.nl/2016/04/14/preventing-csrf-with-samesite-cookie-attribute/ Beware, it's possible that when arriving on the

Is concatenating arbitrary number of strings with nested function calls in C undefined behavior?

痴心易碎 提交于 2019-12-11 02:59:26
问题 I have an application that builds file path names through a series of string concatenations using pieces of text to create a complete file path name. The question is whether an approach to handle concatenating a small but arbitrary number of strings of text together depends on Undefined Behavior for success. Is the order of evaluation of a series of nested functions guaranteed or not? I found this question Nested function calls order of evaluation however it seems to be more about multiple

Choosing Entity framework as default implementation ORM against Nhibernate, cons and pros?

淺唱寂寞╮ 提交于 2019-12-11 01:59:54
问题 I’m working in a development company, which develops small to medium size web based projects, we mainly use Microsoft technology, currently we are in technology selection phase, and we are looking into ORMs, we need to select the standard ORM for our future projects, for now we narrowed the chooses into two: - • Nhibernate: - Mature. Open source. Feature rich. Configurable and flexible, to the highest extends. Well supported by a strong community. Proven to be successful many places. •

std::getline for an ifstream but using a char* instead of a string [closed]

北慕城南 提交于 2019-12-11 00:26:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I want to use the getline function with a char* . I don't want to use std::string because I have a function that takes char* as parameters and writes to them and I don't want to write a whole new one just for