25 July, 2011

How to Create a Social Networking Website like Facebook in Ten minutes : Step by Step Tutorial

This is a quick step by step tutorial of how to make a Social Networking Website like Facebook in TEN Minutes.





 
Step 1.) To Begin with, you need to have a web hosting account. You can get a free hosting account (list of free web hosts) but the problem with these hosts is that they have forced ads or bad uptime or unnecessary stuff required. Make sure the free host gives you FTP access and at least one MySQL Database and PHP support. I recommend you to buy a HostGator hosting account to begin with as it has all things required. Their Hatchling plan is superbly cheap (less than $4 a month) and use a coupon for more discount.



Step 2.) Get a domain too if you’ve bought hosting and configure domain with the hosting account. After all that has been done you will have to install WordPress. There are many ways of installing WordPress. If you’ve got Cpanel, then you can install WordPress with one click installer. If not, you will have to manually do that. Here’s how to do that too. Make sure you install that in the root directory of your hosting account.



Step 3.) After you have done that, you will have to log into your WordPress Blog. Now go to Plugins >> Add New. Type in “BuddyPress” and install that plugin. If you want to manually install it, here’s the link to the plugin.


Step 4.) Activate the Plugin.


Step 5.) Now go to Manage Themes and activate the Buddypress Default Theme.


Step 6.) You’re half way through. Now Few more things and you are there! On your WordPress Dashboard, go to General Settings and tick mark Anyone can Register option.


Step 7.) Now go to Profile Field setup and add the fields to be filled by users when signing up (stuff like Age, Website, Gender, Interests, bla bla).


Step 8.) You’ve got loads of features already. If you want to add more features like Photo Albums, Videos, Chat, you can install plugins to do that. (Here’s a complete list).

Step 9.) If you are annoyed with the current design, you can use a new theme to match your Social Network. A full list of Buddypress Compatible themes.

Step 10.) All set to go! An Example of a working website is testbp.org. You have made something like this!

Labels:

What’s the net speed at Google’s campus?

   Quite a few years back, we were stuck at 56kbps dial-up modems, then we slowly picked up with broadband and triband coming and speedometers touching 256kbps and 512kbps. The battle then began between telecom companies which brought in 2mbps and 4 mbps at cheaper rates. Of course consumers thought it was a bliss, till they see this.

For those of you really eager to know what’s the speed at Google’s Campus, GooglePlex at Mountain View, California is then here you go.
523.96 Mbps and 147.20 Mbps is what they’ve got. Wondering how we got hands on it? Recent Question and Answer session by the Google Chrome team at Reddit let us into these facts. This is freakin’ awesome. Thanks TNW.

Labels:

23 July, 2011

Turbo Speed For Internet, UC Browser 7.8 For Android Release

[Image: 71143901.png]















Turbo Speed for Internet, UC Browser 7.8 for Android Release.

It has been almost one year from the last release of the UC Browser English Version for Android in UC 7.2. With the new release and more than 10 million monthly active users, UC Browser keeps its leading position in Android market, continue to compete with the major players, like Opera Mini, Dolphin & Skyfire.

UC Browser for symbian, java & ppc were also released, you could visit wap.ucweb.com or http://www.ucweb.com to download.

All about Speed
“Faster than your imagination” is the promise UC made to its users, and in the newly upgrade of UC Browser for Android showed that UC has fulfilled the commitment.
1. Fast in Initialization & Exit
UC Browser 7.8 for Android can make the time for initialization & exit in just one second, let the user even can’t feel the open & exit.
2. Fast in Browsing
UC Browser 7.8 for Android made optimization to network connection again, besides the increased speed for visiting website, the stability also get a better performance, to ensure users can have a higher efficient browsing experience.
3. Fast in Operation
For the touch screen users, the smooth of operation is one of the most important points to them. UC Browser 7.8 for Android made optimization for this point to bring users more smooth & faster operation experience.





Introduced the Dual Core Architecture in the first place
7 years ago, UC firstly introduced the C/S architecture to fill the digital gap between the handset and the PC internet, which is 15 months ahead of Opera Mini. Now, again, UC introduced the Dual Core Architecture in the first place to meet different requirement from mobile internet users.

