How to’s

Hello World in different languages

Free Source Code

Free Source Code

Objectives :
* How to write Hello World in Java?
* How to write Hello World in C?
* How to write Hello World in PHP?
* How to write Hello World in C++?
* How to write Hello World in JavaScript?
* How to write Hello World in HTML?
* How to write Hello World in CSS?
* How to write Hello World in COBOL?

Java

[sourcecode language=”java”]
class HelloWorld
{
public static void main(String args[])
{
System.out.println(“Hello World!”);
}
}
[/sourcecode]

C

[sourcecode language=”c”]
#include
#include
void main()
{
clrscr();
printf(“Hello World!”);
getch();
}
[/sourcecode]

C++

[sourcecode language=”cpp”]
#include
#include
void main()
{
clrscr();
cout<getch();
}
[/sourcecode]

CSS

[sourcecode language=”css”]
body:before
{
content: “Hello World”;
}
[/sourcecode]

COBOL

[sourcecode language=”text”]
****************************
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
MAIN SECTION.
DISPLAY “Hello World!”
STOP RUN
****************************
[/sourcecode]

HTML

[sourcecode language=”html”]
<html>
<head>
<title>Hello World Example</title>
</head>
<body>
Hello World!
</body>
</html>
[/sourcecode]

JavaScript

[sourcecode language=”javascript”]
document.write("Hello World");
[/sourcecode]

PHP

[sourcecode language=”php”]
<!–?php echo ‘Hello World!’ ?–>
[/sourcecode]

Linux Shell Script

[sourcecode language=”text”]
echo "Hello World !"
[/sourcecode]

Enjoy coding!

Posted from WordPress for Android

Get MAC Address using Java

Free Source Code

Free Source Code

Objective :

* How to get the MAC Address of a computer?
* How to get the MAC Address of a computer using Java?
* How to get the MAC Address of a computer via programming?

[sourcecode language=”java”]
import java.net.*;

