Thursday, December 29, 2011

The C beginings: part 2

In the last part(i.e part 1) i said something about the origin of C, what C language is about and what it is generally used for. In this post i shall go a step further by giving you an example and explaining every line in details....
In most tutorials, they start by showing you how to display " Hello World " , this is always a good place to start but i will try to run through the C language so that you understand it in great details in the shortest possible time after all you are learning at Gigabyte speed.... So here go...
First i shall explain what happens when a C program/code is complied (i am assuming you know what a compiler is, if you do not; click here for a quick run through )
A program in C language is written by first including a library file that should contain all the functions you will be working with. This includes the particular file that the compiler needs to check in order to know what each of the functions you use stands for. Like in a library where each book holds or contains a particular information that you will need to enable you answer/solve a particular problem set, also for programming you have to tell the compiler which file contains the information it will need to solve a particular task. Below is a sample code that displays the words " Hello World " without the quotes on the command line. For a run through on batch programming in MS-DOS click here.

#include <stdio.h>

int main( )
{
       printf(" Hello World " );
       return 0;
}

I will start explaining the above code line by line. Note the C compiler is not sensitive to spaces in between the wordings, i have spaced the above code in this manner for clarity and it is also a good programming technique to make your code readable by other programmers or by yourself when you go through the code later.
The first line contains the #include <stdio.h>   first notice the word in-between the < > brackets. It is stdio.h and it means standard (std) - input(i) - output(o) - .header file(.h)  . This is the default file in the C standard library that contains functions and methods of interacting with the input and output devices of the machine(could be a computer-PC, micro controller, etc.) you run the code on. The # tells the pre-compiler that this line of code is meant for it, so the code is telling the pre-compiler to go and fetch the standard input output file and include it in the code. The < > bracket mean the the pre-compiler should search all the memory of the computer for that file, in order to specify to the pre-compiler that it should search only the current directory where the file containing your code is stored, you use double quotes(" ") .
The second line starts with int main( )  this tells the compiler that this is the main block where the critical or important code to run is. The int in front of the main( ) is not really necessary because by default all C main methods return an integer value (int for short).
The next line of code tells the compiler that starting from the {  to the } contains a block of code grouped under int main( )
Within the { } contain the code printf(" Hello World ");  meaning print formatted data Hello World to the default output device(in this case the command line screen). The semi colon at the end tells the compiler that it has gotten to the end of a statement. The return 0 on the next line just returns an integer of zero to indicate to the compiler that the code executed properly.
By this stage, i know you have  a lot of questions, feel free to leave them as comments below this post and i will answer it as soon as possible. If you wish to contact me for any reason use the form on the contact page of this blog.



Season's Greetings from Giga Frequency

Wednesday, December 21, 2011

What is a compiler?


A compiler is a special type of computer program that translates source code from a high-level programming language( human readable text file) into a lower level language (e.g., assembly language or machine code) that is a form that the computer can more easily understand. At its most basic level, a computer can only understand binary(  1 and  0). If a human being was to write an instruction for a computer using the language it understands(binary), that person will write very slowly and find the information contained in the long string of 1s and 0s incomprehensible, the person will also be prone to make a lot of mistakes and introduce errors in the intended instruction. A compiler is a computer program that was created to bridges this gap and make writing computer programs(instruction) more human friendly.
In the beginning when compilers were created, they were very simple programs that could only translate symbols into the bits, the 1s and 0s, the computer understood. Programs were also very simple, composed of a series of steps that were originally translated by hand into data the computer could understand. 

This method of programming was very time consuming and prone to mistakes by the writer of the computer instruction, so portions of this task were automated or programmed, and that was how the first compiler was written. This program assembled, or compiled, the steps required to execute the step by step program.
These simple compilers were used to write a more sophisticated compiler. With the newer version, more rules could be added to the compiler program to allow a more natural language structure for the human programmer to operate with. This made writing programs easier and allowed more people to begin writing programs. As more people started writing programs, more ideas about writing programs were offered and used to make more sophisticated compilers. In this way, compiler programs continue to evolve, improve and become easier to use.

If the compiled program can run on a computer whose CPU or operating system is different from the one on which the compiler runs, the compiler is known as a cross-compiler. On the other hand a decompiler is a program that translates from a low level language to a higher level one. A program that translates between high-level languages (e.g from python to JAVA for example) is usually called a language translator, language converter, or source to source translator. A language rewriter is usually a program that translates the form of expressions without a change of language.
A compiler's function include but may not be limited to the following: 
  • lexical analysis
  • pre-processing ( usually a pre-compiler built in with the compiler run through the code first)
  • parsing of the code for syntax errors
  • semantic analysis (Syntax-directed translation)
  • generation of the code
  • also to optimize the generated code
