any

modify nested JSON array with JQ

会有一股神秘感。 提交于 2020-04-30 07:46:33
问题 I would like to use JQ to modify the following JSON input: { "rows": [ { "fields": [ { "name": "id", "value": "k1" }, { "name": "val", "value": "2340378b211aa3d8f2d7607cbddce883b87b191d0425736641e3d308ea329718" }, { "name": "Encoding", "value": "hex" } ] }, { "fields": [ { "name": "id", "value": "k2" }, { "name": "val", "value": "2340378b211aa3d8f2d7607cbddce883b87b191d0425736641e3d308ea329718" }, { "name": "Encoding", "value": "hex" } ] } ] } so that the "hex" value of the "value" field with

modify nested JSON array with JQ

自闭症网瘾萝莉.ら 提交于 2020-04-30 07:46:30
问题 I would like to use JQ to modify the following JSON input: { "rows": [ { "fields": [ { "name": "id", "value": "k1" }, { "name": "val", "value": "2340378b211aa3d8f2d7607cbddce883b87b191d0425736641e3d308ea329718" }, { "name": "Encoding", "value": "hex" } ] }, { "fields": [ { "name": "id", "value": "k2" }, { "name": "val", "value": "2340378b211aa3d8f2d7607cbddce883b87b191d0425736641e3d308ea329718" }, { "name": "Encoding", "value": "hex" } ] } ] } so that the "hex" value of the "value" field with

Difference between in and any operators in sql

痴心易碎 提交于 2020-03-12 07:17:10
问题 What is the difference between IN and ANY operators in SQL ? 回答1: SQL> SQL> -- Use the ANY operator in a WHERE clause to compare a value with any of the values in a list. SQL> SQL> -- You must place an =, <>, <, >, <=, or >= operator before ANY. SQL> SELECT * 2 FROM employee 3 WHERE salary > ANY (2000, 3000, 4000); For In Operator SQL> -- Use the IN operator in a WHERE clause to compare a value with any of the values in a list. SQL> SELECT * 2 FROM employee 3 WHERE salary IN (2000, 3000, 4000

Swift Generics vs Any

♀尐吖头ヾ 提交于 2020-01-21 07:31:45
问题 I read swift documentation in apple site. There is a function swapTwoValues, which swaps two any given values func swapTwoValues1<T>(_ a: inout T, _ b: inout T) { let temporaryA = a a = b b = temporaryA } Now I want to write similar function but instead of using T generic type I want to use Any func swapTwoValues2(_ a: inout Any, _ b: inout Any) { let temporaryA = a a = b b = temporaryA } to call this functions I write var a = 5 var b = 9 swapTwoValues1(&a, &b) swapTwoValues2(&a, &b) I have

How can I quickly see if any elements of more than 2 vectors are equal in R?

家住魔仙堡 提交于 2020-01-17 12:39:16
问题 (I expect this has already been asked/answered. If so, sorry, I'm failing to locate the answer.) Let's say I have 6 vectors. How can I quickly check whether any element for each vector is equal to any element of all the other vectors? I know I could do the following, and it feels really cumbersome/pre-historic/error-prone: any(vec1 %in% vec2, vec1 %in% vec3, vec1 %in% vec4, vec1 %in% vec5, vec1 %in% vec6, vec2 %in% vec3, vec2 %in% vec4, vec2 %in% vec5, vec2 %in% vec6, vec3 %in% vec4, vec3 %in

How can I quickly see if any elements of more than 2 vectors are equal in R?

我们两清 提交于 2020-01-17 12:38:46
问题 (I expect this has already been asked/answered. If so, sorry, I'm failing to locate the answer.) Let's say I have 6 vectors. How can I quickly check whether any element for each vector is equal to any element of all the other vectors? I know I could do the following, and it feels really cumbersome/pre-historic/error-prone: any(vec1 %in% vec2, vec1 %in% vec3, vec1 %in% vec4, vec1 %in% vec5, vec1 %in% vec6, vec2 %in% vec3, vec2 %in% vec4, vec2 %in% vec5, vec2 %in% vec6, vec3 %in% vec4, vec3 %in

How can I quickly see if any elements of more than 2 vectors are equal in R?

北战南征 提交于 2020-01-17 12:38:41
问题 (I expect this has already been asked/answered. If so, sorry, I'm failing to locate the answer.) Let's say I have 6 vectors. How can I quickly check whether any element for each vector is equal to any element of all the other vectors? I know I could do the following, and it feels really cumbersome/pre-historic/error-prone: any(vec1 %in% vec2, vec1 %in% vec3, vec1 %in% vec4, vec1 %in% vec5, vec1 %in% vec6, vec2 %in% vec3, vec2 %in% vec4, vec2 %in% vec5, vec2 %in% vec6, vec3 %in% vec4, vec3 %in

Fast way to find if list of words contains at least one word that starts with certain letters (not “find ALL words”!)

懵懂的女人 提交于 2020-01-15 04:03:56
问题 I have set (not list) of strings (words). It is a big one. (It's ripped out of images with openCV and tesseract so there's no reliable way to predict its contents.) At some point of working with this list I need to find out if it contains at least one word that begins with part I'm currently processing. So it's like (NOT an actual code): if exists(word.startswith(word_part) in word_set) then continue else break There is a very good answer on how to find all strings in list that start with

Fast way to find if list of words contains at least one word that starts with certain letters (not “find ALL words”!)

随声附和 提交于 2020-01-15 04:03:34
问题 I have set (not list) of strings (words). It is a big one. (It's ripped out of images with openCV and tesseract so there's no reliable way to predict its contents.) At some point of working with this list I need to find out if it contains at least one word that begins with part I'm currently processing. So it's like (NOT an actual code): if exists(word.startswith(word_part) in word_set) then continue else break There is a very good answer on how to find all strings in list that start with

Removing Duplicate Data from a Table using MySQL

白昼怎懂夜的黑 提交于 2020-01-05 07:05:25
问题 I am trying to remove duplicate data from my database. I found a nice example on here of how to do this on an oracle database. The bottom query from that answer (only selecting the duplicate rows) works in MySQL, but the delete query (see below) does not... "DELETE FROM studios as a WHERE a.id > ANY (SELECT b.id FROM studios as b WHERE a.name = b.name AND a.email = b.email )" The error I get is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server