How to connect two PC’s on LAN

If you want to connect two computers on LAN (local area network) then you will need a crossover cable. A crossover cable (image) is an Ethernet cable which simply helps to connect computing devices together. In this post i will tell you how to use this crossover cable to connect two computers directly.

You can get this crossover cable from any computer hardware store i guess. I got mine from my nearest computer hardware store. It is also called as RJ45 cable. If you are not getting the cable from any store then you can even create one. To know how to create a RJ45 cable click here.

To connect two computers on the network, Both computers should belong to same WORKGROUP. To check the work group of your computer. Just go to Control Panel > System. Here you can see the workgroup of your computer. See Image Reference. If your computers are not on the same workgroup. Then you can change the workgroup of one of your computer to match the other one. To change the workgroup of your computer follow these steps :

  1. Go to Control Panel > System > Advanced System Settings
  2. Click on Computer Name tab.
  3. You can see ” To rename this computer, click Change.” message.
  4. Click on change.
  5. Now just type in your new workgroup name. Click Ok, Ok. And restart.
That’s it, now you know how to change the workgroup of your computer. So you can put both the computers on the same workgroup before proceeding to the next steps. When both the computers are on the same workgroup then you are ready to connect them together. Follow these steps to connect two computers on LAN :
  1. Go to Control Panel Network and Sharing Center.
  2. Click on Local Area Connection > Properties.
  3. Click on Internet Protocol Version 4 (TCP/IPv4)Properties.
  4. For PC 1. Put IP : 10.1.1.1. Subnet: 255.0.0.0. Default Gateway: 10.1.1.2. (Image Reference)
  5. For PC 2. Put IP : 10.1.1.2. Subnet: 255.0.0.0. Default Gateway: 10.1.1.1. (Image Reference)
  6. Click Ok, Ok, Close.
  7. Restart both PC’s. And you are connected on LAN.
  8. You can find your other PC in My Computer > Network.
If you are getting the message “Access is denied” while accessing the other computer then just go ahead and disable the antivirus/firewall on both the computers and you will be able to access that computer.

If you are not getting the other computer in the Network then just go to your Network and Sharing center. Click on Choose homegroup and sharing options. In that window if you can see create homegroup button, then just click on it and just go clicking next next next till you are done creating homegroup. Now try checking your Computer > Network again. If you still don’t see the other computer then feel free to ask help on the Codefap Forum.

And please connect the crossover cable to both the computers hehe 😛

Top 10 Google search Tips & Tricks

Most of us use the Google search to find or locate something on the web. But normally even after searching multiple times, all we get is disappointment. In this article i will share some of the Google search tips and tricks which will boost your search efficiency to a whole new level.

Google has encoded some rules to search over the web. These rules are defined as syntax of Google search. Using the proper syntax for a particular type of search will help you get your desired results faster than ever.

1) Currency Conversion

Syntax : <currency1> to <currency2>
Suppose if you want to convert Dollars in Indian Rupees. Then you can just type usd to inr and search. You will get the result as 1 U.S. dollar = 56.1608447 Indian rupees

google-currency

[code]Input : 50$ to inr<br />
Result : 50 US$ = 2 808.04223 Indian rupees<br />
Input : 2 pound to dollar<br />
Result : 2 British pounds = 3.09900 U.S. dollars[/code]

2) Calculator

Syntax: <number> <operator> <number>
If you are not getting your calculator and need one urgently then you can just go to Google. And use their syntax to calculate or carry out your desired operations on the numbers.

google-calculator

[code]Input : 5 + 10<br />
Result : 15<br />
Input : 500 – 235 / 25<br />
Result : 490.6[/code]

3) Graph Calculator

Syntax: Put any graphical mathematical equation to see Beautiful static / animated graph.
I was not knowing about graph, but while using google calculator i came across this amazing feature. Click here to see one of the amazing heart graph on Google using a mathematical equation.

google-graph

[code]//try out these codes, one line at a time<br />
sin(x)/x, 1/x^2<br />
graph ln(x)<br />
sin(x)<br />
cos(x)<br />
tan(x)[/code]

4) Find local time

Syntax: time in <place>
If you want to find the local time of any particular place. You can just type in ‘time in name_of_that_place‘ to get the time of that certain place. For example, I can type in ‘time in india‘ and the result is : 19:34 Wednesday (IST) – Time in India.

google-time

