answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Difference between delay subroutine and ordinary subroutine in context of 8085?

a subroutine is a portion of the code within a larger program which performs a specific function and is independent of remaining code.....delay routines are subroutines used for maintaining the timings of various operations in microprocessor

Peterson algorigthm with n process?

while(1) { // thread i (0 <= i < n)

for (j=1 ; j<n ; j++) {

flag[i]=j;

last[j]=i;

for (k=0 ; k<n ; k++) {

if (k==i) continue;

while (flag[k]>=flag[i] && last[j]==i) {

sleep(random());

}

}

}

// critical section

...

// end of critical section

flag[i]=0;

// not critical section

...

// end of not critical section

}

What is a logic error in a programs code?

It is a generic term for screwing the program code up. It means that somewhere in the coding it is not doing what it is supposed to do. Say you wanted to add the amount of apples and then print the amount for inventory. The code says that it is adding the apples then sending a zero amount for the amount to the inventory.So the inventory shows a zero balance all the time. This is a logic error. Good luck.

What statements indicate the start and end of a procedure?

A procedure is started by calling the function that represents that procedure. The function call must include any and all required arguments.

The procedure ends whenever a return statement is encountered anywhere within the function body, or execution falls off the end of the function (assuming no return value is expected from the procedure), or a non-return function is invoked by the function (such as the abort() function) or an unhandled exception is thrown by the function. Apart from a non-returning function call, execution always returns to the calling code (the caller). If an unhandled exception is thrown by a function, the call stack automatically "unwinds" until a suitable exception handler is found. If no handler is found on the call stack, the global main function will unwind, terminating the program with an unhandled exception error. Hence the reason all non-trivial programs should provide a "catch-all" exception handler in the global main function.

Can you see a hacker?

hacker is not a bacteria , or invisible man. we can see hackers. probably your question should be "can we find hackers?". hackers are not robbers or gang lords. they are same as common man but with some knowledge about computer's working. but crackers are hard to be found.

Program to implement strdup in C?

char *strdup (const char *s)

{

size_t len;

char *p;

if ( !s )

return NULL;

len = strlen (s);

p = malloc (len+1);

if (p && len)

{

memcpy (p, s, len);

p[len] = '\0';

}

return p;

}

How many API?

There are 3 types of Java Programming Language Application Programming Interfaces (APIs) :

• The official core Java API, contained in the JDK or JRE, of one of the editions of the Java Platform. The three editions of the Java Platform are Java ME (Micro edition), Java SE (Standard edition), and Java EE (Enterprise edition).

• Optional official APIs that can be downloaded separately. The specification of these APIs are defined according to a Java Specification Request (JSR), and sometimes some of these APIs are later included in the core APIs of the platform (the most notable example of this kind is Swing).

• Unofficial APIs, developed by third parties, but not related to any JSRs.

Third-parties can freely implement any JSR specifications for an official API (even for the core API of the language), providing that they conform to the Technology Compatibility Kit (TCK) for this JSR (the TCK is a suite of tests that checks conformance of implementations for a JSR). The result of this freedom is that many official APIs have more implementations than the Sun's Reference implementation (RI).

What is the difference between circular linklist and linklist?

In a circular linked list every node is connected to another node. In a non-circular linked list. There are definitely starting and ending nodes are lacking an incoming and outgoing link, respectively.

What are the changeover approaches of an information system?

