How do you obtain CPU usage using c?
Read this it might help http://www.codeproject.com/KB/system/processescpuusage.aspx
What is the profit and loss of obeject oriented programming language over structured programming?
Usually when dealing with object oriented code you have a loss of efficiency, but you have the ability to reuse your code. I also find the time that it takes to design the application is more when your using OO.
Should any device be allowed to interrupt CPU while another interrupts are being serviced?
It is possible to allow nested interrupts. This is often done when there is a heirarchy of interrupts, some with higher priority than others. In order for this to work, the second interrupt must not be allowed to influence the progress of the first interrupt. We call this being "thread safe". In a nested scheme, an interrupt mask is set so that higher priority interrupts can be permitted, while blocking interrupts of the same or lower priority, and then interrupts are reenabled during the interrupt service routine. At the conclusion of the first routine, interrupts are disabled again, the mask is restored, and the normal interrupt return sequence is executed.
In the 8085, this can be supported using the Read Interrupt Mask (RIM) and Set Interrupt Mask (SIM) instructions. While not strictly required, the logical priority is often INTR, RST5.5, RST6.6, RST7.5, and then TRAP, in order of increasing priority.
Is there an unlimited efiling program for TurboTax?
Cost of TurboTax CD/Download includes tax preparation and printing of unlimited federal tax returns and free federal efile of up to 5 federal tax returns. ..
You could contact them and ask them about any unlimited efiling program that they may have available to the public for this purpose.
Write a program in java to print a ab ABC?
/* -----a //- is space
* -----ab
* ----abc
* --abcd
* -abcde
*/
import java.io.*;
class RevPyrA
{
protected static void man()throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the limit: ");
byte a=Byte.parseByte(in.readLine());
for(byte i=0;i<a;i++)
{
System.out.println();
for(byte j=a;j>i;j--)
System.out.print(" ");
for(byte j=0;j<=i;j++)
System.out.print((char)(97+j));
}
}}
Code of K'maps i n C plus plus?
#include<iostream>
#include<string.h>
//#include<graphics.h>
//#include<dos.h>
#include<math.h>
using namespace std;
int main()
{
// clrscr();
int c=1,c1=4,c2=1,c3=1,r[2000][10],c4=1,c5=1,p[2000][10],q[2000][10],o[2000][10],t[2000][10],s[2000][10],w[2000][10],i,l=1,j,k,m,u[2000][10],a[2000][10],v,e=0,g=1,f=1,h=0,b[2000][10],z[2000][10],y[6000][5],x[2000][10];
cout<<"Enter 0 for not selecting and 1 for selecting\n";
for(i=0;i<=15;i++)
{
cout<<"Enter the value for "<<i<<":";
cin>>v;
if(v==1)
{
a[c][5]=i;
m=i;
while(c1!=0)
{
a[c][c1]=m%2;
m=m/2;
c1--;
}
c++;
c1=4;
}
}
for(i=1;i<c;i++)
{
for(j=1;j<c;j++)
{
for(k=1;k<=4;k++)
{
if(a[i][k]+a[j][k]==1)
e++;
}
if(e==1)
{
for(k=1;k<=4;k++)
{
if(a[i][k]+a[j][k]!=1)
b[f][g]=a[i][k];
else
b[f][g]=3;
g++;
}
b[f][5]=a[i][5];
b[f][6]=a[j][5];
g=1;
f++;
h++;
}
e=0;
}
if(h==0)
{
for(k=1;k<=4;k++)
x[c2][k]=a[i][k];
c2++;
}
h=0;
}
c=0;
for(i=1;i<f;i++)
{
for(j=1;j<i;j++)
{
for(k=1;k<=4;k++)
{
if(b[i][k]==b[j][k])
c++;
}
if(c!=4)
e++;
c=0;
}
if(e==i-1)
{
for(k=1;k<=6;k++)
u[h+1][k]=b[i][k];
h++;
}
e=0;
}
for(i=1;i<=h;i++)
{
if(u[i][7]!=4)
{
for(j=1;j<=h;j++)
{
if(u[j][7]!=4)
{
if((u[i][6]==u[j][5])(u[i][6]==u[j][5])(u[i][5]==u[j][5])(u[i][5]==u[j][6]))
{
for(k=1;k<=h;k++)
{
if(u[j][6]==u[k][5]u[j][6]==u[k][6]u[j][5]==u[k][5]u[j][5]==u[k][6])
{
for(e=1;e<=h;e++)
{
if(i!=j&&i!=k&&i!=e&&j!=k&&j!=e&&k!=e)
{
if(u[k][6]!=u[e][5]&&u[k][6]!=u[e][6]&&u[k][6]!=u[e][6]&&u[k][6]!=u[e][5])
u[j][7]=4;
}
}
}
}
}
}
}
}
}
cout<<endl;
f=h+1;
e=0;h=0;g=1;l=1;c=1;
for(i=1;i<f;i++)
{
for(j=1;j<f;j++)
{
for(k=1;k<=4;k++)
{
if(u[i][k]+u[j][k]==1)
e++;
if((u[i][k]+u[j][k]==3)(u[i][k]+u[j][k]==4))
e=2;
}
if(e==1)
{
for(k=1;k<=4;k++)
{
if(u[i][k]+u[j][k]!=1&&u[i][k]+u[j][k]!=6)
z[l][g]=u[i][k];
else
z[l][g]=3;
g++;
}
g=1;
l++;
h++;
}
e=0;
}
if(h==0)
{
for(k=1;k<=7;k++)
w[c3][k]=u[i][k];
c3++;
}
h=0;
}
c=0;
for(i=1;i<l;i++)
{
for(j=1;j<i;j++)
{
for(k=1;k<=4;k++)
{
if(z[i][k]==z[j][k])
c++;
}
if(c!=4)
e++;
c=0;
}
if(e==i-1)
{
for(k=1;k<=4;k++)
t[h+1][k]=z[i][k];
h++;
}
e=0;
}
l=h+1;
e=0;h=0;g=1;m=1;c=1;c1=4;
for(i=1;i<l;i++)
{
for(j=i+1;j<l;j++)
{
for(k=1;k<=4;k++)
{
if(t[i][k]+t[j][k]==1)
e++;
if(t[i][k]+t[j][k]==3t[i][k]+t[j][k]==4)
e=2;
}
if(e==1)
{
for(k=1;k<=4;k++)
{
if(t[i][k]+t[j][k]!=1&&t[i][k]+t[j][k]!=6)
y[m][g]=t[i][k];
else
y[m][g]=3;
g++;
}
g=1;
m++;
h++;
}
e=0;
}
if(h==0)
{
for(k=1;k<=4;k++)
r[c4][k]=t[i][k];
c4++;
}
h=0;
}
c=0;h=0;
for(i=1;i<m;i++)
{
for(j=1;j<i;j++)
{
for(k=1;k<=4;k++)
{
if(y[i][k]==y[j][k])
c++;
}
if(c!=4)
e++;
c=0;
}
if(e==i-1)
{
for(k=1;k<=4;k++)
s[h+1][k]=y[i][k];
h++;
}
e=0;
}
f=h+1;
e=0;h=0;g=1;l=1;c=1;
for(i=1;i<f;i++)
{
for(j=1;j<f;j++)
{
for(k=1;k<=4;k++)
{
if(s[i][k]+s[j][k]==1)
e++;
if((s[i][k]+s[j][k]==3)(s[i][k]+s[j][k]==4))
e=2;
}
if(e==1)
{
for(k=1;k<=4;k++)
{
if(s[i][k]+s[j][k]!=1&&s[i][k]+s[j][k]!=6)
q[l][g]=s[i][k];
else
q[l][g]=3;
g++;
}
g=1;
l++;
h++;
}
e=0;
}
if(h==0)
{
for(k=1;k<=4;k++)
p[c5][k]=s[i][k];
c5++;
}
h=0;
}
c=0;
for(i=1;i<l;i++)
{
for(j=1;j<i;j++)
{
for(k=1;k<=4;k++)
{
if(q[i][k]==q[j][k])
c++;
}
if(c!=4)
e++;
c=0;
}
if(e==i-1)
{
for(k=1;k<=4;k++)
o[h+1][k]=q[i][k];
h++;
}
e=0;
}
for(i=1;i<=h;i++)
{
cout<<1;
}
cout<<endl;
for(i=1;i<c2;i++)
{
if(x[i][1]==0)
cout<<"A'";
if(x[i][1]==1)
cout<<"A";
if(x[i][2]==0)
cout<<"B'";
if(x[i][2]==1)
cout<<"B";
if(x[i][3]==0)
cout<<"C'";
if(x[i][3]==1)
cout<<"C";
if(x[i][4]==0)
cout<<"D'";
if(x[i][4]==1)
cout<<"D";
cout<<"+";
}
c=0;
for(i=1;i<c3;i++)
{
if(w[i][7]!=4)
{
if(w[i][1]==0)
cout<<"A'";
if(w[i][1]==1)
cout<<"A";
if(w[i][2]==0)
cout<<"B'";
if(w[i][2]==1)
cout<<"B";
if(w[i][3]==0)
cout<<"C'";
if(w[i][3]==1)
cout<<"C";
if(w[i][4]==0)
cout<<"D'";
if(w[i][4]==1)
cout<<"D";
cout<<"+";
}
}
cout<<endl;
c=0;
for(i=1;i<c4;i++)
{
for(j=1;j<=h;j++)
{
if(((o[j][1]-r[i][1])==2(o[j][1]-r[i][1])==3(o[j][1]-r[i][1])==0)&&((o[j][2]-r[i][2])==2(o[j][2]-r[i][2])==3(o[j][2]-r[i][2])==0)&&((o[j][3]-r[i][3])==2(o[j][3]-r[i][3])==0(o[j][3]-r[i][3])==3)&&((o[j][4]-r[i][4])==2(o[j][4]-r[i][4])==0(o[j][4]-r[i][4])==3))
c++;
}
for(j=1;j<c5;j++)
{
if(((p[j][1]-r[i][1])==2(p[j][1]-r[i][1])==3(p[j][1]-r[i][1])==0)&&((p[j][2]-r[i][2])==2(p[j][2]-r[i][2])==3(p[j][2]-r[i][2])==0)&&((p[j][3]-r[i][3])==2(p[j][3]-r[i][3])==0(p[j][3]-r[i][3])==3)&&((p[j][4]-r[i][4])==2(p[j][4]-r[i][4])==0(p[j][4]-r[i][4])==3))
c++;
}
if(c==0)
{
if(r[i][1]==0)
cout<<"A'";
if(r[i][1]==1)
cout<<"A";
if(r[i][2]==0)
cout<<"B'";
if(r[i][2]==1)
cout<<"B";
if(r[i][3]==0)
cout<<"C'";
if(r[i][3]==1)
cout<<"C";
if(r[i][4]==0)
cout<<"D'";
if(r[i][4]==1)
cout<<"D";
cout<<"+";
}
c=0;
}
cout<<endl;
for(i=1;i<c5;i++)
{
if(p[i][1]==0)
cout<<"A'";
if(p[i][1]==1)
cout<<"A";
if(p[i][2]==0)
cout<<"B'";
if(p[i][2]==1)
cout<<"B";
if(p[i][3]==0)
cout<<"C'";
if(p[i][3]==1)
cout<<"C";
if(p[i][4]==0)
cout<<"D'";
if(p[i][4]==1)
cout<<"D";
cout<<"+";
}
// getch ();
}
What is stored in source file object file and an executable file?
A source file (*.c file) contains the source code for (part of) a computer program written in a high-level language. All the user-defined types used by the source file must be forward declared before the first point of usage. If the source file uses types that also need to be available to other source files, those type declarations can be placed in a corresponding header file which this and other source files can include using the #include compiler directive. This ensures all type declarations are declared consistently across all the source files that use them.
Essentially, the #include directive instructs the compiler to import the code from the named header file into the source code at the point it was declared, just as if the programmer had copy/pasted that code by hand. This is done by the preprocessor which processes all the compiler directives (lines beginning with a # symbol) and strips out all user-defined comments from the source file, including its headers. Note that the source file is not physically changed by the preprocessor, it simply creates a new source file, known as a translation unit. After preprocessing, the compiler only sees the translation unit, not the source file. A translation unit must be entirely self-contained and must not depend on any names in any other translation unit, other than those that are explicitly declared with external linkage.
The compiler processes each translation unit in turn to create an object file, which is essentially the machine code translation of the source code. The machine code is only partially complete at this stage because all offset memory addresses cannot be finalised until all the object files are created. These addresses are symbolised and placed in a table at the end of the object file, along with external linkage information required by the linker.
Once all the object files are created, the linker takes over, linking the object files together to produce a machine code executable. All offset addresses are finalised at this stage. Note that the linker is the only program that "sees" the entire program.
Difference between the first generation language and third generation language?
Released on January 11, 2005, the first-generation iPod Shuffle weighed 0.78 ounces (22 g) and was designed to be easily loaded with a selection of songs and to play them in random order. According to Apple,[citation needed] owners of existing iPods had often left the music selection to "shuffle", and the new iPod Shuffle was a way of implementing that in a much more cost-effective fashion. It relies on the use of an "autofill" feature in iTunes, which can select songs at random from a user's music library (or from a specific playlist) and copy as many as will fit into the iPod Shuffle's memory. The Shuffle can hold up to 240 songs (1-GB model, based on Apple's estimate, of four minutes per song and 128 kbit/sAACencoding). It used the SigmaTelSTMP35xx system on a chip (SOC) and its software development kit (SDK) v2.6, a flash memory IC, and USB rechargeable lithium cell. The STMP35xx SOC and its software was the most fully integrated portable MP3 playback system at release time and SigmaTel was Austin's largest IPO (2003) capturing over 60% of flash based MP3 player world market share in 2004. In 2005, peak iPod first-generation Shuffle production occurred at a hundred thousand units per day, at the Asusfactory.
It lacks a display and the trademark scroll wheel, playlistmanagement features, and is missing the games, address book, calendar, alarm, and notes capability of larger iPods; it cannot be used with iSync. Due to the codec not being ported, it is incapable of playing Apple Lossless andAIFF audio files.
Due to superior audio technology in the SigmaTel STMP35xx SOC and SDK, the iPod Shuffle has a better bassresponse than a 4th generation iPod, according to a review published days after its release.[2][3]
First generation iPod Shuffle with the cap removed to show the USBconnector. The cap snaps onto the unit. iPod Shuffle comes with a second cap on a lanyard, which a user can wear around his or her neck.
iTunes offers some new features for iPod Shuffle. One is the ability to reduce the bit rate of songs to 128 kbit/s AAC. The conversion is done automatically, with the original fileleft untouched on the computer and the smaller (lower bit rate) file sent to the iPod Shuffle. Older versions of iTunes allowed an iPod Shuffle playlist to be viewed and changed while the unit is not connected; the next time the unit is connected, it can then be updated with the changed playlist. This functionality is no longer a part of iTunes as of iTunes 7.
The front of the iPod Shuffle has buttons for Play/Pause, Next Song/Fast Forward, Previous Song/Fast Reverse, and up and down volumeadjustment. On the reverse, it has a battery level indicator light (activated by a button) and a three-position switch to turn the unit off or set it to play music in order orshuffled. It plugs directly into a computer's USB port (either 1.1 or 2.0), through which it also recharges its battery, which has an expected life of around 12 hours between charges. The USB plug is hidden beneath a cap. The unit also comes with a lanyard that attaches to the iPod Shuffle via an attached cap and this allows the user to wear the iPod Shuffle around his or her neck.
The iPod Shuffle can also be used as a USB flash drive. iTunes allows a user to set how much of the drive will be allowed for storing files, and how much will be used for storing music.
Second generation[edit]A Second-generation iPod Shuffle in size-comparison to a Dellmouse.
On September 12, 2006, Apple announced the release of the second generation iPod Shuffle, calling it "the most wearable iPod ever".[4]First shipments of the unit were slated for an October 2006 arrival, but actually started shipping on Friday, November 3, 2006.[5]The second generation initially featured a lone 1 GB model in a silver brushed aluminum case similar to the second generation iPod Nano and the older iPod Mini. The new model is less than half the size of the first generation model at 41.2 x 27.3 x 10.5 mm (1.62 x 1.07 x 0.41 in), and is the size of the iPod Radio Remote available for iPod Nanos and 5th generation iPods. Apple claimed it was the "world's smallest MP3 player". This size includes the new built-in belt clip; the actual unit itself is thinner, with the entire device weighing only 15.5 g (0.55 ounces). The power/shuffle/no shuffle switch from the first generation version was separated into two controls to avoid an accidentally selected mode of operation. The formatting of the iPod itself is new to Apple, as the 2G (second generation) shuffle will only format itself to FAT32. iTunes issues a warning that the iPod is incorrectly formatted if brought to the Macintosh formatHFS+. All previous iPod models have allowed the usage of either the Mac format or the Windowsformat.[6]
On the second generation iPod Shuffle, USBconnectivity is provided via an included piece of hardware which acts as a docking station for the transfer of data and the recharging of the iPod's internal battery through its headphone jack. The second generation iPod Shuffle is also able to act as a flash drive, just like the first generation iPod Shuffle. However, unlike the first generation iPod Shuffle, the second generation does not have a built-in USB connector. This means that the docking station is required for connection to a computer on the second generation model.
The second generation Shuffle can play MP3, MP3 VBR, AAC, Protected AAC, Audible (formats 2, 3 and 4), WAV and AIFF. Due to its low processing power the only iTunes-supported file format that the iPod does not support is Apple Lossless.[citation needed] Using large file sizes inherent of WAVorAIFF files will very quickly fill the device's low 1 GB capacity. iPod Shuffle cannot play music from music video files.
On January 30, 2007, Apple announced the addition of four new colors to the iPod Shuffle line. Pink, orange, green, and blue choices have been made available via retailers and the Apple Store(online) in addition to the original silver color. The colors blue, green, and pink are essentially the same hues as the second generation iPod Nano and iPod Mini. The new orange color is a first for the iPod franchise. They also now come with the new redesigned headphones that were not included with the original silver model. The box was also changed to have gray text instead of the lime-green text; lime-green text indicating that the original headphones are included, gray text indicating that the new headphones are included On September 5, 2007, Apple refreshed the line with four new colors including a Product Redversion. The new colors are turquoise, lavender, mint green, and Product Red, with the previous colors orange, blue, green, and pink being discontinued.
On February 19, 2008, Apple introduced a 2 GB version of the iPod shuffle, retailing for US$69 and available in all the same colours as the 1 GB model. On the same day, the price of the 1 GB model was lowered from US$79 to US$49.
At the Apple Let's Rock Event on September 9, 2008, Apple released four new colors for the iPod Shuffle: blue, green, pink, and red, replacing the colors that were released in September 2007. The blue, green and pink variants of the iPod shuffle during this period reverted to shades that were similar to the colors that were released in January 2007, while the red variant was now a brighter shade.[7]
In June, 2009, Avon offered a gold iPod Shuffle (second generation) for $29 when purchased in conjunction with two ANEW skin care products.[8]
The second generation 2 GB iPod Shuffle was discontinued on March 11, 2009 and the 1 GB version was discontinued on September 9, 2009.
A third generation iPod Shuffle.
The third generation iPod Shuffle was released on March 11, 2009 and was said by Apple to be "jaw-droppingly small" and "The first music player that talks to you" as well as the first waterproof iPod.[9]with dimensions of 45.2×17.5×7.8 mm (1.78×0.69×0.31 in). It was available with a silver or black brushed aluminum case similar to the second generation iPod Shuffle. This made it the first iPod Shuffle that was available in black. It featuredVoiceOvertechnology that allowed song names, artist names, album names and playlist contents and names to be spoken in 20 different languages[10]using the Text-to-Speech incorporated in iTunes 8 and 9. It also gained support for multiple playlists, in contrast to previous versions of the iPod Shuffle, which allowed only a single playlist.
The inside of a third generation iPod Shuffle.
The third generation iPod Shuffle features a polished steel attachment clip, adopting for the first time the polished steel finishing previously found only on the larger iPods, rather than the brushed aluminum used in the second-generation iPod Shuffle. It also no longer had volume or track controls on the device itself. Instead, the packaged iPod earbudsincluded a three-button device on the right earbud cord. This adds the functions of changing between playlists, hearing the song title and artist of the track playing, as well as play/pause, track changes and volume control.[11]It is not possible to change songs or volume with most third-party headphones, since they lack these controls. However, since the iPod Shuffle begins playing music automatically when it is turned on, third-party headphones may still be used in "autoplay" mode (with no volume or playback controls). Some third-party headphones and headphone adapters include full support for the third generation iPod Shuffle.[12]The official headphones contain a chip designed by Apple to control the device. DRM is not however present in the chip as there is no encryption used.[13]
On September 9, 2009, Apple introduced three new colors for the iPod Shuffle: pink, blue, and green. The Apple Store also offered a 4 GB model made of polished stainless steel.[14]
What is Conditional Compilation in C plus plus Any simple example?
Conditional compilation is used to exclude code segments from specific builds. For instance, in debug mode you might include additional code such as an assertion macro which you wouldn't really want in the release code.
The following example declares and defines an ASSERT() macro when the program is compiled in debug mode (when DEBUG is defined). In non-debug mode (when DEBUG is not defined), all calls to ASSERT() will be ignored during compilation because there is no implementation provided.
#ifdef DEBUG
#define ASSERT(x) \
if(!(x)) \
{ \
std::cout << "ERROR!! Assert " << #x << " failed\n"; \
std::cout << "on line " << __LINE__ << std::endl; \
std::cout << "in file " << __FILE__ << std::endl; \
}
#else
#define ASSERT( x )
#endif _DEBUG
Within your code you can call ASSERT() to ensure your invariants are true whilst in debug mode:
int x=1, y=1;
ASSERT( x == y );
// .. remainder of code...
In debug mode, the compiler expands the code for you, just as if you'd written the following:
int x=1, y=1;
if(!( x==y ))
{
std::cout << "ERROR!! Assert " << #x << " failed\n";
std::cout << "on line " << __LINE__ << std::endl;
std::cout << "in file " << __FILE__ << std::endl;
}
// .. remainder of code...
But in release mode there is no macro to expand, so the assert is effectively ignored:
int x=1; y=1
// .. remainder of code...
Other uses of conditional compilation include catering for UNICODE or MCBS encoding of strings. If your program uses one or the other, you can use macros to ensure the appropriate string handling calls and declarations are made.
They are also used to "guard" include files to ensure an included file is never included more than once during compilation. This is important when several files include the same file for the purpose of syntax checking. During compilation, however, only one copy of the file needs to be physically included. If multiple inclusions were not guarded against, the compiler would try to include several declarations of the same functions and, even though they all come from the exact same file, the compiler treats them as separate entities and immediately stops the compilation. The same thing occurs when a function is declared twice in two separate files.
// myclass.h
#ifndef _myclass_h_ // First time around, this will not be defined.
#define _myclass_h_ // Now it is defined.
// Declarations (with or without implementations) go here.
#endif _myclass_h_ // Marks the end of the inclusion.
When the compiler "sees" this file for the first time, it will be included because _myclass_h_ would be undefined first time around. But all subsequent inclusions will be ignored because _myclass_h_ was defined during the first inclusion.
What is a primitive type variable in c plus plus?
same the types used in C. that is int...char...float...
Which are the four criteria for selecting identifiers for entities?
1. Cardinality
2. Conditionality
3. Recursiveness
4. Degree
How to store the file in array variable using perl?
As simple as that. If your Perl is in: /usr/bin/perl, then just copy and paste the text below in a file (e.g. my_prog.pl), make my_prog.pl executable (chmod u+x my_prog.pl) and execure this (./my_prog.pl) .
I hope my comments will allow you to adapt this small script according to your needs.
---- #!/usr/bin/perl
###########################
#### This is how you open the file ####
###########################
# First define the "record delimiter", if you wish. Options:
# $/ = "\n" # One line is one record! This is the default, no need to be defined.
# $/ = "\n\n" # An enpty line is the record delimiter (useful for mail headers, etc.)
# $/ = "you_name_it!" # According to your specific problem.
# try opening the file for reading and associate it with the
# "File Pointer" FP. If you fail the msg below will be printed
# and the program will halt.
open (FP, '/etc/hosts') or die('Cannot open file for reading');
#################################
#### This is how you store the file in arrary ####
#################################
# Read the file; here record=line.
my @records = ;
# and do not forget to close FP
close FP;
#######################
#### This is how you test it ####
#######################
# Print them, just for testing
foreach my $record (@records) {
chomp $record; # Get rid of the trailing "\n" that apears in each line
$record = "[$record]"; # Wrap the record in [] for the sake of presentation
print "$record\n";
}
----
What is the difference between the process of debugging and compiling?
Debugging:-Computer programmers, like everybody else, are not perfect. This means the programs they write sometimes have small errors, called "bugs," in them. These bugs can be minor, such as not recognizing user input, or more serious, such as a memory leak that crashes the program. Before releasing their software to the public, programmers "debug" their programs, eliminating as many errors as possible. This debugging process often takes a long time, as fixing some errors may introduce others.
Compiling:-When programmers create software programs, they first write the program in source code, which is written in a specific programming language, such as C or Java. These source code files are saved in a text-based, human-readable format, which can be opened and edited by programmers. However, the source code cannot be run directly by the computer. In order for the code to be understood by the computer's CPU, it must be compiled into an executable program. Most software development programs include a compiler, which compiles source code files into machine code. This code, sometimes referred to as object code, can be executed directly by the computer's processor. Therefore, the resulting application is often referred to as an executable file. Windows executable files have a .EXE file extension, while Mac OS X programs have .APP extension, which is often hidden.
So the conclution is a compiled program may have errors or bugs but not a successfully debugged program
Full form of basic in computer?
millsbery is good but its no far to shut it down bye millsbery we love millsbery one more chanes plz
Concatenate in MS Excel and most of other tool is function to join text.
import java.io.*;
class stack
{
char stack1[]=new char[20];
int top;
void push(char ch)
{
top++;
stack1[top]=ch;
}
char pop()
{
char ch;
ch=stack1[top];
top--;
return ch;
}
int pre(char ch)
{
switch(ch)
{
case '-':return 1;
case '+':return 1;
case '*':return 2;
case '/':return 2;
}
return 0;
}
boolean operator(char ch)
{
if(ch=='/'ch=='*'ch=='+'ch=='-')
return true;
else
return false;
}
boolean isAlpha(char ch)
{
if(ch>='a'&&ch<='z'ch>='0'&&ch=='9')
return true;
else
return false;
}
void postfix(String str)
{
char output[]=new char[str.length()];
char ch;
int p=0,i;
for(i=0;i
ch=str.charAt(i);
if(ch=='(')
{
push(ch);
}
else if(isAlpha(ch))
{
output[p++]=ch;
}
else if(operator(ch))
{
if(stack1[top]==0(pre(ch)>pre(stack1[top]))stack1[top]=='(')
{
push(ch);
}
}
else if(pre(ch)<=pre(stack1[top]))
{
output[p++]=pop();
push(ch);
}
else if(ch=='(')
{
while((ch=pop())!='(')
{
output[p++]=ch;
}
}
}
while(top!=0)
{
output[p++]=pop();
}
for(int j=0;j
System.out.print(output[j]);
}
}
}
The main class in another notepad
import java.io.*;
class intopost
{
public static void main(String args[])throws Exception
{
String s;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
stack b=new stack();
System.out.println("Enter input string");
s=br.readLine();
System.out.println("Input String:"+s);
System.out.println("Output String:");
b.postfix(s);
}
}
OUTPUT: Enter input string
a+b*c
Input String:a+b*c
Output String:
abc*+
Enter input string
a+(b*c)/d
Input String:a+(b*c)/d
Output String:
abc*d/)(+
Enter
abc*d
Why can a failure in a database environment be more serious than one in a non-database environment?
Database failures for Production envionments could be downtime for the database (data cannot be retrieved or uploaded) or a data loss in which a recovery needs to be performed, which also equates to downtime until the data is recovered. Businesses equate downtime to $$$ loss. It is a database administrator's job to ensure the database is designed for minimal downtime--the recovery is measured in "MTR" (meantime to recovery). What's the fastest way the data can be restored? A full recovery? A point in time? (roll the data up right before the data loss occurred). This must be done carefully through communcation with the individuals where the data loss occurred. If the DBA is given the wrong time and the data is rolled forward beyond the corruption point, then the recovery must be started again. There is much more to this subject.......based on each company's database, design, data, etc.
What is dynamic programming language?
Dynamic programming languages are often refered to as 'weakly typed' which means that variables are not bound to a particular type until runtime. For example, C++ is a 'strongly typed language, while Perl is a 'weakly typed' or 'dynamic' language.
A strongly typed language requires that you specify a type:
int i = 0;
In that C++ snippet, an integer names i is created and assigned the value of 0. The following would not compile in C++:
int i = 0;
i = "Hello world";
This would fail because i has been declared to be an integer and can not be assigned a string value. The following code would succeed in a dynamic language like Perl:
i = 0;
i = "Hello world";
The type is not declared here at all, because it is not bound to a type until runtime. In the first statement, i is bound to an integer type but in the second statement it is bound to a string type.
While dynamic language are easier to program in, they are much slower than strongly typed languages and are generally regarded as less safe since checking is not done until run time.
Ddl algorithm of line generation in c?
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<ctype.h>
#include<math.h>
#include<stdlib.h>
void draw(int x1,int y1,int x2,int y2);
void main()
{
int x1,y1,x2,y2;
int gdriver=DETECT,gmode,gerror;
initgraph(&gdriver,&gmode,"c:\\tc\\bgi:");
printf("\n Enter the x and y value for starting point:\n");
scanf("%d%d",&x1,&y1);
printf("\n Enter the x and y value for ending point:\n");
scanf("%d%d",&x2,&y2);
printf("\n The Line is shown below: \n");
draw(x1,y1,x2,y2);
getch();
}
void draw(int x1,int y1,int x2,int y2)
{
float x,y,xinc,yinc,dx,dy;
int k;
int step;
dx=x2-x1;
dy=y2-y1;
if(abs(dx)>abs(dy))
step=abs(dx);
else
step=abs(dy);
xinc=dx/step;
yinc=dy/step;
x=x1;
y=y1;
putpixel(x,y,1);
for(k=1;k<=step;k++)
{
x=x+xinc;
y=y+yinc;
putpixel(x,y,2);
}
}
What does ping response mean in C?
To ping is to issue an ICMP Type 8 (ICMP Echo Request) to a host which according to RFC1122 it must reply to. (In reality this may be seen as a security risk.). The format of a successful response has type and code of 0. If you're operating down at this level you'll need to examine ICMP in more detail. If you have a sockets interface then you may just get a reply event. Sometimes people call these "pongs". ie Ping? Pong. Ping? Pong.
"If y tends to increase as x increases, then the data have a positive correlation. If y tends to decrease as x increases, then the data have a negative correlation. If the points show no correlation, then the data have approximately no correlation."
Classification of file processing by function?
Write an iterative function to search an element in a binary search tree?
_node* search (_node* head, _key key) {
_node* node;
for (node=head; node != NULL;;) {
if (key == node->key) return node;
else if (key < node.>key) node = node->left;
else node = node->right;
}
return node;
}
How do you print gantt chart for round robin in c?
#include<stdio.h>
struct RRS
{
char p[2];
int btime;
}a[5];
void main()
{
struct RRS a[5];
int i,j,n,k=0,totalbtime=0;
printf("\nEnter the no of process");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\n enter the process name and burst time");
scanf("%s %d", a[i].p, &a[i].btime);
}
for(i=0;i<n;i++)
{
printf("\n process: %s \t btime : %d",a[i].p,a[i].btime);
totalbtime=totalbtime+a[i].btime;
}
while(k<totalbtime)
{
for(i=0;i<n;i++)
{
for(j=0;j<2;j++)
{
if(a[i].btime!=0)
{
printf("%s",a[i].p);
a[i].btime--;
k++;
}
}
}
}
}
output:
enter the no of process:3
enter the process name and btime:p1 4
enter the process name and btime:p2 3
enter the process name and btime:p3 1
processname btime
p1 4
p2 3
p3 1
p1p1p2p2p3p1p1p2