Showing posts with label Programming Concepts. Show all posts
Showing posts with label Programming Concepts. Show all posts

Tuesday, July 26, 2011

Splash Screen In Java

Splash screens are simple graphics which load quickly upon startup, and assure the user that the application is loading promptly. The SplashScreen class was added to JSE 6, and should be used if available.

If JSE 6 is not available, then the following technique is provided as an alternative.

Various policies for controlling the appearance and disappearance of the splash screen are possible. Here, the splash screen disappears when a main window has finished loading.

This example is also of interest since it demonstrates clearly that the launch thread is unusual - it is distinct from the event dispatch thread, where most of the work of a Swing application takes place :

upon launch, the launch thread shows a splash screen, which activates the event dispatch thread
once the splash screen is showing (or, more precisely, is "realized"), the launch thread acts as a "worker thread", and can only close the splash screen indirectly, using EventQueue.invokeLater to properly inject an event into the event dispatch thread


For sample code drop a comment

Friday, February 13, 2009

Understanding Yacc

The term Yacc here, is related to UNIX.Its full form is "Yet Another COmpiler Compiler" and it works as a standard parser generator for the Unix operating system.This code is written by Stephen Johnson at American Telephone and Telegraph (AT&T) and available as an open source.Its whole coding is written in C language.Various versions of Yacc is written for other programing languages like Java and ADA.

Analog to Digital Converters

An analog to digital converter(ADC,A/D or A2D) converts an analog signal to digital signal,and a digital to analog converter(DAC,D/A or D2A) does the opposite.Such type of conversions are necessary because while embedded systems deal with digital values,an embedded system's surroundings typically involves many analog signals.Analog refers to a continuous valued signal such as temperature or speed,with infinite possible values in between.Digital refers to discretely valued signals,such as integers and in computing systems,these signals are encoded into binary.By converting between analog and digital signals,we can use digital processors in an analog environment.

Tuesday, September 30, 2008

Batch File Programming Part-7

Redirection:
Normally the Output is sent to the screen(The standard STDOUT)and the Input is read from the Keyboard(The standard STDIN). This can be pretty boring. You can actually redirect both the Input and the Output to something other than the standard I/O devices.
To send the Output to somewhere other than the screen we use the Output Redirection Operator, > which is most commonly used to capture results of a command in a text file. Say you want to read the help on how to use the net command, typing the usual Help command is not useful as the results do not fit in one screen and scroll by extremely quickly. So instead we use the Output Redirection operator to capture the results of the command in a text file.

c:\windows>net > xyz.txt
This command will execute the net command and will store the results in the text file, xyz.txt . Whenever DOS comes by such a command, it checks if the specified file exists or not. If it does, then everything in the file is erased or lost and the results are stored in it. If no such file exists, then DOS creates a new file and stores the results in this new file.
Say, you want to store the results of more than one command in the same text file, and want to ensure that the results of no command are lost, then you make use of the Double Output Re Direction Symbol, which is the >> symbol.

For Example:
c:\windows> net >> xyz.txt
The above command tells DOS to execute the net command and append the output to the xyz.txt file, if it exits.DOS not only allows redirection to Files, but also allows redirection to various devices.

DEVICE NAME USED DEVICE:
AUX Auxiliary Device (COM1)
CLOCK$ Real Time Clock
COMn Serial Port(COM1, COM2, COM3, COM4)
CON Console(Keyboard, Screen)
LPTn Parallel Port(LPT1, LPT2, LPT3)
NUL NUL Device(means Nothing)
PRN Printer

Say for example, you want to print the results of directory listings, then you can simply give the following command:

c:\windows>dir *.* > prn
The NUL device(nothing) is a bit difficult to understand and requires special mention. This device which is also known as the 'bit bucket' literally means nothing. Redirection to the NUL device practically has no usage
but can be used to suppress the messages which DOS displays on the completion of a task.
For example:
when DOS has successfully copied a particular file, then it displays the message: '1 file(s) copied.'
Now say you want to suppress this task completion message, then you can make use of the NUL device.

c:\windows>copy file.txt > NUL
This will suppress the task completion message and not display it.