The process of putting the new information system online and retiring the old system is known as system changeover. There are four changeover methods which are: Ø Direct cutover: The direct cutover approach causes the changeover from the old system to the new system to occur immediately when the new system becomes operational. It is the least expensive but involves more risks than other changeover methods. Ø Parallel operation: The parallel operation changeover method requires that both the old and the new information systems operate fully for a specified period. Data is input to both systems and output generated by the new system is compared with the equivalent output from the old system. When users, management, and IT group are satisfied that the new system operates correctly then the old system is terminated. It is the most costly changeover method and involves lower risks. Ø Pilot operation: The pilot changeover method involves implementing the complete new system at a selected location of a company. Direct cutover method and operating both systems for only the pilot site. The group that uses the new system first is called the pilot site. By restricting the implementation to a pilot site reduces the risk of system failure as compared with is less expensive than a parallel system. Ø Phased operation: The phased operation changeover method involves implementing the new system in stages, or modules. We can implement each subsystem by using any of the other three changeover methods. In this approach risk of errors or failures is limited to the implemented module only as well as it is less expensive than the full parallel operation. For implementing child health information system we can use above methods but there are some advantages as well disadvantages of using these systems, which are explained below: Ø Direct cutover: = Advantage = As we know health centre does not have enough funds for implementing the new system so it would be easier to implement direct cutover method in the health centre. = Disadvantage = This method of system changeover involves more risks of total system failure and it is preferred for commercial software packages. So if there is a system failure in health centre then it will be difficult to store information of child who visits health centre. And if there is no proper storage then there will be incorrect reports and monitoring of child's health will not be properly done. Ø Parallel operation: = Advantage = The advantage of parallel system is lower risk of system failure so all the tasks can be done properly at health centre. If the new system does not work properly, the health centre can use the old manual system as a backup until appropriate changes are made. = Disadvantage = As we know parallel system is the most costly changeover method as both old and new systems operate fully for specified period and we also know that the budget of health centre is also low so it will be difficult for health centre to follow this changeover process. Ø Pilot operation: = Advantages = Pilot operation is combination of both direct cutover and parallel operation, which restricts the implementation to a pilot site and reduces risk of system failure as compared with a direct cutover method. Operating system only at pilot site is less expensive than parallel operation for entire health centre and all health centers. If we use parallel approach to complete the implementation then the changeover period can be much shorter if system proves successful at the pilot site so a lot of time will be consumed at health centre in implementing the new system. = Disadvantage = This method is also costly as compared to the direct cutover. Ø Phased operation: = Advantages = As we know in this method we have to implement the new system in stages, or modules, which is less prone to risk of system failure or errors at health centers, as failure is limited to the implemented module only. It is also less expensive than parallel system because we have to work only with one part of system at a time. = Disadvantage = As the system, which we are implementing, involves various phased operation like treatment, measuring weight, registration, vaccination etc so it can cost more than the pilot approach. As we can determine from above information that pilot approach is the best approach where we can see the combination of less risks as well as less implementation cost because. There are many health centers so we can implement the new system only at any one of the health centers to check whether it is working appropriately or not. And this method is also cheaper than all other methods except direct cut over where there are chances of risks here in this method risk of system failure is very less.

What is a depopulation program?

A depopulation program is a method to reduce the overall amount of people, animals, or organisms living within a given area. It is typically done to prevent the overcrowding of animals which cannot directly limit their own breeding.

How do you create a loop in f sharp?

The basic syntax for a for loop in F# is :

for pattern in enumerable-expression do

body-expression

The enumerable-expression can be a list, sequence, array, sets, maps so on.

It can also be a range, like 1 .. 10 or 1 .. 2 .. 10.

The former meaning the range of integers from 1 to 10. The later means, range

of odd integers (jumping 2 steps ahead) from 1 to 10.

Who built the world's first binary digit computer the Z1?

Konrad Zuse of Berlin. The Z1 was first designed in 1934 and completed in 1938. It was destroyed by Allied bombing raids in 1943 along with all construction plans. However, Zuse reconstructed the original Z1 from 1986 to 1989. It now resides in the German Museum of Technology in Berlin.

When function returns a value the entire function call can be assigned a variable?

AnswerYes, it can. For instance, if your function returns double you can assign the function call to a variable of type double.
AnswerNo, only the returned value, of course.

What does missing return statement mean?

The compilation error occurred when a FUNCTION (a method that returns a thing, not the void-type) has at least one branch of codes does not return the required object in the correct type.

It maybe confusing with some languages require to use the name of the Function as the "local" variable to be assigned with value, and hence establish the "return", while some languages, such as C# and Java, do not.

---- C# ----

public int My_Int_Function() {

// DO NOT Use the commented statement

// My_Int_Function = 1;

// Instead, use a local variable that is NOT the same as the method name

return 1; // never use the function name as the variable

}

Describe the major disadvantages for memory allocation schemes?

= for memory allocation schemes? = http://wiki.answers.com/Q/FAQ/2096

= for memory allocation schemes? = http://wiki.answers.com/Q/FAQ/2096

In .NET is CLR a process or a thread?

Process ....

it is responsible for managing the execution of the .NET programs , it is the same as JVM is for JAVA programs...

How do you terminate a command before it is executed?

The easiest method of doing this is to press the cancel button if it is available. If it is not, you can go into task manager (press control-alt-delete to do this), find the process you want to stop and click the end process button.