[code]Input : time in london<br />
Result : 15:08 Wednesday (BST) – Time in London, UK[/code]

 5) Weather

Syntax: weather <place>
If you want to find the weather of a certain place, just type in that syntax and your desired place. For example,  if i type “weather mumbai” then i will get the result shown in the image below.

google-weather

6) Unit Conversion

Syntax: <unit1> to <unit2>
Suppose if i want to convert kilograms to grams then i can just type in “kg to g” to get the desired conversion. Similarly you can convert any other unit you want using Google search.

google-unit-conversion

7) Exclude Keywords in Search

Syntax: <search string> <excluded string>
If i want to search something excluding a certain keyword then i can use the syntax mentioned above. For example, if i search for “Webhosting -free” then it will exclude all the results containing the keyword free. And only the remaining results will be displayed. Or lets say if i search for my name excluding the keyword facebook like this : “omkar bhagat -facebook“. Then only the results which do not contain the word facebook will be displayed.
Note: there is no space between minus sign and excluded string.

8) Definitions

Syntax: define: <keyword>
If you want to get the definition of a certain word then just type in define: word. For example, if i want definition for technology, i can just type in “define: technology“.

google-define

9) Searching related websites

Syntax: related: <website>
If you want to get sites related to certain website then just type in related: website_address. For example, if i want to get related websites to wikipedia website, then i can just type in “related: www.wikipedia.org“.

10) Excluding certain websites

Syntax: <search_text> -site:<sitename>
If you want to search something but don’t want results from a certain website. Then you can just use the above syntax. For example, if i want to search for technology but don’t want results from wikipedia, then i can just type in “technology -site: www.wikipedia.org“.

I hope this post was quite informative to you guys. Thanks for reading. 🙂

Getting Input from the User in C++

Now lets learn how to get input from the user, how to store that input, and how to display that input as output. To show the output we used a keyword called cout (console out). Similarly to get the input there is a keyword called cin (console in). But there is one more difference. While using cout we used an insertion operator (<<). This insertion operator was having two less than signs. But while using cin we will use the insertion operator (>>). This insertion operator has two greater than signs.

Now lets understand practically..

In the above code, we ‘declared‘ a variable x of the integer datatype. Then on the second line, we have cin >> x. That means we are getting the input from the console and storing it inside the variable x. So value is being taken from the user and being stored inside variable x using the insertion operator having two greater than signs.

Lets understand this with the help of a simple program ..

Code :

Output 1 :

In the code above, we have put our basic code as learned in the previous tutorials. Then inside the main function we have declared variable x of the integer datatype. Then we displayed “Enter a number : ” on the screen, asking the user to enter a number. User can enter any value. In this case, I entered the value 5. Then after next statement is executed which displays “You entered : ” string on the screen ALONG with the VALUE stored within variable x.

So if  i run the program again and enter some other value then this will be the output :

Output 2 :

You can even perform different operations on the accepted input. We will see that in next Tutorial.

How to make your PC start-up faster

If your PC is working slower than usual, this may be because – too many programs are executed during the computer start up. Some of these programs maybe unnecessary to you. And these unnecessary programs take up too much of the CPU processes, thus making your PC slow. You can just remove these programs from the start up. So these programs will not be automatically run when the computer is started. These programs can be run manually only when needed. This will help you to get more percentage of cpu for your important tasks.

Lets understand this with an example. I have seen computers with so many start up programs, which actually makes the computer handicap to do any other important task. A computer with start up programs like messengers, gaming client, mobile pc suites, user defined themes, etc etc is likely to perform slower than usual. If you want your PC to perform faster then ideally you should only keep the System services, Antivirus and the Firewall on your start up list. So lets see how to modify the start up list.

How to change the start up programs list ?

  1. If you are using Windows XP, then go Start > Run > Type msconfig, press Enter.
    If you are using Windows 7, then go Start > Type msconfig, press Enter.
  2. Then click on start up tab. (Click for image reference).
  3. In this tab, deselect the programs which you don’t want to start up when the computer starts up. Select only those programs which you want to start during the computer start up.
  4. Click on Apply, Click on Ok.
  5. Restart your computer.

Now you have removed the unnecessary programs from the start up list. This will make your computer a bit faster during the start up. Since it will load only the selected programs. To make it a little more faster what you can do is remove the unnecessary services as well.

