Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
2 votes
3 answers
113 views

I have a restaurant ordering app where I'm displaying order items. Currently, I have repetitive code for each menu item (pizza, hamburger, beer). Current code (simplified): function displayOrder(...
3 votes
1 answer
97 views

Is there any cleaner/DRYer way to get nested ordered list items (e.g. list item number 2.4.1.7.8.2.9) that are indented properly, rather than defining every single level manually up to 10 levels deep? ...
Danny Beckett's user avatar
2 votes
1 answer
217 views

I'm writing unit tests to test C++ classes. The functions below test to see how a function handles an exception. The code below does work, but it is very redundant, I would prefer to have 1 template ...
pacmaninbw's user avatar
0 votes
3 answers
359 views

In C++, if you make a separate .cpp file to keep classes separate like you might in Java, you also have to make a .h file declaring everything you want to make. I understand why you must, since the ...
AceLeft's user avatar
  • 17
-1 votes
1 answer
80 views

This is a follow up of this question, which might have been a XY problem. Anyhow, that was closed within a few minutes, before I could get any real help. In our large code base (measurement processing ...
1 vote
2 answers
250 views

In our large code base (measurement processing application) we've had bugs where values were mixed up because everything is a double. So we decided to try-out strongly named types for things like ...
1 vote
1 answer
152 views

I'm writing a library which has a queue object (not std::queue and not usable as a C++ container). On this queue, we can enqueue commands, with arguments. Let's say the commands are foo, bar and baz, ...
0 votes
1 answer
51 views

I am creating a binary tree representation of a mathematical expression for performing differentaiton and integration on it. I am trying to overload the + operator for my Symbol class. It works fine ...
0 votes
1 answer
60 views

What is a Pythonic way to not have duplicated code for exception handling? In a real code base, it is not 2 / 0, but reading or writing from an async socket, and I have more exceptions to catch, ...
WebOrCode's user avatar
  • 7,392
0 votes
1 answer
57 views

I'm looking for a standard, lightweight (preferably built-in) way to handle the problem of interface repetition—where the same parameters (with annotations, defaults, and docs) are repeated across ...
thorwhalen's user avatar
  • 2,462
0 votes
1 answer
101 views

I have created a Blazor Component to handle editing a database record which is defined by a class. I would like this component to be reused to edit other records - that have the same structure, but ...
1 vote
0 answers
100 views

Context Coming from OOP I'm finding as I implement various traits and functions on my structs, I want to abstract bits and pieces of them out. But whenever I do, I run into borrow checker issues. I'm ...
gjh33's user avatar
  • 121
0 votes
1 answer
80 views

Trying to do so involves using the weird syntax of GetAwaiter().GetResult(). Beside that fact, it works; but does it sucks to do so? If yes, then why? Original: internal static ISector Read(ISector ...
aybe's user avatar
  • 16.8k
3 votes
1 answer
87 views

I have a method private void positionMagican() { int x; int y; boolean magicanIsCreated; magicanIsCreated = false; while (!magicanIsCreated){ x =...
Morozov 310's user avatar
2 votes
7 answers
792 views

I have a SQL query where the list of strings is repeated twice: ('foo', 'bar', 'baz', 'bletch'). What is the most maintainable method to avoid such repetition and make this code more DRY? I am not ...

15 30 50 per page
1
2 3 4 5
...
149

AltStyle によって変換されたページ (->オリジナル) /