Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 9113

This tag is for questions that aren't specific to a programming language or environment.

1 vote

Traverse a matrix using a linear index to get an evenly distributed values sample

Put all integers from 0 to NxM-1 into an array, shuffle that array randomly and pick the results one after another (mapping to row/column could be anything trivial like row=idx mod M , col=idx/M). A …
Doc Brown's user avatar
  • 214k
1 vote

What is early and late binding?

Instead of giving you an academic definition I will try to show you some of the differences using a real world example using VBA: Early binding: Dim x As FileSystemObject Set x = New FileSystemObjec …
Doc Brown's user avatar
  • 214k
4 votes
Accepted

The cases where returning Bools as literal expressions is a better option

I don't know what Jim Perry meant, my mindreading capabilities are very restricted. Actually, I disagree to his literal statement: even in a hypothetic "more realistic context" an expression like if …
Doc Brown's user avatar
  • 214k
2 votes

How to determine most challenging test-cases to test any algorithm?

As @Thomas has pointed out, designing good test cases needs experience. But there is good news for you: you can learn it, and there are a lot of books out there where systematic approaches are describ …
Doc Brown's user avatar
  • 214k
5 votes

Strengthening code with possibly useless exception handling

The robustness principle "Be conservative in what you send, be liberal in what you accept" is what you are after. It is a good principle - EDIT: as long as its application does not hide any serious er …
Doc Brown's user avatar
  • 214k
4 votes
Accepted

Generating different combinations from a list of muscles

Create a class "MuscleGroup" Init each object of that class with the list of muscles belonging to that class, and the name of the group add a method PrintRelatedParts(SetOfMuscles som) to that class …
Doc Brown's user avatar
  • 214k
7 votes

Arguments against error suppression

This is 100% context dependent. If the caller of such function has the requirement to display or log errors somewhere, then it is obviously nonsense. If the caller ignored all errors or exception mess …
Doc Brown's user avatar
  • 214k
7 votes
Accepted

How to update the view when the model changes?

This depends on the life time of the view. For short-living views, it may be sufficient not to update the view at all. It may be soon enough to display the new model content the next time the view is …
Doc Brown's user avatar
  • 214k
3 votes

API across multiple languages. Use idiomatic code for each or support the same API structure

Find a compromise. On one hand, you want to make all of your API users happy, and thus design the API implementation for each programming language as idiomatic as you can. On the other hand, you hav …
Doc Brown's user avatar
  • 214k
8 votes
Accepted

Is it bad practice to code the solution, then redo in TDD?

You are not the first who stumbled over the fact TDD misses a solution finding phase. Here is a link to a german blog summarizing a whole article series of Ralf Westphal about the topic. If you don't …
Doc Brown's user avatar
  • 214k
1 vote

How do I test unreachable code?

If the only thing you want is to test if all those error messages are correctly customized, there is a way more efficient solution to this than to invest months of work to create test scenarios for ea …
Doc Brown's user avatar
  • 214k
6 votes

Design: Calling back to the parent class

As others have pointed out, the basic idea of injecting the parent object as a pointer or reference is the way to go - in principle. This has one drawback: you get a cyclic dependency between the par …
Doc Brown's user avatar
  • 214k
0 votes

What is a good alternative to the name variable for a language that only has immutable refer...

Why not just stick with that term? It may not be 100% appropriate, but when you choose a different name that will probably a cause of more misunderstandings than the ones you try to solve. Designers o …
Doc Brown's user avatar
  • 214k
3 votes

Does project architecture have a strong relation to used libraries?

What you describe is just another case of Joel's "Law of leaky abstractions". Read his great blog entry about this topic: http://www.joelonsoftware.com/articles/LeakyAbstractions.html On the other …
Doc Brown's user avatar
  • 214k
1 vote
Accepted

String patterns that can be used to filter and group files

I think what you have in mind could be solved by backreferences. See, for example, here: http://msdn.microsoft.com/en-us/library/thwdfzxy.aspx or here http://www.regular-expressions.info/brackets.h …
Doc Brown's user avatar
  • 214k

15 30 50 per page