How to change the start up services list ?

  1. If you are using Windows XP, then go Start Run > Type msconfig, press Enter.
    If you are using Windows 7, then go Start > Type msconfig, press Enter.
  2. Then click on Services tab.
  3. Click on ‘Hide all Microsoft services‘.
  4. Deselect the unnecessary services or click disable all as per your wish.
  5. Click Apply, Click on Ok.
  6. Restart your computer.

Now you have removed unnecessary programs as well as services from the start up list. But some programs persist in your start up list even after removing them. These programs can be removed from the registry. The following instructions are only for advanced user. Follow these only if you know what you are doing. If you mess up the registry then it can cause serious problems.

So follow the next steps only at your own risk, if you mess up don’t blame me :

How to change the start up in the registry ?

  1. If you are using Windows XP, then go Start Run > Type regedit, press Enter.
    If you are using Windows 7, then go Start > Type regedit, press Enter.
  2. Select HKEY_LOCAL_MACHINE.
  3. Click on Edit > Find. Type msconfig in Find box.
  4. Select Keys. Deselect Values. Deselect Data. (image reference)
  5. Expand MSConfig > Expand startupreg. (image reference)
  6. Select the item you want to delete. (In my case i will select Msn Messenger, check the image in next point).
  7. Right click and Click delete. (image reference).
  8. Similarly you ‘can’ delete other items from the start-up using registry.

NOTE : Please do not be under the impression that deleting registry items makes your PC faster. Deleting only the start up items will help to make your PC a little faster. DO NOT DELETE ANYTHING ELSE unless you KNOW what you are doing. And feel free to ask for help in comments or on forum before messing up anything.

Is there any Software to do all these tasks?

Yes. There is something called as CCleaner by Piriform. It will help you to clean registry, remove startup items by graphical user interface. I recommend this tool to you guys. Its clean and easy to use. And its FREE.

Thanks for reading guys, And if you love the articles, you can subscribe to my Blog. 🙂

Top 10 Essential WordPress Plugins

If you are searching for some great plugins for your wordpress blog then this post might help you. You can search for wordpress plugins on google or on the wordpress.org site. But it can be frustrating task to find the best plugins from the rest. In this post i will share some good working plugins for your wordpress blogs. I am not going to rate any plugin just by reading others reviews for that specific plugin. I am only sharing the plugins which i have used on my site. So all my opinions are based on experience.

Disqus Comment System

My opinion : If you are searching for some great plugin for blog comments system then this is the one. I feel the default comments system in wordpress is not that good. When i had my first post on my blog, at that time only i had decided to replace the comments system. I kept on searching for an alternative. I crossed disqus comments system many times but i didn’t download it.

Instead i was searching for a plugin which would allow visitors to comment using their social networking sites. For example: if a facebooker wants to comment he can log in to Facebook and then comment. Similarly if a googler wants to comment, he can log in to Google and then comment. But all such plugins were most likely premium plugins, that means i had to pay / buy them to use the plugin. Then i finally decided to download and install disqus comments system and i can’t express how satisfied i am with this plugin.

Features : This plugin allows the visitor to comment using their social profiles, disqus profile or by direct name and email id. Easy to integrate. You can change colors to match with your website. And great comments moderation system as well. Other features include top commenters, popular threads, thread rating, etc.

Settings : So if you are asking me how to use this plugin then the answer is just install this plugin and then after installing disqus will ask you to register on their website before using the plugin. Don’t worry its free. Just register and follow their instructions. You will get a short code for you website, just enter it in your plugin to activate it. And after activating you can find disqus in Comments > Disqus.

Really simple Facebook Twitter share buttons

My opinion : The most important plugin for a blog is the one which helps to promote the blog. And by promoting i mean sharing it to others. Every blog must have share buttons on every page. If not every page, at least on the blog posts page. This allows the visitors to share the articles with their friends and thus promoting your blog and helps to get more traffic to your blog. Currently i am using this plugin on my blog, there maybe other better plugins out there. But i am satisfied with this one.

Features : This plugin shows different social sharing buttons on your post. You can set their position according to your preferences. For my blog posts i have chosen to keep the sharing buttons at the bottom of my post.

Settings : Just install the plugin on your wordpress blog.
You can find the plugin settings in Settings > Really Simple Share.

OrangeBox

