1,474 Answered Questions for the topic computer programming

Computer Programming

04/02/19

Why are const parameters not allowed in C#?

It looks strange especially for C++ developers. In C++ we used to mark a parameter as `const` in order to be sure that its state will not be changed in the method. But why can't we mark as method... more
Computer Programming

04/01/19

Why is Math.pow(0, 0) === 1?

Javascript says that: Math.pow(0, 0) === 1 // true and C++ says the same thing: pow(0, 0) == 1 // true Why does `Math.pow(0, 0)` throw no errors?
Computer Programming

03/31/19

Why do new programmers seem to shy away from libraries?

I've noticed questions from new programmers that can be solved using libraries. People sometimes shy away from using libraries. Is it the learning curve?
Computer Programming

03/30/19

Using an ORM or plain SQL?

For some of the apps I've developed (then proceeded to forget about), I've been writing plain SQL, primarily for MySQL. Though I have used ORMs in python like... more
Computer Programming

03/30/19

How do I distinguish between 'binary' and 'text' files?

How do you tell if a file is 'text' or 'binary'? And to restrict is further, how do you tell on a Linux like file-system? I am not aware of any filesystem meta-data that indicates the 'type' of a... more
Computer Programming

03/27/19

What is a good hash function?

I saw a lot of hash function and applications in my data structures courses in college, but I mostly got that it's pretty hard to make a good hash function. I get that is a somewhat good function... more
Computer Programming

03/27/19

Is a GUID unique 100% of the time?

Is a GUID unique 100% of the time?Will it stay unique over multiple threads?
Computer Programming

03/27/19

What's the difference between passing by reference vs. passing by value?

What is the difference between 1. a parameter passed by reference2. a parameter passed by value?Could you give me some examples, please?
Computer Programming

03/27/19

What are the benefits and drawbacks of OOP?

As far as I can tell, in spite of the countless millions or billions spent on OOP education, languages, and tools, OOP has not improved developer productivity or software reliability, nor has it... more
Computer Programming

03/27/19

Function for creating color wheels?

This is something I've pseudo-solved many times and have never quite found a solution for.The problem is to come up with a way to generate `N` colors, that are as distinguishable as possible where... more
Computer Programming

03/27/19

How to check if the given string is palindrome?

How to check if the given string is a palindrome? Looking for solutions in any language.
Computer Programming

03/26/19

Write an Algorithm in Pseudocode

Write an algorithm that, given a sequence of characters, allows you to find the number of words that begin with letter "A"
Computer Programming

03/26/19

Difference between red-black trees and AVL trees?

Can someone please explain what the main differences between these two data structures are? I've been trying to find a source online that highlights the differences/similarities, but I haven't... more
Computer Programming

03/26/19

Why is NaN not equal to NaN?

The relevant IEEE standard defines a numeric constant NaN (not a number) and prescribes that NaN should compare as not equal to itself. Why is that? All the languages I'm familiar with implement... more
Computer Programming

03/26/19

Observer Design Pattern vs "Listeners"?

It seems to me that the Observer design pattern as described in GOF is really the same thing as Listeners found in various toolkits. Is there a difference between the concepts, or are Listeners and... more
Computer Programming

03/26/19

Private vs Protected - Visibility Good-Practice Concern?

I've been searching and I know the theoretic difference. - **public** - Any class/function may access the method/property. - **protected** - Only this class and any subclasses may access the... more
Computer Programming

03/19/19

What is the difference between concurrent programming and parallel programming?

What is the difference between concurrent programming and parallel programing? I asked google but didn't find anything that helped me to understand that difference. Could you give me an example for... more
Computer Programming

03/19/19

What is composition as it relates to object oriented design?

What is Compositon? I understand inheritance from the point of Person : Mammal : Animal, but I can't really see the definition of Compostion anywhere.. Can somebody fill me in?
Computer Programming

03/19/19

Print two-dimensional array in spiral order?

How do I print a 5x5 two-dimensional array in spiral order? Is there any formula so that I can print an array of any size in spiral order?
Computer Programming

03/18/19

What is an invariant?

The word seems to get used in a number of contexts. The best I can figure is that they mean a variable that can't change. Isn't that what constants/finals are for?
Computer Programming

03/18/19

Is it ever advantageous to use 'goto' in a language that supports loops and functions? If so, why?

I've long been under the impression that `goto` should never be used if possible. While perusing libavcodec (which is written in C) the other day, I noticed multiple uses of it. Is it ever... more
Computer Programming

03/18/19

When, if ever, is loop unrolling still useful?

I've been trying to optimize some extremely performance-critical code (a quick sort algorithm that's being called millions and millions of times inside a monte carlo simulation) by loop unrolling.... more
Computer Programming

03/18/19

How to always round up to the next integer?

I am trying to find total pages in building a pager on a website (so i want the result to be an integer. I get a list of records and i want to split into 10 per page (the page count)when i do... more
Computer Programming

03/18/19

Convert light frequency to RGB?

Does anyone know of any formula for converting a light frequency to an RGB value?
Computer Programming Web Design

03/18/19

Can I change my background on each page on my wix website?

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.