24 January 2011

She's out of my league

Hilarious romantic love story. This was my second movie of Jay Baruchel and I am really impressed with this fluke ;-)(a lanky creature having galore acting skills).

The genre is not novel, its the same dork gets the diva, but the presentation is really refreshing.

I recommend it for cynical singles, friends don't despair:-)



Delicious add to del.icio.us saved by 0 users

20 January 2011

chat application in java

I recently created a chat application in java which is based on client-server interaction model.

The server can't handle too much load(at max 50) as I am not using any database.

Following features of java are exploited :

*MultiThreading
*Sockets
*ArrayList

The server application is running on the IIITA server(atleast 23*6 if not 24*7)

I am attaching the link to download the "client application"

click me

Its not a big project but just the basic one which is playing with sockets and threads. If any one needs its source code, let me know.

see ya in the chat box ;)



Delicious add to del.icio.us saved by 0 users

29 December 2010

Devil(2010)

 

















If you love to see supernatural activities on screen, then its indispensable for you to watch it. Five people with not so clean social backgrounds, stuck in a lift and began to feel precarious about each other as they were creeping towards their end by...(hehehehe). Unveil it yourself. This movie deserves more rating from IMDb, don't know how this site rates
NOTE OF CAUTION: THIS IS NOT A GHOSTLY MOVIE.



Delicious add to del.icio.us saved by 0 users

24 December 2010

Tees Mar Khan(TMK)


A complete entertainer. I want to frame it like this " A good meal without sumptuous dessert". Yes Akki was loud, Katrina was doing over-acting, ending was weak still you could find a big natural smile on your face throughout the movie. Farah is good in spoofing and this time she has taken SRK to the task. And for the detractors , I want to say , in this world the toughest job is to bring smile on others' face, if you people are looking for some logic, then go and attend some science conclaves , this movie is for bollywood lovers who know that they have to left their brain at home while rushing the multiplexes.
SOME MIGHT NOT AGREE WITH ME REGARDING TMK, I CANNOT HELP THEM AFTER ALL THEY ARE BORN IN A DEMOCRACY TOO, THEY CAN ALSO SPEAK ANYTHING, NO MATTER IF ITS LOGICAL OR NOT ;-)



Delicious add to del.icio.us saved by 0 users

10 November 2010

powerset program in java

The program was to find the power set of the given set . It was given to us as a lab work, i guess it might be useful for others as software community should always look for "REUSABILITY"



import java.io.*;

class powerset
{
   
    public static void main(String args[]) throws Exception
    {
       BufferedReader br=new BufferedReader(new InputStreamReader(System.in));   
       int i;char buff[]=new char[30];
       String str[]=new String[1024];
   
       str[0]="phi";
   
    System.out.print("Enter the no. of elements in the set : ");
    int x=Integer.parseInt(br.readLine());
    System.out.println();
    double n=Math.pow(2,x);
   
        for(i=0;i<x;i++)
        {
        System.out.print("Enter the "+(i+1)+" element of the set : ");
        String s=br.readLine();
        buff[i]=s.charAt(0);
        System.out.println();
        }
   
       
    for(i=1;i<n;i++)
    {
       
    str[i]=Integer.toString(i,2);
    int z=str[i].length();
    for(int j=0;j<x-z;j++)
    str[i]="0"+str[i];       
       
    }
       
        System.out.println("THE POWER SET IS : ");   
        System.out.println(str[0]);
       
        for(i=1;i<n;i++)
        {
            for(int j=0;j<x;j++)
            {
            char chk=str[i].charAt(j);
            if(chk=='1')
            System.out.print(buff[j]);
               
               
            }
           
        System.out.println();
           
           
           
           
      }
       
       
       
       
       
       
       
       
       
       
        }
   
   
    }



Delicious add to del.icio.us saved by 0 users

19 August 2010

postfix evaluation and checking the balance of the parenthesis

here r the codes for 2 famous problems of programming lab (for 1st yr btech students although i did it in my mtech).The language used here is c++.


1. POSTFIX EVALUATION (I got this problem in the entrance exam of IIIT-A)

#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <ctype.h>


float a[30],top=-1;
void push(int val)
{
 if(top==29)
 cout<<"\nOVERFLOW";
 else
 {
  top++;
  a[top]=val;
 }

}

void pop(char c)
{ float temp;
switch(c)
{

case '+':  temp=a[top-1]+a[top];top--;a[top]=temp;break;
case '-':   temp=a[top-1]-a[top];top--;a[top]=temp;break;
case '*':   temp=a[top-1]*a[top];top--;a[top]=temp;break;
case '/':   temp=a[top-1]/a[top];top--;a[top]=temp;break;

}

}


