Monday, July 28, 2014

.Net Framework Web Browser Class


Web Browser class is one of the most important class provided by .NET Framework for tasks related with web. It has lots of methods which can be used to implement web related tasks such as web scraping, creating a inbuilt browser in a software and many more.

Now I am going to let you know how to create program which will search a given word in yahoo search engine using this WebBrowser class. The language I am using to explain is C# here but you can use languages as visual C++, F#, VB as well.
You need to have some knowledge about C# and HTML before begin to do this task because almost all the things are represented in HTML in a web page thus you need to have an  understanding about HTML. Also if you do not know anything about C# then you are again in trouble. Therefore the prerequisites are C# (I am using Visual Studio 2013 IDE)  and HTML.

Lets get into work,

open visual studio and go to New => project => select windows forms Application under C#

Then you will see a windows form appear with title Form1. Now drag  a "button", "textbox" and a "web browser" from the tool box.


 Set the URL of the web browser as https://www.yahoo.com and text of the button(not the name) as "Go".
you have to make sure that the names of each component were not changed.
web browser name  : webBrowser1
button name            : button1
text box name         : textBox1

Now click on the text box and set TextChanged event as shown below:


just double clik on the TexChanged event(highlighted in yellow).

then a new file will be opened(Form1.cs)  and you will see a method called "textBox1_TextChanged".

 Now always when we  type something on the text box, this method is invoked. What we expect from this is when we type something on the text box it should be appeared on the search box of the yahoo search engine. Now we place a code inside textBox1_TextChanged method to do this task.

How it looks like after adding the code

The piece of code we used it shown above. Now your basic HTML and C# knowledge will help you to understand what happened and I will explain how we got the element ID.(p_13838465-p).

go to the shown link using your web browser. https://www.yahoo.com

now right click on the search box and click Inspect Element (I assume you know these things)

Finding ID of the search box

Then you will see the ID of the search box.

Our next step is setting the "go" button in the windows form work as "search web" button in the web page.

set button click event handler on the "go" button or just double click on the "go" button to set it automatically. set following code to the button1_Click method.

You can find the ID of the search button by the same method used to find the ID of search box.


This is all with coding and now you can test your program by running the code.

When you run the program you will see the web page is loaded into the web browser window.

Then type anything in the text box of the program, then you will see same text appears on the search box too.

When you click the "go" button it will search the web with the entered word.

I hope now you got an idea about some of usages of the web browser class. Like this you can do lots of advanced things with using this class.

Comment below If you have any question regarding this program.

Saturday, May 31, 2014

How to create c++ header files and make them work in ubuntu

You can easily create header files in c++ and work with them using an IDE(Integrated Development Environment) such as CodeBlocks, Eclipse, etc. If you are using an IDE, you just need to create the relevant files( such as header file, implementation file and main file) and compile them directly using the IDE. so when you give the compile command  the IDE care the rest of the tasks and give you the output.

But if you are going to do this task in a terminal(ubuntu) without using any IDE then you will have to do these all the steps done by the IDE manually. Therefore here is explained how the same thing can be done by using terminal.(only the steps are shown and not in much details)

step 1 :

You need to create the header file as you need
(a sample header file is shown below)

// rectangle.h  (begining of the file)


#ifndef _RECTANGLE_H
#define _RECTANBLE_H


double area(int length, int width);
// initialize any functions as you need
#endif


// end of the file

you need to save this as a header file.(rectangle.h)

step 2 :

Now you need to create the implementation file.
(a sample implementation file is shown below)

//rectangle.cpp (begining of the file)

#include <iostream>
#include "rectangle.h"

using namespace std;


double area(int length, int width){

    return length*width;

}


// end of the file

you need to save this file as a c++ file (rectangle.cpp)


step 3 :

Now you need to create the main file
(a sample main file is shown below)


// main.cpp  beginning of the file

 #include <iostream>
#include "rectangle.h"

int main(){

    std::cout<< area(4,4);

    return 0;

}


// end of the file

you need to save this file as a c++ file (main.cpp)

step 4 :

Now you can run these files on terminal.

