specifications

How can I specify https protocol in routing spec with rspec?

守給你的承諾、 提交于 2019-12-05 08:07:37
In my routes file I have: resources :subscription, :only => [:show], :constraints => {:protocol => "https"} I'm trying to add a spec for this route like this: it "recognizes and generates #show" do { :get => "/subscription", :protocol => 'https' }.should route_to(:controller => "subscriptions", :action => "show") end However, the spec still fails. If I remove the :protocol => 'https' , the spec also fails: ActionController::RoutingError: No route matches "/subscription" The (undocumented?) solution is to simply include an entire dummy url, like so: it "recognizes and generates #show" do { :get

Where are ioctl parameters (such as 0x1268 / BLKSSZGET) actually specified?

点点圈 提交于 2019-12-05 05:35:16
This question was migrated from Unix & Linux Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I am looking for a definitive specification describing the expected arguments and behavior of ioctl 0x1268 (BLKSSZGET). This number is declared in many places (none of which contain a definitive reference source), such as linux/fs.h , but I can find no specification for it. Surely, somebody at some point in the past decided that 0x1268 would get the physical sector size of a device and documented that somewhere. Where does this information come from and where can I

Prompt max length

半城伤御伤魂 提交于 2019-12-05 01:47:15
Using prompt() I am generating some html to and need to know the maximum length that I can put in the popup. I can't find anything in the spec about this, wondering if someone can help The ECMAScript Programming Language Specification does not specify any maximum length. The maximum length with will be implementation-specific i.e, based on available memory. Here are some real world numbers in case anyone is interested. Please add more if you have any. Using the following code in the browser console: s = prompt("a", Array(SOME_NUMBER).join("0")); s.length; Chrome 43 - 2000 with ellipses as

MPEG-4 Part 2 had some awesome face- and body- motion concepts, but they disappeared in MPEG-4 Part 10 (H.264). Why?

隐身守侯 提交于 2019-12-05 01:38:40
During the last few weeks, I had the opportunity to read two documents: The MPEG-4 Part 2 specification (ISO/IEC 14496-2), which people just call "mpeg-4" The MPEG-4 Part 10 specification (ISO/IEC 14496-10), which is also called "h.264" or "AVC" After having read all the cool ideas in "mpeg-4" like identifying facial expression, motion of limbs of people, and sprites, I got really excited. The ideas sound very fun, maybe even fantastic, for an idea from 1999. But then I read the "h.264" standard, and none of those ideas were there. There was a lot of discussion on how to encode pixels, but

What's the point of Content-Script-Type and Content-Style-Type

ⅰ亾dé卋堺 提交于 2019-12-04 23:30:52
问题 Consider these two lines: <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> From the W3's documentation on Scripting, in the section The default scripting language: Authors should specify the default scripting language for all scripts in a document by including the following META declaration in the HEAD Yet it continues in Local declaration of a scripting language to say: The type attribute must be specified for

In proper HTML, must an <input> be in a <form>?

和自甴很熟 提交于 2019-12-04 23:09:27
I need a few input elements, but their values won't be submitted anywhere - they're just going to be manipulated by some client-side JavaScript. Do I have to place them in a <form> to have legit HTML, or can they just be free-standing? For additional information, in xhtml strict you have to place in one of these elements: "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" No. You only need a form if you're submitting to a server. 来源: https://stackoverflow.com/questions/2862050/in-proper-html-must-an-input-be-in-a-form

Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep)

最后都变了- 提交于 2019-12-04 21:03:01
问题 I am having a weird RPM issue, I am new to it so bear with me... I have the spec file created and when I run to do the build I get an error: /var/tmp/rpm-tmp.ajKra4: line 36: cd: hero-01: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep) Then I check that temp file and it is trying to CD to a directory that does not exist.. Should it be creating this in the spec file? if so where? Here is my spec file: Summary: Install Hero Name: hero Version: 01 Release: 1

Is __enter__ and __exit__ behaviour for connection objects specified in the Python database API?

我的未来我决定 提交于 2019-12-04 19:01:51
问题 Background I recently discovered the Python with keyword and started seeing its potential usefulness for more prettily handling some scenarios where I'd previously have used try: ... finally: ... constructs. I immediately decided to try it out on the MySQLdb connection object in some code I was writing. I didn't bother reading up on how __enter__ and __exit__ behave in implementors of the Python database API, and naively expected the behaviour to be like that of file objects - all I was

Catch block is not being evaluated when exceptions are thrown from finallys

橙三吉。 提交于 2019-12-04 16:06:26
问题 This question came about because code that worked previously in .NET 4.0 failed with an unhandled exception in .NET 4.5, partly because of try/finallys. If you want details, read more at Microsoft connect. I used it as the base for this example, so it might be helpful to reference. The code For the people who chose to not read about the details behind this question, here is a very quick look at the conditions where this happened: using(var ms = new MemoryStream(encryptedData)) using(var

Is modifying a value type from within a using statement undefined behavior?

落花浮王杯 提交于 2019-12-04 10:49:54
问题 This one's really an offshoot of this question, but I think it deserves its own answer. According to section 15.13 of the ECMA-334 (on the using statement, below referred to as resource-acquisition ): Local variables declared in a resource-acquisition are read-only, and shall include an initializer. A compile-time error occurs if the embedded statement attempts to modify these local variables (via assignment or the ++ and -- operators) or pass them as ref or out parameters. This seems to