[Solved] javascript or PHP sorting array of x,y coordinates

Use sort with a custom compare function: data.sort(function(a, b){ return a[1] – b[1]; }); Example: var data = [[4,1],[20,1],[66,1],[68,3],[70,3],[72,2],[84,1],[96,4],[102,2]]; data.sort(function(a, b){ return a[1] – b[1]; }); // data now contains: [[4,1],[20,1],[66,1],[84,1],[72,2],[102,2],[68,3],[70,3],[96,4]]; If you want to sort in descending order instead just do b[1] – a[1] instead. 5 solved javascript or PHP sorting array of x,y … Read more

[Solved] Is it possible to focus on the hidden input field?

Well, I think I understood your query what exactly you want to achieve. you want to show the datepicker without visible container. It seems impossible because whenever you load datepicker it need some CSS property like left, positioning and all. and if datepicker container is hidden it will throw you exception. Below is another way … Read more

[Solved] add class in master page(code behind) using child page in asp and c# [closed]

FindControl is only able to find server-side controls, not plain HTML tags. In your case it means that you should add attribute runat=”server” to the ClientTab div: <li> <a href=”https://stackoverflow.com/questions/17292020/Clients.aspx”> <div id=”ClientTab” class=”MainNavigationContainerItem” runat=”server”> Client</div> </a> </li> However your code seems to add yet another class tag to this control, which might not be what … Read more

[Solved] understanding JavaScript classes and objects [closed]

You are defining an object literal to be used as namespaces. Sometimes you want to group your functions and objects in logical groups like an url but in reverse. For example: com.myCompany.myApplication.Dom com.myCompany.myApplication.Validators Where Dom does dom stuff and Validators do validation. You can’t just define com.myCompany.myApplication.Dom because window.com is undefined and you can’t add … Read more

[Solved] jquery ajax post method giving internal server error [closed]

Ok Found your problem, you are passing Int64 as parameter which should be string otherwise so when changing it to below I get success message : [System.Web.Services.WebMethod()] public static string btnPostReminder(string TicketId, string remindertext, string reminderon) { return ” successfully”; } Also your data should look like below: data: ‘{“TicketId”:”‘ + re + ‘”,”remindertext”:”‘ + … Read more

[Solved] how to show only child element with php? [closed]

read interested page to string (file_get_contents, curl ) or DOMdocument / SimpleXML find interesting information in string (by RegEx or substring search) or in DOMdocument / SimpleXML (special function in DOMdocument / SimpleXML class), echo it edit: If you like jQuery you can use phpQuery edit: For bbc.com/news you can read RSS http://feeds.bbci.co.uk/news/rss.xml – it … Read more

[Solved] MySQL error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near [closed]

I assume that ‘username’ is a text/char field in your db. Try this code: mysql_query (“SELECT * FROM ” . $iAccount_table . ” WHERE username=”” . $user . “””) or die(mysql_error()); I hope you find this helpful. solved MySQL error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL … Read more

[Solved] Program crashing after trying to read a NSString

The problem is probably that that _guideDescription string already is deallocated when you try to access it in -saveIntoExisted. You are now doing _guideDescription = [[NSString alloc] initWithString:[[notification userInfo] valueForKey:@”selected”]]; and that works, but I would recommend: [_guideDescription retain]; That makes sure the system doesn’t deallocate the string. solved Program crashing after trying to read … Read more

[Solved] Draw vector shapes for background of page

This link should get you started with regards to creating rounded corners in a HTML 5 canvas. http://www.html5canvastutorials.com/tutorials/html5-canvas-rounded-corners/ It will also allow you play around and come up with a solution that looks like your image. With regards to then putting this behind other elements, wrap the remainder of your elements in a div and … Read more