1,486 Answered Questions for the topic computer programming

Computer Programming Computer Science Oracle Proofs

05/24/19

Why is (a | b ) equivalent to a - (a & b) + b?

I was looking for a way to do a BITOR() with an Oracle database and came across a suggestion to just use BITAND() instead, replacing BITOR(a,b) with a + b - BITAND(a,b).I tested it by hand a few... more
Computer Programming

05/20/19

shift bits or other way to reverse equation

(A * 4) + (B * 32) + (C * 128) + (D * 2048) = 2252how to reverse this equation and get the values of A, B, C and D? please help, i've been thinking for days.. thanks in advance.
Computer Programming

05/14/19

how do code this

gross_pay = round(hours * pay_rate, 2)tax_rate = 18
Computer Programming

05/13/19

What Is Tail Call Optimization?

Very simply, what is tail-call optimization? More specifically, Can anyone show some small code snippets where it could be applied, and where not, with an explanation of why?
Computer Programming

05/13/19

Generate all unique substrings for given string?

Given a string `s`, what is the fastest method to generate a set of all its unique substrings? Example: for `str = "aba"` we would get `substrs={"a", "b", "ab", "ba", "aba"}`.The naive algorithm... more
Computer Programming Python Graphic Design

05/12/19

Write a program to implement the DBSCAN algorithm using python. Graphically visualise the cluster outputs with each cluster points given in different colours.

The input will be a chameleon data set. And also check the quality measure using Homogenity and seperation
Computer Programming

05/08/19

What is a lambda (function)?

For a person without a comp-sci background, what is a lambda in the world of Computer Science?
Computer Programming

05/06/19

Choice of programming language for learning data structures and algorithms?

Which programming language would you recommend to learn about data structures and algorithms? There are some books out there that are programming language-agnostic (written from a Mathematical... more
Computer Programming

05/05/19

Why should hash functions use a prime number modulus?

A long time ago, I bought a data structures book off the bargain table for $1.25. In it, the explanation for a hashing function said that it should ultimately mod by a prime number because of "the... more
Computer Programming

05/05/19

How do you stop interim solutions from lasting forever?

Say there are two possible solutions to a problem: the first is quick but hacky; the second is preferable but would take longer to implement. You need to solve the problem fast, so you decide to... more
Computer Programming

05/05/19

Is there a difference between foreach and map?

Ok this is more of a computer science question, than a question based on a particular language, but is there a difference between a map operation and a foreach operation? Or are they simply... more
Computer Programming

05/01/19

What should NOT be under source control?

It would be nice to have a more or less complete list over what files and/or directories that shouldn't (in most cases) be under source control. What do you think should be excluded?
Computer Programming

04/29/19

What is a magic number, and why is it bad?

What is a magic number?Why should it be avoided?Are there cases where it's appropriate?
Computer Programming

04/28/19

Buffered vs unbuffered IO?

I learned that by default I/O in programs is buffered, i.e they are served from a temporary storage to the requesting program.I understand that buffering improves IO performance (maybe by reducing... more
Computer Programming

04/28/19

Given an integer, how do I find the next largest power of two using bit-twiddling?

If I have a integer number `n`, how can I find the next number `k > n` such that `k = 2^i`, with some `i` element of `N` by bitwise shifting or logic.Example: If I have `n = 123`, how can I find... more
Computer Programming

04/28/19

What is stability in sorting algorithms and why is it important?

I'm very curious, why stability is or is not important in sorting algorithms?
Computer Programming

04/28/19

What does the word "literal" mean?

What does the word "literal" mean when used in context such as literal strings and literal values? What is the difference between a literal value and a value?
Computer Programming

04/27/19

What are "first class" objects?

When are objects or something else said to be "first class" in a given programming language, and why? In what do they differ from languages where they are not?
Computer Programming

04/27/19

How do you plan an application's architecture before writing any code?

One thing I struggle with is planning an application's architecture before writing any code.I don't mean gathering requirements to narrow in on what the application needs to do, but rather... more
Computer Programming

04/27/19

What is meant by "thread-safe" code?

Does it mean that two threads can't change the underlying data simultaneously? Or does it mean that the given code segment will run with predictable results when more than one thread are running it?
Computer Programming

04/27/19

What is a predicate?

Being a hobbyist coder, I'm lacking some fundamental knowledge. For the last couple days I've been reading some stuff and the word "predicate" keeps reappearing. I'd very much appreciate an... more
Computer Programming

04/20/19

Why is quicksort better than mergesort?

I was asked this question during an interview. They're both O(nlogn) and yet most people use Quicksort instead of Mergesort. Why is that?
Computer Programming

04/20/19

What is "loose coupling?"

I can't seem to grok the concept of "loose coupling." I suppose it doesn't help that the word "loose" usually has a negative connotation, so I always forget that loose coupling is a *good*... more
Computer Programming C++ Syntax

04/20/19

What is C++ syntax?

Computer Programming

04/19/19

Difference between parameter and argument?

Is there a difference between a "parameter" and an "argument", or are they simply synonyms?

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.