answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Is it true that in designing an object-oriented program the emphasis is placed on the procedures rather than on the objects needed to solve a given problem?

That is false; the very definition of object-oriented programming is to create objects that model real objects, which places an emphasis on data encapsulation, polymorphic objects, and so on to reduce code complexity, common programming errors, and other problems associated with a non-object-oriented language. The procedures are not nearly as important as the objects that are designed.

What is ticking box testing?

; ticking-box testing : a widely used philosophy of testing, in which no testing is done after the project is fairly well debugged -- the program is given to customer's for trial and acceptance (Robert Kruse)

Is FORTH a computer language?

Yes. Forth is a stack-based computer language.

How do you programme Twos complement in binary in c?

int complement (int n) {

return -n;

}

or int complement (int n) {

return ~n+1;

}

both does the same thing.

What is cloud technology?

Answer: Cloud computing is a style of computing in which dynamically scalable and often virtualised resources are provided as a service over the Internet.Users need not have knowledge of, expertise in, or control over the technology infrastructure "in the cloud" that supports them

The concept incorporates infrastructure as a service (IaaS), platform as a service (PaaS) and software as a service (SaaS) as well as Web 2.0 and other recent (ca. 2007-2009) technology trends that have the common theme of reliance on the Internet for satisfying the computing needs of the users. Examples include salesforce.com and Google Apps which provide common business applications online that are accessed from a web browser, while the software and data are stored on the servers.

The term cloud is used as a metaphor for the Internet, based on how the Internet is depicted in computer network diagrams, and is an abstraction for the complex infrastructure it conceals.

Cloud technology provides the ability to save files or run applications for external host servers. It can connect computers over a network and has the ability to run a program on many connected computers at the same time.

Google is an example of cloud computing with the use of Gmail and its 'Drive' which consists of 'Google Docs' and forms, that can invite other connected computers to your work and together create a 'live' project.

How do you test your code?

Hi, Prepare unit testing test cases. Take each control/object in your progra, write test case (what to enter, alpha or numeric or alpha/numeric, date etc) and what are you expecting from the system once you enter the data. Try all options that you have provided (like Add, Change, Display, Print etc) and see whether the program functions as per the requirement. The program should do intended functions and no un-intended thing to happen. hope this helps

What is the main function of design?

Communication, A designer's goal is to communicate something to all the pople who will see the design.

You have no task manager?

If 'Control Alt Delete' doesnt work and you are a client account on network you might not have it. That aside, goto C:/windows/system32 and look for taskmgr application. Once found you can re-establish the shortcut. If you don't find it you will have to try a reinstall through Control Panel 'Add/remove Programs' or attempt running an OS repair from the original Windows install disc.

How many strings can be formed of length 4 from a language containing 10 letters?

In a "language" containing just 10 letters, there are 10,000 four-letter permutations. It's easy to work out if you simply replace the letters with decimal digits 0-9. The first permutation is 0000, followed by 0001, 0002, 0003, ..., 9997, 9998 and 9999.

What does a high uibc level mean?

A high UIBC (Unsaturated Iron-Binding Capacity) level indicates that the blood has a greater capacity to bind iron, suggesting that there may be low levels of transferrin saturation or a deficiency in available iron. This can be associated with conditions like iron deficiency anemia or chronic blood loss. It reflects the body's attempt to increase iron transport capacity in response to low iron levels. However, it’s important to interpret UIBC results in conjunction with other iron studies for a comprehensive assessment.

What does SAP do?

All sustainable businesses work on this basic business model:

1) Take something at a cost of "A" (lets call it the input), then

2) Do something with that input at a cost of "B", to

3) Produce something better (or different) to sell at a cost of "C".

For the business to be sustainable, "C" must be greater than "A"+"B".

In the broadest sense, SAP can be defined is a suite of computer programs all bundled together, which give the business - any business - the capability of doing step 2 (above) better than their competitors.

When a user-level thread executes a system call not only is that thread blocked but also all the threads within the process are blocked Why is that so?

A system call is actually a transition from user mode to kernel space to carry out a required operation..

For exp: Write() function resides in kernel space and can be accessed by a only corresponding wrapper function which was implemented in user space.. In case of Windows OS, Win32 API is the implementation to such as wrapper functions that make the actual system calls from user mode..

A kernel thread is created, scheduled and destroyed by the kernel..

Whereas a library thread (user thread) is created, scheduled and destroyed by a user level library like special threading libraries.. The kernel does know of nothing about library threads since they live in a process's boundaries and bound to its life cycle tightly..

Actually, a process is not the primary execution unit in all operating systems..

When a process is made by kernel, a new kernel thread is created and attached to that process in question..

So the library threads created in user mode by a user mode library must share the time slices given to the kernel thread by the scheduler arbitrarily during the lifetime of a process..

So a process actually has one kernel thread and all other library threads have to share the kernel thread's cycles..