void main()
{  char *p=NULL; int i,s=0; char opt;
do
{ top=-1;
clrscr();
cout<<"\nENTER THE POSTFIX NOTATION(separate operator and operand by a space) : ";
gets(p);
for(i=0;p[i]!=NULL;i++)
{

if(p[i]==' ')
continue;

else if(isdigit(p[i]))
{    while(isdigit(p[i]))
{
  s=s*10+p[i]-'0';
  i++;
}
push(s);
s=0;
}
else
pop(p[i]);
}
cout<<"\nANS IS : "<<a[0];
cout<<"\n\nDO YOU WANT TO CONTINUE(y/n) : ";
cin>>opt;

}while(opt=='y'||opt=='Y');
getch();
}





2. CHECKING THE BALANCE OF THE PARENTHESIS  (I got this problem as a lab test)


#include<iostream.h>
#include<conio.h>
#include<stdio.h>
 

int top=-1; char a[30];
 void push(char p)
 {
 if(top==29)
 cout<<"overflow";
 else
 {top++;
 a[top]=p;
 }

 }

     pop(char p)
{
     switch(p)
     {

     case ')' : if(a[top]=='('){top--;return 1;}
     case '}' : if(a[top]=='{'){top--;return 1;}
     case ']' : if(a[top]=='['){top--;return 1;}


     }
     return 0;

}

void main()
{  char *p=NULL;int i,valid=1;char opt='y';


do
{top=-1;    clrscr();     valid=1;
cout<<"\n\nENTER THE INFIX EXPRESSION : ";
gets(p);
for(i=0;p[i]!=NULL;i++)
{

if(p[i]=='('||p[i]=='{'||p[i]=='[')
push(p[i]);
else if(p[i]==')'||p[i]=='}'||p[i]==']')
{
int chk=pop(p[i]);
if(chk==0)
{valid=0;break;}

}
else
continue;
}

 if(valid==1 && top==-1)
 cout<<"\nbrackets are balanced" ;
 else
 cout<<"\nbrackets are not balanced";
cout<<"\n\ndo you wan to test more(y/n) : ";
cin>>opt;

}while(opt=='y'||opt=='Y');
 getch();
}



NOTE: IF YOU WANT TO DISCUSS ANYTHING RELATED TO C,C++,JAVA(CORE),.NET(C#),DATA STRUCTURE,SQL THEN YOU ARE AT THE CORRECT DOOR....JUST KNOCK IT:)



Delicious add to del.icio.us saved by 0 users

16 July 2010

TO PLAY COUNTER STRIKE ON INTERNET

Today I played counter strike(cs) on internet and it was fun. I remember that i tried the same few years back but was nt successful to establish a connection between my group.
I know two applications used to connect over internet to play cs...
1. Hamachi(which I have not used yet;))
2.TeamViewer


TeamViewer :

TeamViewer is a simple and fast solution for remote control, desktop sharing and file transfer that works behind any firewall and NAT proxy.


STEPS TO CONNECT THROUGH TeamViewer

STEP1 : Download the teamviewer      download from here
STEP2 : Open the application

















STEP3 : From the above window, we can see our id is 127 256 125 and password is 6666.Now choose one of the players who will become server for the VPN connection. Ask the id of the server and type the same on right hand side textbox labeled id in the CREATE SESSION form , select the VPN radio box and click the button Connect to partner






(in this window, the id of VPN SERVER is 126 903 822)













(ask the password of the server VPN)














STEP4 :  Once the connection is established, the following window will appear





your ip address is 7.79.43.167
server ip address is 7.79.36.251
















NOTE : 1. ROLE OF TEAMVIEWER IS OVER,MINIMIZE IT(DONT CLOSE IT)
               2.VPN SERVER IS NOT SPECIAL, A PRIVATE CONNECTION HAS BEEN
                  ESTABLISHED AND EACH PEER HAS ITS OWN IP ADDRESS.
               3. ANY OF THE PEER CAN CREATE SERVER IN COUNTER STRIKE.


STEP5: All the peers open the same game either CONDITION ZERO(yellow icon) or
             COUNTER STRIKE1.6(white icon)

SIXTH STEP IS FOLLOWED BY THE PEER WHO WILL BECOME SERVER FOR COUNTER STRIKE,ANY AMONG THE PEERS CAN BECOME SERVER

STEP6:In the following window,COUNTER STRIKE1.6(white icon) is opened
            Click on New Game,select the map.
            Do the game settings(optional)
            Click the Start button...so the server established
















SEVENTH STEP IS FOLLOWED BY THE PEERS WHO WILL JOIN THE SERVER ESTABLISHED ABOVE.

THE PEER WHO HAS ESTABLISHED THE SERVER FOR COUNTER STRIKE SHOULD TELL HIS IP ADDRESS TO ALL THE PEERS


STEP7 : Click on Find Servers
              Click on the tab Favorites
              Click on the button Add Server
              Type the ip address of the peer who has established the server for the game.
             Refresh the page twice or thrice.....the server name should be visible in the list
             Select the required server from the list and click on the Connect button

              















(here the server is Freaky_ss)










enjoy the game:)



Delicious add to del.icio.us saved by 0 users