Friday, 23 August 2013

how to code highlight in blogger or how to use syntex highlighter in blogger

In order to install & use it on Blogger, follow the below simple steps:
1) Go to your Template Layout->Download your template as a backup first

Wednesday, 17 April 2013

Modern Education : what, why and how we think about current education system. What Next?


Every time when exam comes closer, I thought life doesn't have sense anymore and I'm living very bore life. After exams this frustration regarding life goes magically. Why this happen to me? Probably God knows. 
Let's find some facts:
  1. Possibly our current education system does have some mistake.
  2. Study / syllabus is not interesting. 
  3. My study procedure does have mistake.
  4. Afraid of exams or reading overhead, called exam-phobia. 
  5. Result after exam does matter for all around and finally result will scare me.

Monday, 28 January 2013

Linux : set proxy for whole OS apt.conf

Method 1:
Step 1 : run this command on the terminal

linus@UbuntuLinux$ sudo gedit /etc/apt/apt.conf
//// press enter and then enter password, then gedit will open

Step 2 : write this code into the open gedit file : apt.conf

Acquire::http::proxy "http://username:password@ipaddress:port";
Acquire::https::proxy "https://username:password@ipaddress:port";
Acquire::ftp::proxy "ftp://username:password@ipaddress:port";
Acquire::socks::proxy "socks://username:password@ipaddress:port";

TCP Client & Server Program in Java

// --------------TCPServer.java

import java.io.*;
import java.net.*;

class TCPServer
{

Get own ip address and subnet mask in java


import java.net.*;


InetAddress localHost = Inet4Address.getLocalHost();
NetworkInterface networkInterface = NetworkInterface.getByInetAddress(localHost);
String ipAddress = localHost.getHostAddress();
String subnetMask = "/"+networkInterface.getInterfaceAddresses().get(0).getNetworkPrefixLength();
System.out.println(ipAddress + subnetMask);


--------
output like :
192.168.65.161/23

Saturday, 19 January 2013

Introduction to Version Control System & SVN


http://www.makebetterthings.com/page/7/

Version Control (aka Revision Control aka Source Control) lets you track your files over time. Why do you care? So when you mess up you can easily get back to a previous working version.

So Why Do We Need A Version Control System (VCS)?

Large, fast-changing projects with many authors need a Version Control System (geekspeak for “file database”) to track changes and avoid general chaos. A good VCS does the following:

What is the difference among nil, NULL, Nil in Objective-C?


http://www.makebetterthings.com/#

They are all zeros, the difference lies in their types
-> NULL is a generic pointer value ((void*)0, to be specific). It points to 0×0.
-> nil is an id. So its points to a non-existent objective-c object
-> Nil is a non-existent objective-c class
-> [NSNull null] is an object that’s meant to stand in for nil in situations where nil isn’t allowed. For example, you can’t have a nil value in an NSArray. So if you need to represent a “nil”, you can use [NSNull null]
Also there is no ‘null’ in the objective c its ‘NULL’ not ‘null’. ‘null’ exist in Java or in C# not in Objective-C

How to install VNC server on Ubuntu Server


http://rbgeek.wordpress.com/2012/06/25/how-to-install-vnc-server-on-ubuntu-server-12-04/



   VNC is a protocol that is used to share the desktop with other users/computers over the network/Internet.In order to share a desktop, VNC server must be install and configure on the computer and VNC client must be run on the computer that will access the shared desktop.

Wednesday, 2 January 2013

Proxy support Java Browser

//  WebBrowser.java

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.net.*;
import java.io.*;
import javax.swing.*;
import javax.swing.event.*;

public class WebBrowser
{
     public static void main(String [] args)
     {
          JFrame frame = new EditorPaneFrame();
          frame.show();
     }
}

class ProxyAuthenticator extends Authenticator {

    private String user, password;

    public ProxyAuthenticator(String user, String password) {
        this.user = user;
        this.password = password;
    }

Proxy authentication in Java code (manual proxy)


Proxy authentication in Java

The usual corporate networks provide internet access via proxy servers and at times they require authentication as well. May applications do open the connections to servers which are external to the corporate intranet. So one has to do proxy authentication programmatically. Fortunately Java provides a transparent mechanism to do proxy authentications.

Create a simple class like below-
import java.net.Authenticator;

class ProxyAuthenticator extends Authenticator {

    private String user, password;

    public ProxyAuthenticator(String user, String password) {
        this.user = user;
        this.password = password;
    }

    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(user, password.toCharArray());
    }
}
and put these lines of code before your code opens an URLConnection-
Authenticator.setDefault(new ProxyAuthenticator("user_iiitm", "password123"));
System.setProperty("http.proxyHost", "proxy host");
System.setProperty("http.proxyPort", "port");

Now all calls will successfully pass through the proxy authentication.

see the full browser support code here