Almost every mobile browser for Android leverage the Webkit core, and what they do is to build the client, and draw the user interface. However, for UC Browser, it not only integrated the Webkit, but also developed its own core to bring a faster and traffic saving experience to users.

With the UC’s own core, users can save up to 85% of the traffic. Users can switch between these two cores according to their need, by change the browsing model from “Full Function” to “Data Saving”.

[Image: 20665092.png]

More friendly for the user interface
Besides the speed, UC Browser 7.8 for Android also made the improvement in the user interface, like the UC innovated two screens model bring users the quick access to bookmark, history. Moreover, the theme customization brings users always fresh experience.

[Image: 58341442.png]
[Image: 53866638.png]


Click here for s60v1
Click here for s60v2
Click here for s60v3
Click here for s60v5
Click here for Java Unsign
Click here for Java Sign
Click here for Android

Labels:

How To Use Torrent Client Behind Restrictive Proxy

Step one Download Utorrent  http://www.utorrent.com/downloads/complete?os=win

Step 2 open utorrent (after install) and hit CTRL+P


Step 3 go to connection in the new window (it will open prefs, not print)


Step 4 Where it says type click on HTTPS


Step 5
enter this 130.92.70.254 where it says proxy and 3127 where it says port


This is a free Swiss proxy, high anonymity and HTTPS.

Labels:

[TUT]Make A Mobile Hidden Camera.

cPlease read the full tutorial before attempting this

What you will need for this:

  • A webcam that you are willing to take apart (Can be crappy)
  • A sweatshirt your willing to cut holes in
  • A backpack
  • A laptop


Note: This a cheap way to make a hidden camera, assuming you have all of the above and don't want to actually go out and buy a pair of $150 spy glasses.



Okay, so lets start the tutorial.

First, you are going to need to break/pry/bash with a hammer(Just kidding) your webcam out of it's plastic shell housing without harming the lens or the circuit board inside. You can use a screwdriver or, whatever you wish to make that work.

So, after you have broken it out of the housing, you should just be holding the board with the lens and the cable hanging off.

Now that you have the raw components, its time to get your sweatshirt.
You are going to need to cut two holes in the sweatshirt.
The first hole will be small enough for the cable to fit in. - This hole will be on the inside of the sweatshirt, right behind the front pocket of the sweatshirt. (The big pouch by your stomach).

The next hole should be just big enough for the camera lens to fit in. This hole will go on the outside of the middle front pocket.

So it should go in this order.
1. Hole behind front pocket.
2. Camera is slid into pocket and cord fed through hole stated above.
3. Camera lens peeks out of very front pocket hole so it can see in front of you.

GREAT! Were almost done!

Now we go to the laptop and go to our display settings. (Since I'm typing this on a Mac I can't remember where this would be so you should look around) You need to find a setting that allows the screen to stay on, even when your laptop is closed.

If you have done this and tested it by closing your laptop and then peeking into it and the screen is on. You are pretty much done.

All that is needed now is to setup your webcam software, plug in you webcam from your pocket, press record, put the laptop in your backpack with a little gap in the zipper for the cord to run out of it, and feed the cord into your sweatshirt.

Now you can put your hands in your pocket and point the lens wherever you want.

Note: This may seem VERY noticeable. This is only because YOU know it's there. I've walked around everywhere and even talked to people and no one gave it a second look.

Have fun with this cheap and easy method for a spy camera!

Labels:

18 July, 2011

[Free] Get free views for your videos - Youtube

How to get free views for your youtube video

So, you want free views? You got it!

Step 1: We need too register, as usual :P
- Register at u2bviews

Step 2: After register
- Once you've registered go to your "Control panel" (Upper right corner)

Step 3: Getting credits
- At the bottom go to "Surf".

Step 4: Lets say you use Chrome.
- Open Mozilla, Opera or any other browser program and let the Surf stay on for a while.

The meaning too open a new browser is that you can turn the sound off. While having the sound off you can do whatever you want. Work on your new project, listen too music, play on your computer or even watch a movie while you get credits too add to your movie.

Step 5: Adding your Youtube video
- This is simple, you copy/paste your URL too your ytube video.
- Type in the amount of credits - views you want too add.

There you go!

Free views, simple and fast.

Spoiler 
[Image: nature-photo.png]

Homepage: u2bviews
About u2bviews: http://www.u2bviews.com/about/
--

