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

Sending Data From background.js to extension.js in crossrider

:I am developing a browser extension using crossrider.I have added a context menu (background.js) var ContextData; appAPI.contextMenu.add("key1", "Send Data To Server", function (data) { var ContextData = 'pageUrl: ' + data.pageUrl + '

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

How to write in the manifest file?

:My manifest file is not updated, I used the plugin maven-war-plugin to write, but nothing happened, if I change the name of the directory of the manifest file I get an error manifest file not found while packaging , but when I put it in the right place n

What is wrong with my MySQL query?

:So, I have a form that posts to my php file using ajax, and succeeds. But the following query doesn't insert anything. Can someone help me understand what I'm doing wrong?My php file:?phpinclude 'connect.php' ;$type = mysql_real_escape_string($

Symfony2 Remove UTF-8 BOM from controller responses

:While creating a "force download" action I discovered that ALL responses generated by the controller are including the UTF-8 BOM (). This is not relevant for regular pages, but for downloaded files is undesirable, since JPG or ZIP are reported as co

Simple SQL statement

:I've been over-thinking this too much. Let's say I have a table TEST(refnum VARCHAR(5)) |refnum| -------- | 12345| | 56873| | 63423| | 12345| | 56873| | 12345|I want my "view" to look something along the lines of this |refn

Wait until fs.readFileSync is done

:In my file functions.js i have two functions:var email, url1function getFile(_callback){ email = fs.readFileSync("C:/Emails/" + items[2]) _callback(email); }function getUrl(){ getLatestMail(function(email) { email.split(/\n/).fo

How to clone a prototype with property methods?

:I am using the Typed.React library which includes a method to extend one prototype definition with that of another:function extractPrototype(clazz) { var proto = {}; for (var key in clazz.prototype) { proto[key] = clazz.prototype[key]; }

What is wrong with my attempts to mock a simple C++ method with googlemock?

:As per Patterns for unit testing a C++ method that makes a standard library call, I'm test-driving development of a network-abstracting class. In order to unit test code that makes standard C library calls (which I can't mock) to handle BSD sockets, I

How to define string parameters in C++ header file - Bridged with Swift?

:I have a Xcode project with Swift and C++ (with bridging header), and I am trying to create a function in C++ with 2 string parameters, and returning an array of integers back to Swift:.cpp file:int* example(string one, string two){ int test[3] = {7,2

How to check NSDate against a date in TAPKU calendar

:I am using core data to store objects for my project.There is a date field in the object .I want to check against the clicked date of the Tapku calendar component for iphone. The date on my object is in the format2011-01-10 and it is a localized date .Ho

java polymorphism late binding rules

:I am trying to do some polymorphism exercises and I cannot figure out how this kind of polymorphism works. I did not find any deep information about this kind of exercised. I hope you guys could give me some explanation.exercise 1:class Top { public v

Can't install MySQL 5.6 by RPM

:I'm trying to install MySQL 5.6 community edition from the RPM package I downloaded. I'm running on cloudera's CDH 4.5 virtual machine, which is CentOS 6.4. The VM came with MySQL 5.1.73 installed, the old versions of files seem to be blocking me fr

How to call a server side method on losing focus from a textbox, asp.net mvc

:I have two textboxes, one isfor 'program' and the other for 'description'. I have a predefined set of programs and it is associated descriptions in the database. Example : For program named 'Test' it has the description as 'Valid' in the DB Table

Calling a function again better than assigning it to variable [duplicate]

: This question already has an answer here: Java Method invocation vs using a variable 14 answers Is calling a getter function in class that does not computation better than a

Jersey Client resulting in 415 Unsupported media type

:The obvious reason for this would be not providing proper content type. But I am providing. Still i am getting Unsupported Media Type. Not sure why. Any help greatly appreciated.Client c = Client.create();WebResource resource = c.resource(HOST+"/test")

function running in foreach loop

:thank you for taking time to look at this. I have been dealing with this annoying foreach loop. Here is what I am trying to do.I have the first page "form.php".On this page I have check boxes. Each check box is generated from a database table. Here is

CodeIgniter + Smarty = Error

:Here's what I did:Downloaded and unzipped CIDownloaded and unzipped Smarty in /application/libraries/Smarty-3.1.4Saved https://github.com/kzhiwei/codeigniter-smarty/blob/master/application/libraries/Smartylib.php to /application/libraries/Smartylib.php

Puppet: is there a way to catch failure to apply a resource?

:is there a way in Puppet to catch a failure when resource is applied, for example, when declaration like file { '/var/tmp/test': ensure => file, mode => '0755', }fails, invoke something like exec { 'Register some failure': command

tests skipped inspite the dependant method passed. TestNG

:I have a number of tests across classes. Each class is defined as @Test and group name added to it same as class name[they are u1,u2,u3,u4,u5]. In u1, I have a test method for prerequisites called prereqSetup(). This is added to the group "prereq".Now,

Combining and splitting assignment in Haskell IO do block

:I /think/ I have a similar misunderstanding of the language in two places involving how variable assignment works in do blocks, involving the IO monad. Could you help me understand (1) is it the same misunderstanding, (2) how to clear it up (in an answer

Bootstrap - Want hide content's until modal loads

:I'm using jquery modal to load multiple vimeo video's in a single page. I've been noticing that all the video's loading (34) in the DOM affects performance (creating a lag on load). So I want make sure that the video players are only loaded when the

How to compose variable name dynamically?

:I need to generate a list,and name it's items based on for-loop indexnumber, like this:for(int i=0;i

How to query for oneway flights using the Sabre Insta Flights Search REST API?

:What query params do I need to pass to search for oneway flights only using the Sabre Insta Flights Search REST API?I get an error from the service if I do not include a returndate param. If I do include a returndate, I get roundtrip flights in the resul

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