Posts

ios - How to stop push button -

This question is already an answer here 5 answers I I'm a newbie for iOS program and I need your help. When I click on the button, my code checks to have a condition, if the condition is correct, I want to use the next to go to UIViewController readyForSegue with data, but if the condition is , I do not want that VC next to to use and want to stay on current VC . How can I do this? When I click on my button, it is possible to block access to the code directly in the next VC IBAction ? I try to code on a push button - (IBAction) Lancerity: (ID) sender {... Other answers should work, but they ignore the whole issue of segues in a way: if you should There is no need to manually action on buttons for things, instead you should override - (bool) shouldPerformSegueWithIdentifier:. (NSString *) Identifier this: (ID) This selector To do this, you need to give your segue one (NSString *) identifier this: (id) this {if ([ Identifier isEqualToStr...

ruby - Rails flash.now within after_action -

The code speaks for itself on it. This works ... Classes some controllers & lt; ApplicationController DEF Index Flash. Now [: Warning] = 'Some have got bored!' End and and this is not ( flash is empty) ... class SomeController --Eytmprop = "text"> At the end of your index action rails, you new refer to the page, as if you have not specified anything different, after the index page is rendered, after_action is executed, it adds a callback after the index action is completed Will be said. Therefore, test_flash has no effect because it is too late and the index page has already been provided. Edit: If you want to call test_flash before rendering, you can override the Render method and do something like this: def render * args test_flash super end

mysql - Parameter warning php -

इस सवाल का पहले से ही एक उत्तर है: $ name1 = $ _POST [ 'name1']; $ Lname = $ _POST ['lname']; $ Uname = $ _POST ['uname']; $ Email1 = $ email1; $ ईमेल 2 = $ ईमेल 2; $ Pass1 = $ pass1; $ Pass2 = $ pass2; $ पास 1 = एमडी 5 ($ पास 1); $ Sql ​​= "का चयन करें * उपयोगकर्ताओं से जहां uname = $ uname"; यदि (mysql_num_rows ($ sql) & gt; 0) {गूंज "क्षमा करें, वह उपयोगकर्ता पहले से मौजूद है"; बाहर जाएं(); } चेतावनी: mysql_num_rows () पैरामीटर 1 को संसाधन होने की उम्मीद है, /nas/students/unix/public_html/dsa1/register.php में लाइन 27 पर दिया गया है निश्चित रूप से: int mysql_num_rows (संसाधन $ परिणाम) पुनर्प्राप्त करता है एक परिणाम सेट से पंक्तियों की संख्या। यह कमांड केवल SELECT या SHOW जैसे एक बयान के लिए मान्य है जो कि वास्तविक परिणाम सेट को वापस लाती है। एक संसाधन एक एसक्यूएल क्वेरी से कुछ अलग है इस मामले में एक संसाधन है जो PHP MySQL लाइब्रेरी एक कथन के संदर्भ में चारों ओर से गुजरता है जो पहले से ही चल रहा है। आपको ...

CUDA: How should I handle cases where the number of threads cannot be represented as a dimGrid*dimBlock? -

Suppose that my input has seven data points on which some are calculated and returned the result back to an output array Goes 7. Size declares the block dimension, there are 4 results in grid size of 2, which is to run the kernel with the invalid thread id (using pt_id = blockIdx.x * blockDim.x + threadID.x) Goes to Attention 7 and fails due to invalid memory access (since I base the thread ID But I am using some of my things). I could add the code to my kernel which specifically connects the thread ID to a max_thread_id parameter and if thread_id> max_thread_ id does nothing, I wonder if rubbing is a great way to handle input arrays . The function of a size that is not greater than the dimension of the block, is. The solution I use the most is to assume that the size of your input data is N and you want to configure your launch with the block size equal to BLOCK_SIZE Are there. In this case, your launch configuration can look like this: kernel_function & lt; ...

python 2.7 - TypeError: unsupported operand type(s) for %: 'long' and 'str' -

इस कोड के साथ: current_time = time.localtime () time_now = time.strftime ('% H:% M:% S', current_time) cursor.execute ("SUBSCRIPTION_DETAILS से * चुनें * अलर्ट_time = '% s'")% time_now मुझे त्रुटि मिलती है: % के लिए असमर्थित ऑपरेंप प्रकार (s): long and str प्रकार of अलर्ट_टाइम Varchar है आपने अपना % खो दिया है आप अब कर रहे हैं: कर्सर.असेक्यूट ("[स्निप]")% time_now इसलिए आप time_now cursor.execute के परिणाम पर आप स्ट्रिंग के साथ % का उपयोग कर सकते हैं, जैसे: कर्सर। एक्सक्यूट ("[स्निप]"% time_now) लेकिन ऐसा मत करो, आपको उपयोग करना चाहिए: कर्सर। Execute ("चुनें SUBSCRIPTION_DETAILS से * जहां Alert_time =% s", (टीआई ध्यान दें कि हम यहां % ऑपरेटर का उपयोग करने के बजाय दूसरे पैरामीटर के रूप में समय-समय गुजरते हैं। यह सुनिश्चित करता है कि एसक्यूएल इंजेक्शन के हमलों को रोकने के लिए क्वेरी ठीक से साफ कर दी गई है। दूसरा असल में एक ट्यूपल है यह सुनिश्चित करने के लिए , अनुगामी (कुछ...

Is it semantically appropriate to have a header column in HTML? -

I have a table of information, but instead of the typical table where the headings are at the top: Foo. Fornord | | Fiji | Buzz ---- | ------- | ------- | ----------------- 42 | Yes. No | Mr 13 Yes. Flags | Colon mustard 1 | Plum | No | Ms. Red Color I'll put it down: Foo | 42 | 13. 1st Fornord | Yes. Yes. Plum Fizzy | No | Flags | No buzz. Sir | Colonel mustard | Ms. Scarlet Obviously this is permitted by doing something & lt; Table & gt; & Lt; Tr & gt; & Lt; Th & gt; Top 1 & lt; / Th & gt; & Lt; Td> Data 1 & lt; / Td> & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Th & gt; Heading 2 & lt; / Th & gt; & Lt; Td> Data 2 & lt; / Td> & Lt; / Tr & gt; & Lt; / Table & gt; So I am planning to do it in some way, but I want to see if it is in any kind of brakes or something else in the sense. What is the right way to do this? There is nothing wrong with doing this, to mak...

C - Buffer size reduced after being passed to another function -

I am working on an assignment in C and when I found an error, I started something, understand Not come * Hostname), int port) {// to store in buffer variable char * msg = "Hi, I'm a message"; // Stellen (msg) == 17 uint16_t sender_id = hayton (1); // size (sender_id) == 2 uint16_t packet_size = htons (sizeof (packet_size) + sizeof (sender_id) + strlen (msg)); // size (packet_size) == 2 // buffer four buff [100]; // Copy everything Memc (& amp; Buff, & Sender_ID, Size (Sender_ID)); Memcpy (& amp; buf + sizeof (sender_id), & amp; packet_size, sizeof (packet_size)); Memcpy (& amp; buf + sizeof (sender_id) + sizeof (packet_size), & amp; msg, strlen (msg)); Printf ("l1_connect - sizeof (buf):% d \ n", (integer) size (buf)); // == 21 // buffer to another function int bytes_sent = l1_send (1, buf, sizeof (buf)); Return bytes_sent; } At the end of this function, buffer size is 21. After passing it to another function, it is c...