Hope you have gained some knowledge about compilers(at least the basic understanding). For a more detailed explanation you can check Wikipedia here.

Note:
The faults or errors introduced into the compiled program by an incorrect behavior of a compiler in compiling the source code can be very difficult to track down. 

Season Greetings from Giga Frequency

Season Greetings

Season greetings everyone....


Thanks for everything,
Giga Frequency...

Wednesday, December 14, 2011

Do you think school is boring or killing creativity?

Most people go to school but don't know why, some say it is because they want to get a better Job, get riches while others don't even know why. Some that are in school don't have a good reason why they are studying their current discipline, they just choose the discipline because of their friends, parents etc...
Well, not withstanding, my personal views on the present educational system is that it has failed to equip anybody with the desperately needed   "  real  "   learning. They don't teach you to be creative or innovative they just teach you some boring old crap that someone else invented or created a long time ago (or  even recently); they don't teach you teamwork, most make you work in isolation(like as if anything good comes out of that !). Nobody really teaches you to go into uncharted waters, go into unexplored terrains and just be creative.
I have tried several time to encourage my class mates to be more creative and innovative and not just depend on only the old crap that is been thought in school. They tend to see no point in being innovative, after all when they get all the As they graduate and start looking for a job, some even think i am wasting my precious time trying to learn other stuff and trying to be more creative. They also see me as someone wasting time learning other stuffs that are not in the syllabus for the semester(even if it will be needed in my discipline after i have graduated) instead of focusing on reading to get an "  A "  in all my courses(how sad; Is school all about getting As ?)...
To buttress my point, i will post this cool video i saw on youtube.com about schools...simply put "   Schools kill creativity "  . Tell me what your views are by leaving your comment below this post.
Enjoy...




Don't forget to check out our post for the month, click here

New addition:twitter

Good morning everyone, hope you are enjoying the festive season of Christmas...
Giga Frequency is now on twitter so you can follow us, to follow us click on the small twitter icon at the top of the blog and it will take you straight to our twitter page...
You can also follow us directly on twitter @gigafrequency, if you wish to go to our twitter page point your browser to this location http://www.twitter.com/gigafrequency

Thanks,
Giga Frequency...

Tuesday, December 13, 2011

New addition:mobile view

mobile preview
Due to complains from our viewers/members about the difficulty of viewing/loading this blog on a mobile device, changes have been made and the mobile version of this blog has been created and optimized for your mobile devices....
If you are still having problems viewing the mobile version, please send your feedback to me by leaving a comment below this post or by using the form on the contact page of this blog and i will make the changes as quickly as possible...

Thanks,
Giga Frequency.....

Friday, December 9, 2011

The C beginings...

Hello everyone, i have been posting stuffs about IT news and others.. Well i want to start the day off by discussing a very cool Language, the C language.
C is a general-purpose programming language which spots features such as
  • economy of expression
  • modern flow control and data structures 
  • and a rich set of operators. 
C is not a " very high level '' language, it is small(i.e. it is compact and tiny) , and is not specialized to any particular area of application. But its absence of restrictions and its generality make it more convenient and effective for many tasks than supposedly more powerful languages.

C was originally designed for and implemented on the UNIX operating system on the DEC
PDP-11, by Dennis Ritchie. The operating system, the C compiler - a compiler is a piece of software that converts human readable high language into machine readable language(code) , and essentially all UNIX
applications programs are written in C.
Production compilers also exist for several other machines, including the IBM System/370, the Honeywell 6000, and the Interdata 8/32. C is not tied to any particular hardware or system, however, and it is easy to write programs that will run without change on any machine that supports C.

...i will continue this c stuff later posts....stay tuned...
....to search all the categories on this blog click here

Monday, December 5, 2011

New addition:customised comments


Customized commenting style was added to this blog to make the chat experience in the chat room pages more easier and graphical. Now you can add images, colored text and other kind of customization to the comments you post on this blog.
Your Ideas and questions are very important to you and to us, we believe that with rich graphics and text formatting we will be able to give you an avenue to better share your thoughts, ask/explain your questions and better understand the answers/solutions to your questions posted on this blog. After-all, this blog is all about helping you learn at the fastest frequency/pace....
Below are the syntax used to make the graphically comments, if you are finding it difficult to use any of them, then leave a comment below this post and i will explain it in details to you....

Cheers.....
Giga Frequency......

