• 0

Json ?


Question

hi I have tried reading the documentation on json but its not getting me anywhere ... I could tell you exactly what json is and does ....

json is a language which belongs to the javascript family blah blah blah it can be used to communicate between different languages and platforms ect ect .... but the thing is I have no idea how this thing is working can someone give me links to json / php to java tutorials that they have found usful ? or give me some small little bits of code so i can see what the hell is going on ? or give me some indepth explination to what i can do with this ? I need to learn it apparently

Link to comment
https://www.neowin.net/forum/topic/1127368-json/
Share on other sites

8 answers to this question

Recommended Posts

  • 0
or give me some indepth explination to what i can do with this ?

Familar with XML? Same kinda thing, just (in my opinion) better. It's just an easy standardized way for one program to talk to another.. regardless of who wrote it, if it properly parses JSON data, it'll get there unmangled. It's not a transport, just a way to ensure that program A can understand program B and vice versa. Some IDE's will have JSON parsers built in so you can view/serialize data a bit easier, there's some online too. Take your data, serialize it into JSON, and presto, you get something like below. The other program receives this then does it in reverse, and you get a "tree" which you should be able to easily visualize in your head with this example.


{
"firstName": "Max",
"address": {
"streetAddress": "123 Main St.",
"city": "Anytown",
"state": "US",
"postalCode": 12345
},
"phoneNumbers": [
"123-456-7890",
"123-555-1212"
]
}
[/CODE]

Link to comment
https://www.neowin.net/forum/topic/1127368-json/#findComment-595410430
Share on other sites

  • 0

JSON is merely a data-interchange format for passing data between programs written using various languages/technologies. Since it is widely used on the Internet and PHP has a habit of including the kitchen sink, it also has JSON encode and decode functions built-in (since PHP 5.2.1). The json_decode page in the PHP manual has not only function documentation but also several examples. You might also take a look at this StackOverflow question about parsing JSON in PHP. It has most of the code for a complete parser.

Link to comment
https://www.neowin.net/forum/topic/1127368-json/#findComment-595410434
Share on other sites

  • 0

Familar with XML? Same kinda thing, just (in my opinion) better. It's just an easy standardized way for one program to talk to another.. regardless of who wrote it, if it properly parses JSON data, it'll get there unmangled. It's not a transport, just a way to ensure that program A can understand program B and vice versa. Some IDE's will have JSON parsers built in so you can view/serialize data a bit easier, there's some online too. Take your data, serialize it into JSON, and presto, you get something like below. The other program receives this then does it in reverse, and you get a "tree" which you should be able to easily visualize in your head with this example.


{
"firstName": "Max",
"address": {
"streetAddress": "123 Main St.",
"city": "Anytown",
"state": "US",
"postalCode": 12345
},
"phoneNumbers": [
"123-456-7890",
"123-555-1212"
]
}
[/CODE]

