Skip to main content

Posts

Showing posts from August, 2012

An Example of Json Parsing with Jquery

Giving a very simple example of json parser using jquery.. It can parse any json feed and prints in key-value pairs in a table… Check out…
<html>
<head>
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js” type=”text/javascript”></script>

<script type =”text/javascript”>
var num = 1;
var jsonData = ” “;
function parseJSONDATA() {
  $(”#loaderDiv”).css(”display”, “block”);
  $(’.placeHolder’).html(”");
  num = 1;
  jsonData = $.trim($(”#txtData”).val());
  $.getJSON(jsonData, function (data) {
    $.each(data, function (key, val) {
      getJson(val);
    });
    $(”#loaderDiv”).css(”display”, “none”);
  });
}
function getJson(JData) { $.each(JData, function (Jsonkey, Jsonval) {     if (Jsonval && typeof Jsonval == “object”) {       getJson(Jsonval);     } else {       if (num == 1) {         $(’.placeHolder’).append(”<tr><th>Key</th><th>Value</td></th>”);       }       $(’.placeHold…

Writing and Parsing Json with Java

Here is a simple example of Writing and parsing Json with Java. I have used simple json library for the purpose.
Get the library in this link
http://code.google.com/p/json-simple/downloads/detail?name=json_simple.jar&can=2&q=
/**
Author Mridul Chatterjee
 */
package com.demo.util;
import java.text.ParseException;

import java.util.Iterator;
import org.json.simple.*;
import org.json.simple.parser.JSONParser;
public class JsonParser {
     public static void main(String[] args) throws ParseException {
JSONObject jsonobj = new JSONObject();
jsonobj.put(”name”, “mridul”);
jsonobj.put(”age”, new Integer(100));
JSONArray list = new JSONArray();
list.add(”some text 1″);
list.add(”some text 2″);
list.add(”some text 3″);
jsonobj.put(”messages”, list);
try {
System.out.println(”#################Here We build a json string #############”);
System.out.println(jsonobj.toString()); } catch (Exception e) {
e.printStackTrace();
}
System.out.println(jsonobj);
System.out.println(”#################…

Gauss Malware

The latest of the virus threats in the internet is gauss. Let’s have some knowledge about that before it struck your computer… It is a common factor that your computer gets affected with virus every now and then. In fact, it makes you ponder about the scary virus. Recently, the market is afflicted with one of the deadliest viruses called Gauss Malware. It is a kind of virus, that do enters your computer and steals all the confidential data especially the bank detail. Gauss is a kind of virus that disseminated in the areas of the Middle East to hack all the information from the Lebanese bank. Sources revealed that Gauss mainly attacks the 32 bit versions of the windows. Moreover, the virus gets segregated in equal parts in both the windows Xp as well as the windows 7.Well the exiting fact is that sometimes the virus to fail to attack windows 7.On the other hand, linux also stays in the safe mode. T he virus was actually found in the year of 2011 and are still said to be active. Above …