I will make future guides for those who wants too go even deeper in this.
If anything is unclear, then please tell me so i can correct my mistakes!

I'm sorry for my gramar.. Can't help i choose wrong on to/too
Best of luck, would be good if someone could post results :)

Labels:

Yahoo Account Creator




Product Features:

1. Proxy support[Ip:Port Format]
2. Ability to limit number of accounts created per proxy
3. Ability to rotate proxies manually.
4. Decaptcher Integrated.


http://www.enterupload.com/p4ldkwzb2ybw/slight%5BCoderTrick%5D.rar.html

Labels:

15 July, 2011

Teachings Of Basic, Proper Java

So, where do we begin?

Variables

In Java, there are certain things that you can create called variables. Technically, a variable is an object that can hold a specific type of data. In other words, a variable is something that can hold a value.
Here are the types common of variables, what they stand for, and the type of value they can hold:

Code:

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.
int

This is a very common variable. It stands for integer, and can hold values of whole numbers less than 2.17 billion (this includes negatives), but cannot hold decimal values. If you try to make an integer bigger than 2.17 billion, your program will crash.

long

This is the exact same as an int, except it can hold larger values than 2.17 billion (on Windows machines). It cannot hold decimal values.

double

The double is the exact same as a long, except it can hold decimal values.

boolean

This is a helpful little variable, although it can only hold two values. The boolean cannot hold numbers, it can only hold two values: true and false.

String

The String is a special type of variable. It can hold multiple characters to form a series of words or a sentence.

So how do we use these variables?
In Java, any variable must be explicitly declared. Because of this, Java is sometimes considered a strongly typed language. Don't worry about that though. Just know that before you want to use a variable, you must tell Java that it exists. To do this, we declare our variable.

Declaring a variable looks like this:

Code:

accesslevel type name;
Access Level:
The access level is how your variable can be accessed. By default, other packages cannot see or use a variable unless you set the access level properly. A package is a folder that contains related Java classes. A Java "class" is a Java file. Most private servers don't use packaging, so you don't need to be too worried about the access level.
Common access levels are as so:
Code:
public
private
There are more, but you don't need to worry.

public

The access level public means that other packages can see it, hence the term public.

private

The direct opposite of public, other packages cannot see a variable with access type of private

You do not have to specify an access level for your variables. By default, variables are private and cannot be accessed by other packages unless you declare them as public.

Type:

The type in our variable declaration is the type of variable we are declaring: int, long, boolean, double, etc.

Name:

Name is simply the name you give to the variable you are declaring. By Java conventions, your variables should start with a lowercase letter, and any other words in your name must start with an upper case letter. The name cannot contain spaces.

An example of a variable declaration:

Code:

public int myInteger;
Statements

A statement in Java is basically anything you are coding. Anything from declaring a variable to doing advanced math is either a statement or a series of statements. The variable declaration above is a statement. Statements must end with a semicolon unless you are using a code block. A code block is simply, a block of code, starting with { and ending with }. Therefore, for every {, there must be a } to end the statement.

Conditional Statements

A conditional statement is a statement that will execute only when a certain condition is met. These statements are also called "if" statements. This is the layout for an if statement:

Code:

if(arguement)
    code to execute;
If you are using only a semi colon in any statement, you cannot perform more than one action in the statement. Here is an example explaining this concept:
Code:
int myInteger;
myInteger = 1;
if(myInteger == 1)
    System.out.println("Yay!");
System.out.println("myInteger is equal to one!");
How many statements are in the above code? There are actually four statements in the above code.
Statement one: declaring myInteger.
Statement two: setting myInteger to 1.
Statement three: this is our conditional statement, it therefore includes the "System.out.println("Yay!")", but only executes it if myInteger is 1.
Statement 4: printing "myInteger is equal to one!" into our console.

System.out.println(String) prints text to the console.

What do you think the output is of this program? Here is what it will say:

Code:

Yay!
myInteger is equal to one!
What happens if we change the code to this?

Code:

int myInteger;
myInteger = 2;
if(myInteger == 1)
    System.out.println("Yay!");
System.out.println("myInteger is equal to one!");
Now what is the output?

Code:

myInteger is equal to one!
Surprised? I expect you to be. By changing myInteger to 2, the conditional statement should not execute and it should not say anything at all. Wrong, because as I stated above, you can only execute one action if you are using just a semi colon. To change this, we will use what is called a code block. A code block allows you to execute more than one action at once within one statement.

Here is an example of the above code, with a code block instead:

Code:

int myInteger;
myInteger = 2;
if(myInteger == 1)
{
    System.out.println("Yay!");
    System.out.println("myInteger is equal to one!");
}
Now what is the output of the program?

Nothing.

We have successfully bunched two actions into our code block, and because our myInteger variable is 2, the if statement never executes because it only executes if myInteger is 1.

You might have noticed the "=" and "==" characters in the above statements. These are called operators, which brings me to the next section...

Operators

An operator is something that performs a calculation. There are many operators, all meant for specific calculations. Here is a list of the common ones, and their purpose.
Code:

+ ~ 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
Thats a lot of operators eh? Trust me, there are more operators, designed for performing calculations on the level of bits and bytes. For the sake of your sanity, we'll just stay with the operators I've listed above.

I wont go into detail about these operators for the sake of time, you can figure out what they do by looking at the list above.
Now that I've gone over basic conditional statements and variables, lets go onto methods.

Methods

Simply put, a method is a chunk of code that performs a calculation, and returns a value based on the calculation it makes. Its not as complicated as it seems. A method is just like a variable, it is declared in the same way. The key difference is that a method must have a code block, while a statement doesn't have to. A method is a holder for statements. Here are a few types of methods:

Code:

void
int
long
String
boolean
double
The list goes on, however, these are the most common types of methods. You may have noticed that they are very similar to variables, well in a sense they are. I mentioned before that a method returns a value. Every method returns a value except for a void. Lets go over what they return.

void
No return type.

int

Returns an integer.

long

Returns a large integer.

String

Returns a String value.

boolean

Returns a boolean value

double

Returns an integer value with decimal points supported, or a double.


You may have noticed that the methods return the value that their brother variables can hold. If you made this connection, good job. If not, that's okay.

Declaring a method is just like declaring a variable, but you add a code block.

Here's the way you declare methods:

Code:

accesslevel type name(parameters)
{
    Code inside the method
    return value
}
Parameters are slightly more advanced. Basically, a parameter is a way of giving our method variables so it can perform calculations. You can have multiple parameters in your method.

To make a method execute, we have to call the method by its name and its parameters. Here is the layout of calling a method:

Code:

name(parameters);
Separate parameters are separated by a comma. Here is an example of how to use parameters:
Code:

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;
}
We will go over the above code line by line

Line 1: our main method which Java calls when it starts the file.
Line 2: opening brace for our main method code block
Line 3: printing to the console window by calling doAddition(int, int) method
Line 4: closing brace for our main method code block
Line 5: declaration of our doAddidion method which is the double type, so we can do addition with not only whole numbers but also decimals
Line 6: opening brace for our doAddition method code block
Line 7: creating a new integer called solution, then setting solution to one + two.
Line 8: returning solution, the value that was calculated based on the parameters given
Line 9: closing brace for our doAddition method code block


The output of the above program looks like this:
Code:

The value of 5.5 + 5.5 is equal to 11
What might confuse you is the parameters. You declare variables in parameters, and use them only within the code block of the method that has the new variables. We give the parameter variables their value when we call the method.

Why do this when we can just do variable = number + number? Well sometimes we want to do more advanced calculations than just addition, such as the quadratic formula or distance formula. Methods are advanced, custom calculations.

About the void. A void is a method with no return type, therefore it does not return anything. The void simply executes the statements within it and finishes whenever it is called.

Classes

A class, technically, is an object in object-oriented programming. Simply put, a class is usually a Java file that holds methods. This is a slightly more advanced concept than we have previously talked about.
A class is declared just like a method, except you must put 'class' as the type. All of your code must be contained within the code block of a class.

Here is what a normal Java program looks like:
Code:

public class HelloWorld
{
    public static void(String[] args)
    {
  System.out.println("Hello World!");
    }
}
The above code will compile and run in the Java environment.
When running once compiled, it will say
Code:
Hello World!
Cute.
Lets move on.