Hence when a library thread makes a blocking call, all the threads within the process are blocked because as I said, actually process has only one kernel thread assigned to it and others try to make use of it..

So to prevent other threads from blocking, either you should use library threads that make use of kernel threads or you could just use the CreateThread() Win32 API system function for kernel threads but the synchronization mechanism must be provided by the programmer using events, signals, mutex, semaphore etc..

Sun, BSD Unix flavours, Windows etc follow the same threading architecture in their systems as POSIX standard..

However, a thread is a process in Linux.. That's why Linux is so powerful in server systems.. So the control is left to programmers to create a POSIX way of treading model by Clone(2) system call(s).. So address space and data etc can be shared by lightweight processes easily.. When a Linux kernel thread (child process) is crashed, it won't affect the rest of the threads belong to parent process.. This is just the opposite in other operating systems that a crashing thread will destroy all of the threads in the process..

NPTL is a great threading library that was implemented by using Linux clone(2) system call.. Linux also has another type of kernel thread only lives in kernel space that can be utilized by kernel code like modules..

User threads can't be run in parallel on the different CPUs because of this. However, they are portable..

Kernel threads can be scheduled by kernel to be run on a SMP system..

Hope this helps..

hsaq19@ TH Algan

How primitive variables are stored on Stack?

Call-stacks are fixed-length and are allocated on a per-thread basis as threads are instantiated. The stack pointer CPU register keeps track of the next available address in the current thread's stack. The compiler computes the length of a function according to the number and type of its local variables (including formal arguments) plus the return address. When the function is invoked, the current stack pointer is adjusted by this amount, creating a "stack frame" specific to that function. Given the start address of the stack frame, the local variables and formal arguments can be referred to via constant offsets within the stack frame. When the function returns, the stack pointer is readjusted, effectively freeing the memory without actually releasing it back to the system. In this way, memory can be allocated and released on the stack with minimum cost.

What is linking in computer programming?

In order to execute a high-level program, the source code must be converted to a machine code executable. To achieve this, each translation unit is precompiled by the preprocessor. The resultant code is then compiled by the compiler to generate an object file. Once all the object files are generated they are interwoven and linked together to produce the final executable. This final stage is known as linking.

Compiling

A computer source program, written as human readable text, needs to be converted to something the computer can use as instructions as part of a program. A compiler (or assembler) performs this function by examining the text and creating a machine language version of the source program. If the program is simple enough and you have the right compiler/assembler, the results may be a program that is immediately usable as an executable program. Otherwise the results of a compilation is a file called an object module, object program, or program object and the contents of the file is called object code. This has nothing to do with object oriented programming.

Objects (not OOP)

Modern day programming involves larger complex programs made up of multiple source programs that are compiled separately into object modules (or functions or subroutine). These programs often reference each other to do things required for the computer program to work properly. They also may reference system supplied and other modules that may already be available, or need to be made available on the computer.

Referencing these external modules is done with special codes inserted by the compiler into the results of the program compilation. These unresolved external references is one of the reasons the result of compiling a program is not immediately executable.

Linking

Unresolved references have to be identified and made available in the executable program. Most systems refer to this as linking. It is also called binding or object resolution. The program that does this can be called (depending on your computer or system) a linker, linkage editor, binder, loader, or task builder. There are even systems that can do the work "on the fly" as the program running.

Linkers get a list of files of object modules and locations on the computer to look for more modules, put them together and change the unresolved references to point to the actual code in the object modules. Any remaining unknowns are searched for in system areas and are resolved similarly. Once done the result should be a program that is executable in the system.

What are the benefits of the WEEE directive?

The Waste Electrical and Electronic Equipment (WEEE) Directive aims to prevent the generation of electrical and electronic waste and to promote re-use, recycling and other forms of recovery in order to reduce the quantity of waste discarded. It requires the collection of waste electrical and electronic equipment and the recovery and re-use or recycling of waste collected.

What is auto text?

AutoText is an excellent tool in Word for writing the same text repeatedly. It is found under Tools, AutoCorrect. Once you have created an AutoText, as you start to write the text, a hover-over flag appears and you simply hit Enter to auto complete with the pre-formatted, pre-written text. It allows paragraphs to multiple pages to insert, for example an approved ending to a customer complaint letter. In PowerPoint, the only option you have is AutoCorrect which allows you to write one or two letters and have the automatically change to a whole word or phrase, for example your initials change to your whole name.

What is the difference between G code and M code in CNC programming?

Generally G codes are writen in and performed by the CNC processor and operate the motion control part of the control, the M codes are MACHINE codes, these operate most of the basic electrical control functions such as Coolant, Tool changers, safety circuits etc, the M,S & T codes are written in a separate PLC processor, both processors usually communicate with each other over a common bus.

The tool changer and spindle are both configured to suit a particular machine specifics.