put all the above 3 files into a same folder. then open terminal and go to the folder where these 3 files reside. (using "cd" command   eg : "cd Desktop\header_test_folder")

first you need to compile all c++ files.
type bellow command for each c++ file

g++ -c filename.cpp
 //other cpp files (if any)
g++ -c main.cpp

example : (for above files)

g++ -c rectangle.cpp
g++ -c main.cpp

now you need to link these files and create the executable file.
so you need to run below command for that.

g++ -o finalfilename main.o filename.o  // otherfiles.o (if any) 

example : (for above files)

g++ -o finalrectangle main.o rectangle.o

now you can see there is a new file in your directory(finalfilename)
you need to run that file

./finalfilename

for above example

./finalrectangle

now it will be running on the terminal.









Sunday, February 16, 2014

Assemble Your Dream PC



Hello friends, today from this short article I am going to describe  about pc configurators.  Actually there is a dream computer in everyone's mind. Which may be powerful pc with high performance with magnificent components.


Now you are capable of assembling your dream pc virtually. That means now you can make your dream computer virtually using desired components. so after creating it you can see how it looks like and know the total price of the computer.

This virtual assembly can be done using a pc configurator software which is available online free of charge. So you can build any computer you like and get an understanding about that computer. I have provided some links of pc configurators. Now you can go to those web sites and begin building any pc you like.

 PC Configurators

  Artilces You may like  :  Cloud Gaming   Blu-Ray Disc


Sunday, December 29, 2013

True Backlinks Detection

This post is specially dedicated for Bloggers and for those who are willing to begin blogging. The word "backlink" is a very familiar word with every blogger. There is no blogger who does not know about this. So I am not going to explain it now. As many people say, the most common method of making backlinks is commenting on other blogs. If you have searched on internet "How to increase the rank of a website/ blog ?", 99% of websites says that comment on other blogs and it will make  back links to your blog and large number of backlinks will increase the rank of your website. Some people says that make 50 comments per day then 1500 per month, etc.


But unfortunately the matter is that "Do really those comments make backlinks to your blog/website ? ". Most of people think that once a comment is created automatically a backlink created but unfortunately most of time you are just wasting your time. Because search engine crawlers do not go through those links(web addresses) which you have put with your comment.

How Does This Happen ?

If you have observed the HTML code of a link it looks like this:

<a href=”URL”>Link Text</a>

Link Text appears on the web page and when you click it the Web browser loads the content of the URL. This is a real backlink if your link appear on a web page with above format then search engines accept that link as a backlink.

But most of comments you put are in the below format.

 <a href=”URL” rel=”nofollow”>Link Text</a>

in this case also your link is shown on web pages but you can see there is a special tag called "nofollow". Because of these tags search engines just go through your link but does not consider as backlinks.

Why do they use "nofollow" tag ?

Most of people comment on other blogs not to admire them. Commentators need just to add a backlink to their blog/website. Sometime they comment without even reading the content( You might have seen many comments such as "A great post", "Thank you for posting these content", etc these comments are put just to generate backlinks). To prevent these things and spams, blog/website administrators use "nonfollow" tag. The comment remains but does not make a backlink.

How to detect whether my comment makes a backlink ?

There are many methods of detecting true backlinks. i will teach you a methods to detect which web browser independent.

step 1 :  go to the comment section of the blog/website that you are going to comment



step 2 : Then right click on a comment someone has posted already



step 3 : Click "inspect element" (This option is available in many web browsers, I have tested this
             in firefox, chrome and internet explorer)





when "inspect element" is clicked  the web browser loads the html code as shown below


As shown on the above image. The HTML code of the link is shown in a highlighted line. In this example you can see there contain the nonfollow tag. if  the highlighted text contain nonfollow tag then your comment does not make a backlink it just a comment. If there is not a non follow tag then it creates a backlink.

I hope now you have the ability to check a true backlink. The advantage of a comment is that even though it is does not create backlinks, it makes human readers aware about your blog. If you have any problem regarding this post put a comment.





Tuesday, November 26, 2013

Cloud Computing



