Skip to main content
7 votes
Accepted

Generate filesystem usage report using Awk

ISO dates Yeah, I get it that you have a pre-defined data format. Input Data Format Month (in MM.YYYY format) But that's significantly less than ideal. If feasible, try to get new records produced ...
J_H's user avatar
  • 30.7k
4 votes
Accepted

Making an input validator function

Overall: Good idea. But your checks seem to be designed for machine input (not user input where a user could be told about the error and can then retry). But on the other hand you are prompting for ...
Loki Astari's user avatar
  • 95.4k
3 votes

Check if options are valid to create FAT12 image

fat.h has no need to #include <stdio.h>, so remove that. However, it does require ...
Toby Speight's user avatar
  • 77.3k
3 votes

Image upload filter for PHP

Avoid pitfalls using PHP extensions It is good to be aware of the pitfalls like users attempting to upload non-image files. In order to avoid them PHP extensions like fileinfo offers ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes
Accepted

Validate that the console input contains positive integers only

First, I would suggest that when posting code for review that it be a complete. For example, variables blank_input and ...
Booboo's user avatar
  • 1,756
2 votes

Model validation through the combination of PCA with classifiers

This looks fine. The code is crying out "put me in a function!" You've polluted the global namespace with a bunch of variables that should be local to a function. And you've not explained ...
J_H's user avatar
  • 30.7k
2 votes

Making an input validator function

I like the idea; in fact, this is something I’ve considered doing myself from time to time. Before I get into the review, I have to ask: why is this tagged C++14? It seems peculiar to tie yourself to ...
indi's user avatar
  • 12k
2 votes

Simple credit card validation with Luhn's Algorithm

Follow the specs Credit card numbering is a well-defined system, standardized in ISO/IEC 7812. While accessing the standard text is expensive, the outline of its contents is well documented and ...
gazoh's user avatar
  • 3,359
2 votes

Generate filesystem usage report using Awk

Ah good old awk. I believe this program is 50 years old! Your script is a good illustration of what can be achieved with this tool. But as hinted already, it may not be the best tool for the job. If I ...
Kate's user avatar
  • 7,083
1 vote

About self validated Java POJOs

Content warning: this may be controversial and go against a lot of established practises. I think you have figured out the advantages and disadvantages pretty well except for one thing. Having ...
TorbenPutkonen's user avatar
1 vote
Accepted

Improved input validation function

After reading @indi explain what problem I have with my code I've fixed it in accordance with the comments he left. If anyone sees any more problems with it you are welcome to point it out. The new ...
globalturist's user avatar
1 vote

Making an input validator function

I do not see a good reason for erroring when min == max. Consider allowing the == case ...
1 vote

Chess Dictionary Validator (Python) (Automate The Boring Stuff)

This code will not work if in the board multiple pieces have the same position. For example, below board contains 2 white pawns in the same position "3a". Even though the board is an invalid ...
tom varghese's user avatar
1 vote

Generic custom regular expression with dynamic pattern used as data annotation for Model

Microsoft provides a Regular expression attribute: https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.regularexpressionattribute?view=net-8.0 Which, from the docs, ...
Henners2002's user avatar

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