tagged [language-agnostic]

Determine Whether Two Date Ranges Overlap

Determine Whether Two Date Ranges Overlap Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap? As an example, suppose we have ranges deno...

29 Jan at 02:7

Converting a Uniform Distribution to a Normal Distribution

Converting a Uniform Distribution to a Normal Distribution How can I convert a uniform distribution (as most random number generators produce, e.g. between 0.0 and 1.0) into a normal distribution? Wha...

6 Jun at 20:56

What is the difference between an abstract method and a virtual method?

What is the difference between an abstract method and a virtual method? What is the difference between an abstract method and a virtual method? In which cases is it recommended to use abstract or virt...

What is the meaning of the term "thread-safe"?

What is the meaning of the term "thread-safe"? 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 resu...

Enums and Constants. Which to use when?

Enums and Constants. Which to use when? I was doing some reading on enums and find them very similar to declaring constants. How would I know when to use a constant rather than an enum or vice versa. ...

8 Aug at 21:5

Generate list of all possible permutations of a string

Generate list of all possible permutations of a string How would I go about generating a list of all possible permutations of a string between x and y characters in length, containing a variable list ...

How to write an algorithm to check if the sum of any two numbers in an array/list matches a given number?

How to write an algorithm to check if the sum of any two numbers in an array/list matches a given number? How can I write an algorithm to check if the sum of any two numbers in an array/list matches a...

19 Apr at 10:40

Finding all possible combinations of numbers to reach a given sum

Finding all possible combinations of numbers to reach a given sum How would you go about testing all possible combinations of additions from a given set `N` of numbers so they add up to a given final ...

How to explain callbacks in plain english? How are they different from calling one function from another function?

How to explain callbacks in plain english? How are they different from calling one function from another function? How to explain callbacks in plain English? How are they different from calling one fu...

Learning to write a compiler

Learning to write a compiler : C/C++, Java, and Ruby. I am looking for some helpful books/tutorials on how to write your own compiler simply for educational purposes. I am most familiar with C/C++, Ja...

What is the best regular expression to check if a string is a valid URL?

What is the best regular expression to check if a string is a valid URL? How can I check if a given string is a valid URL address? My knowledge of regular expressions is basic and doesn't allow me to ...

29 Dec at 17:3

Rename Files and Directories (Add Prefix)

Rename Files and Directories (Add Prefix) I would like to add prefix on all folders and directories. Example: I have I would like to add prefix "PRE_"

30 Dec at 12:46

When to throw an exception?

When to throw an exception? I have exceptions created for every condition that my application does not expect. `UserNameNotValidException`, `PasswordNotCorrectException` etc. However I was told I shou...

28 Nov at 12:47

IOException: The process cannot access the file 'file path' because it is being used by another process

IOException: The process cannot access the file 'file path' because it is being used by another process I have some code and when it executes, it throws a `IOException`, saying that > The process can...

29 Mar at 01:23

How would I get started writing my own firewall?

How would I get started writing my own firewall? There is previous little on the google on this subject other than people asking this very same question. How would I get started writing my own firewal...

10 Jul at 19:14

Elegantly check if a given date is yesterday

Elegantly check if a given date is yesterday Assuming you have a Unix timestamp, what would be an easy and/or elegant way to check if that timestamp was some time yesterday? I am mostly looking for so...

What is an ORM, how does it work, and how should I use one?

What is an ORM, how does it work, and how should I use one? Someone suggested I use an ORM for a project that I'm designing, but I'm having trouble finding information on what it is or how it works. C...

11 Jun at 16:31

Why optional parameters must appear at the end of the declaration

Why optional parameters must appear at the end of the declaration In all programming languages supporting optional parameters that I have seen there is a imitation that the optional parameters must ap...

Why are reified generics hard to combine with higher-kinded types?

Why are reified generics hard to combine with higher-kinded types? There exists a notion that combining reified generics with higher-kinded types is a hard problem. Are there existing languages who ha...

What is the difference between all the different types of version control?

What is the difference between all the different types of version control? After being told by at least 10 people on SO that version control was a good thing even if it's just me I now have a followup...

25 Jan at 07:30

Sorting sets of ordered linked lists

Sorting sets of ordered linked lists I'm looking for an elegant, high performance solution to the following problem. There are 256 linked lists. - - - How would you create a single ascending ordered ...

Do e-ink / e-paper screens work in the RGB, CMYK, or some other colour space?

Do e-ink / e-paper screens work in the RGB, CMYK, or some other colour space? Do e-ink / e-paper screens work in the RGB, CMYK, or some other colour space? Will we need to support native CMYK displays...

14 Oct at 10:57

The "backspace" escape character '\b': unexpected behavior?

The "backspace" escape character '\b': unexpected behavior? So I'm finally reading through [K&R](https://en.wikipedia.org/wiki/The_C_Programming_Language), and I learned something within the first few...

Of Ways to Count the Limitless Primes

Of Ways to Count the Limitless Primes Alright, so maybe I shouldn't have shrunk this question sooo much... I have seen the post on [the most efficient way to find the first 10000 primes](https://stack...

23 May at 12:33

What is the difference between a framework and a library?

What is the difference between a framework and a library? What is the difference between a and a ? I always thought of a library as a set of objects and functions that focuses on solving a particular ...