specifications

Spring Data JPA. How to get only a list of IDs from findAll() method

江枫思渺然 提交于 2019-11-27 12:50:47
问题 I have a very complicated model. Entity has a lot relationship and so on. I try to use Spring Data JPA and I prepared a repository. but when I invoke a method findAll() with specification for the object a have a performance issue because objects are very big. I know that because when I invoke a method like this: @Query(value = "select id, name from Customer ") List<Object[]> myFindCustomerIds(); I didn't have any problems with performance. But when I invoke List<Customer> findAll(); I had a

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

Is there a Python language specification?

自古美人都是妖i 提交于 2019-11-27 12:03:51
Is there anything in Python akin to Java's JLS or C#'s spec? There's no specification per se. The closest thing is the Python Language Reference , which details the syntax and semantics of the language. You can check out the Python Reference No, python is defined by its implementation. 来源: https://stackoverflow.com/questions/1094961/is-there-a-python-language-specification

Can type selectors be repeated to increase specificity?

喜欢而已 提交于 2019-11-27 09:17:22
The spec states regarding calculating CSS specificity: (bold mine) Note: Repeated occurrences of the same simple selector are allowed and do increase specificity. So for example .class.class {} has twice the specificity than .class {} - DEMO However, regarding the term ' simple selector ' the spec has this to say: (bold mine) A simple selector is either a type selector or universal selector followed immediately by zero or more attribute selectors, ID selectors, or pseudo-classes, in any order. So since the spec says that repeated occurrences of the same simple selector are allowed - this would

HTTP Spec: Proxy-Authorization and Authorization headers

情到浓时终转凉″ 提交于 2019-11-27 09:15:47
问题 So I'm trying to implement the following scenario: An application is protected by Basic Authentication. Let's say it is hosted on app.com An HTTP proxy, in front of the application, requires authentication as well. It is hosted on proxy.com The user must therefore provide credentials for both the proxy and the application in the same request, thus he has different username/password pairs: one pair to authenticate himself against the application, and another username/password pair to

Decode data bytes of GIF87a raster data stream

白昼怎懂夜的黑 提交于 2019-11-27 08:17:23
问题 I'm trying to decode the data bytes from a GIF87a raster data stream. I'm unsure of how to read the LZW variable length codes (and how LSB...least significant byte first fits in this). The raster data stream starts as follows (in hex): 06 6b 40 86 70 48 2c 1a 8f 44 4b 44 22 89 58 8e 10 c7 e1 80 06 ->code size of 6 6b ->block byte count of 107 40 ->clear code (2^6) which is 64 in decimal or 40 in hex 86 -> start of actual data GIF87a spec: http://www.w3.org/Graphics/GIF/spec-gif87.txt The

Is a colon a legal first character in an XML tag name?

雨燕双飞 提交于 2019-11-27 08:10:14
问题 According to the W3C XML Recommendation, start tag-names have the definition: STag ::= '<' Name (S Attribute)* S? '>' ..where Name is: Name ::= NameStartChar (NameChar)* NameStartChar ::= ":" | [A-Z] | ... ..(n.b., states that a colon can appear as the first character) suggesting the following is a valid XML document: <?xml version="1.0" ?><:doc></:doc> ..but any parser I try this in shows the colon as a formatting error. Also, under Appendices B (though now a depreciated part of the document

Rails rspec set subdomain

烂漫一生 提交于 2019-11-27 07:10:56
I am using rSpec for testing my application. In my application controller I have a method like so: def set_current_account @current_account ||= Account.find_by_subdomain(request.subdomains.first) end Is it possible to set the request.subdomain in my spec? Maybe in the before block? I am new to rSpec so any advice on this would be great thanks. Eef I figured out how to sort this issue. In my before block in my specs I simply added: before(:each) do @request.host = "#{mock_subdomain}.example.com" end This setups up the request.subdomains.first to be the value of the mock_subdomain. Hope someone

HTTP URL - allowed characters in parameter names

匆匆过客 提交于 2019-11-27 06:35:19
问题 Is there any formal restriction as to which characters are allowed in URL parameter names? I've been reading RFC3986 ("Uniform Resource Identifier (URI): Generic Syntax") but came to no definitive conclusion. I know there are practical limitations, but would it actually be forbidden to do something like: param with\funny<chars>=some_value as long as I escape it correctly: param%20with%1cfunny%3cchars%3e=some_value 回答1: There are no restrictions on escaped parameter names in the URI specs.

What is the actual HEX / binary value of the GS1 FNC1 character?

我是研究僧i 提交于 2019-11-27 05:06:38
I have searched many a page on wikipedia, the official GS1 specifications, but have yet to find a definite answer to the question What is the actual HEX / binary value of the GS1 FNC1 character? There is much information about how to use the GS1 identifiers, how to print the barcodes with ZPL and how to encode the FNC1, but I want to know the actual HEX value of that character. The special function characters such as FNC1 through FNC4 do not have any direct ASCII representation. Each symbology that supports such characters has a different scheme for encoding them in its internal representation