specifications

why javascript permits $ for name of functions?

我的未来我决定 提交于 2019-12-13 20:18:35
问题 I am starting to love jQuery but as PHP developer I hate using that $().stuff as everyone know $ in PHP marks variables. I guess jQuery in javascript declares a function like this function $(element) {/*stuff*/} Does javascripts permits $ as the name of a func? Is that a good behaviour? I knew only standard [0-9a-zA-Z_] could be the name of funcs/vars. Am I missing something? Thanks 回答1: You can do var whatever = $.noConflict(); now you can use whatever(..) instead of $(...) documentation at

Understanding rules for parsing tokens in foreign content

。_饼干妹妹 提交于 2019-12-13 18:00:26
问题 I have a question it is related to the stage of executing instructions in the condition. I do not quite understand what each instruction means and when it is executed. Examples with the help of UA would be very helpful in this case. Here is a piece from specification: A start tag one of the following: b, big, blockquote, body, br, center, code, dd, div "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", "menu", "meta", "nobr", "ol", "p",

AngularJS directives as “custom” HTML tags: isn't this dangerous and may conflict with future HTML versions?

邮差的信 提交于 2019-12-13 15:26:52
问题 I'm currently reading a lot about different JS frameworks (EmberJS, AngularJS, etc.). On first sight, I loved AngularJS' idea of using directives like custom HTML tags: <mytag>...</mytag> But isn't this dangerous? If I define a lot of such tags, then there's a high likelihood that a future HTML spec may also define one of my custom tags, but with a whole other meaning! I know that custom tags may be allowed by the HTML spec itself: http://w3c.github.io/webcomponents/spec/custom/ But at the

Rails generators not generating the proper test templates

人盡茶涼 提交于 2019-12-13 12:33:33
问题 My project lives here: https://github.com/jonesdeini/ICanHazSandvich I'm getting setup using minitest-rails add I can't get the generators to generate the correct test templates. from my application.rb: config.generators do |g| g.test_framework :mini_test, :spec => true, :fixture => false end even with "g.test_framework nil" I still get the same test templates generated: Output: rails g model Foo invoke active_record create db/migrate/20120827160129_create_foos.rb create app/models/foo.rb

using group by with specification in Spring data count method

天大地大妈咪最大 提交于 2019-12-13 10:29:40
问题 I want to implement a spring data method which check result of the following query select count(1) from installation_requested_t requested where requested.installation_id in (select installation_id from installation_requested_t where request_id=?) group by requested.installation_id having count(1)>1; For the project, it is mandatory to use specification with the spring data jpa. So there is my repository method call : installationRequestedRepository.count( InstallationSpecs

object property order between integer indexes, symbols and strings

孤街浪徒 提交于 2019-12-13 10:26:59
问题 In recent ECMAScript, is it possible to obtain a list of all properties of an object in creation order [1] ? There are two issues that i could not find to be exposed by specification [2] . I am asking whether i missed something. Is either possible to obtain? Creation order of integer indexes Order of integer indexes, symbols and strings between another In other words, given an object coming from an object literal { "propName": 0, [Symbol.for("identifier")]: 0, "0": 0 } Is it possible to

Is it valid to nest <html> inside <html>?

血红的双手。 提交于 2019-12-13 05:46:35
问题 Is this valid HTML? <!DOCTYPE html> <html> <head/> <body> <p>Hello, World</p> <html> <head/> <body> <p>Hello, World 2: Revenge of the Pointer</p> </body> </html> <html> <head/> <body> <p>Hello, World 3: GOTO null</p> </body> </html> </body> </html> According to the HTML5 specs, the <html> element can be used: As the root element of a document. Wherever a subdocument fragment is allowed in a compound document. It's the second part that I'm confused about. Does this mean that <html> is a

Why fetch Body object can be read only once?

為{幸葍}努か 提交于 2019-12-12 16:27:08
问题 The fetch specification states that the readable stream Body contains the Body.bodyUsed flag which is initially set to false and then is set to true with a call of any parsing method. Here's an example: fetch('/some/path', (res) => { // res.body.bodyUsed === false res.json(); // res.body.bodyUsed === true }); If you try to call a method like res.json() or res.text() once again, an exception is thrown. The question is : why that behavior is used? Why not to allow parsing that readable stream

Selenium Can't Find 'spec' Folder

≯℡__Kan透↙ 提交于 2019-12-12 15:16:40
问题 So I'm attempting to set up my local system to help finish off an existing project from an employer who uses only rails. They want me to primarily focus on rspec testing as the project is nearly functional and I need to flesh out the things they've missed. However, I cannot get 'rake spec' to build my test folder. As it is, the test folder contains a few basic user login tests using Selenium (I didn't write them). Here is the trace from the error: /opt/local/lib/ruby/gems/1.8/gems/selenium

How To Bundle .jar Files with Pyinstaller

六眼飞鱼酱① 提交于 2019-12-12 12:19:27
问题 How do you get pyinstaller to bundle .jar files as archives for a python project that utilizes them? For instance, to make an exe with (I am using pyjnius for handling the sikuli-standalone jar): # test.py import os import sys # set the classpath so java can find the code I want to work with sikuli_jar = '/sikuli-api.standalone-1.0.3-Pre-1.jar' jarpath = os.path.dirname(os.path.realpath(__file__)) + sikuli_jar os.environ['CLASSPATH'] = jarpath # now load a java class from jnius import