Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
65 votes
Accepted

Easier user input in C++

namespace std Others have said this already but it's important enough to be repeated: Don't put your own definitions into ...
user avatar
  • 4,230
12 votes
Accepted

Efficiency of this constantly running time processor for an HTML5 video control bar

If you're worried about performance, this should raise a red flag: someJQueryObject = $("#some-id"); ... someJQueryObject.html(aPlainOldString); ...
user avatar
  • 4,531
11 votes

Easier user input in C++

I've actually implemented the same functionality in the past, so here are my comments. Wrong behaviour? It depends on what you can consider wrong. Consider running your own example and inputting <...
user avatar
  • 555
11 votes

Easier user input in C++

namespace std is reserved. Don't add stuff to it. Especially since there's no reason to in this case. Just put it in your own namespace. unnecessary string usage ...
user avatar
  • 18.3k
10 votes
Accepted

English Draughts

A couple of things: <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <StackPanel> ... Putting the ...
user avatar
10 votes

GUI for a quiz tool or game

1. Instead of: def __init__(self, root): """Constructor""" self.root = root # root is a passed Tk object do: ...
user avatar
  • 3,984
9 votes

Efficiency of this constantly running time processor for an HTML5 video control bar

When converting time values like this I find it much simpler, and more readable to work up from the smallest units. Consider the following: ...
user avatar
  • 96.7k
8 votes
Accepted

IBDesignable UICheckbox

In playing around with this, I noticed a few things I didn't particularly like: This picture represents the first problem. Setting the background color fills in the entire rectangle, but should ...
user avatar
  • 25.2k
8 votes

Lemonade stand menu program

Here's a few things I noted: Don't have using namespace std; in your code. It's almost universally considered a bad practice. The C++ standard states that you ...
user avatar
  • 21.6k
8 votes

Implementing a customized helpful hints function which includes docstring but much shorter than Python help()

Disclaimer Now that the OP has clarified that they intend to use this as a teaching tool, my answer has lost relevance for their use-case. It can still be taken as general advice for most Python ...
user avatar
  • 1,341
7 votes

CommandBars, Buttons and Commands: Cleanup is on the menu

This looks good! I've got a couple of comments to make in a vague, hand wavy way so I'll start off with a comment about the code as written: ...
user avatar
  • 16.6k
7 votes

Digital root computation with benchmarking

I think your algorithmic part is exceedingly verbose. One of the nicenesses of Python is how it can lead to code that reads almost like English. And for this particular problem, even leaving ...
user avatar
  • 6,512
7 votes
Accepted

Implementing a customized helpful hints function which includes docstring but much shorter than Python help()

I'm not sure whether you're reinventing the wheel, but you are using the wrong tools for the job. I've been through the phase where I think I'm doing something unique enough that I need to do ...
user avatar
  • 1,203
6 votes

Lemonade stand menu program

Correctness Issues main() issues void main() is not valid C++. main() must return ...
user avatar
  • 1,318
6 votes

Efficiency of this constantly running time processor for an HTML5 video control bar

I (like many others) prefix my jQuery object variables with a $ to make $timeProgress and ...
user avatar
  • 3,595
6 votes
Accepted

CommandBars, Buttons and Commands: Cleanup is on the menu

I think you have the right idea, but your implementation can be improved. I'll give it a try, although I have no clue what rubberduck is, so I might be missing ...
user avatar
  • 13k
5 votes

C++ line-editing micro-library

I don't have the time to do a completely thorough review at the moment, but here are some things that I noticed that may help you improve your code. Don't use ...
user avatar
  • 64.1k
5 votes
Accepted

Testing quicksort user input

Spaces Put a space after for and if: for(int i = 0; i < bound; i++) --> ...
user avatar
5 votes
Accepted

Populating Day/Month Selections in UserForm Controls

Why not doing it more directly like this: ...
user avatar
5 votes
Accepted

Swing GUI in Java

Yes, that is proper use of composition over inheritance. Although some may say this is actually aggregation, due to the nature of Swing. Composotion is the act of one object owning another object. ...
user avatar
  • 424
5 votes

Digital root computation with benchmarking

Regarding digits_generator You don't need to use a new variable. You could use nb directly. You may use the fact that non-0 ...
user avatar
  • 28.7k
4 votes
Accepted

Toggle-item inside a Bootstrap dropdown-menu

It'd definitely be nice to get rid of the inlined style attributes. Since you've already ID'ed the sub-menu pretty extensively, it's pretty easy to add this to the ...
user avatar
  • 32.9k
4 votes

User Interface for Strategy Game

Now that I look at this block mode, I'm finding the logic a bit confusing: ...
user avatar
  • 25.2k
4 votes
Accepted

User Interface for Strategy Game

First, I'll start by emphatically stating that this method is far too large and tries to accomplish far too much. When your method grows this large, it should definitely be tasked out into smaller ...
user avatar
  • 25.2k
4 votes
Accepted

TextField Validation for Teleport Feature in Game

Table organization ...
user avatar
4 votes
Accepted

Implementation of Hangman in Java

All GUI modification must be done in the GUI thread. It refers to the creation of components, too. It means that your buildGUI method should be invoked on the EDT ...
user avatar
  • 5,550
4 votes
Accepted

HMSegmentedControl react to tapping on currently selected segment

You can fork the control and do a tiny modification to the code to do what you need. In touchesEnded:withEvent:, you need to modify this line so it wouldn't check ...
user avatar
  • 156
4 votes
Accepted

Heavily nested anonymous classes for Swing UIs

Anonymous constructors are very confusing for many people. They don't correspond well to people's expectations, and are not common knowledge. I would recommend against them on principle. Having said ...
user avatar
  • 96.7k
4 votes
Accepted

CommandBars, Buttons and Commands: Take 2

I think the code is definitely much better! I wouldn't worry too much about registering the ICommands in your IoC. After all, you're not going to have hundreds of ...
user avatar
  • 16.6k
4 votes

Removing a subview with a subview from a UIView without memory leaks

...
user avatar
  • 25.2k

Only top scored, non community-wiki answers of a minimum length are eligible