Pages

Thursday 24 January 2013

Introduction to C # programming language Part 1


              A computer is an electronic device that doesn’t understand human language. It needs some set of instructions to perform any specific task which we call program. Further the program is written in a specific language called programing language that computer understand, C# is one of those programing language to know about the history of C# or programming language you can search on the net or read it in Wikipedia , to read about the history of programming  click here

   we will introduce you to C# after reading the post you will be able to make programs on C# or you can understand it more easily if you are learning C#
   If you think that learning C# require top level of math then you are completely wrong it just require basic mathematics anyone can learn programming if he or she want.
You will require Microsoft visual studio to write programs in C#

Compiler

    Every programming language require a special program that can translate that programming language into machine language or computer language like I said “ special program that can translate that programming language” every programming language has its own  compiler  example  for a java language you require java compiler , the compiler for C# language is CSC. This process of conversion is called compilation.

Common terms

Before we start making programs there are some common terms which we should know.

Object oriented – programming

     C# is based upon OOP (Object oriented –programming) in this concept the program is developed like a real world system were it represent a real world entity or concept. In this concept a program is chopped into independent and reusable parts called objects, which can be integrated to form a complete program.

Objects

         Every object has its own unique identity and it never change in its life time an object may have the same behavior and state example two cars has same behavior accelerate and steer but has its own unique identity like company name or model no.
An object is made up of user defined data and instruction the data stored in an object defined the state of an object now in OOP the data is called attributes and the instruction in an object form its behavior. The behavior of an object defines what it can do, and this behavior is contained in method. An object can have multiple methods, each having a set of instruction. It may be confusing for you now that what make an object to better understand see the image below.   
  Now with the help of this image you can better understand what an object is.                    

Classes

        The characteristic of an object like it shape size color behavior classified it into different group. These groups are called classes. The object belonging to a given class is called an instance of the class. A class consists of a set of objects that share a common structure and behavior.

Writing programs

         Like various programming languages, C# also has some predefined keyword. Keywords are reserved words that a special meaning. In programming languages, vocabularies like every human language have, is called keywords and grammar is referred to us as syntax.

Declaring a class

C# also has some predefined classes and method and you can also define your own classes.
The syntax for declaring a class is:

class <class name >
{
…..
}


Rules for declaring a class

    1.  Must begin with a letter the first word of the class name must not be a digit (0-9).
    2.  Must not contain any symbol; however an underscore (_) can be use wherever a space is required.
    3.  You can’t use any keyword as class name.

Example to declare a class My_name which show a message “My name is Feroz “you have to write the following code


  public class My_name
  {
       public static void Main()
       {
           System.Console.WriteLine("My name is Feroz");
       }
  }

In this example the class declaration include the Main() method that will display the message My name is Feroz on your screen. 


      1.       The method Main()

              The execution of the code starts from the Main() method. The first line a c# compiler look in a code is the main() method the Main() method is used to create objects and invoke the method of various classes. So you must include a Main method in a class in order to execute your program.

                      2.     System.Console.WriteLine(“My name is Feroz”) 

             The System is a namespace were namespace is a collection of classes if you want to use some input/output operation you have to use System.IO namespace. Console is a class of system namespace. Console class includes a predefined method WriteLine().  WriteLine() method displays the enclosed text on your screen. The Console class also has some more methods that I will introduce to you one by one.The(.)dot character is used to access the WriteLine() method.
      
      3.    WriteLine()Method.
                      
                     The WriteLine() method is used to write or print text on the screen. After writing the Console.Writeline(“”) statement you can write anything inside the brackets double inverted Quote. 



        4.   The using keyword

                The System.Console.WriteLine() statement can also be written as Console.WriteLine() if the first line of the code include the using keyword. This using keyword is used to include namespace in the program. The using system declares that you can refer to the classes defined in the system namespace. A program can include multiple using statement. Example the previous code can be written as :


          using System;

          public class My_name
          {
              public static void Main(string[] args)
              {

                 Console.WriteLine("My name is Feroz ");

              }

          }


How to run a program

              Now after writing the program your first question will be how to run it, in technical term how to Compile and execute a program to do it you have to first write the program in notepad or any document writer then follow the following step:

Step.1  Save the file with the .cs extension by doing this it will signify as C# program.

Step.2  Now open the visual studio command prompt and change to the directory were you have save the file.

Step.3  Type csc myname.cs to compile the program.

Step.4  Then type  type myname.exe to execute your program.

We have saved our file with myname.cs name that’s why I have used the name in the step don’t be confuse by that

Your program will show the following output on screen.


  
                                                                                                                                                   next part

Thursday 17 January 2013

Learn HTML in an easy way


HTML is used  in the web browser to make web pages and other information that can be displayed.

Html (hypertext markup language):- It is the most widely language used for writing the web pages.
                                                             The language is so easy that anybody can able to learn it.
 


So let us now start learning the html
First we need to open a notepad
At the top of the page type <html>.
On the next line, indent five spaces and now add the opening header tag: <head>.
On the next line, indent ten spaces and type <title> </title>.
Go to the next line, indent five spaces from the margin and insert the closing header tag: </head>.
Five spaces in from the margin on the next line, type<body>.
Now drop down another line and type the closing tag right below its mate: </body>.
Finally, go to the next line and type </html>.
In the File menu, choose Save As.
In the Save as Type option box, choose All Files.
Name the file template.html
Click Save.
NOTE: One HTML file can have extension as .htm or .html. So you can use either of them based on your comfort.


 

Now you have created one HTML page and you can use a Web Browser to open this HTML file to see the result. Hope you understood that Web Pages are nothing but they are simple HTML files with some content which can be rendered using Web Browsers.



Document structure
When we start writing the html it begins with <html> and end with </html> this things tell the browser that the whole document is written in the html format.
The <html>,<h1>,<boby> all this are called as tags there are mainly 72 tags we used for writing the html.
The document was written into two section
First <html>…</html> which has the information about the document example title of the document, author of the document.
Second <body>..</body> it contain the real text which is going to be read.
Now let us learn the next tag that is metadata/metatag
It is used to include the name/value pairs describing the properties of the html document.
It is an empty element so it does not have any closing tag like the </body> rather than <meta>  it carry the information in between so we don’t have to close it.
When we type any keyword in the space provided in the search engine the metadata assist the best match to the search engine to find the relevant match for the same.



Attributes
It is also an important part of the html. It is used to define the characteristics of an element and is placed inside the element’s opening tags.
It is made up of two parts
1. Name
2. Value
Name= it is the property that we want to set for example font
Value=it is the property of the value itself like the front size.




We can see the following example of this in the following figure on sixth line
In that like it is written that <font face etc> and see what  happens.


We can see the color change in this figure.
Else we can also write the following things to make the easy  to use the color


In this figure we can see that we have written the color yellow and the color changes.







If we want to change the font style so we can able to change it also
Example:



Here I have change the following font face/style that is written in the sixth line.




Formatting tags

If we want to distinguish between the written matter so it is important to use the formatting tags.
It is important to make the web pages convenient so that the browsers don’t get bore of reading from the internet.

Headings<hn>tags

In html there are six type of heading <h1>, <h2>, <h3>, <h4>, <h5>, <h6> while displaying the heading browsers adds one line before and after that heading.
Example



Here we can see that <h1>, <h2> have written and some text also have written.


We can see the two different heading has written in the following example.

Paragraph the <p> tags
By this tag we can able to make the paragraph .
We can also use align with the <p> tag



We can see that it is written that <p align> right and in third line it si written that by this the text …..
So let see what has happen



We can see that the text which has written by using <p align right> has move to the right side
Let see what is going to happen when we use the <p align left,center,justify>






Break line the <br> tag
It is an empty tag it is used to break the line.
Note: The <br /> element has a space between the characters br and the forward slash. If you omit this space, older browsers will have trouble rendering the line break, while if you miss the forward slash character and just use <br> it is not valid XHTML.



In the following  figure we can see that it is written that <br> hello……..and in the next line it is written that  hope you are fine  let’s see what is going to happen



We can see that all the text is in the same line so for different line we have to use <br />



 Now we can see that by using the <br /> the rest text has come in the next line.