Redirecting Input:
Just like we can redirect Output, we can also redirect Input. It is handled by the Input Redirection Operator,which is the < style="font-weight: bold;"> c:\windows>more <>
This command sends the contents of the xyz.txt file to the MORE command which displays the contents page by page. Once the first page is read the MORE command displays something like the following on the screen: ......MORE...... You can also send key strokes to any DOS command which waits for User Input or needs User intervention to perform a task. You can also send multiple keystrokes.
For example:
a typical Format command requires 4 inputs, firstly pressing Enter to give the command, then Disk Insertion prompt, then the VOLUME label prompt and lastly the one to format another disk. So basically there are three User inputs-: ENTER, ENTER N and ENTER.(ENTER is Carriage return)So you can include this in a Batch file and give the format command in the following format: c:\windows>format a: <>.
In the next post we will finish our Batch File Programming Concepts.

Batch File Programming Part-6

The CHOICE Command:
Before we learn how to make use of the CHOICE command, we need to what error levels really are. Now Error levels are generated by programs to inform about the way they finished or were forced to finish their execution. For example, when we end a program by pressing CTRL+C to end a program, the error level code evaluates to 3 and if the program closes normally, then the error level evaluates to 0. These numbers all by themselves are not useful but when used with the IF ERROR LEVEL and the CHIOCE command, they become very kewl.

The CHOICE command takes a letter or key from the keyboard and returns the error level evaluated when the key is pressed. The general syntax of the CHOICE command is:

CHOICE[string][/C:keys][/S][/N][/T:key,secs]

The string part is nothing but the string to be displayed when the CHOICE command is run.

The /C:keys defines the possible keys to be pressed. If options are mentioned then the default Y/N keys are used instead.

For example, The command,
CHOICE /C:A1T0

Defines A, 1, T and O as the possible keys. During execution if the user presses a undefined key, he will hear a beep sound and the program will continue as coded.

The /S flag makes the possible keys defined by the CHOICE /c flag case sensitive. So it means that if the /S flag is present then A and a would be different.

The /N flag, if present shows the possible keys in brackets when the program is executed. If the /N flag is missing then, the possible keys are not shown in brackets. Only the value contained by STRING is shown.

/T:key,secs defines the key which is taken as the default after a certain amount of time has passed.

For Example:
CHOICE Choose Browser /C:NI /T:I.5

The above command displays Choose Browser[N,I] and if no key is pressed for the next 5 seconds, then it chooses I.Now to truly combine the CHOICE command with the IF ERROR LEVEL command, you need to know what the CHOICE command returns.The CHOICE command is designed to return an error level according to the pressed key and its position in the /C flag.
To understand this better, consider the following example,

CHOICE /C:AN12

Now remember that the error level code value depends on the key pressed. This means that if the key A is pressed, then the error level is 1, if the key N is pressed then the error level is 2, if 1 is pressed then error level is 3 and if 2 is pressed then error level is 4.

Now let us see how the IF ERROR LEVEL command works. The general syntax of this command is:

IF [NOT] ERRORLEVEL number command.

This statement evaluates the current error level number. If the condition is true then the command is executed.
For Example:
IF ERRORLEVEL 3 ECHO Yes

The above statement prints Yes on the screen if the current error level is 3.

The important thing to note in this statement is that the evaluation of an error level is true when the error level us equal or higher than the number compared.

For Example: in the following statement,

IF ERRORLEVEL 2 ECHO YES
The condition is true if the error level is > or = 2.

Now that you know how to use the CHOICE and ERROR LEVEL IF command together, you can now easily create menu based programs. The following is an example of such a batch file which asks the User what browser to launch.

@ECHO OFF
ECHO.
ECHO.
ECHO Welcome to Browser Selection Program
ECHO.
ECHO 1. Internet Explorer 5.5
ECHO 2. Mozilla 5
ECHO x. Exit Browser Selection Program
ECHO.
CHOICE "Choose Browser" /C:12x /N
IF ERRORLEVEL 3 GOTO END
IF ERRORLEVEL 2 START C:\progra~1\Netscape
IF ERRORLEVEL 1 start c:\progra~1\intern~1\iexplore.exe
:END

NOTE: Observe the order in which we give the IF statements.

