IE9 javascript sort order … why?

Question:I noticed IE9 sort order is changing elements order when comparison function returns 0.See:var myarray=[ {id:1,val:0}, {id:2,val:0}, {id:3,val:7}, {id:4,val:41}];myarray.sort(function(a,b){return a.val - b.val});for(var i in myarray){

jq: count nest object values which satisfy condition

:json data:{testId: '1' studentId:{'s1':{score: 20} 's2':{score: 80}}}{testId: '2' studentId:{'s1':{score: 60} 's2':{score: 70}}}{testId: '3' studentId:{'s5':{score: 40} 's7':{score: 30}}}...I would like to use JQ to tell me how many stu

Output the result of each loop in different columns

:price.txt file has two columns: (name and value)Mary 134Lucy 56Jack 88range.txt file has three columns: (fruit and min_value and max_value)apple 57 136banana 62 258orange 88 99blueberry 98 121My aim is to test whether the value in price.txt file is betwe

putting html content between php function

:i need to put some html content in a variable for generating pdf using mpdf, is there any way to assign html content to a variable in a php function.this is what i am trying. function getInvoice($conn,$uid,$id,$invoice_no) { echo "some

MVC 5 Web API Login without Bearer Token

:Long story short. I have a login form in the header on every single page, when I log in successfully it works fine but when the user is incorrect for example it redirects to the default login page (a view that was originally created with MVC project) wit

how do I access variable attributes using gon (in jQuery & Rails)

:I was recently pointed to gon for passing variables from my controller to javascripts available on a page.Suppose I pass a variable @note that has attributes location, content, and tags (associated tags). How to I access these attributes in the jQuery fi

Compiling web app against Java 5, but String.isEmpty() is still being allowed?

:I am compiling my web app in Netbeans against Java EE 5. I know that the String.isEmpty() function is only supported in Java 6. Having said that, I can still compile my project using the .isEmpty() in my code. How come Netbeans is allowing my web app

how to save imageof axes for high resolution in matlab GUI

:I trying save image with the comand 'getframe' but resolution is very low, so I can not give zoom. for now I'm using the code:[arq,dir] = uiputfile('*.jpg','Output Files');fileName=fullfile(dir,arq);f=getframe(handles.axes1);[x,map]=frame2im(f);i

Xcode-Instruments cannot run app on simulator with the app target I choose

:I am trying to run an automation on an iOS App using UIAutomation with Instruments.It had worked well when I had tried it out a few weeks back. However, I tried out another automation testing framework (KIF from Square) in the meantime, and now when I tr

How do I remove all unnecessary whitespace from a string?

:I pull some text from a website and save it in an NSString, and display it back to the user, but I want it in one clear line, one word after another word, with absolutely zero line-breaks or unnecessary whitespace or tabs.Take the following image:Body ha

Ruby Mechanize screen scraping help

:I am trying to scrape a row in a table with a date. I want to scrape only the third row that have the date today.This is my mechanize code. I am trying to select the colum row witch have the date today and its and its"//td").

awk to extract the data between Dates

:Would like to extract the line items, if the dates between 5th Apr to 10th Apr from second field ($2) . Having many gun zip files into that directory.Inputs.gzDes1,DATE,Des1,Des2,Des3ab,01-APR-15,10,0,4ab,04-APR-15,25,0,12ab,05-APR-15,40,0,6ab,07-APR-1

Library for handling a List of Ranges

:I have to handle a list of timestamps (Long) in a Java 8 application:If a user adds a new range, it should be merged together with the other existing ranges, like in this pseudo code:rangeList = [100, 200], [300, 400], [500, 600], [700, 800]newRangeList

Java DateFormat format and parse gives unexpected result

:I'm getting unexpected output when running following code,DateFormat df = new SimpleDateFormat("YYYY-MM-dd");Date date = df.parse("2012-06-23");System.out.println(df.format(date));Output : 2012-01-01I'm expecting 2012-06-23 as output,what am i doin

NLP Postagger can't grok imperatives?

:Stanford NLP postagger claims imperative verbs added to recent version. I've inputted lots of text with abundant and obvious imperatives, but there seems to be no tag for them on output. Must one, after all, train it for this pos? 1:There is no spec

Concatenating Multiple DataFrames with Non-Standard Columns

:Is there a good way to concatenate a list of DataFrames where the columns are not regular between DataFrames? The desired outcome is to match up all columns that are a match but to keep the ones that have no match off to the side. The reason you would wa

Manipulate HTML paragraphs in php [duplicate]

: Possible Duplicate:Highlight keywords in a paragraph Here is another question for you. I have a small problem in php and I thought before find an extra-ordinary solution by myself there maybe an easier and faster way to solve the problem.Assuming I h

Out of Memory using bsxfun MATLAB

:I try to implement image compression using Burrows-Wheeler transform. Consider an 1D matrix from path scanning is:p = [2 5 4 2 3 1 5];and then apply the Burrows-Wheeler transform :function output = bwtenc(p) n = numel(p);x = zeros(length(p),1);for i = 1:

How can I create an activity for data conversion in Design Automation API?

:I'm prototyping a web service to convert data using Design Automation API in Autodesk Forge.My approach is to invoke an activity that executes a script to import a target data file (such as STEP, IGES format).As an example, I created an activity to conv

blank pdf attachment sent using FPDF and SwiftMailer

:I am trying to create a PDF stream using FPDF library and to send the pdf over e-mail using Swift Mailer. Below is my code. The mail is sent successfully and even pdf is also attached but the pdf is blank. It has a size of 1Kb and can be opened as a pdf.

possible collision hashing uuid cakephp

:Is it possible to have collisions if to use Security::hash on uuid() string ? I know that uuid() generates truly unique string, but I need them to be hashed, and I am worried if there is a possibility that the hashed string can be repeated.Thanks 1:Fi

Get count of elements in javascript object where key=option

:This is a javascript object.How can I get the count of elements with condition gallery="Abstract" and gallery="Game". window.paintings = { 1: { id: 1, name: 'Abstract 1', gallery: 'Abstract', src:'Image64.jpg' }, 2: { id: 2, name: 'Abstrac

Format MySQL number to datetime?

:I have a MySQL database show uptime for devices. The uptime is how long the device has been up in seconds. I have a query showing all devices with uptime less than 86400 (24 hours) which I want to bring into a PHP page. I want to format this uptime st

Predicate must be true of all elements in a list

:I have a set of facts:likes(john,mary).likes(mary,robert).likes(robert,kate).likes(alan,george).likes(alan,mary).likes(george,mary).likes(harry,mary).likes(john,alan).Now I want to write a relation which will check for all element X of an input list if l

Editing a text file in c

:guys can you help me with my code.. i want to edit a specific line in a text file using c i have this code...#include#include#includestruct studentinfo{ char id[8]; char name[30]; char course[5];}s1;int main

 4308    1 2 3 4 5 6 7 8 9 10 Next Last