language-agnostic

how to read an address in multiple formats like google maps

notice that on google maps you can input the address any way you like. as long as it is a valid address...google maps will read it. In some ruby book I had seen code snippet for something like this, but with phone numbers. Any ideas how this could be done for addresses? in language of your choice. EDIT: i dont care about a "valid" ...

Learning material for working with book databases?

I'm tasked with developing an application for retrieving, storing and searching data about books, magazines and the like, something very similar to a library application. While researching the topic I was stunned with the magnitude of different standards and acronyms, ISBNs, EANs, IANs and many more... so, are there any books or articles...

When to remove the Beta tag?

My team will soon be launching a web app in Beta. At what point does the Beta tag need to go? Google seems to hold on to the Beta tag for a long time while others do it for a month or so. Is there some rule of thumb like all known bugs fixed to follow or a time frame or some other methodology for this? Of course when Beta is gone then ...

Purpose of private members in a class

What are the purposes of having private/protected members of a class/structure in object-oriented programming? What's the harm in having all members be public? ...

What kinds of problems are most likely to occur? (question rewritten)

If I wrote 1) a C# SQL database application (a simple program consisting of a GUI over some forms with logic for interfacing with the SQL database) 2) for home use, that doesn't do any network communication 3) that uses a simple, reliable, and appropriate SQL database 4) whose GUI is properly separated from the logic 5) that has c...

Number of attempts to brute force an average password / non intrusive yet meaningful limits?

There are several useful answers on SO regarding prevention of brute forcing a password of a web service by applying throttling. I couldn't find any good numbers though and I have little expertise in this area, so the question is: How many attempts does it usually take to brute-force an average password of 6 or more characters (with no ...

Building a tree using a list of objects

I have a list of objects with property id and parent_id. I want to build a tree to link up those children and parents. 1 parent may have several children and there is an object which will be the ancestor of all objects. What's the fastest algorithm to implement that? I use C# as programming language, but other languages are also okay. ...

Algorithm design and analysis separation

Should the people who analyse the output and results of an algorithm be aware of its design? By analysis I mean finding cases where the algorithm failed and returned bad results. ...

Fantasy names database

I am building a demo dataset for my webapp. I would like thousands of "real looking" names. They should not be names of famous people or fiction heroes or names that will evoke associations. They should all have various and different sounding but realistic male and female names and surnames. Birth dates and other data can be randomly ge...

How to measure or represent change in a value between time periods?

I need to provide some indication of the way a value is changing between time periods. This value could move in any of the following ways: 0 -> some positive value some positive value -> 0 positive value -> larger positive value positive value -> smaller positive value I have initially looked at providing a % change value, however thi...

How can I make named parameters peform as fast a positional parameters?

Are there techniques for this, or does it come down to the individual language and compiler? ...

How do I implement a Voting system?

I am required to implement a functionality similar to SO voting. I tried to look up some existing questions around this topic and noticed that most people are stuck with how to vote up and down. i am past that. my problem is related to how to handle after a vote has been upvoted. here is what i have done till now. Vote up, Down and Sco...

System re-design, SyRS

If you are re-designing a system, and you are writing a SyRS for the re-designed version of the system, following IEEE 1233 how do you make backreferences to "the old design" and mention what was wrong with it? I can think of 2 ways to do it: The old system should be summarized outside the new SyRS, and the new SyRS should simply spec...

Name that technique (it may be called 'piggybacking')

What is the name of the following method/technique (I'll try to describe the best I could, background on "memoization" is probably needed to understand why this technique can be very useful): You start some potentially lenghty asynchronous computation and you realize that an identical computation has already been started but is not done...

Most efficient way to count occurrences?

I'm looking to calculate entropy and mutual information a huge number of times in performance-critical code. As an intermediate step, I need to count the number of occurrences of each value. For example: uint[] myArray = [1,1,2,1,4,5,2]; uint[] occurrences = countOccurrences(myArray); // Occurrences == [3, 2, 1, 1] or some permutation...

Tools for viewing logs of unlimited size

It's no secret that application logs can go well beyond the limits of naive log viewers, and the desired viewer functionality (say, filtering the log based on a condition, or highlighting particular message types, or splitting it into sublogs based on a field value, or merging several logs based on a time axis, or bookmarking etc.) is be...

Thread Quantum?

What is a thread quantum, and how can I identify it on my system? ...

Code Golf: Collatz Conjecture

Inspired by http://xkcd.com/710/ here is a code golf for it. The Challenge Given a positive integer greater than 0, print out the hailstone sequence for that number. The Hailstone Sequence See Wikipedia for more detail.. If the number is even, divide it by two. If the number is odd, triple it and add one. Repeat this with the n...

How would you calculate all possible permutations of 0 through N iteratively?

I need to calculate permutations iteratively. The method signature looks like: int[][] permute(int n) For n = 3 for example, the return value would be: [[0,1,2], [0,2,1], [1,0,2], [1,2,0], [2,0,1], [2,1,0]] How would you go about doing this iteratively in the most efficient way possible? I can do this recursively, but I'm int...

OK to put my public interfaces into their own package

Would it be OK to put my public interfaces into their own package (for my organisation only). for example com.example.myprogram - contains all normal code com.example.myprogram.public - contains public accessible interfaces com.example.myprogram.abstract - contains abstract classes Is this a good or a bad thing to do, are there any...