All Questions
5 questions
-1
votes
1
answer
196
views
Rotate a matrix in place, moving elements? (How to write a part of flow/logic after understanding the problem?)
Following is a java solution of the classic question of rotating a nxn matrix in place clockwise by 90 degrees.
public void rotate(int[][] matrix, int n) {
for (int layer = 0; layer < n / 2; ++...
1
vote
1
answer
991
views
Coding guidlines for Controller and Dao?
My Controller code:
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
ObjectReader objectReader = objectMapper.reader(...
1
vote
1
answer
125
views
Reference wind directions to texture space?
I have a 2D array filled with a simple class:
class Tile
{
boolean N,E,S,W;
}
I also have a tilesheet representing all possible outcomes except all false (12 + crossroad). Now i need to reference ...
26
votes
4
answers
3k
views
How to choose between Tell don't Ask and Command Query Separation?
The principle Tell Don't Ask says:
you should endeavor to tell objects what you want them to do; do not
ask them questions about their state, make a decision, and then tell
them what to do.
...
5
votes
6
answers
4k
views
Write once, run anywhere. Is it still relevant? [duplicate]
Since Oracle bought Sun and Apple have decided not to continue developing their JVM, is the "write once and run everywhere" model still relevant or has web services/SOA reduced it to an edge case?