Sunday, April 5, 2009
REINSTALLING GRUB
>> open up the terminal AND TYPE COMMAND
sudo fdisk -l
and check the linux system in it
if linux is there then type next command
$ sudo grub
-find /boot/grub/stage1
(hdx,y)
- root (hdx,y)
- setup (hdx)
- quit
- exit
thats all you need to and you will get you linux back and your window will be there too....
Sunday, March 8, 2009
C++ program
#include"iostream.h"
void main()
{
char a[32];
int x = 0;
Wednesday, February 25, 2009
crossover linux professional ( run .EXE Ffiles on linux)
CrossOver Linux Professional delivers a complete web browsing experience by making the full range of Windows Web Browser Plugins available on Linux. Plugins are programs that extend the capabilities of a browser or email client -- for example, to play movies or view Word documents.
CrossOver works by running the actual Windows applications. Because no CPU emulation is involved they run at full speed on your system. They also integrate with your mail client and desktop environment, making it possible to view Word, Excel or PowerPoint attachments, or to open these file types from the KDE or Gnome desktop or file managers. CrossOver Linux Professional further acts as a bridge between the native browser (e.g. Mozilla) and Windows plugins (e.g. QuickTime) so that you can use them in your favorite browser.
Tuesday, February 24, 2009
program to inter lines in files in read and write the lines for file!
#include"fstream.h"
#include"string.h"
int main()
{
ofstream fout;
fout.open("gne.txt");
char ch[50];
int len,count=0,sp=0,line=0;
fout<<"guru nanak dev engg. college \n ludhiana \n bracnh \n d2IT ";
fout.close();
ifstream fin;
fin.open("gne.txt");
while(!fin.eof())
{
fin.getline(ch,80);
cout<
else
count++;
}
line++;
Sunday, February 15, 2009
LEX And YACC
What is Lex?
Lex is officially known as a "Lexical Analyser".
It's main job is to break up an input stream into more usable elements.
Or in, other words, to identify the "interesting bits" in a text file.
For example, if you are writing a compiler for the C programming language, the symbols { } ( ) ; all have significance on their own. The letter a usually appears as part of a keyword or variable name, and is not interesting on it's own. Instead, we are interested in the whole word. Spaces and newlines are completely uninteresting, and we want to ignore them completely, unless they appear within quotes "like this"
All of these things are handled by the Lexical Analyser.
What is Yacc?
Yacc is officially known as a "parser".
It's job is to analyse the structure of the input stream, and operate of the "big picture".
In the course of it's normal work, the parser also verifies that the input is syntactically sound.
Consider again the example of a C-compiler. In the C-language, a word can be a function name or a variable, depending on whether it is followed by a ( or a = There should be exactly one } for each { in the program.
YACC stands for "Yet Another Compiler Compiler". This is because this kind of analysis of text files is normally associated with writing compilers.
However, as we will see, it can be applied to almost any situation where text-based input is being used.
For example, a C program may contain something like:
{ int int; int = 33; printf("int: %d\n",int); }In this case, the lexical analyser would have broken the input sream into a series of "tokens", like this:
{ int int ; int = 33 ; printf ( "int: %d\n" , int ) ; } Note that the lexical analyser has already determined that where the keyword int appears within quotes, it is really just part of a litteral string. It is up to the parser to decide if the token int is being used as a keyword or variable. Or it may choose to reject the use of the name int as a variable name. The parser also ensures that each statement ends with a ; and that the brackets balance.
Lex and yacc are tools for building programs. Their output is itself code, which needs to be fed into a compiler; typically, additional user code is added to use the code generated by lex and/or yacc. Some simple programs can get by on almost no additional code; others use a parser as a tiny portion of a much larger and more complicated program.