In the next post we will see some more concepts of Batch File Programming.

Sunday, September 28, 2008

Batch File Programming Part-5

IF: CONDITIONAL BRANCHING
The If statement is a very useful command which allows us to make the batch files more intelligent and useful. Using this command one can make the batch programs check the parameters and accordingly perform a task. Not only can the IF command check parameters, it can also checks if a particular file exists or not. On top of all this, it can also be used for the conventional checking of variables (strings).

Checking If a File Exists Or Not
The general syntax of the IF command which checks for the existence of a file is the following:

IF [NOT] EXIST FILENAME Command

This will become clearer when we take up the following example,

IF EXIST c:\autoexec.bat ECHO It exists
This command checks to see if the file, c:\autoexec.bat exists or not. If it does then it echoes or prints the string 'It exists'. On the other hand if the specified file does not exist, then it does not do anything.

In the above example, if the file autoexec.bat did not exist, then nothing was executed. We can also put in the else clause i.e. If the File exists, do this but if it does not exists, by using the GOTO command. Let's consider the following example to make it more clear:

@echo off
IF EXIST C:\saurav.doc GOTO Saurav
Goto end
:Saurav
ECHO Saurav
:end

The IF statement in this code snippet checks to see if there exists a file, c:\saurav.doc. If it does then DOS is branched to :SAURAV and if it does not, then DOS goes on to the next line. The next line branches DOS to :end. The :end and :SAURAV in the above example are called labels. After the branching the respective echo statements take over.

HACKING TRUTH: We can also check for more than one file at a time, in the following way:

IF EXIST c:\autoexec.bat IF EXIST c:\autoexec.bak ECHO Both Exist

We can check to see if a file does not exist in the same way, the basic syntax now becomes:

IF NOT EXIST FILENAME Command
For Example:

IF NOT EXIST c:\saurav.doc ECHO It doesn't Exist

HACKING TRUTH: How do you check for the existence of directories? No something like IF C:\windows EXISTS ECHO Yes does not work. In this case we need to make use of the NULL device. The NULL device is basically nothing, it actually stands for simply nothing. Each directory has the NULL device present in it. (At least DOS thinks so.) So to check if c:\windows exits, simply type:

IF EXIST c:\windows\nul ECHO c:\Windows exists.
One can also check if a drive is valid, by giving something like:

IF EXIST c:\io.sys ECHO Drive c: is valid.

Comparing Strings to Validate Parameters:
The basic syntax is:

IF [NOT] string1==string2 Command


Now let's make our scripts intelligent and make them perform a task according to what parameter was passed by the User. Take the following snippet of code for example,

@ECHO off

IF %1==cp GOTO COPY
GOTO DEL
:COPY
Copy %2 a:
GOTO :END
:DEL
Del %2
:END

This example too is pretty much self explanatory. The IF Statement compares the first parameter to cp, and if it matches then DOS is sent to read the COPY label else to the DEL label. This example makes use of two parameters and is called by passing at least two parameters.

We can edit the above example to make DOS check if a parameter was passed or not and if not then display an error message. Just add the following lines to the beginning of the above file.

@ECHO OFF

IF "%1" == "" ECHO Error Message Here

If no parameter is passed then the batch file displays an error message. Similarly we can also check for the existence of the second parameter.

This command too has the NOT clause.

In the next post we will see some more concepts of Batch File Programming.

Thursday, September 25, 2008

Batch File Programming Part-3

The PAUSE Command: Freezing Time
Say you create a batch file which shows the Directory Listing of a particular folder(DIR) before performing some other task. Or sometimes before deleting all files of a folder, you need to give the user time to react and change his mind. PAUSE, the name says it all, it is used to time out actions of a script.

Consider the following scenario:
REM This Batch program deletes *.doc files in the current folder.
REM But it gives the user to react and abort this process.

@ECHO OFF

ECHO WARNING: Going to delete all Microsoft Word Document
ECHO Press CTRL+C to abort or simply press a key to continue.

PAUSE
DEL *.doc
Now when you execute this batch program, we get the following output:

C:\WINDOWS>a.bat

WARNING: Going to delete all Microsoft Word Document

Press CTRL+C to abort or simply press a key to continue.
Press any key to continue . . .

