answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Why was java developed and what is the purpose of this programming language?

It is object oriented language in which All program is to be written inside a specific class. it is more comfortable and less coding required to build program.

What is the difference between a command driven interface and a graphical user interface?

The difference between graphic user interface and character user interface are its command. GUI does not need any type of command to interact with the computer, while CUI needs commands in order to interact with the computer.

What is the need for another oops language java instead of c?

actually the c language is the procedure based language n emphasis on the procedure. on tyhe other hand the java is object oriented lannguage,emphasis on the data and it's importance.

Refinement

Java is platform independent language and it made it more popular in creating embedded system. As its bytecode can be transferred to any platform so there was no need to implement compiler in the embedded system but JVM(a runtime systme) was required to be installed in embedded software.

Moreover the runtime was also reduced as it was not required to be compiled again.

http:\\in-central.blogspot.com

What is a raster device?

Common examples of raster devices are computer monitors (e.g. cathode ray tube, LCD). The term "raster device" means a device that is composed of discrete image samples or pixels.

22222222 bytes how many MB?

1kb = 2^10 = 1024 bytes 1 mb = 2^10 = 1024 kb = 2^20 bytes = 1048576 bytes. 22222222 bytes = 21.197 mb 21 mb = 22020096 bytes that is 202126 bytes short of the given no. 202126 bytes = 197.388 kb

What is the maximum amount of memory any single process on Windows can address and is this different from the maximum virtual memory for the system?

Answer

Processes access virtual memory space, not physical memory. Applications never access RAM directly but only through the memory management interface of the processor.

Depending on which version of Windows you are using, and how the program was compiled there is a different maximum ammount of addressable memory.

All 32 bit processes on 32bit Windows have a 4GB virtual address space. The upper 2GB is common to all processes and is used by the system. The lower 2GB is private to each process and is inaccessable to all others. Unless the program was compiled as large address aware, in which case it will have 3GB of private address space.

For 32bit processes on 64bit Windows, each process has 2GB private address space, unless compiled large address aware in which case it has 4GB private address space.

For 64bit processes on 64bit windows each process has 8TB of private address space whilst compiled as large address aware. The 2GB address space limit remains for programs not compiled as large address aware.

This is completely independent of the size of RAM or the pagefile. The system maps physical memory into this virtual address space according to both need and availability.

At any given time the data in virtual memory space might be stored in RAM, on disk, or both. All of this is totally transparent to all applications. Frequently accessed data will be kept in RAM with the remainder left on disk.

Real time example for user defined exceptions?

class My_Exception {};

void f (int x) {

if (x==0) throw My_Exception;

// ...

}

int main () {

try {

f (42); // ok

f (0); // will throw

} catch (const My_Exception& err) {

std::cerr << "Invalid argument in f()\n";

}

}

What is difference between heap memory and stack memory?

Difference between Stack vs Heap memory"Stack memory" and "Heap memory" are physically the same.

The same chip of RAM may be used as stack memory when running one program and later used as heap memory when running some other program.

The difference is in how they are used.

Stack

Often a function or method calls another function which in turn calls another function etc.

The execution of all those functions remains suspended until the very last function returns its value.

All the information required to resume the execution of these functions is stored on the stack.

In particular, local variables are stored on the stack.

Local variables are often stored for short amounts of time while a function/method block uses them to compute a task.

Once a function/method has completed its cycle, the space on the stack used by all local variables is freed.

This chain of suspended function calls is the stack, because elements in the stack (function calls) depend on each other.

The stack is important to consider in exception handling and thread executions.

Heap

Heap

The heap is simply the memory used by programs to store global variables.

Element of the heap (variables) have no dependencies with each other and can always be accessed randomly at any time.

All global variables are stored in heap memory.

All variables dynamically created by the program with "new()" or "malloc()" or similar commands are also stored on the heap.

In some programming languages, all instances of an object, including all the attributes of that instance, are stored on the heap.

In those programming languages, local variables of a function that have object type are implemented as creating the new object on the heap,