oh that seems a bit long winded :/ I got my program at the moment posting to a php script then catching the response via datainputstream ... is this fine? or do you think Json would be better ? for large bits of information I send as 1 string with specific parameters so my java program can handle and string manipulate its self... I Dont know what i was hoping for with json but to me it does not sound that useful sounds like there are many alternatives... :(

Link to comment
https://www.neowin.net/forum/topic/1127368-json/#findComment-595410464
Share on other sites

  • 0

oh that seems a bit long winded :/ I got my program at the moment posting to a php script then catching the response via datainputstream ... is this fine? or do you think Json would be better ? for large bits of information I send as 1 string with specific parameters so my java program can handle and string manipulate its self... I Dont know what i was hoping for with json but to me it does not sound that useful sounds like there are many alternatives... :(

JSON would be what's received by the InputStream. It's not a replacement for any data socket handling things, it is the data. If your data needs lots of key-value things like you're sending objects, maps, or arrays across, then JSON would be good for your uses. It's not good for just straight strings or for binary data.

Link to comment
https://www.neowin.net/forum/topic/1127368-json/#findComment-595410504
Share on other sites

  • 0

To avoid stuff like that, you'll want to ensure that you're using a proper JSON encoder/decoder. JSON isn't actually JavaScript (It just shares the object notation, hence the name) and there's a bunch of subtle differences that can cause things to break if the parser isn't smart/good enough (Which is also another reason you never parse JSON using eval(), and be very very careful with "JSONP", grab it via XHR instead, etc.)

Link to comment
https://www.neowin.net/forum/topic/1127368-json/#findComment-595417088
Share on other sites

  • 0

JSON = JavaScript Object Notation. The name kinda explains what it is. It's simply a way of notating javascript objects so you can pass them around in a standardised, lightweight way.

BTW, if you're using Chrome, install the JSONView extension which will automatically format JSON responses into a nice readable display.

Link to comment
https://www.neowin.net/forum/topic/1127368-json/#findComment-595417190
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Close, but it is for any application starting, not just during boot time. In fact, it probably will not improve boot time at all because during a boot, the CPU is already boosting, so a pre-boost wouldn't change anything. I agree that it isn't exciting (especially considering every other OS already does it), but it is a good thing, even if they are just playing catch up.
    • Any so called performance increase will be in milliseconds, which nobody will actually notice in real world usage.
    • All it does is use the CPU more efficiently during boot to speed up boot times. That's it. Yawn....
    • It's not a one or the other kind of thing. Software should run efficiently, and the operating system should appropriately manage the CPU clocks. You could have the best most optimized software on earth, and it will still run faster if the CPU does a better job of boosting as needed. All this is doing is pre-boosting the CPU based on user actions, instead of waiting for the normal detection mechanism to kick in. If the OS knows it is about to need more CPU, why shouldn't it use that knowledge? It's the same idea of downshifting before passing someone, instead of just burying your foot into the peddle and waiting for the transmission to figure out what you want to do.
    • Audacity 3.7.8 by Razvan Serea Audacity is a free, open source digital audio editor and recording application. Edit your sounds using cut, copy, and paste features (with unlimited undo functionality), mix tracks, or apply effects to your recordings. The program also has a built-in amplitude-envelope editor, a customizable spectrogram mode, and a frequency-analysis window for audio-analysis applications. Built-in effects include bass boost, wah wah, and noise removal, and the program also supports VST plug-in effects. You can use Audacity to: Record live audio. Record computer playback on any Windows Vista or later machine. Convert tapes and records into digital recordings or CDs. Edit WAV, AIFF, FLAC, MP2, MP3 or Ogg Vorbis sound files. AC3, M4A/M4R (AAC), WMA and other formats supported using optional libraries. Cut, copy, splice or mix sounds together. Numerous effects including change the speed or pitch of a recording. Write your own plug-in effects with Nyquist. And more! See the complete list of features. Audacity 3.7.8 changelog: #10688 Fixed an exception thrown when pasting into a newly-created track (Thanks, David Bailes (@DavidBailes)!) #10870, #10884, #10775, #10629 Fixed tone generation, waveform-scale setting, SetClip Name parameter, and clip-boundary command names for scripting and macros (Thank you, David Bailes (@DavidBailes)!) #11106 Fixed the loading of presets for the Distortion effect (A million thanks, David Bailes (@DavidBailes)!) #10947 Fixed paste into an empty audio track not preserving the source sample rate (Thanks, Juan Gabriel Colonna (@juancolonna)!) #10776 Allowed AltGr modifier in label and clip name editing (Thanks, Davide Peressoni (@DPDmancul)!) #9938 Added options to choose where silence is truncated (start/middle/end) (Thanks, Noah Rosenfield (@nosenfield)!) #9935 Added Podcast 2.0 chapters JSON export for label tracks (Thanks, Noah Rosenfield (@nosenfield)!) #10103 Improve UI on HiDPI displays on Linux/wxGTK (Thanks, Ivan A. Melnikov (@iv-m)!) #10099 Fixed MixerBoard Mute and Solo button display (Thanks, Ivan A. Melnikov (@iv-m)!) #10681 Fixed multichannel FLAC import #10999 Fixed envelope being broken after joining clips Download: Audacity 64-bit | Standalone ~20.0 MB (Open Source) Download: Audacity 32-bit | Standalone Download: Audacity ARM64 | Standalone View: Audacity Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Year In
      slackerzz earned a badge
      One Year In
    • One Year In
      highriskpaym earned a badge
      One Year In
    • One Month Later
      highriskpaym earned a badge
      One Month Later
    • Week One Done
      highriskpaym earned a badge
      Week One Done
    • Week One Done
      FBSPL earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      501
    2. 2
      PsYcHoKiLLa
      198
    3. 3
      +Edouard
      155
    4. 4
      Steven P.
      84
    5. 5
      ATLien_0
      71
  • Tell a friend

    Love Neowin? Tell a friend!