Classes can be (here comes a big word) instantiated, or created an instance of. Creating an instance of a class from another class tells that class to run relative to the class that is creating an instance of it. Its complicated, you may have to read that sentence a few times to understand. Basically, you can call a class like you can call a method. But instead of calling the class, you must create an instance of the class. Once you create an instance of the class, you can use almost any method or variable that is inside the class.

Here is how you instance a class:
Code:

classname variablename = new classname(parameters);
Yes, classes can also have parameters. This is done by what is called the classes constructor. It is an advanced concept that you may not understand for a while until you get used to programming Java.
By default, any class you create has no parameters, so you do not include any parameters in the instance of the class.

This is how to create an instance of a class using parameters.The class we are going to instantiate
Code:
public class SayHello
{
    String text;

    public SayHello(String text)
    {
  this.text= text;
    }

    public static void main(String[] args)
    {
  System.out.prinltn(text);
    }
}
Line 1: declaring our class SayHello
Line 2: opening brace for our SayHello class
Line 3: declaring a new string, naming it 'text'
Line 4: white space
Line 5: constructor. Notice the parameters, we are creating a new variable inside the constructor.
Line 6: opening brace of the code block for our constructor
Line 7: setting the String text in the outside of our constructor to the parameter that we received when the class was instantiated.
Line 8: closing our constructor code block
Line 9: white space
Line 10: main method called by Java when the program starts
Line 11: opening brace for our main method code block
Line 12: printing to the console the value of the 'text' String
Line 13: closing our main method code block
Line 14: closing our SayHello class code block.

Instancing the class
Code:

SayHello mySayHelloClassVariable = new SayHello("Hello, World!");
Now, when we run the above statement that instances the SayHello class, the SayHello class will print the 
following text:
Code:

Hello, World!
Congratulations, if you have made it this far, you now understand the basics of Java programming.

Labels:

How To Setup A Working Java Compiler [TUT]

Hey guys, i'm going to tell you how to setup a fully working Java compiler.

First we need the files: http://www.multiupload.com/0UL5AR7Z04 (This are the older versions of JRE and JDK, but they are still working fine) when finished just install both of the files. (JRE 6 Update 16 setup.exe first)

Step 1:
Go to Start > Configuration.

[Image: 23193454.jpg]

Step 2:
Double click at System.

[Image: 45502085.jpg]

Step 3:
Click the Advance tab and after that the other button.

[Image: 15058713.jpg]

Step 4:
Hit the Path line in the lowest box and after that click Edit.

[Image: 79031364.jpg]


