Why PTI Azadi March is necessary and need of the moment

Causes:

  • Massive rigging was done on #May11.
    • Examples: Out of 100000 verified votes of #NA118, ECP has no records of 50000 votes, claimed by NADRA, other examples also there
  • #PMLN along with others was involved in this massive rigging.
    • Examples: Najam Sethi promoted as PCB head, Ex. CJ’s son made VC of board of investment baluchistan
  • PMLN will never investigate any of the rigged constituency or will never form a free and fare ECP.
    • Example: there is committee made on making and deciding such reforms and for the past 8 months, there’s not a single session held, imagine how serious PMLN is in making reforms.

To get rid of this corrupt and rigged system, people of Pakistan need to decide whether they want Pakistan as it was running for 65 years or needs #Change? If yes, then ECP must be revamped and PTI’s efforts of #AzadiMarch is for this purpose only.

For those who said, that PTI should speak in Parliament to make such changes example is there of parliamentary committee.

So, ECP must be revamped before next elections otherwise this system is just a crap. And PMLN will never do it, so if PTI has to do it, then after getting humiliated for 1 year in courts, they are left with only one option; #Streets.

Yes, on the issue of mid-term elections, I too have some reservations but it’s purely constitutional.

A Message to PTI Critics and Young Writers of saach.tv

We all know the importance of social media; it has given so much power to the people, where no one can stop them from either appreciating or abusing. Blogs, a big tool of social media, are one of biggest advantages of social media where young writers can publish their views even without proof reading.

Saach.tv (headed by senior TV anchor and host, Talat Hussain) is one of such effort. It’s more of a news channel on social media. It has helped and promoted many young writers to express their views on the political situation going on in the country and it should be appreciated a lot. I’ve seen some excellent, impressive and quality words by many young writers. But it is also observed that most of their work is surrounded around criticizing Pakistan Tehreek-e-Insaf (PTI) and its chairman, Imran Khan. This little piece is to let them understand a little about what impression they are creating in General.

Comparing PTI to any other political party and Imran Khan to any other party head, one would find they are stand on the two edges of a rope. One can count enormous differences in their way of politics.

Most of these young writers, they have forgotten every other Party & Politician, who have given all the dents to Pakistan and its people. They start their political discussion criticizing PTI & Imran Khan and end it with a long list of charges on PTI and its performance.

A party, started from Zero, grown its membership without asking any help from the establishment, held the Pakistan’s first ever Intra Party Elections, was never into government before, and when given, the responsibility was of Pakistan’s most difficult province, where it is all set to explore it’s agenda. Road map to every field of human interest has been set and production is about to begin. Imran Khan inaugurated a 250 MW power plant in Kalaam, a KP’s first MCH (Mother Child Health) center and a Mobile Lady Doctor Service for far flung areas of KP on August 27, 2013. Imran Khan repeated its commitment to produce what he had committed before election campaign. Beside all these efforts and commitments, these young writers, when speak, criticize PTI and Imran Khan.

No matter to which party you belong to or to which system you are affiliated with, one thing is agreed and accepted by all the major critics and politicians that Imran Khan is one of the most SINCERE, HONEST and BRAVE leader of Pakistan in present times. The only leader who has given a new thought to the young blood of Pakistan. The only leader who has delivered in Education i.e. Namal College, Mianwali and Health i.e. Shaukat Khanum Memorial Cancer Hospital and Research Center.

And now started delivering in KP, where only his 2.5 months’ performance talks a lot. He lost two NA seats in By Elections and the reasons he accepted his failure and wrong selection.

Imran Khan, the only elected chairman of any political party and only politician who can be called “A MAN OF WORDS” and yet people criticize him. He’s the only leader who held Intra Party Elections right from Top-to-Bottom, the only chairman of the only political party, PTI, who have elected office bearers from Chairman to UC Levels and yet people criticize him.

Imran Khan is the only leader who forced International Media to put attention on the innocent Drone victims and that is why he was named 3rd strongest politician of the world (see Most Powerful Politicians of 2013), a leader who talks against drone attacks and asked for exposing names of the Drone Victims and yet people criticize him.

When the government was established in KP, unlike all the previous governments where parties use political slogans for Election Campaigns and point scoring, Imran Khan didn’t change a word of what he committed during his election campaign and yet he keeps on repeating what he promised and making commitments that he’ll deliver Naya KP and yet people criticize him.

“Talking justice will increase the credibility of all the Young Writers and will also help them get better understandings of the situation in the country.”

I want to reassure that I do not want them to write success stories of PTI’s and Imran Khan day and night. I only want them to show some justice. When they say that Imran Khan should not award tickets to the ones suggested by Pervaiz Khattak, they should also talk about all the families’ associates of Mian Nawaz Sharif and Mian Shahbaz Sharif involved in decision making of their party. When they talk about Prevaiz Khattak using government helicopter, they should also talk about Prime Minister of Pakistan carrying his family with him on China Visit even when he said “Khazana Khali He”.

But they didn’t, all they know is Kith and Kin of PTI and Imran Khan but not a word about all those parties which have ruled for past 65 years and ruined everything. My request to all these emerging writers to please keep in mind the efforts, sincere efforts done by Imran Khan and Team in establishing KPK.

Hello World Example of AJAX using JSON

Here is the code for Hello World AJAX example using JSON:


index.html

