20
votes
Accepted
COBOL Database Program
ZOMG, that is frightening along so many dimensions.
Disclaimer: Within the last decade I wrote lots of python code to parse production COBOL database record formats. And as an undergraduate I had ...
18
votes
Accepted
Console Library System in C++
Make variables and functions const where appropriate
You used const references in a few places, but you missed a lot of ...
13
votes
Accepted
Generalization of any() function with switchable default parameter for empty iterables
I really think this is a bad idea. A function called any returning True if there not only isn't anything true but even not ...
11
votes
Inserting a DBNull value into a database
The most terse and declarative way to write this is to use C#'s ?? operator. Your line becomes:
...
11
votes
Accepted
Header-only log-structured database
nit, typo: lenght ... lenght
Also, "it is rebuilT from the data",
and "reported as not writed" --> "written".
motivation
App developers who need logging features
would ...
10
votes
Accepted
Inserting a DBNull value into a database
All you have to do is to use the ?: (ternary operator):
...
10
votes
Accepted
Reducing the amount of duplicated code (python) - cricket matches
Disclaimer: I know nothing whatsoever about the rules of cricket.
Useless check
Because either info['toss_decision'] equals ...
10
votes
10
votes
Simple Key Value Database using C
mutex serves no purpose. It is not shared between processes, and your program is not multithreaded.
If you want an exclusion between unrelated instances of the ...
9
votes
Accepted
LinDB: A dictionary type database
Both impressive and ambitious!
Passwords
the absolute requirement of a 32 character long password ensures it will take a considerable amount of time to break the encryption
It will also ensure that ...
9
votes
Generalization of any() function with switchable default parameter for empty iterables
Any and All
If you are going to override any(...) to return a custom result when given an empty iterable, you should also override ...
9
votes
Accepted
Embedded IoT: local data storage when no network coverage
We're missing an include of <stdint.h> in the header, and <stdbool.h> in the implementation.
Some parts of the code ...
9
votes
JSON data format for MCQ data bank
You have at least three factors to judge the formats by:
Readability/intuitiveness (how easy are the formats to understand),
Extensibility (how readily do the formats adapt to unforeseen needs), and
...
8
votes
Accepted
Non-Entity framework database interaction model
Application Architecture
The architecture of the application is divided into models and views to separate the data and business model
from the user interface. Within the models there is an ...
7
votes
Accepted
Creates an employee record in a time and attendance database and returns the employee object
It is common practice to use static methods-creators instead of constructors. But this approach is used in cases where you need to convert some objects to the object of desired type. It is the main ...
7
votes
Accepted
Improvement in file management system based on the file names
It would be better to design the system so that each collection of signals has a canonical filename, regardless of the order of the signals in the collection. This is most easily done by sorting the ...
7
votes
Generalization of any() function with switchable default parameter for empty iterables
Benchmarks and a faster solution
Code including the solutions at the end. And note I also have an image further down that might be worth checking out before/while reading.
Empty iterable
First an ...
7
votes
A Hit Counter For AWS Python Lambda powered with DynamoDB
[Edited following discussion in the comments]
A few brief notes on your code:
Your type hints could be more complete/descriptive. You don't have any return annotations; the ...
7
votes
Console Library System in C++
The review by G. Sliepen has already covered most of what I would have said, so this is intended to be a complementary review addressing points not mentioned there.
Eliminate unused variables
The ...
7
votes
Accepted
High traffic website that shows users subscription status
Architecture
Regarding this concern:
Table where user's subscription status is supposed to contain is not complete. It has rows for very few users and the intent behind this whole exercise is to fill ...
7
votes
Header-only log-structured database
I see nothing C11-specific in your code, and it compiled just fine with gnu99 instead of gnu11. Though, I am going to suggest ...
6
votes
Accepted
Civil status database with Django
Few things here:
1. Parent1 and Parent2
It's not really clear why would you need to have parents in the separate tables while they both represent a person. There is no difference between parent1 and ...
6
votes
Accepted
Joining WorkTypes to WorkGroups via Channels and Users to check authorization
I am understanding that your goal is to return a set of data that a user is authorized to see. I further understand that ChannelUsers and ...
6
votes
Backup document root and MySQL in Linux
Since you are repeatedly using $(date +\%F-\%T), you can store that as a variable (unless you want to also know how long it took the script to jump between ...
6
votes
Non-Entity framework database interaction model
I won't read this code beginning to end. Some basic advice:
Namespaces
ExperimentSimpleBkLibInvTool.ModelInMVC.DictionaryTabelBaseModel doesn't follow naming ...
6
votes
Embedded IoT: local data storage when no network coverage
Here are some things that may help you improve your code.
Use the required #includes
The code uses uint8_t and ...
6
votes
Accepted
Summing categories of financial records per month in a query
Mixing Portuguese and English makes this code messy. Please pick one or the other. I recommend coding consistently in English, because Python, its library, and its code ecosystem are in English, so ...
6
votes
High traffic website that shows users subscription status
You may have heard the adage about separation of concerns, and that each function should do only one thing, and do it well.
Consider the function ...
6
votes
Accepted
Optimal Algorithm to Append and Access Tree Data
A few suggestions:
There is a typo in Tree.append where we move to cur.right when cur.left ...
6
votes
Accepted
A schema for awallet system that allows transfers between users
redundant wallets
CREATE TABLE wallets (
id UUID PRIMARY KEY ...,
user_id UUID REFERENCES users(id), ...
currency VARCHAR(3) ...
This isn't ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
database × 555c# × 104
python × 99
sql × 97
php × 90
mysql × 70
java × 64
performance × 48
object-oriented × 47
beginner × 39
django × 25
sqlite × 25
python-3.x × 22
pdo × 22
sql-server × 21
postgresql × 20
javascript × 18
c++ × 16
c × 16
entity-framework × 14
ruby × 13
mysqli × 13
.net × 12
design-patterns × 10
csv × 10