Tuesday, January 7, 2014

Akhter Wahab's invitation is awaiting your response

 
 
 
 
 
Akhter Wahab would like to connect on LinkedIn. How would you like to respond?
 
 
 
 
Akhter Wahab
Software Developer at Scrapinghub
 
 
 
 
You are receiving Reminder emails for pending invitations. Unsubscribe.
© 2014 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.
 
 

Wednesday, January 1, 2014

Akhter Wahab's invitation is awaiting your response

 
 
 
 
 
Akhter Wahab would like to connect on LinkedIn. How would you like to respond?
 
 
 
 
Akhter Wahab
Software Developer at Scrapinghub
 
 
 
 
You are receiving Reminder emails for pending invitations. Unsubscribe.
© 2014 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.
 
 

Monday, December 16, 2013

Invitation to connect on LinkedIn

 
LinkedIn
 
 
 
Akhter Wahab
 
From Akhter Wahab
 
Software Developer at Scrapinghub
Pakistan
 
 
 
 
 
 
 

I'd like to add you to my professional network on LinkedIn.

- Akhter

 
 
 
 
 
 
 
You are receiving Invitation to Connect emails. Unsubscribe
© 2013, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA
 

Monday, December 2, 2013

Akhter Wahab's invitation is awaiting your response

 
 
 
 
 
Akhter Wahab would like to connect on LinkedIn. How would you like to respond?
 
 
 
 
Akhter Wahab
Software Developer at Scrapinghub
 
 
 
 
You are receiving Reminder emails for pending invitations. Unsubscribe.
© 2013 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.
 
 

Monday, November 25, 2013

Akhter Wahab's invitation is awaiting your response

 
 
 
 
 
Akhter Wahab would like to connect on LinkedIn. How would you like to respond?
 
 
 
 
Akhter Wahab
Software Developer at Scrapinghub
 
 
 
 
You are receiving Reminder emails for pending invitations. Unsubscribe.
© 2013 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.
 
 

Wednesday, November 20, 2013

Invitation to connect on LinkedIn

 
LinkedIn
 
 
 
Akhter Wahab
 
From Akhter Wahab
 
Software Developer at Scrapinghub
Pakistan
 
 
 
 
 
 
 

I'd like to add you to my professional network on LinkedIn.

- Akhter

 
 
 
 
 
 
 
You are receiving Invitation to Connect emails. Unsubscribe
© 2013, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA
 

Friday, October 19, 2012

This might actually work for you: earn $300-$1000 a day! Next TangerStyle - 20% Sale

This might actually work for you: earn $300-$1000 a day! says,

Greetings! I would like to invite you friend to check this online job-just for you. This data-entry-job can be done at the comfort of your own home-you manage your time, you choose the hours of when to work and basically you will dictate the pace as to how much your earnings will go from 300-1000 dollars a day depending on your effort put to the program. As for your assurance this awesome offer comes with a "60 day money back guarantee!" Why take delays now if you've already been assured about our policy and what you are trying to consider here is for you to earn cash. To see more of our website click http://doiop.com/compensationathome as to how you go over to the process of earning extra straight from home. Best of luck! to your success, Ann Chelsea Cole

Ready, Set, Save! Click here to get your own 20% OFF coupon for your next Tanger outing and enjoy exclusive savings at participating stores

Wednesday, November 10, 2010

Akhter Wahab invites you to Freelancer.com

Hi akhterwahab.1987!

Akhter Wahab invites you to join Freelancer.com!

Freelancer.com is the largest micro-outsourcing site in the world, with over 1 million registered professionals ready to bid on your jobs and produce high quality work quickly and to budget. You can outsource anything, whether it be web design, graphic design, marketing or sales. The average job is under $200 which makes it very affordable for SMEs. Turbocharge your business today!

Alternately looking for work? We have the largest network of employers ready to hire just about any skill set.

Akhter Wahab has also sent you a special coupon code which will give you *100 bonus points* when you sign up!

This code is MYFRIEND which you can use at the end of the signup process when asked for a redemption code.

Follow this link now to sign up:
http://www.freelancer.com

Regards,
Freelancer.com Support

Sunday, August 8, 2010

finding Fibonacci series in Java

import java.util.*;
/**
 *
 * @author Akhter Wahab
 */

public class Main {

    /**
     * @param args the command line arguments
     */
    public static long fib(int n) {
        if (n <= 1) return n;
        else return fib(n-1) + fib(n-2);
    }

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int N = Integer.parseInt(scan.nextLine());//taking input from the user the limit of the Fibonacci series
        for (int i = 1; i <= N; i++)
            System.out.println(i + ": " + fib(i));
    }

}

Saturday, August 7, 2010

finding Prime Number in java

class Prime {
  public static void main(String[] args) {
    int number = 11;
    int i;
    for (i=2; i < num ;i++ ){
      int n = number%i;
      if (n==0){
        System.out.println("number is not Prime!");
        break;
      }
    }
    if(i == num){
      System.out.println("number is Prime !");
    }
  }
}

difference between abstraction and encapsulation

 The difference between both are ,Abstraction and encapsulation are two  separate concepts in Java. Abstraction is a technique that is used to represent common functionality amongst a set of classes. An analogy is to look at a set of vehicles: Car, Truck and Bus have some common features that all road vehicles share. From a Java perspective, the mechanics of turning four wheels, an engine, could be handled in abstract form through a common superclass. Abstraction allows subclasses to share common code without duplication.

Friday, August 6, 2010

Java Mail as text


public class MakeSend {
 
