Search Results
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 |
Use this tag for programs that interact with their user by means of a character-based console or terminal
4
votes
Accepted
Command line todo list manager
Your program expects the user to refer to completed or incomplete tasks by a numeric index. However, the Markdown file contains an unnumbered bulleted list, which forces the user to count the items m …
7
votes
Spicy's Ultimate Computer Utility Version 4.0
def again():
again = input(cyan("Do you want to use the calculator again? Y/N"))
if again == 'Y':
start()
You probably meant to call run() rather than start(), because this code do …
2
votes
Accepted
Displaying a table of shell aliases
The best practice for dealing with temporary files is simply not to use them in the first place. Many things can go wrong with temporary files:
Lack of permissions to write to a directory
Lack of d …
4
votes
Accepted
Prompt system from reading a text file
Interface
I don't think that instantiating a HelpSystem should have a side-effect of starting the interpreter loop. Either of these following designs would be better:
Instantiate, then run the loop …
61
votes
How clean is my snow?
Cool animation!
Let's get some linting out of the way. As per PEP 8, you should use 4 spaces of indentation consistently, and function names should be snake_case.
Scalability
The main weakness of …
7
votes
Add color to terminal output
As @LokiAstari says, hard-coding these escape strings into your program is a bad idea, as the escape sequences vary according to the type of terminal. There are libraries such as ncurses and terminfo …
16
votes
Accepted
"Up" script for moving up directories quickly
Your recommendation is to define alias up=". path/to/up" so that when you type up 3, it expands to . up 3. However, since you want to take an optional argument and affect the state of the current she …
11
votes
Quadratic equation solver in C++
You have committed a grave error here with operator precedence, which should have easily been caught with simple testing:
X1 = Sector4Arithmetic / 2 * a;
The variable names SectornArithmetic are bi …
5
votes
Accepted
m3u file collector
Command-line handling
Fatal errors should be reported on sys.stderr and cause a non-zero exit status.
Don't check for os.path.exists(dest), because:
Existence doesn't actually guarantee that it is …
0
votes
Simple console snake game in Python
GameState is a rather weird class. You're actually not using it as a class, but as a namespace. Basically, you have a bunch of global variables that don't look global because they are prefixed by Ga …
4
votes
Accepted
Local source control
Obviously, the error handling needs work: you are swallowing FileNotFoundError, discarding invalid input, and generally ignoring all kinds of failures. (In my experience, adding good error handling e …
6
votes
Finding cost of tile to cover W x H floor
Your calculation was wrong: it did not make use of StartSquare at all. The bug might have been avoided with better naming: cost is too ambiguous. (Better naming would also be more valuable than the …
2
votes
Song search app with dynamic tables
I'm going to assume that search returns a data structure like this:
data = [
{ 'ArtistName' => 'Crash Test Dummies',
'AlbumName' => 'God Shuffled His Feet',
'SongName' => 'Mmmm_Mmmmm...',
…
3
votes
Accepted
Search utility that searches through source code files
The POSIX grep command accepts the keyword as the first parameter, then the paths to search as subsequent parameters. That has the advantage of letting the user specify any number of paths to search. …
2
votes
Simple Ruby directory navigator functions
Your two code samples are not exactly equivalent. The second one has nicer formatting (fixed-width numbering) and attempts to parameterize the glob pattern (but fails in that regard — full_directory_ …