Nonbreaking Spaces

Suppose we want  to use the phrase "26 mahatma gandhi road." Here you would not want a browser to split the "26" and “mahatma gandhi road “across two lines.
In cases where we do not want the client browser to break text, you should use a nonbreaking space entity (&nbsp;) instead of a normal space. For example, when coding the "26 mahatma gandhi road." paragraph, you would use something similar to the following code.



Practice the above lesson wait for the next post.

To be continue.....






Sunday 13 January 2013

Now change wallpaper and apply aero glass effect in windows 7 starter/Home basic


         
    I am a student of NIIT and all students who are pursuing GNIIT course have to buy a netbook NIIT provide, you can’t choose your own. The netbook they gave us was an Acer aspire one d270 268kk the netbook is not bad compare to its price and comes with good specification but it comes with Windows 7 starter edition it’s not a fault of NIIT that they provide us this specific netbook, this netbook really fit their requirement and price ratio.

So, that’s how I stuck with windows 7 starter edition.

Who in the world will not want that his desktop will look like the way he want so after following some of my step your desktop can look like the image below



In windows 7 starter edition you can't change background image even the personalize windows is not available. 


There are two options available to solve this problem with the first  option you will be able to do everything you can change the background image and you can use the Aero glass effect too.

And  the second option  is to change only wallpaper with Starter background Changer. 
Both option will target different people But before trying any of the following option  i will recommend you to Create a system restoration point.  


Option One:

You have to first download two setup file from the following site i am giving a link to do that, the credit of the software goes to the people behind the site.

But first you have to change your UAC (user account control )settings to never notify and restart your PC.

To download the first software click here



Go to the above link and download the setup file then extract it in a new folder.


Then right click on the file and Run as administrator.


Click next to start the installation process.

Don't change any settings and click next.


The first red circle is showing the path were the file will install check it and then click on next.



Click on install.



Let the installation process complete.



Click on finish.



If you want to Visit the home page then click yes otherwise click no and close the application.



Right click on desktop and you will find the personalize option, click on the option and an new personalize window will open you can change your desktop  background now but you have to wait for that now just restart your computer.

To download the second software click here 



Click on download option and save the file.



Then right click on the file and Run as administrator.


Now you can see that there are two personalize option available don't do anything now just restart your computer. 



After restart you will have full Aero features click on the second or first personalize option in the right click option bar in desktop. and you will see windows original personalizetion panel.




Click on windows color and change desktop color or get transparent task bar change your wallpaper.



  
 Now you have completed the process do whatever you want play with color.

Visit the software site for more information.


Like written on the Software  website you windows will be not genuine but no notification will be shown at your desktop. if you really want it badly then try it but if take my advice i will say you that only changing  wallpaper is enough for most peoples so just try the second option its risk free your windows will be genuine. Option Two:
Starter background Changer.
It is decent software and we have like it much, the installation process language was different but now they have updated their software and installation process has gone simple in English language.If you are just happy with changing your wallpaper then this option is only for you and it completely free from money and risk

You can download the setup file from their site, click here


If you are confused than see the images:
Click on the place were i have made the red circle the language is different don't be afraid because of the donate button it is completely free if want you are free to donate may be if you want you can donate, this people have done a great job.

Click on download in English then in the new window click on the save file option now go to your download location  to find the file.
The credit of this software goes to the people behind this site completely. 

First of all download the file and start the installation process by double clicking on the setup file.
I don’t think that you will require step to step guide because the language of the software is change to English now but we are providing you the Screen shot of the installation process by this you will be able to see what happen and what to do in the installation process.


 click on next
Select I agree and click on next

 The two red box is showing the path were the software is installing and a warning saying that if you installed the older version than please uninstall it , after checking the details click.

Click the start button to start the installation process.

Select your language then click OK, And then click on next.

Let the installation process complete.

Close the window and click on next.

Installation process is complete now click on exit to close the window.



After completing the installation process you will get custom personalization window, congratulation you can change your background image now

 Just click on desktop background and change your wallpaper



Now see your new  desktop.



 Congratulation.
 we have use this software for more than 6 month and we have no complaints.