answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Does a compiler allocate memory space for each constant?

No. Memory is allocated for each unique constant rather than to each individual constant. However, compilers do not physically allocate memory; the constants are allocated in the program's data segment at linktime. The actual allocation within memory occurs at loadtime, when static memory is physically allocated to the executable. Constants are then initialized using information found in the program's data segment.

How many programming languages are based on C?

C++, Java, Perl, Python, PHP, JavaScript, LPC, C# is the most popular languages based on C, but there is probably more languages.

What is spooling in c language?

example for spooling:

assume there are many computers and all of them want to print a data at a same time and give a print command on keyboard but there is only one printer between them. so printer will use the command to the first person who used to give at first according to the time but he will also accept the other persons command and keep them in a waiting state and when the print of 1st command is over it will automatically accept the another command for printing the data and acoording to this pattern only he will goes on and complete his task....

according to me spooling means this.

further i cant say u.....

What is a natural language interface?

binary language is the natural language of computer

What is the mean of object identity and classification in terms of object oriented programming?

Well, that's pretty straightforward. An "object" is a named thing with certain properties, like in Plato's "Allegory of the Cave," and "classification" refers to a GROUP of similar things, that all share certain properties. To use a non-programming example, the classification "animals" might include objects like "mammal," "reptile," "bird," and so forth. Or those things might themselves be "classes," depending on your own personal choices and needs. So a "bird" might be a "class" including "objects" like "robin," "thrush," and "starling," with properties like "color of breast," "forked tail," and "temperament."

Does Final Media Player Have Viruses?

Final Media Player, (supposedly), does not contain viruses, however some anti-virus programs will tag it as undesirable because it offers potentially unwanted software during installation in a manner similar to Open Candy's methods.

A version downloaded directly from the Final Media Player web-site at www.finalmediaplayer.com on May 18th, 2014 was scanned and passed as "OK" by the Avira Anti-Virus Professional 2014 installed on my machine. However, earlier versions of Final Media Player were tagged as Potentially Unwanted Program(s)

I both use, and recommend, VideoLAN's excellent VLC Media Player. It's totally Open Source, licensed under the Free Software Foundation's GPL-2, and contains absolutely no nonsense, adware, slimeware, or other nasties.

How do you stop a computer from going into standby mode when the settings are already set to never standby?

You might have a laptop, if it's true just do what you did for both battery and power adapter source of energy.

What is the best background image size?

There is no one ideal size... it depends on your goals for the Site.

One thing is true, the smaller your image size, the better. For that reason, most Web Designers use a seamless, "tiled" image, meaning a small piece that can be repeated over and over again without the viewer being able to see where the edges meet.

Pick a size, for example 50px x 50px. Try to find the tile size that allows you to make a unique background while using the smallest amount of real estate.

It takes a little practice to be able to design a tile properly so that it blends together with itself, but in no time you'll be a pro. Just think symmetrically, both horizintally and vertically, and you're already off to a good start.

Some Site Designers out there want the entire background to be a unique, non-repeating pattern. For these applications, you're going to have to use an image that is as wide and tall as the standard screen (about 1024px x 728 these days). This image will undoubtedly be larger in file size and take more time to load into a browser window, which is one of the reasons most Designers don't take this approach.

Many Designers are of the opinon that file size doesn't matter that much anymore. Most Internet users have a high-speed connection these days and the load times don't take as long as they used to. Old-School Designers like myself were taught to design to the lowest common denominator: That is, to design your pages so that Joe Blow in middle America with a 56K dial-up connection can still access your Site and see it properly.

You will have to make a call on which stance you take, maybe somewhere in between... determining what size background image to use is based upon your needs and goals.

Best Wishes

Marc

How do I convert a string to an integer in python?

1.>>> x=input("enter data: ")
2.enter data: 25
3.>>> type(x)
4.
5.>>> y = int(x)
6.>>> type(y)
7.






I used Python 3.0 for this.Else for earlier version, to accept string type input, u should be using "raw_input" instead of "input" only.
I made python accept a data and tested its type, which return to be a string (line 4).
Then I used
int()
to convert the string into a number, which, for testing purpose, I assigned the value to a variable y. (line 5)
Testing the type of data that variable y stores, confirms that the string type was converted to an integer type.(line 7)

What is 'Invalid application of sizeof to an incomplete type'?