The batch file program actually asks the user if he wishes to continue and gives the user the option to abort the process. Pressing CTRL+C cancels the batch file program(CTRL+C and CTRL+Break bring about the same results)

^C

Terminate batch job (Y/N)?y
After this you will get the DOS prompt back.

HACKING TRUTH: Say you have saved a batch file in the c:\name directory. Now when you launch command.com the default directory is c:\windows and in order to execute the batch file program stored in the c:\name directory you need to change the directory and go to c:\name.This can be very irritating and time consuming. It is a good practice to store all your batch programs in the same folder. You can run a batch file stored in any folder(Say c:\name) from anywhere(even c:\windows\history) if you include the folder in which the batch file is stored (c:\name)in the AUTOEXEC.BAT file, so that DOS knows which folder to look for the batch program.

So simply open c:\autoexec.bat in Notepad and append the Path statement to the
following line[c:\name is the folder in which all your batch files are stored.]:

SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\name

Autoexec.bat runs each time at startup and DOS knows each time, in which

directory to look for the batch files.

Parameters: Giving Information to Batch Programs

To make batch programs really intelligent you need to be able to provide them with parameters which are nothing but additional valuable information which is needed to ensure that the bath program can work efficiently and flexibly.

To understand how parameters work, look at the following script:

@ECHO OFF
ECHO First Parameter is %1
ECHO Second Parameter is %2
ECHO Third Parameter is %3

The script seems to be echoing(printing) messages on the screen, but what do the strange symbols %1 , % 2 etc stand for? To find out what the strange symbols stand for save the above script and go to DOS and execute this script by passing the below parameters:

C:\windows>batch_file_name abc def ghi

This batch file produces the following result:

C:\windows>batch_file_name abc def ghi

First Parameter is abc
Second Parameter is def
Third Parameter is ghi

The first line in the output is produced by the code line:

ECHO First Parameter is %1

Basically what happens is that when DOS encounters the %1 symbol, it examines the original command used to execute the bath program and look for the first word (argument) after the batch filename and then assigns %1 the value of that word. So one can say that in the ECHO statement %1 is replaced with the value of the first argument. In the above example the first word after the batch file name is abc, therefore %1 is assigned the value of this word.

The %2 symbol too works in the similar way, the only difference being that instead of the first argument, DOS assigns it the value of the second argument, def. Now all these symbols, %1, %2 are called replaceable parameters. Actually what happens is that %1 is not assigned the value of the first argument, but in fact it is replaced by the value of the first argument.

If the batch file command has more parameters than what the batch file is looking for, then the extras are ignored. For example, if while executing a batch file program , we pass four arguments, but the batch file program requires only 3 parameters, then the fourth parameter is ignored.

To understand the practical usage of parameters, let's take up a real life example. Now the following script requires the user to enter the name of the files to be deleted and the folder in which they are located.

@ECHO OFF
CD\
CD %1
DEL %2

This script can be called from the DOS prompt in the following way:

C:\windows>batch_file_name windows\temp *.tmp

In a single script we cannot use more that nine replaceable parameters. This means that a particular batch file will have replaceable parameters from %1 to %9.Infact there is a tenth replaceable parameter, the %0 parameter. The %0 parameter contains the name of the batch file itself.

HACKING TRUTH: Say you want to execute a batch file and once the procedure of execution is complete, want to leave DOS and return to Windows, what do you do?
The EXIT command can be used in such situations. So simply end your batch file
with the EXIT command.

EXIT

In the next post we will see some more concepts of Batch File Programming.

Wednesday, September 24, 2008

Batch File Programming Part-2

Now let's execute this batch file and see what results it shows. Launch command.com (DOS) and execute the batch file by typing:

C:\WINDOWS>batch_file_name
You would get the following result:
C:\WINDOWS>scandisk
And Scandisk is launched. So now the you know the basic functioning of Batch files, let' move on to Batch file commands.

The REM Command:
The most simple basic Batch file command is the REM or the Remark command. It is used extensively by programmers to insert comments into their code to make it more readable and understandable. This command ignores anything there is on that line. Anything on the line after REM is not even displayed on the screen during execution. It is normally not used in small easy to understand batch programs but is very useful in huge snippets of code with geek stuff loaded into it. So if we add Remarks to out first batch file, it will become:

REM This batch file is my first batch program which launches the fav hacking tool; Telnet

telnet

The only thing to keep in mind while using Remarks is to not go overboard and putting in too many of them into a single program as they tend to slow down the execution time of the batch commands.


ECHO: The Batch Printing Tool

The ECHO command is used for what the Print command is in other programming languages: To Display something on the screen. It can be used to tell the user what the bath file is currently doing. It is true that Batch programs display all commands it is executing but sometimes they are not enough and it is better to also insert ECHO commands which give a better description of what is presently being done. Say for example the following batch program which is full of the ECHO command deletes all files in the
c:\windows\temp directory:

ECHO This Batch File deletes all unwanted Temporary files from your system ECHO Now we go to the Windows\temp directory.

cd windows\temp

ECHO Deleting unwanted temporary files....

del *.tmp

ECHO Your System is Now Clean
Now let's see what happens when we execute the above snippet of batch code.

C:\WINDOWS>batch_file_name
C:\WINDOWS>ECHO This Batch File deletes all unwanted Temporary files from your system

C:\WINDOWS>ECHO Now we go to the Windows\temp directory.
Now we go to the Windows\temp directory.

C:\WINDOWS>cd windows\temp

Invalid directory

C:\WINDOWS>ECHO Deleting unwanted temporary files

Deleting unwanted temporary files...

C:\WINDOWS>del *.tmp

C:\WINDOWS>ECHO Your System is Now Clean

Your System is Now Clean



The above is a big mess! The problem is that DOS is displaying the executed command and also the statement within the ECHO command. To prevent DOS from displaying the command being executed, simply precede the batch file with the following command at the beginning of the file:

ECHO OFF

Once we add the above line to our Temporary files deleting Batch program , the
output becomes:

C:\WINDOWS>ECHO OFF
This Batch File deletes all unwanted Temporary files from your system
Now we go to the Windows\temp directory.

Invalid directory
Deleting unwanted temporary files...

File not found
Your System is Now Clean

Hey pretty good! But it still shows the initial ECHO OFF command. You can prevent a particular command from being shown but still be executed by preceding the command with a @ sign. So to hide even the ECHO OFF command, simple replace the first line of the batch file with @ECHO OFF

You might think that to display a blank line in the output screen you can simply type ECHO by itself, but that doesn't work. The ECHO command return whether the ECHO is ON or OFF. Say you have started your batch file with the command ECHO OFF and then in the later line give the command ECHO, then it will display ' ECHO is off ' on the screen. You can display a blank line by giving the command ECHO.(ECHO followed by a dot)Simply leaving a blank line in the code too displays a blank line in the output.

In the next post we will see some more concepts of Batch File Programming.

Tuesday, September 23, 2008

Batch File Programming Part-1

Hello friends in the next five or six post i am going to give you a complete explanation on Batch File Programming.Here if you read it carefully and try to understand it then i am sure that you became the master of Batch File Programming.

Batch file programming is nothing but the Windows version of Unix Shell Programming. Let's start by understanding what happens when we give a DOS command. DOS is basically a file called command.com It is this file (command.com) which handles all DOS commands that you give at the DOS prompt---such as COPY, DIR, DEL etc. These commands are built in with the Command.com file. (Such commands which are built in are called internal commands.).DOS has something called external commands too such as FORMAT, UNDELETE, BACKUP etc. So whenever we give a DOS command either internal or external, command.com either straightaway executes the command (Internal Commands) or calls an external separate program which executes the command for it and returns the result (External Commands.) So why do I need Batch File Programs?

Say you need to execute a set of commands over and over again to perform a routine task like Backing up Important Files, Deleting temporary files(*.tmp, .bak , ~.* etc) then it is very difficult to type the same set of commands over and over again. To perform a bulk set of same commands over and over again, Batch files are used. Batch Files are to DOS what Macros are to Microsoft Office and are used to perform an automated predefined set of tasks over and over again.So how do I create batch files? To start enjoying using Batch files, you need to learn to create Batch files. Batch files are basically plain text files containing DOS commands. So the best editor to write your commands in would be Notepad or the DOS Editor (EDIT) All you need to remember is that a batch file should have the extension .BAT(dot bat)Executing a batch file is quite simple too. For example if you create a Batch file and save it with the filename batch.bat then all you need to execute the batch file is to type:

