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 ...
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);
...
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 <...
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
...
10
votes
Accepted
English Draughts
A couple of things:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel>
...
Putting the ...
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:
...
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:
...
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 ...
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 ...
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 ...
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:
...
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 ...
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 ...
6
votes
Lemonade stand menu program
Correctness Issues
main() issues
void main() is not valid C++. main() must return ...
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 ...
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 ...
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 ...
5
votes
Accepted
Testing quicksort user input
Spaces
Put a space after for and if:
for(int i = 0; i < bound; i++) --> ...
5
votes
Accepted
Populating Day/Month Selections in UserForm Controls
Why not doing it more directly like this:
...
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. ...
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 ...
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 ...
4
votes
User Interface for Strategy Game
Now that I look at this block mode, I'm finding the logic a bit confusing:
...
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 ...
4
votes
Accepted
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 ...
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 ...
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 ...
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 ...
4
votes
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
user-interface × 139javascript × 39
python × 22
java × 18
html × 17
css × 16
jquery × 14
c# × 12
swift × 10
ios × 10
swing × 9
gui × 9
c++ × 7
python-3.x × 7
vba × 7
console × 7
react.js × 7
performance × 6
event-handling × 6
tkinter × 6
object-oriented × 5
game × 5
excel × 5
io × 5
layout × 5