and storing a reference to that object in the local variable, which is on the stack.

When that function exits, the heap memory used by each local variable that has object is freed, and then all the stack used by that stack is freed.

Comparison

A Heap reference is also stored in Stack memory until the life cycle of the object has completed. Inside the Heap reference all the the contents of the object are stored whereas with a local variable only the variable contents are stored in the stack.

Example:

Stack

var blue

var red

ref 0x456783 (Heap reference)

var tom

ref 0x498702 (Heap reference)

var diane

Heap (0x456783)

name => Susan

age => 26

city => London

height => 5'7

sex => female

Heap (0x498702)

name => Paul

age => 21

city => Glasgow

height => 6'0

sex => male

In addition to heap memory and stack memory, a completely separate section of memory stores the constructors and other methods of a class/object.

What is the prototype of scanf in c programmin?

int scanf(char* format, ...);

the format accepts the format specifier string, the elipsis operator accepts the variable list

scanf("var type var type ...", &var, &var, ...);

example:

int num1, num2, num3;

scanf("%d %d %d",&num1,&num2,&num3);

Is that what you were looking for?

Maybe this can help also...

Load and go compiler?

i know bt i dnt wanna tell u.hehhehehhe

What do non-interactive multimedia means?

They mean pictures, audio and video which doesn't interacts with the user.

A better answer can be ...

Linear (Non Interactive)active content progresses without any navigational control for the viewer such as a cinema presentation. Non-interactive form of multimedia in which a project starts at a beginning and runs through to the end. Conventional "television" is essentially "linear multimedia" (although switching channels could be said to involve interactivity). However, there is no ability for the end user to control when elements are to be delivered. Some multimedia projects are like television in that they present material in a linear fashion from beginning to end.

Linear multimedia can be distinguished from non-linear multimedia because it has literally no interactivity of any kind. It lacks any extra features that a user can take advantage of, such as the ability to choose different options, click on icons, control the flow of the media, or change the pace at which the media is displayed.

The main reason to use linear multimedia over the more interactive and fun non-linear types of multimedia is to aid in teaching or training. Linear multimedia works exceedingly well for providing information to large groups of people such as at training sessions, seminars, workplace meetings, or study groups.

How is a non-breaking space represented in HTML?

In HTML, a non-breaking space is coded as "&nbsp;" (without the quotes).

What is the imbilicord?

Umbilicord is a flexible cord like structure that contains blood vessels and attaching a human/other mammalian fetus to the placenta during gestation.

How is a 20 byte string value stored in memory?

As a 21 byte array of type char (including 1 byte for the null terminator).

Some solved question of array in C programming?

Q: What is the very first element of array 'argv' is good for?

A: It contains the name of the actual program. Try it: printf ("I am '%s'\n", argv[0]);

What is the difference between user documentation and system documentation?

User documentation demonstrates how to best use the product. A system documentation is considered more of a user manual, which is very straightforward, with no opinion.

What is the algorithm to create a list containing all of the alphanumeric 3 character combinations?

#include<iostream>

#include<string>

int main() {

// edit the following string to include any other alphanumerics you require:

const std::string alpha {"abcdefghijklmnopqrstuvwxyz0123456789"};

int a, b, c;for (a=0; a<alpha.size(); ++a)

{

for (b=0; b<alpha.size(); ++b)

{

for (c=0; c<alpha.size(); ++c)

{

std::cout << alpha[a] << alpha[b] << alpha[c] << std::endl;

}

}

}

}

What is best programming language to learn first?

There is no single best language to learn first. A variety of languages could be proposed as a first language, and most of them have been. If you only want to do one thing, you can just start with the language you want to use for that purpose (JavaScript for web, Objective-C for iPhone apps, etc.). For learning to program, in general I think that Python is a good first language, as it is simple, powerful, and popular.

Peter Norvig, Director of Research at Google, recommends Python or Scheme.

Trevor Blackwell, a Silicon Valley entrepreneur, recommends Python.

Eric Raymond, a noted programmer and open-source advocate, also recommends Python as a starting language.

