Skip to main content

Posts

Showing posts from September, 2017

5 Tips for Computer Science Students

You are in college now so I am skipping the basics the go to class do your homework study for tests stay out of the hospital. These are not all important pieces of advice but I am sure you have heard them. Instead, let’s talk computer science. Here are some tips I have specially collected by talking to students who wish they’d heard them when they were students. Listen up. Seek help when you need it. Your classes are going to get harder, they are going to test your knowledge but that’s why you are there for. Some people find attending office hours or seeking extra help to be embarrassing. But these resources are there for a reason. Taking advantage of the help you are offered will not only help you prepare for future classes and learn the material better but a lot less harmful than bad grades or any other consequences of struggling. Don’t let yourself intimidated by large projects. The best thing to do, sit down a day at the assignment and break it up into smaller tasks. A lot o

JSON with JAVA – Introduction to JSON – Part2

JAVA SE does not have any internal package for processing JSON data. We have to import an external library. There are many libraries available. You can choose any. I will use Json-simple1.1 here. This makes our first step, importing the lib. Importing the lib   Click here  and download the zip file containing the jar library and follow the following steps to import it into eclipse. 1. Extract the zip file. 2. Right Click on the project folder in the package explorer, hover over Build Path and click on Configure Build Path. 3. You will see a nice window. Go to the Libraries tab and click on Add External JARs. 4. Navigate to the extracted jar folder, select the library and press open/ok. 5. Press ok again and you are done. Exploring the lib The library contains parser and data structures to process the given JSON formatted string. The parser parses the JSON data from string/Reader to its own readable form. The data structures consist of JSONObject and JSONArray Cla

Introduction to JSON – Part 1

JSON is a data interchange format, frequently used for data exchange between clients and servers across the web. I am dividing this short tutorial series into three parts just to make it easy for you to understand. Part 1 is an introduction to JSON. It shows what is JSON, its structures are and how to write a JSON document. Part 2 explains How to process JSON in JAVA. The last part includes JSON Serialization. Hold your breath, a lot is coming up. JSON, short for J ava S cript O bject N otation is a lightweight format which makes data exchange more than easier. It is also used to store data. JSON is language independent. For example, you can make a JSON Object in java and send it to a C# program which will gracefully handle it. JavaScript object can be converted into a JSON object and vice versa. A JSON document can have two structures. JSON Object: A name value pair or a key value pair. Names/Keys are only strings however values are of various types. Name and value are separ