C:\windows>batch.bat
So what happens when you give a Batch file to the command.com to execute?
Whenever command.com comes across a batch file program, it goes into batch mode. In the batch mode, it reads the commands from the batch file line by line. So basically what happens is, command.com opens the batch file and reads the first line, then it closes the batch file. It then executes the command and again reopens the batch file and reads the next line from it. Batch files are treated as Internal DOS commands.



Hacking Truth: While creating a batch file, one thing that you need to keep in mind is that the filename of the batch file should not use the same name as a DOS command. For example, if you create a batch file by the name dir.bat and then try to execute it at the prompt, nothing will happen.This is because when command.com comes across a command, it first checks to see if it is an internal command. If it is not then command.com checks if it a .COM,
.EXE or .BAT file with a matching filename.All external DOS commands use either a .COM or a .EXE extension, DOS never bothers to check if the batch program exits.

Now let's move on to your first Batch file program. We will unlike always(Normally we begin with the obligatory Hello World program) first take up a simple batch file which executes or launches a .EXE program. Simply type the following in a blank text file and save it with a .BAT extension.

C:
cd windows
telnet

Now let's analyze the code, the first line tells command.com to go to the C:
Next it tells it to change the current directory to Windows. The last line tells it to launch the telnet client. You may contradict saying that the full filename is telnet.exe. Yes you are right, but the .exe extension is automatically added by command.com. Normally we do not need to change the drive and the directory as the Windows directory is the default DOS folder.

In the next post i will continue with its remaining part.

Thanks

Friday, June 27, 2008

What TCP/IP Networking is?

Hello friends in this post i am going to tell you about the most important part of any Computer Networking that is TCP/IP Networking.Here in this post we will see what is TCP/IP networking,how it works and many other things related to it.

First of all to understand the TCP/IP networking we have to understand the TCP/IP protocol.In the simplest word we can say that TCP/IP protocol is the basic communication language or protocol of the Internet.TCP/IP protocol is also used as a communications protocol in a private network either an intranet or extranet.Whenever you tried to access internet a TCP/IP program copy is provided to your computer just as every other computer so that you can send messages or get information from also has a copy of TCP/IP.Now come to our issue TCP/IP networking is a two layer program.
The higher layer that is the Transmission control protocol layer manages the assembling of a message or file into smaller packets that are transmitted over the Internet and received by a TCP layer that reassembles the packets into the original message.The lower layer, Internet Protocol, handles the address part of each packet so that it gets to the right destination.TCP/IP networking uses the client server model of communication in which a computer user (a client) requests and is provided a service (such as sending a Web page) by another computer (a server) in the network.It is also said that TCP/IP communication is a point to point communication that means from one point(host computer) in the network to the other point(host computer).
TCP/IP and the higher-level applications that use it are collectively said to be "stateless" because each client request is considered a new request unrelated to any previous one.In addition to this TCP/IP protocol also includes the HTTP(Hyper Text Transfer Protocol),FTP(File Transfer Protocol),Telnet for remote login and the SMTP(Simple Mail Transfer Protocol).

Sunday, May 25, 2008

What Python is?

If any person had a little bit knowledge of programming then he or she is definitely heard about the Python.In this post i am going to told you about what python is, when it was developed, reasons behind development and many other things.

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python was first developed by Guido van Rossum in 1991.Like Perl, Python source code is now available under the GNU General Public License (GPL).

Python supports modules and packages, which encourages program modularity and code reuse.Python is most preferred by programmers because of the increased productivity it provides. Similar to perl it has no compilation stage due to which the edit-test-debug cycle is incredibly fast. Python can easily run on Windows, Linux/Unix, Mac OS X, OS/2, Amiga, Palm Handhelds, and Nokia mobile phones. Python has also been ported to the Java and .NET virtual machines. In addition with perl, python is also similar to java.