The idea behind recommending Python and similar languages is that the beginning programmer can spend more time thinking about what they actually want to accomplish, and less about the details of Java or C++ (e.g. "public static void main(String[] args)"). Also, despite being easy to learn, Python is a language that is actually used (by Google and NASA, for example).

Is multi level marketing illegal?

It is illegal if done one way and it is perfectly legal when done another way. Basically if you follow the FTC's recommendations, multi-level marketing can be perfectly legitimate and profitable for people who are able to recruit and sell products and services. In fact, on March 27th, Donald Trump will shock the nation by promoting a network marketing opportunity on national TV so, yes, if it is a legitimate business opportunity there is nothing illegal about direct selling through multi levels of people. The important thing is that you are not being paid for recruiting people (from the sign up fee) but from your performance selling legitimate products and services and providing the same biz opportunity to others.

There are many legitimate multi-level marketing companies in the U.S. that have been around for years or even decades. You just have to look. Be prepared that most people when they hear about MLM, just run. It's a stereotype that's hard to overcome because you always have a hard time convincing the public that something is legitimate. The tendency is for people to assume it isn't, until they see your financial success, then you score points in your favor.

What do you do if you accidentally wiped your hard drive and when you try to reinstall Windows XP it says some files may be corrupt and will not copy?

If it says "Some file maybe corrupt" then the problem is in your Windows CD. You need a new one Format you hard disk completely once. Then try reinstaling Windows XP. This will resolve the problem.

What is a 'Brown Field' project?

A "Brown Field" project is a project that is already in progress. Contrast that with "Green Field" that means a project that has not had any work done to it. Think of being a builder, asked to build a building in an empty lot with just green grass growing. That is the analogy.

Why is object orientation required?

Object-oriented programming is a programming aid. It is not required, but it does make programming substantially easier. Machine code is "spaghetti" in nature and is extremely difficult and tedious to write. Structured programming makes it much easier to produce machine code, but structured programming is often highly repetitive. Duplicate code is problematic in that if you wish to change the code you have to locate all duplications and change those as well. If not done properly it can lead to inconsistencies. Also, most data is in global scope and global data is notoriously difficult to keep track of. Procedural programming is an extension of structured programming that allows programmers to break code down into a sequence of simple procedures or functions known as subroutines, allowing data to become more localised, passing from function to function. This also helps reduce code duplication to a degree. However, the programmer still has no control over which function may modify which data, which can make it difficult to maintain invariants. Object-oriented programming extends procedural programming by encapsulating data and the methods that operate upon that data into self-contained entities known as objects, each of which has its own interface. The interface defines an object's invariant and gives the programmer fine-grained control over accessibility. New object types (classes) can inherit from existing types as well as embed existing types, greatly reducing the need for code duplication and allowing the programmer to construct elaborate data models more easily.

What are the advantage and disadvantage of coding standards?

Advantages

  • Consistent conventions, patterns and/or processes to follow
  • Standards should be treated as an INTERFACE for programmers to read and write codes

Disadvantages

  • Standards means the rules are enforced. To enforce them, code review must be conducted. To perform code reviews, more rules will need to be established (snowball effect)
  • Need to have the authority and another set of rules to conduct code reviews (to enforce the standards). (I've encountered the violation of standards being spotted in the code reviews, mentioning them were the only outcome. The reviews were just a formality to kill time.)
  • When it's wrong, it may be a rotten apple to ruin the whole basket of them (the entire standards)
  • Standards means deviation will happen. Any deviation will need to be approved. But then, when there are more approved deviations than the standards, the standards may be meaningless.
  • Standards should be reviewed from time to time: today's good idea will be bad tomorrow
  • With a "standard" become a habit for quite awhile, it will be hard to break away from it
  • The standards were not carefully thought out. The rules or principles were carried over to a different programming language, but cannot or should not be applied when codes are written in a different one (code conversion).
  • One computer language should have its own coding standards if there are standards. When there are 2 computer languages used at the same time (C# and Sql is fairly common to work together), the rules may be very confusing and even against each other.