If you are using Thrust library, when you use the CUDA related functions of it without naming the extension of the code file "*.cu", the nvcc compiler will complain as stated.

For more information:

http://code.google.com/p/thrust/issues/detail?id=138

pH0@d - phoad

Differentiate between polynomial algorithm and exponential algorithm?

Do you mean, "the difference between an algorithm that runs in polynomial time, and one that runs in exponential time".

First a real quick review. A polynomial is any equation of the form

y = cmxm + ... + c2x2 + c1x + c0 ,

where ci are constants

An exponential function is something of the form

y = cx

These functions grow much faster than any polynomial function.

So, if T(n) describes the runtime of an algorithm as a function of whatever (# of inputs, size of input, etc.)., and T(n) can be bound above by any polynomic function, then we say that algorithm runs in polynomial time.

If it can't be bound above by a polynomial function, but can be bound above by an exponential function, we say it runs in exponential time.

Note how ugly an exponential algorithm is. By adding one more input, we roughly double (or triple, whatever c is) the run-time.

Can someone make write you a program that tells somebody their zodiac signs the program asks a person their year month and day they were born and it should be for the Chinese Zodiac and Western?

#include <stdio.h> #include<string.h> main() { char s[80]; int d; clrscr(); printf("enter the month of your birthday: "); gets(s); if(!(strcmp(s, "january"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=19) printf("\n CAPRICORN"); else printf("\n AQUARIUS"); } if(!(strcmp(s, "february"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=18) printf("\n AQUARIUS"); else printf("\n PISCES"); } if(!(strcmp(s, "march"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=20) printf("\n PISCES"); else printf("\n ARIES"); } if(!(strcmp(s, "april"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=19) printf("\n ARIES"); else printf("\n TAURUS"); } if(!(strcmp(s, "may"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=20) printf("\n TAURUS"); else printf("\n GEMINI"); } if(!(strcmp(s, "june"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=20) printf("\n GEMINI"); else printf("\n CANCER"); } if(!(strcmp(s, "july"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=22) printf("\n CANCER"); else printf("\n LEO"); } if(!(strcmp(s, "august"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=22) printf("\n LEO"); else printf("\n VIRGO"); } if(!(strcmp(s, "september"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=22) printf("\n VIRGO"); else printf("\n LIBRA"); } if(!(strcmp(s, "october"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=22) printf("\n LIBRA"); else printf("\n SCORPIO"); } if(!(strcmp(s, "november"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=21) printf("\n SCORPIO"); else printf("\n SAGITTARIUS"); } if(!(strcmp(s, "december"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=21) printf("\n SAGITTARIUS"); else printf("\n CAPRICORN"); } getch(); }

C program to print nos divisible by 8?

#include #include
#define N 100 /* change the upper limit by changing value of N */
int main()
{
int i;
clrscr();
printf("\nPROGRAM TO PRINT NUMBERS DIVISIBLE BY 8 between 1 and 100\n");
for(i=1;i<=N;i++)
{
if(i%8==0)
{
printf("%d\n",i);
}
}
getch();
return 0;
}

What are four examples of routine decisions?

Routine decisions could include but are not limited to: choosing what time to get up in the morning, what to wear, what to have for breakfast, what time to leave for school, whether to walk to school or ride the bus

How do you select a user-name in command prompt I have a two part user-name and can't select it.?

At the command prompt, whitespace is used as a delimiter. To treat whitespace as being part of a value, you must enclose the whole value in quotes.

myprog albert einstein

myprog "albert einstein"

In the above examples, the first treats albert and einstein as being two separate values, whereas the second treats "albert einstein" as being one value (the surrounding quotes are part of the value, but these can be removed programmatically if required).

How do you install bit locker encription?

First, Download Bitlocker.

You can download it on the Softpedia Website.

After downloading, you can now double click the newly downloaded File and start the installation. Follow the steps. If you are propted with EULA (End-User License Agreement), select I agree..

After installing, insert the pendrive and right click it's icon, click the "Bit Locker" encryption icon.

Write a program to perform a binary search on an unsorted list of n integers?

#include<iostream>

#include<iomanip>

#include<vector>

#include<random>

// The node class is used to store a value from the

// unsorted list, along with its index in the list.

// The left node points to a tree of nodes where

// all values are less than this node's value. The

// right node points to a tree of nodes where all

// values are greater than (or equal to) this node.

struct node

{

unsigned value;

unsigned index;

node* left;

node* right;

node (unsigned val, unsigned idx)

: value (val), index (idx),

left(NULL), right (NULL) {}

~node ()

{

delete left;

delete right;

}

void insert (node& n)

{

if (n.value<value)

{

if (left)

left->insert (n);

else

left = &n;

}

else

{

if (right)

right->insert (n);

else

right = &n;

}

}

node* find (unsigned val)

{

if (val == value)

return this;

else if (val < value)

return left ? left->find (val) : NULL;

else

return right ? right->find (val) : NULL;

}

};

// The tree class maintains the root node of a binary

// search tree (BST). The default constructor builds

// a BST from a vector of values. All other methods

// delegate to the root node.

struct tree

{

node* root;

tree (const std::vector<unsigned>& v)

: root (NULL)

{

for (unsigned i=0; i<v.size(); ++i)

{

node* n = new node(v[i], i);

if (!root)

root = n;

else

root->insert (*n);

}

}

~tree ()

{

delete root;

}

node* find (unsigned value)

{

return root ? root->find (value) : NULL;

}

};

// A helper function to determine if a value exists

// in a vector or not.

bool exists(std::vector<unsigned> vect, unsigned num)

{

for (unsigned i=0; i<vect.size(); ++i)

if (vect[i] == num )

return true;

return false;

}

int main()

{

// random number generator (range: 1 to 15)

std::default_random_engine generator;

std::uniform_int_distribution<unsigned> distribution (1, 15);

// create an unsorted list with 10 random numbers and print them

// in the order they are generated

std::vector<unsigned> vect;

std::cout << "Unsorted list: ";

unsigned nums = 10;

while (nums--)

{

do

{

unsigned num = distribution (generator);

// ensure num is unique!

if (!exists (vect, num))

{

vect.push_back (num);

std::cout << std::setw(3) << vect.back();

break;

}

} while (true);

}

std::cout <<std::endl;

// create a binary search tree from the vector

tree bst (vect);

// now go find all the numbers in the tree and show where they

// reside in the list (include all the missing numbers)

for (unsigned num=1; num<=15; ++num)

{

if( node* n = bst.find (num))

{

std::cout << num << " was found in the tree";

std::cout << " and is at index " << n->index;

std::cout << " in the list" << std::endl;

}

else

std::cout << num << " could not be found in the tree" << std::endl;

}

}

Who is coded32?

He is a famous Internet Hacker. Hacked into IBM, Microsoft Russia, and his domain was www.coded32.net.tc

another domain was www.coded32.com

I dunno wat happened to them, but they were there.

What should i have to know about computers to be able to learn Assembly language and from where may i learn that language?

Assembly languages are specific to a particular micro processor or micro processor family, and strongly rely on your familiarity with this processor not only in terms of its assembly language, but also in terms of its overall architecture and hardware.

Therefore, the best place to start would be to chose a processor family and get a simple board with this chip. Rather than starting with the considerable complexities of writing a Windows application in assembly for a modern PC's processor, you might want to look for evaluation kits with a simple 16 or 32 bit micro controller, such as an ARM 7 or ARM 9 board (or many others).

Many of these boards are supplied with free software development tools, typically including an assembler and a C language compiler. (Not all software may be freely available. Free software might be feature-limited or work for a limited trial period. Check out the terms and conditions before buying.)

You'll find many boards are available in the "extended pocket money range."

You'll need to spend some more time and (probably) money on a good book that teaches you about the chosen processor, it's internal architecture and its assembly language.

What Linked list uses.type of memory allocation?

Linked lists use dynamic memory allocation (also called "heap memory allocation", as the linked list is stored in heap memory).

What is Internet email?

Internet email is a service provided by companies like Hotmail, MSN and AOL. It is email which you can access via the Internet. AKA Webmail.

What is short integer?

In computer programming, a variable can be (among other things) an integer or a long integer.

An integer can be any whole number in the range of -32,768 to 32,767

A long integer can be any whole number in the range of -2,147,483,648 tp 2,147,483,647

I have never heard of an "integer" variable being called a "short integer" but it makes a kind of sense.

Note: The size of integer types is platform-dependent, but usually:

short: 16 bits

int: 32 bits (16 in archaic systems: MSDOS OS Windows16)

long: 32 bits (64 in unix64)

long long: 64 bits