<html>
<head>
<title>Ajax JSON Demo</title>
<script type=”text/javascript” src=”script/ajax-script.js”></script>
</head>
<body onload=”setTimeout(‘sendAjaxRequest()’,500);”>
<div id=”resDiv”>
Please wait while the list is being generated…
</div>
</body>
</html>

ajax-script.js

var httpRequest;

function getXHR()
{
var xhr = null;
if (window.XMLHttpRequest) // Mozilla, Safari, …
{
xhr = new XMLHttpRequest();
if (xhr.overrideMimeType)
{
xhr.overrideMimeType(‘text/html’);
}
}
else if (window.ActiveXObject) // IE
{
try
{
xhr = new ActiveXObject(“Msxml2.XMLHTTP”);
}
catch (e)
{
try
{
xhr = new ActiveXObject(“Microsoft.XMLHTTP”);
}
catch (e) {}
}
}

if (!xhr)
{
alert(‘Cannot create an XMLHTTP instance’);
return false;
}
return xhr;
}

function sendAjaxRequest()
{
var reqUrl = “AjaxJsonServlet?list=std”;
httpRequest = getXHR();
httpRequest.onreadystatechange = ajaxCallback;
httpRequest.open(‘GET’, reqUrl, true);
httpRequest.send(null);
}

function ajaxCallback()
{
try
{
if (httpRequest.readyState == 4)
{
if (httpRequest.status == 200)
{
generateStudentList(httpRequest.responseText);
}
}
}
catch(e)
{
alert(‘Caught Exception: ‘ + e.description);
}
}

function generateStudentList(resData)
{
var html = “”;

if(resData != null && resData != “”)
{
html = “<table><tr><th>ID</th><th>NAME</th></tr>”;
resData = eval(resData); // validates the json string and convert it into object
for(var i=0; i<resData.length; i++)
{
var obj = resData[i];
html += “<tr>”;
html += “<td>” + obj.id + “</td><td>” + obj.name + “</td>”;
html += “</tr>”;
}
html += “</table>”;
}
else
{
html = “No data to display!”;
}

var resDiv = document.getElementById(“resDiv”);
resDiv.innerHTML = html;
}

AjaxJsonServlet.java

package com.ajax.json.demo;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class AjaxJsonServlet extends HttpServlet
{
public void init() throws ServletException
{
}

public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType(“text/json”);
PrintWriter out = response.getWriter();

String fromPage = request.getParameter(“list”);

if(fromPage != null && fromPage.equals(“std”))
{
String json = JSONGenerator.generateStudentListJSON();
out.write(json);
}

out.flush();
out.close();
}

public void destroy()
{
super.destroy();
}
}

JSONGenerator.java

package com.ajax.json.demo;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class JSONGenerator
{
public static String generateStudentListJSON()
{
JSONArray studentList = new JSONArray();
JSONObject jsonObj = null;
jsonObj = new JSONObject();
jsonObj.put(“id”, 1);
jsonObj.put(“name”, “Adnan Sohail”);
studentList.add(jsonObj);

jsonObj = new JSONObject();
jsonObj.put(“id”, 2);
jsonObj.put(“name”, “Asim Riaz”);
studentList.add(jsonObj);

jsonObj = new JSONObject();
jsonObj.put(“id”, 3);
jsonObj.put(“name”, “Hassan Zeb”);
studentList.add(jsonObj);

jsonObj = new JSONObject();
jsonObj.put(“id”, 4);
jsonObj.put(“name”, “Alam Virk”);
studentList.add(jsonObj);

return studentList.toString();
}

}

web.xml

<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app version=”2.4″
xmlns=”http://java.sun.com/xml/ns/j2ee&#8221;
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”&gt;
<servlet>
<servlet-name>AjaxJsonServlet</servlet-name>
<servlet-class>com.ajax.json.demo.AjaxJsonServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>AjaxJsonServlet</servlet-name>
<url-pattern>/AjaxJsonServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>

Build a project in eclipse or some other IDE, and run the following application.

It will results like:

Results-1

Results-1

Results-2

Results-2

What is JSON?

JSON (Java Script Object Notation) used as data transfer format. Because JSON is lightweight, easy to understand, manipulate and generate, it has almost replaced XML which was used previously as the only data-interchange format. It is because of the reasons that:

  • XML is heavier than JSON
  • to parse XML, we have to use xPath which is an overhead removed in JSON because JSON is native to JavaScript
  • XML uses tags to describe user data and tags increase the size of data

Data in JSON is represented in the form of Objects and Arrays:

JSON Object:

A JSON Object is an unordered set of name/value pairs separated by a comma ( , ). Each object begins with a left brace ( { ) and ends with a right brace ( } ) and each value pair in an object is separated by a colon ( : ).

JSON Array:

A JSON Array is an ordered collection of values which may contains many comma ( , ) separated JSON Objects. It begins with left bracket ( [ ) and ends with right bracket ( ] ) and JSON Objects in it are separated by comma ( , ).

{ “students” : [

{“id”:1, “name”:”Adnan Sohail”},

{“id”:2, “name”:”Irfan Razzaq”}

]

}

What are the benefits of JSON over XML?

  • JSON supports data types like string, integer, boolean etc.
  • JSON is native data format for JavaScript and therefore it faster for the browser to read and understand.
  • As JSON contains no tags but data and therefore less data to be transferred between client and the server. So, it’s lighter than XML.
  • Easy for humans to read and write.