class GetMac
{
public static void main(String arg[])
{
try
{
InetAddress address = InetAddress.getLocalHost();
NetworkInterface nwi = NetworkInterface.getByInetAddress(address);
byte mac[] = nwi.getHardwareAddress();
System.out.println(mac);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
[/sourcecode]

Note : This code will return only the first net address; if you need other detils too, get a list.

Posted from WordPress for Android

Execute multiple functions on single HTML event

Objectives :-

* How to execute multiple functions on single HTML event?
* How to call multiple funtions on single HTML event?

Many time you may have faced this issue, you may need to call / execute multiple functions on single HTML event & you may have stucked there, stop working, changed the functionality, etc.

But now don’t worry about it anymore. Here is the Code to execute multiple functions on a single HTML event :-

[sourcecode language=”html”]
<html>
<head>
<script type="text/javascript">
function Message1 ()
{
alert ("Message1");
}
function Message2 ()
{
alert ("Message2");
}
</script>
</head>
<body>
<form name="NameTheForm">
<input type="Button" name="buttonName" onclick="Message1(); Message2()">
</form>
</body>
</html>
[/sourcecode]

The above code will execute / call two functions on single HTML event. Here for example I have written two functions but you can write multiple functions & can call them to onclick event separated by semicolon (;) as shown above.

Posted from WordPress for Android

Rotate a picture in Windows Explorer

Objectives :
* How to rotate picture in Windows Explorer?
* How to rotate picture in Windows Explorer in Windows 7?

Hey friends, if you want to rotate a picture in Windows Explorer, you can use following shortcut :

Press Ctrl+Period (.) – It will rotate a picture clockwise in Windows Explorer

Posted from WordPress for Android

How to create sticky note in Windows 7

[gigya src=”http://player.videofy.me/player.swf?videoId=479871″ width=”480″ height=”270″ quality=”high” wmode=”transparent” allowFullScreen=”true” ]

Objectives :

* How to create sticky note in Windows 7?
* How to save to do’s in Windows 7?
* How to activate sticky note gadget in Windows 7?
* How to use sticky note in Windows 7?

Hey all, some of my friends asked me that Windows 7 has no sidebar as that of Windows Vista, so there is no gadget called “Sticky Notes” so that they can save their to do’s & all.

One good news is that even if there is no sidebar in Windows 7 as that of Windows Vista but the gadget Sticky Note is still there & you can use it easily.

 

Steps :

  1. Go to Start Menu
  2. Type “Sticky Notes” in search field at bottom & it will appear at top of Start Menu.
  3. Click on “Sticky Notes” & it will create a new Sticky Note for you.

 

Access Google+ faster now

Objectives :

  • How to access Google+ faster
  • What are the shortcuts for Google+?
  • What are the keyboard shortcuts for Google+?
  • List of the shortcuts for Google+?
  • List of the keyboard shortcuts for Google+?

Hey friends, many of you were asking me that how we can access Google+ faster in terms of handling such that every time you need to access it from mouse & need to move it across the screen.

For Navigation :

Navigation

Key Action
J Scroll down to next Google+ stream update.
K Scroll up to previous Google+ stream update.
Space Scroll down stream by regular interval.
Space + Shift Scroll up stream by regular interval.
QQ Moves cursor to Search Box in Chat section.
Enter or Return Moves cursor to Comment Box when any stream update is selected.
Enter or Return + Tab Submit Comment.
@ @ followed by User Name is used mention someone in a post or share the post with them.

For Formating :

Formatting

Key Action
* (Star) Denotes the beginning & end of the bold text.

Example : *This is Bold in Google+ *

_ (Underscore) Denotes the beginning & end of the italic text.

Example : *This is Italic in Google+ *

– (hyphen) Denotes the beginning & end of the strikethrough text.

Example : *This is Strikethrough in Google+ *

Enjoy Social Networking with Google+ now.

Access Facebook faster now

Objectives :

  • How to access Facebook faster
  • What are the shortcuts for Facebook?
  • What are the keyboard shortcuts for Facebook?
  • List of the shortcuts for Facebook?
  • List of the keyboard shortcuts for Facebook?

Hey friends, many of you were asking me that how we can access Facebook faster in terms of handling such that every time you need to access it from mouse & need to move it across the screen.

 

Keyboard Shortcuts for Facebook :

 Key  Action
 Alt + ?  Search
 Alt + m  Compose a new message
 Alt + 1  Jump to Home Page
 Alt + 2  Jump to Your profile page
 Alt + 3  Friend Requests
 Alt + 4  Your messages
 Alt + 5  Notifications
 Alt + 6  Account Page
 Alt + 7  Privacy
 Alt + 8  Facebook’s Facebook Page
 Alt + 9  Facebook Terms/Agreement
 Alt + 0  Facebook help center

 

Note :

  • For Firefox : Add Shift to the key combination, so as not to trigger the Firefox’s own shortcuts. Ex. Shift + Alt + ? => Search
  • For Mac : Use Ctrl instead of Alt for using shortcut. Ex. Ctrl + ? => Search

Creating Google+ Page

Objectives :

  • How to create Google+ page?
  • How to create page on Google+?
  • How to create Google+ fan page?
  • How to create fan page on Google+?
  • How to create page on Google Plus?

Here is the video tutorial which will guide you on above questions :

[youtube:http://www.youtube.com/watch?v=3u-HdzmEa3o&feature=youtu.be]

 

MAKING THE MOST OF 3G

Objectives :

  • How to use 3G connections properly?
  • How to monitor 3G usage from phone?
  • How to save money while using 3G connection?
  • How to reduce your bill while using 3G connection?

Get yourself a 3g connection, but are verified of a huge bill? Keep following points in mind and your bill will remain within bounds.

TURN OFF 3G:

Simply quit 3g (most smartphone allow you to choose 2g and 3g connection) when you are not browsing the internet or making video calls, fear not, push mail will work is well on an EDGE connection.

USE SPECIFIC BROWSERS:

Pick browsers like Opera Mini while surfing the net, These reduce data usage as they compress Web pages before sending them to your device, resulting in lesser data consumption.

KEEP TRACK OF USAGE:

Download an application that monitors data, such as the data counter widget on ANDROID, to keep track of your usage.

CHOOSE MOBILE VERSION:

Most handset browsers give you the option of viewing desktop or mobile version of websites. when in doubt, go with the mobile version. They are much lighter in terms of data usage.