Wednesday 8 March 2017

Programmer can be a Good Life Coach


When people are doing physical tasks, it is easy to assess how much they have done for a day. But when you are sitting and facing a computer every day, most people assume your job is way too easy. Programmers are often at the receiving end of such comment and wrong impression. They spend most of their lives in front of a machine; other people think they are machines as well. However, what other people don’t realize is that programmers are well-driven and highly motivated individuals. They strive to perfect their tasks and achieve their goals while in a deadline. Here are a few things people don’t usually realize about programmers:
  • They are Perfectionists
    One of a programmer’s tasks is to correct errors by making appropriate changes and then rechecking the program to ensure that the desired results are produced. This would entail a lot of checking and reviewing for errors over and over again until it is perfect.
But they understand that before you achieve perfection, you’ll have to work hard for it.
    Programmers run multiple tests to ensure that they come up with the favored result and correct instructions.
  • They know that working in a team is important.
    Most programmers work in a team during a project. Each of them is assigned specific tasks to perform.
But everyone needs to step up individually.
    Everything that one programmer adds or deletes in the project could either make the project better or worse. So programmers need to do a good job individually for the team to be more productive.
  • They are frequently seen working alone
    You can see programmers cooped up in their own workstations or in front of their computer, focusing only on their work.
But they are considerate of others.
    They would document what they have edited and insert comments to guide other programmers about the program. They also help in making the instructions and manuals for end users.
  • They can be irritable at times
    Programmers may be working on a code for weeks to months and it could just be ruined by one click. They put a lot of work and effort into a project when things go wrong they feel frustrated.
But they are patient most of the time.
    Amidst all the errors, stress and hysteria they encounter, a programmer learns to be patient, retrace his steps and calmly figure out what the problem is.
  • They have wild ideas.
    There are no limits on what programmers can achieve. Programs nowadays range from absurd to very useful applications.
But they are motivated in fulfilling those ideas.
    Programmers invest a lot to every project they are set to accomplish. Some startups may not even gain any monetary reward for their work at the beginning. But they know that taking a risk on something you really believe in could help you attain success in the future.
  • They are goal-oriented.
    Programmers have one goal and that is to succeed.
And most of the time, they achieve that goal.
So, who can better motivate you to reach your goals than programmers who face multiple errors and problems every day before they can achieve their goal?

Saturday 25 February 2017

JSON Encoder and Decoder For JavaScript

What is JSON?

Answer : JSON(json stands for JavaScript Object Notation) is a most lightweight and very faster then XML computer data interchange(object,array,etc..) format.

The Following List Of Characteristics of JSON

1st : JSON is very easy to read mode and write mode.
2nd : It is a most lightweight with very faster more than XML text-based interchange format Data.
3rd : JSON is all language (Global)independent Data.
Json encoder and decoder tool used to convert or computes json encoded format data and decoded format data strings for the given text:

Following the List of Tools for JSON Encoder and Decoder :

JSON.stringify : Example

1st : JSON.stringify({}); // Result is : ‘{}’
2nd : JSON.stringify(true); // Result is : ‘true’
3rd : JSON.stringify(‘ng4free’); // Result is : ‘”ng4free”‘
4th : JSON.stringify([2, ‘false’, false]); // Result is : ‘[2,”false”,false]’
5th : JSON.stringify({ j: 50 }); //Result is : ‘{“j”:50}’
3th : JSON.stringify({ abc: 5, def: 6 }); //Result is: ‘{“abc”:5,”def”:6}’ or ‘{“def”:6,”abc”:5}’

Convert – an object to a string in javascript, used to JSON.stringify function in javascript:

1
var simple_json_text_demo = JSON.stringify(name_your_object_data, null, 2);

Convert – JSON string to object in javascript, used to JSON.parse function in javascript:

1
var name_your_object_data = JSON.parse(simple_json_text_demo);

jQuery with json – encode and decode

1
2
3
4
var simpleappmyObj = {script: "example", "demo": "simpleblogspotng4free"};
$.toJSON(simpleappmyObj);
 
// Result is = : {"script":"example","demo":"simpleblogspotng4free"}

Converting a JSON Text data to a JavaScript Object with Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html>
<head>
<title>
JSON Encoder and Decoder For JavaScript with Example
</title>
</head>
<body class="well">
 
<h2>Create Simple Object from data of JSON String For JavaScript with Example</h2>
 
<p id="simpledemo"></p>
 
<script>
var text_all = '{"userlistex":[' +
'{"userfirstName":"ng4free","userlastName":"king" },' +
'{"userfirstName":"ng4free.com","userlastName":"wordpress" },' +
'{"userfirstName":"ngking","userlastName":"patel" }]}';
 
obj = JSON.parse(text_all);
document.getElementById("simpledemo").innerHTML =
obj.userlistex[1].userfirstName + " " + obj.userlistex[1].userlastName;
</script>
 
</body>
</html>

JSON Format supports – DataTypes List

1 : Number
2 : String
3 : Boolean
4 : Array
5 : Value
6 : Object
7 : Whitespace
8 : null