Step 5:
Scroll to the end of the text rule and add this: ";C:\Program Files\Java\jdk1.6.0_16\bin" without the quotes. (DON'T PUT A SPACE BETWEEN IT!)

[Image: 91084555.jpg]

Congratulations, you've just setted up a working Java compiler.
I hope you people can understand everything in this tutorial.

Labels:

Getting started with Java Programming!

In this tutorial you going to learn some basics, I'm not advanced Java programmer I only know basic comand's. Also I will show you how to setup & start with Java. It's really simple, but you will need to download Java, link it & download and install compiler. Java is really nice & easy programming language. It works on all Operating Systems : Windows, Mac, Linux & Solaris. When you become better Java programmer you can get job as programmer too. Like I said it's really nice & easy programming language but in my opinion it's best. Smile

I - Download & installing necessary drivers

First you will need to download some important drivers & applications. Well first we will need to download Java Development Kit version 6. You don't need to worry is it infected or not because you will download from their official website. Just click link and select your Operating System. For this example I will show you for Windows OS, so you select Windows and hit Download.

[Image: 2079n55.png]

When you finish with download, just install it now we will need setup something in Control Panel. Now go to:

Control Panel > then search for System > and then Advanced system settings > click Environment Variables... click New...(Second New... button) and link your JDK bin folder. Mine is installed in C drive so link is: C:\Program Files\Java\jdk1.6.0_17\bin and name Variable to Java.
[Image: 25fpyy0.png]
[Image: v9pbn.png]

Now you can test Java in your CMD, go to Start > Run > type in cmd > and write javac and if you get some crap about java that means you did it all good. Tongue

II - Installing Compiler ~ NetBeans

NetBeans is best compiler ever for Java. You can also use Eclipse, it's text editor but it's for Console only. But in NetBeans you can make Normal Desktop application, console application & website application. Cool

We will download it from their official website, so you don't need to worry about infection. Go to this link and download it.
[Image: 2r3835s.png]

When you download it just start installation process. If you done everything correctly NetBeans will work fine.

III - NetBeans

Now you will learn more about NetBeans. There are few different types of Java applications. We are going to talk about Console Application's and Desktop application's.

Console Application

What's console application?

- A console application is a computer program designed to be used via a text-only computer interface, such as a text terminal, the command line interface of some operating systems or the text-based interface included with some Graphical User Interface (GUI) operating systems.

Hello World:
To make Hello World program, you will need to make New Class. Click File > New Project... > select Java Class > click Next, name it [b]NewClass and click Finish button.

Now, we will need to make new method.


Whats method? (Click to View)

So now just write this code inside your Class(NewClass):
Code:
public static void Main(String[]args){
        System.out.println("Hello, world");
    }

Desktop Application

What's desktop application?

- Application software is computer software designed to help the user to perform a particular task. Such programs are also called software applications, applications or apps. Typical examples are word processors, spreadsheets, media players and database applications.

Hello World:
To make Hello World program, you will need to make Desktop Application. Click File > New Project... > select Java Desktop Application > click Next, name it [b]DesktopApplication1 and click Finish button.

We will need jButton1 also!

At the top of the code write:
Code:
import javax.swing.*;
import java.awt.event.*;

And now inside our method DesktopApplication1 write:
Code:
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:

What is Java?

Quoting Wikipedia:


Java is a programming language originally developed by James Gosling at Sun Microsystems (which is now a subsidiary of Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is general-purpose, concurrent, class-based, and object-oriented, and is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere". Java is considered by many as one of the most influential programming languages of the 20th century, and widely used from application software to web application.

There were five primary goals in the creation of the Java language:

  • It should be "simple, object oriented, and familiar".
  • It should be "robust and secure".
  • It should be "architecture neutral and portable".
  • It should execute with "high performance".
  • It should be "interpreted, threaded, and dynamic".
  •  
Syntax

The syntax of Java is largely derived from C++. Unlike C++, which combines the syntax for structured, generic, and object-oriented programming, Java was built almost exclusively as an object oriented language. All code is written inside a class and everything is an object, with the exception of the intrinsic data types (ordinal and real numbers, boolean values, and characters), which are not classes for performance reasons.

See also
Official Website:

http://www.java.com/en/

Labels:

Simple Chat Program + Source

Hello Programmers,

It's a very simple chat program. The only problem is that the server doesn't handle multiple clients. I'll make one as soon as I gain in depth knowledge in Winsocks. If possible, can anyone link me to a guide to learn about handling multiple clients?

Client source:
Code:



#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;
}

Server source:

Code:
/**

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;
}

Client code with C++ highlights: http://pastebin.com/Zbc7qwDc
Server code with C++ highlights: http://pastebin.com/R3stNU0v

Also, I need your guys' favor. The only way I can improve my knowledge is by receiving projects that require me to search for new methods and concepts. So, if possible, give me some tough projects or tough concepts to research. I need some concepts to learn....

Thanks,

Labels:

Funny c++ script(windows)

This is a funny script i found.cool but VERY annoying :)

(btw it doesn't harm your computer,it just flashes colors on a console.)


Code:

#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;
}
YES it is using system.i didn't understand the other one. :P

Labels:

Get Captcha Image in PictureBox [VB.NET]

There is the source to get a ReCaptcha Image into your PictureBox. This only works for ReCaptcha so far. Will be making more soon.
Theres 2 Methods:
1) Put this Sub in your Project.
You need:
  • PictureBox --> name = PictureBox1
  • WebBrowser --> name = WebBrowser1

getcaptcha()
Code:
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

Then find the WebBrowser1 Document Completed Sub (shown below)
Code:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

  End Sub

And Add this code below to the Sub Above ^^
Code:
If WebBrowser1.DocumentTitle.Contains("Emk") Then
    getcaptcha() 'Runs the sub getcaptcha()
  End If

So it would look like this
Code:
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

Here is the whole source of the program if you don't want to download...

2) Download my Source code. It says Get Youtube Captcha but it really doesn't so just a heads up. Download link is http://dl.dropbox.com/u/11786922/Get%20Y...aptcha.zip

Screenshot

This isn't an auto Captcha all it does it get the image from the website and put it in a PictureBox.

Labels:

14 July, 2011

How To Shut Down Computer Using A Cell Phone

How to Shutdown a Computer with a Cell Phone

 Using this method, a user can shutdown, restart, hibernate, etc. his or her computer,
just by sending an email from his or her phone.


To do this, all you will need is Microsoft Outlook which should come with Microsoft
Office, which most people have. This will need to be on the computer wish you wish to
shutdown.


So, this is how you do this:

1. First, you need the batch files to perform the Shutdown, Hibernate etc. You can
write them down yourselves or can download them from here.


2. Extract them to your C:\ drive so the path to the shutdown batch file is
C:\sms_functions\shutdown.bat (Important this is a must the path must be exact)
or you can modify the rule once you import it to point to the new destination, it's
your call.


3. Open up Microsoft Outlook. Make sure that you have already configured it for
your email.Now we will need to make it so that Outlook checks your inbox about every
minute (1 minute for testing time can be increased if a delayed shutdown is desired).
You can do this by going to Tools: Options.


4. Then click the Mail Setup tab, and afterwards, the Send/Receive button.

5. Make sure that the Schedule an automatic send/receive every... box is checked,
and set the number of minutes to 1. Now you may close all of these dialog boxes.


6. Now go to Tools: Rules and Alerts... Next click the options button in the upper
right hand corner and press the Import Rules button.


7. Now select the shutdown.rwz file that was found in the zip file named
sms_functions that you downloaded.


8. Now, when you send a message from your phone to your e-mail address with the
subject smsshutdown%%, your computer will shutdown.


You can also make your own rule, so that you can use your own batch file, and may
specify the phrase you want to trigger the action.


Once a great hacker said.....Don't learn to hack, hack to learn

Labels:

You Want To Learn A Programming Language?

Contents
           
  • Introduction

  • Programming Languages Covered on HF

  • Choose a Programming Language

  • Helpful Hints

  • Which to start with?

  • Thanks

  • Sources and Notability



  • Introduction

    Okay, we all know that in modern society, people will tell you that computers are the answer. They will tell you that it will be a great job opportunity. Some people tell you the opposite. Regardless of this, teenagers spend A LOT of time surfing the web, and in some cases, learning on the web. Everyone has different interests, and many decide they want to program, either to have fun or to hack, it is important to take the right procedure. Well, if you want to have a job with computers as a programmer, you should learn a programming language. There are many to choose from, and the ones covered in the HF Programming, Coding, and Languages Section are listed below.



    Programming Languages Covered on HF

    • Visual Basic and .NET Framework Visual Basic .NET (VB.NET) is an object-oriented computer programming language that can be viewed as an evolution of Microsoft's Visual Basic (VB) which is generally implemented on the Microsoft .NET Framework. Microsoft currently supplies Visual Basic Express Edition free of charge.

      Information: Tutorials and coding help for Visual Basic is here. Microsoft's event driven language using the COM model. Also included are the .NET Framework topics. C# topics should be here too.

      Important Threads:
      Guide: All HackForums VB source codes & tutorials!

    • C/C++/Obj-C Programming C is one of the most popular programming languages of all time and there are very few computer architectures for which a C compiler does not exist. C has greatly influenced many other popular programming languages, most notably C++, which began as an extension to C.

      Information: A forum for the entire family of C/C++/Obj-C coding. Gain help on compiling, objects, classes, and functions.

      Important Threads:
      The Complete C++ Guide

    • Batch ,Shell, Dos and Command Line Interpreters A command-line interpreter (also called a command line shell, command language interpreter, or abbreviated as CLI) is a computer program that reads lines of text entered by a user and interprets them in the context of a given operating system or programming language.

      Information: For any hacker the base of their coding should be CLI. The knowledge of the command line is crucial to being a legit hacker.

      Important Threads:
      BEST BATCH TUTORIAL ( PLEASE READ)
      COMPLETE BATCH TUTORIAL!!
      How to Make a batch from notepad

    • Java Language, JVM, and the JRE A Java Virtual Machine (JVM) enables a set of computer software programs and data structures to use a virtual machine model for the execution of other computer programs and scripts. The model used by a JVM accepts a form of computer intermediate language commonly referred to as Java bytecode.

      Information: Write once and run anywhere. That's Java. This is the forum for Sun's popular language. Java is one of the best Object-Oriented Programming languages available today. Learn more here.

      Important Threads:
      .: Compilation of Java Guides and Resources :: Navigation :.

      Sub Forum:
      Android Development

    • PHP Development PHP: Hypertext Preprocessor is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document.

      Information: For PHP classes, functions, and development discussions we ask you post here. PHP is the #1 used web language and is easy to use. Its strength is it's simplicity.

      Important Threads:
      PHP MySQL - Beginners Tutorial

    • Python Python is a general-purpose high-level programming language whose design philosophy emphasizes code readability. Python aims to combine "remarkable power with very clear syntax", and its standard library is large and comprehensive. Its use of indentation for block delimiters is unusual among popular programming languages.

      Information: Python is one of the most powerful adaptable general purpose languages. We have this forum specifically devoted to the Python language.

      Important Threads:
      [Tut] Fundamentals of Python 2.6

    • Assembly Language and Programming An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other integrated circuits. It implements a symbolic representation of the binary machine codes and other constants needed to program a particular CPU architecture.

      Information: For low-level machine coding please use this section. Topics include instructions mnemonics, memory execution, and opcode.

      Important Threads:
      Poll: [Tutorial] Assembly Language Basics Tutorial w/ SCREENSHOTS

    • Perl Programming Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular amongst programmers.

      Information: Perl is an old language that's flexible, powerful, and versatile. Even though it's dated from the 80's today it can be used for a large number of useful scripts. The power behind Perl in undeniable. Post here for Perl help.

    • Delphi Object Pascal refers to a branch of object-oriented derivatives of Pascal, mostly known as the primary programming language of Embarcadero Delphi. Pascal compilers, including those for Object Pascal, generally run very fast while producing highly optimized code.

      Information: This forum is setup for all Delphi programming threads. Delphi is perfect for rapid development with its integrated IDE. Its Rapid Application Development tools are key to success.

      Important Threads:
      Compilation :: Delphi Tutorials, Videos and Source Codes :: Navigation
      All my Delphi Tutorials || 21 Tutorials/Snippets and other things that will defiantly help you in Delphi!

    • Lua Coding Lua is a lightweight multi-paradigm programming language designed as a scripting language with extensible semantics as a primary goal. Lua has a relatively simple C API compared to other scripting languages.

      Information: A smaller lightweight language mainly used most often for game programming. Lua can be used for standalone purpose with its simple procedural syntax.

    • Coding and Programming Ruby, ASP and other programming languages not covered in the other forums should be posted here.


    Choose a Programming Language

    Okay, so now that you know the programming languages covered on HF, you might ask yourself.. now what? Well, my advice is to pick one programming language to start with. Trying to learn too many at once when you start out will give you some trouble. Browse through each one and see which one you like the most!


    Helpful Hints

    Well.. if you got this far, congratulations! Here are some handy hints to set you off on a great path of learning a programming language. First of all, do not give up. At times, it may seem like you are getting nowhere. Don't worry! Think of it as learning a foreign language, you won't be able to speak it fluently only after a week will you? Of course not! Same goes for Programming. You will not know everything about a programming language until after some time. Second, take small steps. If you are completely new to programming, do not try to tackle a big project right away, you will only get discouraged. Take it at small steps, because remember, it is like learning a new language, it will take some time. Just stay determined, and take it easy, and you will do great.

    Another thing you may want to do is find and read various e-books on the programming language you want to code in. By searching Google you can find many e-books for your programming language. There are many e-books out there, if you do not understand one, try another! But never give up.


    Which to start with?

    Many of you might have read through the thread but are still wondering, which programming language should I start with? Well, if you are not too serious with programming, or want easy GUI (Graphical User Interface) you should choose VB.Net. An easy programming language that is also powerful would be Python. Both are good for beginners, but I believe VB.Net teaches bad habits.

    Thanks

    Thank you everyone for reading this guide on picking the right programming language. It is designed to help those who want to start programming, but do not know what to do.

    Sources and Notability

    A few clippings here ('information' sections) were taken from Wikipedia.
    The 'Important Threads' are property of their respective owners.

    Thank you all. If you have any corrections to this, please tell me.

    Also, if you have any suggestions or threads you would like linked, tell me.

    Labels: