JavaScript Object Notation (JSON) is a lightweight data exchange format and is often used with JavaScript, Ajax, and RESTful web services.

learn more… | top users | synonyms

0
votes
1answer
31 views

Is there a better way to read json in node

I have this view that populates an unordered list from values in a json file. I am doing this in node. So is there a better way to do this, or a mode 'node-like' way? Can I load the json file without ...
1
vote
1answer
34 views

my first jquery/json

This is my first use of jquery and json so would be grateful for any feedback please. Background - this is on a job listing site and it has a Linkedin apply button plugin - this provides for a ...
2
votes
1answer
61 views

Json whitespace formatter

I couldn't quickly find Java code with googling to make serialized Json easier to read (this is a debugging library, obviously implementation code wouldn't use this as it's just more characters). This ...
-1
votes
1answer
87 views

ASP.NET MVC 4 Shopping Cart - Cannot update shopping car items using JQuery , Ajax, jSON, jGrid [closed]

I have this code in a C# MVC 4 VS2012 project. I need to be able to update the shopping cart with jSON data using JQuery/AJAX, i'm using jqGrid to display the data and pulling the shopping cart items ...
3
votes
1answer
60 views

JavaScript object to JSON

Since I didn't find a way to properly transform JavaScript object to JSON with PHP, I wrote a snippet. Lets assume the following excerpt from Google Fonts JavaScript API: WebFontConfig = { ...
0
votes
2answers
74 views

JSON API in C++ with Node.native, RapidJSON, and MySQL

Hey folks, I was hoping I might get some feedback and ideas for improvement on this, particularly the WebRouter class. Any tips or suggestions would be great! #include <native/native.h> ...
2
votes
1answer
76 views

Most efficient way to insert into ordered sequence

I have a dashboard like interface, that can have many tabs. There can be as many or as few tabs as the user likes, with the user being allowed to re order them as they wish. Exactly like browsers do. ...
2
votes
1answer
79 views

JSON schema validator

