2022 Developer Survey is open! Take survey.

New answers tagged

1 vote

Are there typo-tolerance algorithms (as opposed to string similarity)?

There are a couple of string similarity algorithms that could be useful in an editor for detecting typos. The trick is to use the current position, find the start of the current token by moving back ...
user avatar
  • 66.9k
2 votes

Are there typo-tolerance algorithms (as opposed to string similarity)?

I don't think there is a single algorithm that's going to do what you want. For point 1 (transpositions) you can use Damerau-Levenshtein Distance, or the simpler Optimal String Alignment distance (...
user avatar
  • 668
1 vote
Accepted

Calculate operation time and setuptime or costprice based on a variable set of parameters - Design Pattern?

There are a couple of approaches possible here. To name a few: create dependency network: the parameters of your excel sheet would be nodes. The transformations that use these parameters to determine ...
user avatar
  • 66.9k
1 vote

Calculate operation time and setuptime or costprice based on a variable set of parameters - Design Pattern?

The decorator pattern may be of help here. The idea being that optional behaviors can be mixed and matched arbitrarily with construction code rather than a forest of if branches. This can end up ...
user avatar
0 votes

Determing uniformity of (name, value) array

First you have to define exactly what you mean by diversity. You'll have to come up with some scaling algorithm with different weighting factors. In doing so you might have two different lists with ...
user avatar
  • 154
0 votes

Is there any specific reason to use "else if" clause?

The number of days in a year is 365, except every four years it is 366, except every 100 years it is 365, except every 400 years it is 366. (There was lots of code getting it wrong in the year 2,000, ...
user avatar
  • 37.4k

Top 50 recent answers are included