Posts

ruby on rails - Include two inputs in same LI element in Formtastic -

Using the formattic, I have a volume field and unit field that is measured in the amount of items and the unit that is measured in it. My problem is that I would like to display the unit box with the volume box. However, because it's structural past in every input element in its own element, I can not appear next to each other. Any thoughts? Use an html wrapper for your volume and unit fields: & lt;% = form.input: Quantity: wrapper_html = & gt; {: Class = & gt; 'Fl'}%> & Lt;% = form.input: unit ,: wrapper_html = & gt; {: Class = & gt; 'Fl'}%> And to float a CSS float property li in my CSS (probably formtastic-changes.css), I used to give some cells to breathe unit labels to some extent Added correct margins: form.formtastic fieldet ol li.fl {float: left; Margin-right: 2 AM;} You must have specific classes or IDs for wrapper_html and Bella with CSS to get your layout. / P>

javascript - A simple If...else block. Why is it doing nothing? -

& lt; html & gt; & Lt; शीर्ष & gt; & lt; / head & gt; & LT; बॉडी & gt; & Lt; स्क्रिप्ट प्रकार = "टेक्स्ट / जावास्क्रिप्ट" & gt; Var x = 5; Var y = 8; यदि (x & lt; 6) {document.write ("वे समान हैं"); } और {document.write {"वे समान नहीं हैं"); } & Lt; / script & gt; & Lt; / body & gt; & Lt; / html & gt; मुझे लगता है कि आपके पास एक वाक्यविन्यास त्रुटि है: दस्तावेज़.लिखित {"वे बराबर नहीं हैं"); होना चाहिए document.write ("वे समान नहीं हैं");

javascript - How would MVC-like code work in Node.js? -

I'm starting to get my head around node.js, and I'm trying to figure out that How do I generalize the MVC stuff for example, here is a Django view that draws two sets of records from the database, and sends them to provide them in a template. def view (requested): things1 = ThingsOne.objects.all () things2 = ThingsTwo.objects.all () render_to_response ('template.html, {' items1 ': Things 1, Things 2 ': Things2}) The same node.What does the JS function look like? is a great small article, in which there is a full example of a MVC pattern, which is used by the Defratch Node Module does. It lists the optional modules currently available, it has answered this question to me, compared to which there are some good things but I did not find anything at MVC.

display jQuery prettyPhoto lightbox in parent window from iframe -

I know that this issue has been discussed earlier but I can not seem to work for it. I have a master HTML page with IFrame. I am using jquery prettyphoto and I was wondering how can I display the light box in the original box when I click on the link in the iframe? Master page: & Lt; Title & gt; Master page & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Iframe src = "iframe.html" width = "300" height = "300px" frameborder = "0" & ​​gt; & Lt; / Iframe & gt; & Lt; / Body & gt; & Lt; / Html & gt; Iframe page: & Lt; Title & gt; Iframe & lt; / Title & gt; & Lt; Style type = "text / css" media = "screen" & gt; @import url ("property / css / infotech-iframes.css"); @ Import URL ("Asset / CSS / Infotech-Popup CSS"); & Lt; / Style & gt; & Lt; Script src = "property / js / jquer...

objective c - NSDateFormatter and date conversion not working -

I am developing an app for the iPhone where I get an XML feed from a date in just one HH: mm format Need to change. I have the following method that does not work and I have no clue what I am doing. As an example, the timing string will be: " Mon, 01 Feb 2010 21:55:00 +0100 " (without quotation marks) This method works when the area is in the U.S. (I get the correct date back), but not when I change the area (settings-> General-> International) in Spain, or in other areas (in that case I do not get back). - (id) timeContentHHM: (NSString *) Time to Convert {NSString * newPubDate = timeToConvert; // Remove any garbage from IA code Newboot = [newPubDate stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]] ;; // Extractor format and format to convert XML string into an NSDate NSDateFormatter * originalDateFormatter = [[[NSDateFormatter alloc] init] AutoCurlus; [Original Dataform Setad Format: @ "EE, DMM Mi Yyyy H: mm: SS Z...

c# - How is.NET's NetworkStream delimiting multiple messages in the same packet? -

So I have been entrusted with the task of creating a tool for our QA department which can read the packet from the wire and Can rejoin correctly (they do not rely on our logs ... long story). The NCT's TCPLstner and TCP Client Classes are being used to communicate the application I want to communicate. Stopped the packet is not a problem (I'm using). However, adding correctly packet to application level messages is proving to be a bit trickier. In some packets there is a message ending and the next message begins and they tell me how 'networkstream object' in NTT tells us where an application level message ends and the other starts. I have been successful in determining whether the TCP header "PSH" (push) flag will be turned on in an application level message in any packet. But I do not know how .NET knows what's inside that packet at the end of the message. The data of a packet can look like this: / & lt; Message & gt; & Lt; M...

SQL Server 2005 Unique constraint on two columns -

How can you add a unique barrier to SQL Server 2005 in two columns? So I can say that I have: PK, A, B ... x1 1 x x2 1 2 x3 2 1 x4 2 2 Should not I be able to add another line 'x5' and do the values ​​for A and B be 1 because they are already in the database in X1? Okay, we managed to work it out and thank you, God. Go to the Table view, select two columns, right-click and select 'Indexes / keys' - General tab, select the columns you want to make unique and then set 'Unique' to the right. This table is using the designer. Thank you. In SQL Server, use the unique barrier is actually implemented as a unique index : create unique indexes & lt; Uix_name & gt; On & lt; Table_name & gt; (& Lt; col_A & gt;, & lt; col_B & gt;) For more information, see.