[Solved] Transform Date to JSON

The seems like the date/time wire format used in WCF. From MSDN it states: DateTime values appear as JSON strings in the form of “/Date(700000+0500)/”, where the first number (700000 in the example provided) is the number of milliseconds in the GMT time zone, regular (non-daylight savings) time since midnight, January 1, 1970. The number … Read more

[Solved] php, from json decode to individual variables

$result = $data->response->result; Assuming the variable $data is where you stored your json_decode. It returns an instance of stdClass, and viewing the vardump, you can see the structure and get the data you want. solved php, from json decode to individual variables

[Solved] Read Json using C# [closed]

Your json is broken and many json parser would complain about it. I’ll use Json.Net for parsing. string json = @”{data: { “”1000″”: { “”country-id””: 1000, “”name1″”: { “”name””: “”Afghanistan””, }, }, “”4000″”: { “”country-id””: 4000, “”name1″”: { “”name””: “”Albania””, } }”; var countries = ((JObject)JsonConvert.DeserializeObject(json))[“data”] .Children() .Select(x => new { Id = (int)x.First()[“country-id”], Name … Read more

[Solved] Javascript object sorting [closed]

You can’t sort properties in an object. Copy the data into an array and sort it. Example: var arr = []; $.each(data, function(key, value){ arr.push({ id: key, data: value }); }); arr.sort(function(x,y){ var xn = x.data.userStatuINT; var yn = y.data.userStatuINT; return xn == yn ? 0 : xn < yn ? -1 : 1; }); … Read more

[Solved] Android : parse a JSONArray

Here is your code to parse data, private void parseData(){ try { JSONArray jsonArray=new JSONArray(response); JSONObject jsonObject=jsonArray.getJSONObject(0); JSONArray jsonArrayNid=jsonObject.getJSONArray(“nid”); JSONArray jsonArrayUid=jsonObject.getJSONArray(“uid”); JSONArray jsonArrayField_image=jsonObject.getJSONArray(“field_image”); for(int i=0;i<jsonArrayNid.length();i++){ JSONObject jsonObjectNid=jsonArrayNid.getJSONObject(i); String value=jsonObjectNid.getString(“value”); //here you get your nid value } for(int i=0;i<jsonArrayUid.length();i++){ JSONObject jsonObjectUid=jsonArrayUid.getJSONObject(i); String target_id=jsonObjectUid.getString(“target_id”); //here you get your uid target_id value String url=jsonObjectUid.getString(“url”); //here you get your … Read more

[Solved] How to resolve InvalidCastException after translating LINQ-to-JSON query from c# to VB.NET?

In order for {columns}.Concat(rows) to work, it seems you need to add an explicit call to AsEnumerable() in order to make sure the type TSource for Enumerable.Concat(IEnumerable<TSource>, IEnumerable<TSource>) is inferred correctly: Dim csvRows = { columns.AsEnumerable() }.Concat(rows) _ .Select(Function(r) String.Join(“,”, r)) Fixed fiddle #1 here. A DirectCast({columns}, IEnumerable(Of IEnumerable(Of String))) also seems to work, as … Read more

[Solved] Remove parent JSON element depending on child value

Well, I found a way to iterate through the JSON object: function remove(jsondata) { for (let i in jsondata) { if (jsondata[i].value != undefined && jsondata[i].value == ”) { delete jsondata[i]; } else if (typeof jsondata[i] === “object”) remove(jsondata[i]); } } Not sure, if it’s the most elegant way, but it works so far. 1 … Read more

[Solved] How to execute the asynchronous task several times?

You can iterate through the list size and call asynchronous task in that. for(int i=0; i<list.size();i++) { // Call AsyncTask with any value you want to pass // just generate a constructor accordingly new AsyncTask(i).execute(); } And get the value in AsyncTask class with required constructor : public class AsyncTask{ Integer position; public AsyncTask(Integer passedValue) … Read more

[Solved] Unable to capture records name , price and rating and image in Requests Python [closed]

You have to scrape the adidas site and use regex: import requests import re endpoint = “https://www.adidas.com.au/continental-80-shoes/G27707.html” headers = { ‘User-Agent’: ‘Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36’ } response = requests.get(endpoint, headers = headers) data = response.text pricereg = r”(?<=\”price\”:)(.*)(?=,\”)” namereg = r”(?<=\”name\”:)(.*)(?=,\”co)” ratingreg= r”(?<=\”ratingValue\”:)(.*)(?=,\”reviewCou)” price = re.search(pricereg, data, re.MULTILINE).group() name … Read more

[Solved] How to get Joomla users data into a json array [closed]

You are overwriting the $id variable and then you are not using it… It seems there’s a mess in there with the $title, $name and $id variables. Try this: <?php $sql = “SELECT * FROM `jos_users` LIMIT 0, 30 “; $response = array(); $posts = array(); $result=mysql_query($sql); while($row=mysql_fetch_array($result)) { $id=$row[‘id’]; //change here $name=$row[‘name’]; //change here … Read more

[Solved] Riot Api – Json

Please take a look at these guides I wrote for an introduction to the Riot API and using/understanding JSON. While you can use many languages like PHP, I teach it in Javascript/Ajax/JQuery as that knowledge than be applied to other languages pretty easily, especially with PHP since the syntax of both look decently similar. [Tutorial] … Read more

[Solved] JSONObject how to change value depend on key value? [closed]

As fas as I understand your problem statment, are you looking for something like this? var data = [ { “pages”: “foo1”, “hasil”: “” }, { “pages”: “foo2”, “hasil”: “” }, { “pages”: “foo3”, “hasil”: “” }, { “pages”: “foo4”, “hasil”: “” }, { “pages”: “foo5”, “hasil”: “” }, { “pages”: “foo6”, “hasil”: “” } … Read more

[Solved] Fetch Json from MySQL in Jquery calender

Depends on the programming language you are using, if you’re using Java/php, create a service method which would get the JSON from the database and return the JSONobject through ajax, and introduce it into the calendar through jquery javascript. i would also recommend you to use full calendar as its very easy to grasp. $(‘#calendar’).fullCalendar({ … Read more

[Solved] Need rules/doc for casting JSON to c# class

you can try this for your json, replace mproject by parent class, make itemId_ optional and remove HttpPath [Route(“{itemId_?}”)] public IHttpActionResult PatchItemById([FromUri] int itemId_, [FromBody] parent webForm_) 0 solved Need rules/doc for casting JSON to c# class