My opinion : I don’t know exactly how to describe it. But to see it practically, you can visit any post in my blog containing a image. And then click on it. The image will be displayed in a box on the same screen, clicking on it again will zoom the image. If you have multiple images in one blog posts then these will be grouped together in orangebox. So when you click on an image in a post, it will appear on screen with left and right arrows for viewing the previous and next image respectively. Even videos can be viewed in similar way. I am just in love with this plugin. Its awesome. It makes the images and videos to be viewed beautifully.

Features : Well i described most of the features in the above paragraph only. So to see what exactly it does, you can see the screenshots on the official orangebox plugin at the wordpress.org. Click here to see the screenshots.

Settings : Directly install on your blog.
The plugin settings are located at Settings > OrangeBox.

User Avatar

My opinion : Its a great plugin which helps your registered users to upload their own avatar on your Blog. Well there’s nothing more to say about it. I like it for its simplicity and ease.

Features : Allows registered user to upload their own avatar.

Settings : There are no settings, just a upload option in Users > Your Profile.

Sliding Youtube Gallery

My opinion : If you want to display all your youtube videos on your blog without taking too much space then this is a great plugin for you guys. This plugin puts all your videos in a order in one single block, allowing user to browse through videos just by mouse movement (left or right).

Features : Customizable video block. Helps to view all videos in one single block like a Gallery.

Settings : The plugin settings can be found in Settings > SlidingYoutubeGallery.

Spider Tracker

My opinion : This plugin really makes tracking very simple. I started using this plugin a week ago and i feel great to see which spiders are tracking my site. Its not very complex plugin. Its very simple and neat plugin.

Features : Displays which spiders are tracking your blog. Displays the number of visits by spiders to your blog and also the percentage of one spider from another with a green tracking bar.

Settings : The settings are located directly below Settings option. Named Spider Tracker.

Related Posts Thumbnails

My opinion : If you want to show related posts just below a thread, then this plugin can help you out. This plugin puts related posts along with excerpts and thumbnails just below your thread. I am not totally satisfied with this plugin, i am still searching for a better one. Because if i change the thumbnail size through media settings from 150×150 to something else. Then the thumbnails of the related posts go blank or cause problems. So if you know any good plugin you can comment below. But till then i will just work out with this plugin.

Features : Shows related posts below the thread. The threads can be either random, from same category or from same tag. Thus the user will gain more interest in your site.

Settings : The plugin settings are located in Settings > Related Posts Thumbs.

Google XML Sitemaps

My opinion : Instead of explaining what it does, i would like to show you the working. The following data is shown in my administration panel. You can have a idea of what it does by looking at it :

  • Your sitemap was last built on July 21, 2012 10:01 am.
  • Your sitemap (zipped) was last built on July 21, 2012 10:01 am.
  • Google was successfully notified about changes.
  • Bing was successfully notified about changes.
  • There was a problem while notifying Ask.com.
  • The building process took about 0.25 seconds to complete and used 29 MB of memory.

Features : Helps to generate XML sitemap of your blog posts.

Settings : The plugin settings are found in Settings > XML-Sitemap.

Ad Injection

My opinion : This is really a great quality plugin for a wordpress blog. This plugin helped me to inject ads into the blog posts. And i really love this plugin for all the complexity managed in a simple way. There are so many options which helps us gets the desired result. And the administration interface is really up to the mark.

Features : Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.

Settings : The plugin settings are found in Settings > Ad Injection.

Syntax Highlighter Evolved

My opinion : If you are posting codes on your blog, by codes i mean programming language codes then this plugin is highly recommended to you. The code you post on your blog will be highlighted using that specific language. Example: If you are posting a c++ code then c++ keywords will be highlighted accordingly.

Features : Easily post syntax-highlighted code to your site without having to modify the code at all.

Settings : The plugin settings are found in Settings > SyntaxHighlighter.

So i hope you loved this article. Thanks for reading. 🙂 Take care guys.

Floating share bar for Blogger

So if you already started blogging then the first most important thing you will need is sharing buttons on your blog posts. These sharing buttons will allow or help your visitors to share your post on different social networking sites. So in this post i will share the code which i had adapted from some site long ago when i was blogging on blogspot. And then eventually i kept modifying and experimenting with this code to get desired results on my blog. And with time i learned the function of every part of this code, so now i will help you to implement this code on your Blog powered by Blogger. And also i will explain how to work with this code.

First have a look at the floating share bar. Click here to see it on Live Blog.

Now to implement this floating bar on your Blog, Just follow these instructions :

