answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Where we can use dijkstra's algorithm?

A practical application is in certain routing protocols, like OSPF. The problem it solves is to search for the "shortest" path to each destination - "shortest" meaning the one that has the lowest "distance" or "metric" according to the criteria used.

Dijkstra's algorithm is easy to use and is a good graph search algorithm to use when it is hard to calculate the heuristics.

In vb6.0 why we are using modules?

Hi.

  1. Many think "Visual Basic" is all about "Visual", in other words "no forms, no programs". There are many situations in real life where you need to have programs that do not have anything to do with forms. Like some DOS command line applications. This is one situation you need to use a module.
  2. There are situations where certain generic functiions that are used across the entire application are to be placed in one place, in such cases Modules are used.
  3. Certain complex data types (eg: array of user defined types being passed around as parameters) that cannot be handled in form module and you need a Module for this.
  4. There are situation when you need to hook or sub class Windows events, and Modules are inevitable here.
Hope this helps,

Tomsan

What is a C program to calculate the number of characters in a string?

#include<stdio.h>

int Strlen (const char* str) {

if (!str) return -1; /* invalid argument */

int count;

count=0;

while (*str++) ++count;

return count;

}

int main (void) {

char str[1024];

scanf ("Enter a string: %s\n", str);

printf ("Length of string: %d\n", Strlen(str));

return 0;

}

What does machine language consists of?

A series of 1's and 0's which represent Instructions.

Assembly Language is a 1-to-1 representation of machine code in human readable context. Assembly Language can also contain comments and label names which get filtered out when converting assembly to machine code (compiling).

If you want to read machine language, you use a disassembler to convert machine code into assembly. Otherwise programs such as notepad or nano will show the contents of the file as gobbly-gook (random characters with no meaning).

32-bit processors parse the file into 32-bit 1's and 0's segments. Each segment gets ran and processed individually. And not all segments are meant to be ran. Some are data and get skipped over, and other instructions load and use that data for their intended purpose.

What are the advantages and disadvantages of pairwise programming?

Assuming you understand what Pair-wise programming is, we can in general say that it is advantageous because the overall logic of the code written, the idea behind using certain constructs in the code, etc. are known to different people rather than a single head. Since, two or more heads is obviously better than one, we see that Pair-wise programming is certainly advantageous. But, the flip-side is say you are stuck in a situation in the code-development and one fine afternoon you get a flash but you cannot code because your partner is not there. Also, increased costs is another disadvantage. These are the basic points and I can assure you that there are several subtleties involved.

What flag was used as the basis of the design of Alabama's flag?

The flag that was used as the basis of the design of Alabama's flag was the flag of Scotland. The design was the same with just a few modifications like the color.

What is first -fit algorithem in memory allocation?

When seeking a contiguous block of memory to allocate, the first block that is at least as large as the size being requested is allocated.

How do you get the edit sidebar link to pop up in a Google sites document?

From Google support:

Edit the sidebar

If you are the owner of a site, you can change whether the sidebar appears, where it appears, and what gadgets are included in it.

Getting to the sidebar editor:

- Click the More button near the top-right corner of your browser window.

- Select Edit site layout.

Sidebar options

Once you are in the "Edit site layout" mode:

1. Click on Sidebar in the toolbar to enable or disable the sidebar.

2. If you want to keep your sidebar, you can choose where it will appear by selecting the pencil-shaped edit button on the black "Sidebar" header. You can also change the sidebar width by entering a new width, in pixels, in the edit dialog.

Adding and deleting gadgets in your sidebar

Once you are in "Edit site layout" mode, you can click on the + icon in the header to add items.

Individual gadgets can be removed by hovering over a gadget and clicking x. You can reorder gadgets by dragging them.

What is the importance of a test specification?

you need test to see if it is right or wrong. You also need to test 10times maybee to make sure it's right or wrong. you need test to see if it is right or wrong. You also need to test 10times maybee to make sure it's right or wrong.

Term used to denote an error in computer programme?

A bug.

The story may be apocryphal, but supposedly an early programmer, possibly Grace Hopper or one of the people involved with the ENIAC, was trying to figure out why their primitive computer was not working correctly. They traced the problem to a board that held dozens of electromechanical relays. After inspecting it for a while, they found that an insect had crawled between two contact points as was preventing a circuit from completing. When asked what the problem was, the programmer replied that they "had found a bug".

How do you retrieve files from corrupt laptop that can't boot to Windows?

Your operating system is corrupt not your laptop. If your laptop is not physicaly broken most likely its in good shape and ready to serve you. You don't have to throw away your laptop and waste your money.

You can easily retrieve your files by loading linux onto your computer via a USB stick. Linux is another operating system which is used by many programmers and developers.

Here is a free software that will let you make a linux pendrive. The instructions on the site are very simple. If you're the kind of person who is not good with computers have a friend or relative do this for you.

After making the linux pendrive just stick the usb into the computer and boot it up. There should be an option to load linux and click that option. If you have trouble loading your linux pendrive please go to www.youtube.com and see a step by step instructional video on loading pendrivelinux.

Once linux has booted you can easily use it as you would use any other operating system. From here on click folders and find your data. Once you find your data you can drag your files into another USB stick or an external hard drive or an SD card.

Like I said before just because Windows is corrupt doesn't mean that your laptop is broken. Save yourself the money and trouble of buying a new PC and just reinstall windows. If you lack the computer knowledge to reinstall windows have a friend or relative do it for you, there are step by step tutorials on youtube that are easy to follow.

If you or anyone you know can't reinstall windows I would reccomend finding your local Computer technician and having them do it for you. This option however would cost you a lot of money. Be aware of computer technicians of who are frauds, I highly reccomend you delete all your personal files before handing your computer to a stranger, also make sure this person doesn't steal the hardware on your laptop. There are many cases where computer technicians take advantage of people who don't know much about computers by stealing valuable computer chips and replacing them with cheap computer chips. A technician may also tell you that there are many things wrong with your computer and you need get some major work done when in reality there is nothing wrong with your computer.

How do you make an invisible program?

To make a program invisible, you can take one of the following methods:

(1) hide the user interface of the program. most programming languages provide APIs (Application Programming Interface) for you to hide the windows, task bar icons and other visible elements.

(2) create your program as a service. Services don't need user interfaces, so they are invisible to normal users.

(3) inject your program into other hosts (programs). This is the typical behavior of Trojans and Virus, this kind of program is prone to be detected as malicious software by anti-virus software, so it is not a good method to create normal programs.

Distinguish between a procedural language and OOPS language?

procedural language:

1.doesnt uses objects

2. code is not divided into different functions

3.no code reusability

4.uses only procedures-top to bottom approach

5.cobol is best example for procedural language

6.takes long time to compile and difficult to find errors

oops:

1.we can use objects to identify different classes

2.divide code into different classess

3.code reusability

4.speed compilation and execution

5.easy to correct errors and easy to understand

6.bottom to top approach

by Bipin

What displays the results of the processing?

The results would normally be displayed on a monitor, printer, or plotter.