Cloud computing technology is a very popular technology nowadays. Lots of people and companies use this technology to make easy their work. Some people use this technology even without knowing that they use this technology. Let’s understand clearly what this technology is and how it makes computing easy/beneficial.


Let assume you have an organization and there are bunch of computers. When you need to install same software for a number of computers then there may be many constraints. Sometime there are legal policies that ask you to pay them a large amount of money to install for a bunch of computers also sometimes it may be very time consuming task to install individually. 

The most important/considerable fact is that the computers may not be compatible with the software that you are going to install (hardware, operating system may not support / ram, video card, processor is not enough).  If you still need to install under these conditions definitely you need to upgrade your computers for the installation of new software. In this case cloud computing come for your rescue.



In cloud computing technology, the software/application that you need to use is not installed into your computer. So where is it   ???  It is installed into the cloud computing server. What you have to do is just logging into the server and use it.  In this technology your pc does not need to have high performance hardware or any specific operating system for the application. You just need an internet connection and a normal pc to log into the server. All the processing parts of the software are executed in the server. When you give an input from the keyboard or mouse that command directly sent to the server and that command is executed on the cloud server. so you can use software in the servers as they are in your PC.



Advantages of cloud computing

  •  Do not need to waste a large amount of money for hardware
  •  Operating system independent
  •  Easy to handle : The total software is stored in servers therefore space of your computer, memory usage and processor usage is saved
  •  some PC based applications can be used even from a mobile phone

Disadvantages of cloud computing

  •  Information security and protection                                                                                                                                                    When some very private and important data are stored in servers sometimes it can be stolen or  corrupted data (but nowadays these things are happened rarely)

  •  Servers do not support lots of software                                                                                        Cloud servers support only for popular and mostly used software so sometimes they will not provide service for some software

 Popular applications which use cloud computing technology

  •  you tube
  •  Facebook
  • google doc 
  • cloud gaming applications (click here to know more about cloud gaming)

 Suggested Articles  :  Cloud Gaming   What is Bluetooth ?    Blu-Ray Disc

Friday, November 8, 2013

Cloud Gaming




            Cloud gaming is one of the most popular technology in the world for game playing. The words “cloud gaming” may little bit weird for the people who are not much involved in the IT sector. But the simple meaning of “cloud gaming” is that you can play complex modern games without having expensive hardware parts. (Simply, even though system requirements are not satisfied you can play games from your own pc) 



          Think for a while, nowadays when someone needs to play a modern game definitely he should have a high performance pc.  Many people do not have high performance pcs due to their cost.  Therefore this new technology helps gamers to play modern new games by their own ordinary pc without fitting new hardware components.  (Amazing isn’t it :) )



Ok now let’s learn a bit about how this method works. 

This is like video streaming. As an example when you are watching a video on YouTube it is called video streaming. So the game is also played like a video streaming method.   When you play the game it is actually executed on “cloud gaming servers” not on your pc. When you play it all the visuals of the game are streamed in to your computer. When you give instructions/commands using your input devices mouse, keyboard or joystick those commands are directly sent to the cloud gaming server and at the server they are executed. So the game is originally played on the servers and you are just watching the videos.





  Cloud gaming technology has two methods which depend on the speed of the internet connection which are  video streaming method (for speed connections) and file stream method (for low speed connections). So you can play these games from a low speed connection too.

Advantages of cloud gaming


  •       No need to pay for additional hardware to play games
The game run on cloud gaming servers, so just having basic hardware is enough to play modern games.

  •        You can play games from any operating system
Normally lots of games are restricted to a specific operating system. So people who are using other operating systems cannot play the game. But in this method you can play from any OS which support this service.

  •   You can play it instantly and can save space
When you are going to play a game in traditional/usual way first you have to download and install the game with wasting a huge amount of space in the hard disk (number of GBs). But now when you are getting the service from a cloud gaming server you can easily play a game you like.

  •    Can play it even in mobile phones
Cloud gaming technology is extended for mobile usage therefore you can play many games using your smart phone.

Cloud gaming sites






Above are few sites which provide cloud gaming facility. You can create an account and play. www.onlive.com site s 30 min free playing time and you can feel the difference of cloud gaming technology.