1) Go to your Blogger Administrator Panel > Click on Template > Click on Edit HTML

2) Click Proceed > Click on Expand Widget Templates

3) Find the line :

4) Just below that line, add the following code :

5) Now replace codefapcom on 85th line with your twitter username.

Changing the position of this plugin or widget :

Here i will not explain the complete working as most of the visitors reading this post are just seeking quick solutions and not lectures. So to change the position, Check the line number 5. That line says :

Now in that line you can change the position of the widget with respect to bottom and left margin. So you can edit these two properties in the following way :

bottom : Increasing this value from 10% to 20% will push your widget away from the bottom of your browser (that is upwards). So you can increase this value to put this widget more nearer to the top or decrease the value to put it near the bottom.

margin-left : Increasing this value from -90px to -80px will push your widget towards the right. Decreasing the value from -90px to -100px will push your widget towards the left.

So just experiment with this values to suit your requirements. And happy blogging.

Making this widget appear on home page

This widget only appears on post pages and not on the home page. If you want this widget to appear on the home page as well. Then remove 001, 002, and 101 line from the code.

Click here to see how to add floating share bar to WordPress Blog

Variable, Constants and Datatypes in C++

So lets understand what are variables, constants and data-types in c++. To understand variables and constants we can relate them with a box and a object. A box can be considered as a variable while a object can be considered as constant. So basically we store the objects(constants) inside the boxes(variables). This is the perfect analogy i can come up with. So lets understand this practically. You used to have a subject called algebra in your school right? In algebra you used to perform certain operations like :

Here we are storing value of 1o inside variable x, value of 5 inside y and sum of x and y is passed as a value to variable z. So here X, Y, Z are the variables. While 5, 10, 15 are constants.

Constants

In C++, the types of C++ constants are divided into Primary Constants and Secondary constants. Primary constants consist of Integer Constants, Real Constants and Character Constants. While secondary constants consist of Array, Pointer, Structure, Union, etc.

Data-Types

Since there are different types of constants, there is a need for difference types of variables to handle different types of constants. These variable data-types are called as Data-types in C++. The following table shows the same :

As you see in the above picture, Data-types in c++ are classified into three categories, namely user-defined types, built-in types and derived types. Where user defined types are the one which are defined by us (like structure, union, class, enumeration). And derived types are the ones which are derived from existing data types (like array, pointer, reference).

The built in data-type is again classified into three categories, which are integer (int and char), void and floating type(float and double). These are the pre defined data types inside c++ programming language.

  • int can only accept integer type of value.
  • char can store only 1 character.
  • float can store real constants which contain decimal.
  • double is same as float, just the range is wider
  • void means ‘null’ or nothing. Or as good as ’empty’.

Declaring and Creating Variables

Now you have a idea of what are variables, constants and data-types. So now we are ready to learn how to declare and create variables in c++ programming language.

The syntax to declare variable is given below :

example :

We can even write these two lines as a comma separated list as follows :

This is the way to declare variables. Now to create variables we have to assign values to variables which are already declared before. The syntax for creating variable is :

example :

Up till now we declared x and y variables. Then we created these variables in memory by assigning values to the created variables.  Instead of taking many lines, we can write these lines in short by using short-hand property. The syntax to declare and create variables in one line is given below :

example :

Now if we want to write these two in one single line, we can use comma separated list as shown below :

Ok so now we know how to declare and create variables but there are certain rules to construct variable names. Lets see what are these rules :

  • The first character in a variable name must be an alphabet or an underscore.
  • No commas or blank spaces are allowed within a variable name.
  • No special symbol other than an underscore ( _ ) can be used in a variable name.

Variables can be even dynamically initialized . That means we can do some operation on the right hand side and assign to left hand side. Lets see what it actually means in the examples below :

Lets learn how to display value of variables in the output. The concept is that if we pass variable to console out ( cout ) by using insertion operator ( << ) then the value contained within that variable will be displayed as the output. But if we pass a variable in quotation marks ( ” ” )  to console out ( cout ) by using insertion operator ( << ) then that variable itself is displayed on the screen. Lets understand the following example :

Code :

Output :

Putting it all together

Now grouping together all the points we learned, lets write a simple program as an exercise for this tutorial. So the program below is to demonstrate creation of variables and displaying variables as output.

Code :

Output :

So that’s all in this tutorial. Keep practicing and if you have any doubt you can leave a comment below. Take care.