A person having basic knowledge of both can easily learn python.In addition to all of these python provides you advanced programming features such as generators and list comprehensions, automatic memory management frees you from having to manually allocate and free memory in your code and many other features. It is assumed that python is great for both shell and web scripting. Now a days it makes its way in way into every facet of computing from Google to video games.

What Perl is?

If any person had a little bit knowledge of programming then he or she is definitely heard about the PERL.In this post i am going to told you about what perl is, when it was developed, reasons behind development and many other things.

Perl is a dynamic programming language which was developed by Larry Wall in 1987.Actually perl was developed 4 years before the development of LINUX.Perl stands for Practical Extraction and Reporting Language, the meaning of this expansion is that perl is an interpreted programming language with a huge number of uses, libraries and resources.The main reason that is assumed behind the development of PERL is that Mr Wall was unhappy with the functionality of sed, C, awk and the Bourne Shell that these languages offered.

Then after this they decide to made a language that contains advantage of all these languages. The main popularity that the perl earned when it is used as a language for writing server-side scripts for web-servers. In addition to this perl is also used for system administration tasks, managing database data, as well as writing GUI applications. Perl also consists of various capabilities like it can store strings and data structures that are unlimited in size, nested to any depth, it has powerful syntax and built-in functions, it also provide support for namespaces, classes, and objects, it can run on almost any platform imaginable and has relatively portable and secure code.

As all we know perl is an interpreted language so no compilation is needed here. The programs that are written in Perl are known as Perl scripts and the term perl program refers to the system program named perl for executing Perl scripts. Now if you had any previous experience on shell scripts or awk or sed or similar (Unix) utilities for various purposes, you will find that you can normally use Perl for those and many other purposes, and the code tends to be more compact.

Saturday, May 24, 2008

What Shell Script is?

Hello friends in this post i am going to tell about the shell script,what
exactly shell script means and many other things about shell script.

As a computer programmer we definitely aware of the term Shell Script,what exactly shell script means. First of all before understanding what the shell script is, we must know what is shell. Actually in early days of computation instruction are provided using binary language, which is difficult for all of us, to read and write.So to overcome this problem a special program which is known as SHELL used in the operating systems. Shell accepts instructions or commands from you in English and pass it to the kernel if it is valid.

In other words we can also say that Shell is a user program or it's environment provided for user interaction.Shell is an command language interpreter that executes commands read from the standard input device (keyboard) or from a file.Now we come on to the shell script.Shell Script is series of command written in plain text file. It means you can store a sequence of n commands in the text file in the order in which you want to execute them.After entering all commands you can tell the shell to execute this text file instead of entering the commands. This text file is known as Shell Script.

Shell Script is almost similar to batch files in MS-DOS but shell scripts are more powerful then batch files.Now the main question that arises here why to use shell script, the answer to this problem is very simple by using shell script you can take input from user, file and output them on screen, also useful in to create your own commands, save lots of time,also help you in to automate some task of day today life and with the help of shell script system Administration part can be also automated.

What Linux is?


Hello friends this is my first post and in this post you found various interesting points about LINUX. Hope you enjoy the reading.

It is definite that every computer programmer or a software engineer is definitely aware of Linux.Linux is Unix like operating system and it is developed by Linus Torvalds. The main reason behind the development of Linux is to provide personal computer users a free or very low-cost operating system comparable to traditional and usually more expensive Unix systems. Within the next few years of its developments its made image like of a very efficient and fast performing operating system.

Today LINUX is freely available in the market while you had to pay for other operating systems. The biggest advantage of using LINUX is that you can adjust your LINUX operating system as per your requirement because when you get Linux you will also get source code of Linux, so you can modify OS according to your requirement.Unlike Windows and other proprietary systems, Linux is publicly open and extendibles by contributors. Linux provides you poratble operating system interface that means any program that is written on LINUX can be easily ported to the other operating system.

In addition to all these things it also offers many Free Software applications, programming languages, and development tools etc.When we compare LINUX and UNIX then they almost have all the same features like Unix, Linux is also written in C,both of them are Multi-user/Multitasking/32 or 64 bit Network OS, both of them had rich Development/Programming environment.The only difference between Unix and Linux is that Linux is open source while Unix is not open source.