Stack Overflow » JSON
1 FOLLOWERS
most recent 30 from stackoverflow.com
Stack Overflow » JSON
8M ago
Here are the instructions:
Giving a randomly-generated JSON string. Find the longest list and return its key, followed by a dash ('-'), followed by the element at index 1
{
"agistment": "nonpromulgation",
"gastroparietal": 4599,
"ryotwar": [
"mealies",
"sophistress",
"money",
"astraeid"
],
"pranava": [
"rosinesses",
"basis"
],
"loomer": 581.6,
"bangalay": "orthopnea",
"inflexive": 3367,
"spinelles": [
"druith",
"pseudomonades",
"nonrhythmically",
"ischiocavernosus",
"operettist"
],
"articulator": 2805.3,
"preempted ..read more
Stack Overflow » JSON
8M ago
I wrote the following function to move a file between folders in the Google shared drives. It works normally, without any error, but the file is not moved. How can I do?
public function MoveFileToFolder($access_token, $file_id, $source_folder_id, $target_folder_id) {
$apiURL = self::DRIVE_FILES_URI . $file_id . "?corpora=allDrives&includeItemsFromAllDrives=true&supportsAllDrives=true";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH ..read more
Stack Overflow » JSON
8M ago
I'm trying to understand if there is a way to validate the result of JSON.parse for different possible type. In the APIs I'm working on there are a lot of Json fields coming from the database that should be made with specific structures, so I would like to check if a certain JsonValue returned from database is coherent with a given type.
I've made a bit of different tries, this is how I've defined the generic funcion:
parseJsonField<T>(jsonValue: Prisma.JsonValue): T {
return JSON.parse(JSON.stringify(jsonValue));
}
I'd like to have something that throws an error when the jsonValue ..read more
Stack Overflow » JSON
8M ago
This question has nothing to do with the suggested duplicate question. The answer for that specific question is that the debugger in Visual Studio escapes JSON strings. I already outruled this by writing the actual value to a file. I also specifically mention that I use the Text Visualizer tool in Visual Studio which does not have this issue!
Problem description:
I have a SQL table Descriptions:
Id
Description
1
Hello \n world
I retrieve the table using Linq:
var result = _dbContext.Descriptions.Single(x => x.Id == 1);
Looking at the value of result.Description in the Text Vis ..read more
Stack Overflow » JSON
8M ago
Suppose I have two columns:
JSON 1
JSON 2
{"key1":"value1"}
{"key2":"value2"}
{"key3":"value3"}
{"key4":"value4"}
I need to concat these columns to have a LIST of JSON in the third column, something like this:
JSON 1
JSON 2
JSON 3
{"key1":"value1"}
{"key2":"value2"}
[{"key1":"value1"},{"key2":"value2"}]
{"key3":"value3"}
{"key4":"value4"}
[{"key3":"value3"},{"key4":"value4"}]
Actually I solved the problem, but I don't think it's the best approach:
from pyspark.sql import DataFrame
from pyspark.sql.functions import col, concat, concat_ws, lit
def concat_jsons(df: D ..read more
Stack Overflow » JSON
8M ago
I wrote the following function to check if a folder exists in Google shared drives. . How can I do?
public function DeleteFileFromDrive($access_token, $file_id) {
$apiURL = self::DRIVE_FILES_URI . $file_id . "?supportsAllDrives=true";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: Bearer '. $access_token));
curl_ ..read more
Stack Overflow » JSON
8M ago
I have this array of objects
var worksSummaryDetailsArr = [
{
year: 2020,
worksSummaryDetailsObj: [ [Object], [Object], [Object], [Object] ]
},
{
year: 2021,
worksSummaryDetailsObj: [ [Object], [Object], [Object], [Object] ]
},
{
year: 2022,
worksSummaryDetailsObj: [ [Object], [Object], [Object], [Object] ]
},
{
year: 2021,
worksSummaryDetailsObj: [ [Object], [Object], [Object], [Object] ]
},
{
year: 2022,
worksSummaryDetailsObj: [ [Object], [Object], [Object], [Object] ]
}
]
I want to merge it into
{
year: 2020,
worksSum ..read more
Stack Overflow » JSON
8M ago
With .Net 8.0 supporting 128 bit integers as Int128 and Uint128 (here),
How can this be possibly handled in browsers ..read more
Stack Overflow » JSON
8M ago
Saving user input from a table into a son local file. The rest of the data is from an external JSON file.
I tried to just get a display before I save but can only get data of first row after the button is clicked ..read more
Stack Overflow » JSON
8M ago
I have the below json and i want to take the value from the DataSetWriterId field, which is dynamic and use it as the key value, followed by a counter for each Body item.
{
"MessageType": "ua-data",
"PublisherId": "1",
"Messages": [
{
"DataSetWriterId": "key_07",
"SequenceNumber": 2,
"Payload": {
"Data": [
{
"Type": 1,
"Body": false
},
{
"Type": 1,
"Body": false
},
{
"Type": 1,
"Body": false
}
]
}
}
]
}
Lik ..read more