How to Create a Social Networking Website like Facebook in Ten minutes : Step by Step Tutorial
Labels: Tricks
2G 3G 4G Gprs Free Internet Tricks Tips, Free Easy recharge Offers, Online Recharge it now,Prepaid, Postpaid, Idea, Bsnl, Docomo, D2h, Big Tv, Paytm Coupon
Labels: Tricks
Labels: Tricks
Labels: Tricks
Labels: Tricks
Labels: Tricks
Labels: Tricks
Labels: Tricks
int - integer - whole numbers under 2.17 billion in size
long - long integer - whole numbers that are larger than 2.17 billion.
double - double - variable that can contain numbers with decimal values
boolean - boolean - holds only two values, true or false
String - String - holds more than one character, like a word or sentence.
accesslevel type name;
public
private
public int myInteger;
if(arguement)
code to execute;
int myInteger;
myInteger = 1;
if(myInteger == 1)
System.out.println("Yay!");
System.out.println("myInteger is equal to one!");
Yay!
myInteger is equal to one!
int myInteger;
myInteger = 2;
if(myInteger == 1)
System.out.println("Yay!");
System.out.println("myInteger is equal to one!");
myInteger is equal to one!
int myInteger;
myInteger = 2;
if(myInteger == 1)
{
System.out.println("Yay!");
System.out.println("myInteger is equal to one!");
}
+ ~ Addition
- ~ Subtraction
* ~ Multiplication
/ ~ Division
> ~ Greater Than
< ~ Less Than
>= ~ Greater than or equal to
<= ~ Less than or equal to
== ~ Equal to
!= ~ Not equal to
++ ~ Increment
-- ~ De-increment
&& ~ AND
|| ~ OR
void
int
long
String
boolean
double
accesslevel type name(parameters)
{
Code inside the method
return value
}
name(parameters);
public static void main(String[] args)
{
System.out.println("The value of 5.5 + 5.5 is equal to" + doAddition(5.5, 5.5));
}
double doAddition(double one, double two)
{
double solution = one + two;
return solution;
}
The value of 5.5 + 5.5 is equal to 11
public class HelloWorld
{
public static void(String[] args)
{
System.out.println("Hello World!");
}
}
Hello World!
classname variablename = new classname(parameters);
public class SayHello
{
String text;
public SayHello(String text)
{
this.text= text;
}
public static void main(String[] args)
{
System.out.prinltn(text);
}
}
SayHello mySayHelloClassVariable = new SayHello("Hello, World!");
Hello, World!
Labels: Tricks
Labels: Tricks
public static void Main(String[]args){
System.out.println("Hello, world");
}
import javax.swing.*;
import java.awt.event.*;
JFrame frame;
public static void main(String[] args){
DesktopApplication1db = new DesktopApplication1();
}
public DesktopApplication1(){
frame = new JFrame("Show Message Dialog");
JButton button = new JButton("Click Me");
button.addActionListener(new MyAction());
frame.add(button);
frame.setSize(400, 400);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public class MyAction implements ActionListener{
public void actionPerformed(ActionEvent e){
JOptionPane.showMessageDialog(frame,"Roseindia.net");
}
}
Labels: Tricks
Labels: Tricks
Hello Programmers,
#include <iostream>
#include <windows.h>
#pragma comment(lib, "ws2_32.lib")
SOCKET sock;
void recvdata()
{
while(1)
{
char msg[256];
memset(msg, 0, 256);
int r = recv(sock, msg, 256, 0);
if(r == SOCKET_ERROR)
{
std::cout << "\n\nServer is disconnected\n\n";
std::cin.ignore();
std::cin.get();
closesocket(sock);
WSACleanup();
exit(1);
}
else
std::cout << "Friend: " << msg << std::endl;
}
}
void senddata()
{
while(1)
{
char msg[256];
memset(msg, 0, 256);
std::cin.get(msg, 256);
int ret = send(sock, msg, strlen(msg), 0);
if(ret == SOCKET_ERROR)
{
std::cout << "\n\nServer is disconnected\n\n";
std::cin.ignore();
std::cin.get();
closesocket(sock);
WSACleanup();
exit(1);
}
std::cin.ignore();
}
}
int main()
{
WSADATA wsData;
if(WSAStartup(MAKEWORD(2, 2), &wsData) != 0)
{
std::cout << "WSAStartup!\n";
}
else
{
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(sock == INVALID_SOCKET)
{
std::cout << "socket()\n";
WSACleanup();
}
else
{
sockaddr_in sin;
sin.sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
sin.sin_port = htons(626);
sin.sin_family = AF_INET;
while(connect(sock, (sockaddr*)&sin, sizeof(sin)) == SOCKET_ERROR)
connect(sock, (sockaddr*)&sin, sizeof(sin));
std::cout << "Connected to your friend\n\n";
HANDLE hThread[2];
DWORD thread1, thread2;
hThread[0] = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)recvdata, NULL, NULL, &thread1);
hThread[1] = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)senddata, NULL, NULL, &thread2);
WaitForMultipleObjects(2, hThread, true, INFINITE);
}
}
std::cin.ignore();
std::cin.get();
return 0;
}
/**
Program: Simple chat program
Author: Sri Krishna
**/
#include <iostream>
#include <windows.h>
#pragma comment(lib, "ws2_32.lib")
SOCKET sock, acceptsock;
void recvdata()
{
while(1)
{
char msg[256];
memset(msg, 0, 256);
int r = recv(sock, msg, 256, 0);
if(r == SOCKET_ERROR)
{
std::cout << "\n\nServer is disconnected\n\n";
std::cin.ignore();
std::cin.get();
closesocket(sock);
WSACleanup();
exit(1);
}
else
std::cout << "Friend: " << msg << std::endl;
}
}
void senddata()
{
while(1)
{
char msg[256];
memset(msg, 0, 256);
std::cin.get(msg, 256);
int ret = send(sock, msg, strlen(msg), 0);
if(ret == SOCKET_ERROR)
{
std::cout << "\n\nServer is disconnected\n\n";
std::cin.ignore();
std::cin.get();
closesocket(sock);
WSACleanup();
exit(1);
}
std::cin.ignore();
}
}
int main()
{
WSADATA wsData;
if(WSAStartup(MAKEWORD(2, 2), &wsData) != 0)
{
std::cout << "WSAStartup!\n";
}
else
{
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(sock == INVALID_SOCKET)
{
std::cout << "socket()\n";
WSACleanup();
}
else
{
sockaddr_in sin;
sin.sin_addr.S_un.S_addr = INADDR_ANY;
sin.sin_port = htons(626);
sin.sin_family = AF_INET;
while(bind(sock, (sockaddr*)&sin, sizeof(sin)) == SOCKET_ERROR)
bind(sock, (sockaddr*)&sin, sizeof(sin));
while(listen(sock, 1) == SOCKET_ERROR)
{
listen(sock, 1);
}
while(1)
{
acceptsock = SOCKET_ERROR;
while(acceptsock == SOCKET_ERROR)
{
acceptsock = accept(sock, NULL, NULL);
}
std::cout << "Connected to your friend!\n\n";
sock = acceptsock;
break;
}
}
}
HANDLE hThread[2];
DWORD thread1, thread2;
hThread[0] = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)recvdata, NULL, NULL, &thread1);
hThread[1] = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)senddata, NULL, NULL, &thread2);
WaitForMultipleObjects(2, hThread, true, INFINITE);
std::cin.ignore();
std::cin.get();
return 0;
}
Labels: Tricks
This is a funny script i found.cool but VERY annoying :)
#include <iostream>
int main()
{
while(true)
{
system("Color 1A");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color 2B");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color 3C");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color 4D");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color 5E");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color 6F");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color A1");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color B2");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color C3");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color D4");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color E5");
std::cout << "\t\t\t Hello World" << std::endl;
system("Color F6");
std::cout << "\t\t\t Hello World" << std::endl;
}
return 0;
}
Labels: Tricks
Public Sub getcaptcha()
Dim str As String = WebBrowser1.Document.GetElementById("recaptcha_image").InnerHtml 'Gets the html code for the recaptcha_image element
Dim img As String = str.Remove(0, 33).Replace(""" width=300 height=57>", "") 'Deletes all the info around the link because the height and width will never change
PictureBox1.ImageLocation = img 'Sets the ImageLocation to the URL of the ReCaptcha Image
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
End Sub
If WebBrowser1.DocumentTitle.Contains("Emk") Then
getcaptcha() 'Runs the sub getcaptcha()
End If
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
getcaptcha() 'Runs the sub getcaptcha()
End Sub
Labels: Tricks
Labels: Tricks
Contents
Labels: Tricks