 String userName;
 String passWord;
 Logger logger = Logger.getLogger(MakeSend.class);
 
 public MakeSend(String userName,String passWord){
  
  this.userName = userName;
  this.passWord = passWord;
 }
  
 public String doSend(String smtp, StringBuffer msgBody,
String toEmail, String subject, String mimetype){
  
  Session mailSession;
  
  try{
   Properties mailProps = new Properties();
   mailProps.setProperty("mail.transport.protocol", "smtp");
   mailProps.setProperty("mail.smtp.host", smtp);
   mailProps.setProperty("mail.smtp.auth", "true");
   
   Authenticator mailAuth = new SMTPAuthenticator();
   mailSession = Session.getInstance(mailProps,mailAuth);
   Transport transport = mailSession.getTransport();
   
   MimeMessage msg = new MimeMessage(mailSession);
   
   msg.setFrom(new InternetAddress(userName));
   msg.setSubject(subject,"UTF-8");
   msg.addRecipient(Message.RecipientType.TO,
new InternetAddress(toEmail));
   msg.setDataHandler(new DataHandler(
     new javax.mail.util.ByteArrayDataSource(msgBody.
toString(), mimetype)));
   
   transport.connect();
   transport.sendMessage(msg, msg.getRecipients(Message.
RecipientType.TO));
   transport.close();
   
  } catch (MessagingException mex) {   
   logger.error("Email send failed, exception on:
[" + toEmail + "] -" + mex);
          return "ERROR";
  }catch (IOException ioex){
   logger.error("Email send failed, exception on:
[" + toEmail + "] -" + ioex);
   return "ERROR";
  }
  finally {
   mailSession = null;
  }
  
  return "OK";
 }
 
 private class SMTPAuthenticator extends Authenticator {
  
  public PasswordAuthentication getPasswordAuthentication(){
     
   return new PasswordAuthentication(userName,passWord);
  }  
 }

}

java Mail

you can send mail by using transport service here is the cod for example

public void sendEmail(String emailBody, String emailRecipients, String subject){
        try {
            String[] toAddress = parseArray(emailRecipients);
            String from = (FROM_ADDRESS);
            if (toAddress != null) {
                for (int i = 0; i < toAddress.length; i++) {
                    String address = (String) toAddress[i];
                    m_transportService.sendText(emailBody, subject, address, from);
                }
            }
        } catch (Exception e) {
            getLogger().log(LogLevel.WARN, e.getMessage());
        }
    }

my First Program in JAVA

public class MyFirstProgram{
    public MyFirstProgram(){
    }
public static void main (String args[]){
      System.out.println("This is my First Program ");
}

the out put is "This is my first program " pm the console

primitive data types in JAVA

There is Eight primitive data types in the JAVA
boolean
one-bit. can take one value true and false only.

true and false are defined constants of the language and are not the same as True and False, TRUE and FALSE, zero and nonzero, 1 and 0 or any other numeric value. Booleans may not be cast into any other type of variable nor may any other variable be cast into a boolean.

byte
one byte .values from -128 to 127.

short
two bytes, -32,768 to 32,767

int
four bytes -2,147,483,648 to 2,147,483,647.

long
eight bytes Ranges from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807.

float
four bytes range from 1.40129846432481707e-45 to 3.40282346638528860e+38

double
eight bytes IEEE 754. range from 4.94065645841246544e-324d to 1.79769313486231570e+308d .
char
two bytes, 0 to 65,535 unicode

JAVA Magic

this program will not compiled

 public class Magic {
 public void test() {
while(true) {
 System.out.println(“I am here”);
 }
 System.out.println(“Bye”);
 }
public static void main(String[] aergs){
Magic c=new Magic();
c.test();
 }
 }

but this will be compiled guess what is the reasion for this ???

 public class Magic {
 public void test() {
boolean b = true; // Now, it should work!
while(b) {
 System.out.println(“i am here”);
 }
 System.out.println(“bye”);
 }
public static void main(String[] aergs){
Magic c=new Magic();
c.test();
 }
 }

Thread in JAVA

you can create a Thread in java with two different ways

1)by extending from Thread class

public class MyThread extends Thread {
  
    public void run() {
        System.out.println("This is Thread");
    }
  
    public static void main(String[] args) {
        Thread thread = new MyThread();
        thread.start();
    }
}

2) by implementing runnable

public class MyRunnable implements Runnable {
  
    public void run() {
        System.out.println("this is Thread");
    }
  
    public static void main(String[] args) {
        Thread thread = new Thread(new MyRunnable());
        thread.start();
    }
}

List /ArrayList itration

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class ArrayToList {
  public static void main(String[] argv) {

 String myArray[] = new String []{"Arr1", "Arr2", "Arr 3"};

 //conversion of array to list
 List list = Arrays.asList(myArray);

          // loop itration
 Iterator iterator = list.iterator();
 while ( iterator.hasNext() ){
     System.out.println( iterator.next().toString() );
 }

          // 2nd way throgh for loop
 for (int i=0; i< list.size(); i++)
 {
 System.out.println( list.get(i) );
 }

          //3rd way through while loop
 int j=0;
 while (j< list.size())
 {
 System.out.println( list.get(j) );
 j++;
 }

  }
}

Servlet Example

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class SomeServlet extends HttpServlet {
  public void doGet(HttpServletRequest request,
                    HttpServletResponse response)
      throws ServletException, IOException {
    PrintWriter out = response.getWriter();
    // Use "out" to send content to browser
    out.println("Hello i m first servlet");
  }
}

when this servlet invoke the output will be "Hello i m first servlet"