This are the code/tags/syntax, they are like HTML tags except that they use square brackets [ ].

  • To input Images in your comment, use this tag     [im] ...image link/url... [/im]

  • To get a text scrolling effect(from left to right), use this tag    [ma]  ....text...  [/ma]

  • To get a text scrolling effect from the right to the left, use this tag    [ma+]  ...text...  [/ma+]

  • To decide the font size of the text, use this tag{you can change the numbers, larger number give larger font sizes}         [si=" 2 "]  ... text ...  [/si]

  • To choose the text color, you can change to any color you want        [co=" red "]  ... text ...  [/co]

  • To centralize the text in the comment box       [ce]   ... text ...   [/ce]

  • To place your comment in a box with boarders, use this tag       [box]    ... text ...   [/box]

  • To mark the comment       [mark]   ... text ...    [/mark]

  • To place a background color behind a text in a comment (you can change to any color you want    ), use                                                                             [card=" blue "]  ... text ...  [/card]

  • To get image to fit the column of a comment box (i.e width=100%), use                                                         [im#] ...  image link/url  ... [/im]

  • To Highlight the words in a comment, use      [hi=" yellow "]  ...  text  ...   [/hi]
Note:
The height of an image cannot be determined so please post an image with a reasonable height

The image and text effects does not show in the preview tab, it is until you publish the post before it shows

Sunday, December 4, 2011

How does pinging work on a blackberry ?


First and foremost, i will define what a BlackBerry Messenger is because a PIN cannot go without it, BlackBerry Messenger is an instant messenger program for BlackBerry-to-BlackBerry communication utilizing your PIN code, for a more detailed explanation click here. BlackBerry Messenger is built into some of the newer devices. If your device does not come preloaded with BlackBerry Messenger, you can download it here


Now that brings us to what a PIN is,  a PIN is an eight digit alpha-numeric sequence that is assigned to every BlackBerry device. You can find your PIN code by going to
Options>Status>PIN   your PIN will appear in the status screen.
You can also find your PIN code by typing " mypin " into an email (without the quotes), the BlackBerry will automatically insert your PIN code.


When you ping, here is what is happening; your message goes from your device through your network carrier, then it passes through a relay to the receiver's carrier network and finally into the recipient black berry phone/device.

Here are some points to note about a ping:
  • PIN messaging does not go through your corporate environment, so you are able to PIN to PIN when your BlackBerry Enterprise Server (BES) or Mail Server is down.

  • PIN to PIN messaging is NOT 3DES or AES encrypted. It is only encrypted using a hash. SMS is plain text, so PIN is more secure but a hash is a low level of encryption. It is remotely possible for anyone to intercept it, you should keep it in mind and not send sensitive information in a PIN to PIN message.

  • PIN to PIN messages, SMS message and phone call logs are now able to be logged and audited in  BlackBerry Enterprise Server (BES) 4.1. The logging is off by default but you can assign an IT policy to any user to start logging their PIN, SMS and call logs.
  • If you are on a BlackBerry Enterprise Server (BES), you should assume none of your data is private as it all goes through the BES. On the other hand, if you are on a BlackBerry Internet Service (BIS), conversations are not stored on the device, so they should be relatively private. 
click here for other related posts
OR
you can just browse through all the posts on this blog here

    Saturday, December 3, 2011

    Video album:Nano technology

    Hello guys, today i wanna talk about Nano technology, a topic i fancy so much... Here goes...

    Nanotechnology, or sometimes nanotech as some people call it, refers to a field of applied science which focuses on the control of matter on an atomic and molecular scale. Generally nanotechnology deals with structures about 100 nanometers or smaller, and involves developing materials or devices within these small size range, isn't that amazing.

    Nanotechnology is an extremely diverse and multidisciplinary field, ranging from novel extensions of conventional device physics, to completely new approaches based upon molecular self-assembly, to developing new materials with dimensions on the nanoscale, or the scale of nothing, even to speculation on whether we can directly control matter on the atomic scale.

    Nanotechnology has the potential to create many new materials and devices with wide-ranging applications, such as in medicine, electronics, and energy production the list goes on and on and is only limited by imagination. On the other hand, nanotechnology raises many of the same issues as with any other new and developing technology, including concerns about the toxicity and environmental impact of nanomaterials, and their potential effects on global economics.

    Check out this video from youtube about Nano technology, Enjoy....


    Blackberry Messenger - download

    BlackBerry Messenger combines the reliability and exceptional user experience of BlackBerry with the familiar look-and-feel of instant messaging programs that most people are already used to.

    It's designed to allow you to have a PIN-to-PIN messaging conversation with another BlackBerry user.
    It also supports group chat, File Transfers, Checking your message delivery status and your Contact status. You can also search for PIN, by searching the PIN stacks, adding the PINs of members of  Pinstack.com 
    It is totally free
    To download Blackberry Messenger, click here

    You can also download directly to your BlackBerry, to download directly to your blackberry point your Blackberry browser to:

    blackberry.com/messenger