[Solved] form_for [@parent, @child] causes undefined method `parent_child_path’ in Child#new

[ad_1] The thing about form_for is that its URL is based on the model that you passed in. In your case, it’s: <%= form_for [@user, @college] do |f| %> Rails automatically looks for user_college_profiles_path because you assigned User to @user, and current_user.college_profile to @college. Fortunately, Rails provides a way to override the default URL the … Read more

[Solved] IBOutlet Array declaration [closed]

[ad_1] You probably need more practice with Xcode/Objective-C basics and idioms. Your approach is not valid (for instance, on iOS, we don’t loop (while(1)) to listen for events). Find some books, and you will be able to make your own soundboard soon. If you want to persist, here is some hints : Assuming you place … Read more

[Solved] Converting DateTime string in ddd MMM dd HH:mm:ss ‘EST’ yyyy format?

[ad_1] In my controller I do the following now. var startDateTZ = _startDate.Substring(20, 4); if (startDateTZ[3] == ‘ ‘) { startDateTZ = _startDate.Substring(20, 3); } if (startDateTZ.Length > 3) { if (startDateTZ[3] == ‘0’) { startDateTZ = _startDate.Substring(19, 4); } if (startDateTZ[3] == ‘2’) { startDateTZ = _startDate.Substring(19, 3); } } var startDate = new … Read more

[Solved] Read var_dump data with PHP

[ad_1] You’ll want to read the var dump types to determine how to access the data structure. If it says object (e.g., in your dump it first lists object(stdClass)#13), then you’ll use -> operator to access the listed elements (e.g., $object->contact). If it says array, you can use index notation [0] or, if more than … Read more

[Solved] PDO table inside table using json

[ad_1] Start by returning objects from PDO as that is what you want. Then only select from the table the columns that you actually need Then build the data structure that you believe you want from the returned data $stmt1 = $db->prepare(“SELECT title,description FROM data WHERE id=’1′”); $stmt1->execute(); $data = $stmt1->fetch(PDO::FETCH_OBJ); $stmt2 = $db->prepare(“SELECT id,title … Read more

[Solved] How can i open a link in a new window in IE8? [closed]

[ad_1] You can do it with popups <script language=”javascript” type=”text/javascript”> function popitup(url) { newwindow=window.open(url,’name’,’height=200,width=150′); if (window.focus) {newwindow.focus()} return false; } Then, you link to it by: <a href=”https://stackoverflow.com/questions/9221563/popupex.html” onclick=”return popitup(“https://stackoverflow.com/questions/9221563/popupex.html”)”>Link to popup</a> [ad_2] solved How can i open a link in a new window in IE8? [closed]

[Solved] How to sort/order tuple of ip address in python

[ad_1] You can do it like this: a = [{‘host’: u’10.219.1.1′}, {‘host’: u’10.91.1.1′}, {‘host’: u’10.219.4.1′}, {‘host’: : ‘10.91.4.1’}] sorted(a, key=lambda x: tuple(int(i) for i in x[‘host’].split(‘.’))) # [{‘host’: ‘10.91.1.1’}, {‘host’: ‘10.91.4.1’}, {‘host’: ‘10.219.1.1’}, {‘host’: ‘10.219.4.1’}] sorted(a, key=lambda x: tuple(int(i) for i in x[‘host’].split(‘.’))[::-1]) # [{‘host’: ‘10.91.1.1’}, {‘host’: ‘10.219.1.1’}, {‘host’: ‘10.91.4.1’}, {‘host’: ‘10.219.4.1’}] 2 [ad_2] solved … Read more

[Solved] error updating inside js (tabbed panel) [closed]

[ad_1] Probably you do not initialize the pageLoad no where in your code. var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(pageLoad); This pageLoad is not a function that automatically called from UpdatePanel, you need to initialize that on javascript part. Actually is not a know function, so I guess that you copy paste this code from somewhere with … Read more

[Solved] how to send sms via a dual sim mobile using serial port

[ad_1] did you try AT+CSIMSEL=1 ? see 11.4 AT+CSIMSEL Switch between two SIM card in this document: http://www.scribd.com/doc/63648056/186/AT-CSIMSEL-Switch-between-two-SIM-card The command is used to select external or embedded SIM card. NOTE Embedded SIM card supported by customization. Customer should provide informationwritten into USIM chipset. The command is disabled if the embedded SIM card isn’t exist, i.e. … Read more

[Solved] HTML Input (Javascript) [closed]

[ad_1] I have created a JSFiddle to demonstrate this. When you type in the email and then leave the input box, it shortens. When you re-enter the input box it expands back to its full length… $(‘#email’).bind(‘change’, function () { $self = $(this); var fullEmail = $self.val(); var shortEmail = fullEmail; if(fullEmail.length > 15) { … Read more

[Solved] Time shift in time format as input, the shifted real time as output [closed]

[ad_1] You will probably want some thing like the Calendar for the time addition. Example: Calendar future = Calendar.getInstance(); future.add(Calendar.HOUR_OF_DAY, enteredHour); future.add(Calendar.MINUTE, enteredMinute); future.add(Calendar.SECOND, enteredSecond); //And so on… //Now the calendar instance ‘future’ holds the current time plus the added values. As for entering the time, one possibility is to enter it as a text, … Read more

[Solved] How to start internet explorer without any add-ons except flash?

[ad_1] Here is the autoit code: ; Toolbar Kontrolü Başla ; 64 bit başla if $mimari == 64 Then For $i = 1 to 100 $var = RegEnumVal(“HKLM64\SOFTWARE\Microsoft\Internet Explorer\Toolbar”, $i) If @error <> 0 Then ExitLoop $read = RegRead(“HKLM64\SOFTWARE\Microsoft\Internet Explorer\Toolbar”, $var) $result_no = StringInStr($var, “Locked”) $result_yes = StringInStr($var, “-“) if $result_no == 0 and $result_yes … Read more