I wrote a simple JSON schema validator. The full code is over here on gist.github.com However, the code without comment is... validate = function(schema, instance) { var i; var errors = 0; ...
1
vote
0answers
93 views

How to optimize this algorithm? (solving systems of linear equations)

I am working on a programming challenge described here: http://www.enigmagroup.org/missions/programming/9/ Basically, you have a 6x6 table where the first 5 columns and rows are comprised of ...
4
votes
2answers
65 views

Recursive XML2JSON parser

I made a Python function that takes an XML file as a parameter and returns a JSON. My goal is to convert some XML get from an old API to convert into Restful API. This function works, but it is ...
0
votes
1answer
55 views

Can this iterating javascript code be optimized?

Say I have this type of code I'd like to execute. There's some data encapsulated around a big Javascript object containing methods & properties that I'd like to extract based on comparing some ...
3
votes
2answers
61 views

Help with jquery form data code refinement

Could someone please help me make this code as professional as it can be? It works fine, it's just I look at it and think, 'there is surely a better way to do some of this', I would really appreciate ...
1
vote
1answer
64 views

Improving localStorage functions

As part of a larger web app we are producing, I was asked to help build functionality to tie a page's shopping cart into localStorage for persistency. What follows are the three functions that I wrote ...
1
vote
2answers
146 views

Simple JSON writer

I am working on a way to quickly build JSON strings in Java. To this end, I have created the following two files. Assuming that I do not need to parse JSON strings for Java, is this an efficient ...
1
vote
0answers
138 views

How to add faster object to an array

I have a list with contentlets and want all languages from every contentlet (I get these with the method languageAPI.getAllValuesByKey(key , contentList). I get a Hashmap and iterate over it. There ...
-1
votes
1answer
82 views

Why I need to use 2 functions, but not only one [closed]

I paste all of my code because it might have a connection with the function I am asking for. I had some problems with my parseJSON() function and someone helped me to make it work. Now I don't know ...
-1
votes
1answer
121 views

JSON array data posts but table does not update - PHP - Mysql - PDO - AJAX [closed]

I have a php script that encodes my db table into an array. I echo the json_encode and it echos just fine. script : <?php $host="localhost"; // Host name $username="root"; // Mysql username ...
1
vote
1answer
33 views

How can I animate this foreach ajax call in jquery?

I have created an app in codeigniter that fetches some json data via ajax and displays it on the page. What i am trying to achieve is to load in a div per fan that is essentially just a box ...
2
votes
1answer
73 views

Passing a large amount of diverse information in JSON using Symfony 2.1 and Doctrine 2

For a project I need to give a load of diverseinformation in JSON format. All the information will be used on the same page so a single call would result in the least overhead. The information all ...
3
votes
2answers
147 views

Better way to return data via AJAX?

Let's say I have three files: a page that is used for searching data called search, a file that handles requests called controller, and a file that has functions which the controller calls based on ...
0
votes
1answer
65 views

JSON get Array in Array [closed]

I need to generate JSON array in array data. I am able to get data from first array, however not able to get data from child array. For example :- [ { "id":"2012" "month": [ { ...
5
votes
0answers
169 views

My PHP AJAX bridge to jQuery library

I've been working on this library for 2 years now and using on many websites with great success. And I decided to make it public, I can assure this is the best jQuery <=> PHP bridge library there ...
6
votes
1answer
320 views

C# serialisation implementation review

I'm just starting to develop more in C# after being mainly a VB.Net developer and was looking for some one to critic my implementation of a NewtonSoft Json.Net serialiser. Can you provide some ...
5
votes
1answer
409 views

Handling parsing failure in Scala without exceptions

I have a Scala (Play!) application that must get and parse some data in JSON from an external service. I want to be able to gently handle failure in the response format, but it is becoming messy. What ...
2
votes
0answers
322 views

iOS: Parsing NSDictionary from NSJSONSerialization

playerObject is an NSDictionary from JSONObjectWithData:options:error: I'm trying to update a CoreData entity. My code looks like this: if ([results count] > 0) { newPlayer = (Player ...
3
votes
1answer
187 views

JQuery Promise Interface for a (very) simple JSON Parser

I have written a parser function that returns a JQuery Promise. You can see from the code that this is the top level parser and it delegates out to two other more specific parsers. At the minute it ...
0
votes
2answers
258 views

How can I improve my PHP backend for html5/js mobile app?

I would really appreciate any feedback on the back-end of my mobile application. I tried to keep an MVC pattern, where I considered the app to be my view. Perhaps an REST framework would have been ...
2
votes
2answers
250 views

Convert JSON to a different format (nested json)

This is really not a question. I was looking up this solution but couldn't find it anywhere. Thought of posting it here so it may save someone's time. Here was my issue: I had a JSON coming from ...
5
votes
2answers
2k views

jQuery plugin $(node).toJSON() - convert html form to JS Object

GitHub project repo I've been working on this little function to convert an HTML form into a JSON Object having the same structure of the form. Basically it is intended to be useful in those ...
3
votes
2answers
186 views

QJson: Yet another Json parser and serializer for Qt, but with additional features

I wrote QJson, a utility class in/for Qt, I need you to take a look at. It is both a JSON parser and serializer, but with extended funcionality (going beyond the JSON specification) (see first ...
3
votes
0answers
448 views

QJsonView: A QWidget-based json explorer for Qt

Abstract I'm developing applications using Qt which highly make usage of the JSON language to communicate, store and load data of different types. I often need a simple viewer similar to the Firebug ...
2
votes
1answer
178 views

Loading a pseudo-class instance from JSON

Is there a better way to do this? function Person(name) { this._type='Person'; this.name=name; this.hello = function(){ alert('Hello '+this.name); }; } function ...
2
votes
0answers
786 views

JSON Serializer

Carrying on from: Yet another C++ Json Parser Yet another C++ Json Parser (Recursive) All the code is available from git hub: ThorsSerializer but only reviewing a small section here. The idea is ...
5
votes
2answers
180 views

Check if a value exists or catch an exception

I am parsing a response from server, and in case it contains the fields "chunk_number"(J_ID_CHUNK_NUMBER) and "total_chunk_number"(J_ID_CHUNK_TOTAL), I want to check whether I should request another ...
1
vote
1answer
4k views

Android: Optimize JSON insertion to SQLite (insert … on duplicate key ignore)

In current task, I'm refactoring the code of converting JSON file into SQLite database on Android device. Code compliant with Java 6. As od benchmark, grabbing the code from remote server takes ~1 ...
4
votes
3answers
529 views

python: is my program optimal

I wrote code in python that works slow. Because I am new to python, I am not sure that I am doing everything right. My question is what I can do optimally? About the problem: I have 25 *.json files, ...
1
vote
1answer
205 views

JSON formatting and processing hierarchies

I have a properties file I'm using for GIS software and currently you have a feature like road, then properties under it like so: { "road": { "colour": "rgb(0,0,0)" }, ...
4
votes
3answers
630 views

StackOverflow user info fetcher

I'm starting to look at Python and it's facilities. I just try to make one simple program using some base libraries. I would like to hear some comments about anything you've noticed - style, ...
3
votes
1answer
925 views

Yet another C++ Json Parser (Recursive)

Following on from this request Yet another C++ Json Parser A friend pointed out that he though a recursive decent parser would be more efficient. Before I agree I want to test it so I wrote it for ...
14
votes
1answer
1k views

Yet another C++ Json Parser

This is a framework for a json Parser I put together last night. Any comments appreciated. JsonLexer.l: Breaks the input into lexemes JsonParser.y: Understands the language syntax JsonParser.h: ...
3
votes
1answer
219 views

A better way to convert an SQLObject instance into a dict

I've got this function which returns an SQLObject instance as a dict (taking into account inherited classes, properties, etc). It doesn't work right now on SQLObject classes which inherit from ...
3
votes
1answer
529 views

Convert XSD to JSONSchema, tips for refactoring

UPDATED - This is v 0.4 .. i have fixed a few more bugs ..and covered more cases. public static class ReadXsd { #region ExtensionMethods private static void AddTypeAndExtends ( this ...
1
vote
2answers
284 views

JSON for one column of a csv file?

I wrote this to pull one column of data from a csv file, divide each of the results in 2, and then format it as JSON so I can do stuff with it in a web app. It works, but it feels wonky and weird. ...
3
votes
2answers
412 views

Passing HTML back inside a JSON object

First question on here. I'm working on a piece of code in my MVC3 application and I'm struggling to decide if what I plan to do is a bad idea or not. I have a snippet of javascript that calls an mvc ...
2
votes
1answer
150 views

Is there a better way of fetching / formatting / storing tweets to my database in PHP

I am periodically getting tweets, formatting them, and storing them into the database. Now the line of code I use for this is an awefull lot. I was windering if this could be improved. Any ...
4
votes
1answer
2k views

How to exactly work with the JSON Object and jQuery, adding info to posts

I have been working with AJAX and JSON for quite some years now, but to be honest I still do not know exactly what all the functionality are, and how to create optimized code for jQuery. So my first ...
1
vote
1answer
395 views

Storing JSON blobs as well as using ActiveRecord relationships?

I am building a (fairly simple at this point) web app using Rails 3.1 and Backbone.js. The only hard part is building on part of the UI, which needs to allow rich responsive manipulation of ...
2
votes
1answer
255 views

Best way to iterate over JSON (using mootools in ex)

So this is my first time going over a pretty big nested object, was posting this up to see how I can possibly cut this down. (Some fears I have would be, I currently know the extent of the nesting (4) ...
1
vote
1answer
148 views

Python JSON method, how to optimise?

I wrote a Python method to convert an object and a subset of its attributes into a JSON string with a given field as the key There's a lot of string concatenation, and I'm not too sure what the best ...
4
votes
4answers
352 views

How can i make this piece of code better ?

using System; using System.Collections.Generic; using System.Text; using System.Reflection; namespace ParserProject{ class ParseToJsonString{ private readonly StringBuilder _sb; ...

1 2