Skip to main content
53 votes
Accepted

Counting rows in a CSV file that correspond to a database row, each with a million records

Your inner loop appears to be unnecessary. Why not create a lookup: ...
RobH's user avatar
  • 16.9k
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 ...
J_H's user avatar
  • 25.6k
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 ...
G. Sliepen's user avatar
  • 55.7k
14 votes

Counting rows in a CSV file that correspond to a database row, each with a million records

The code appears to be broken, you're not break;ing after finding a match so all records will likely have row[12] == "N". You ...
Johnbot's user avatar
  • 2,974
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 ...
superb rain's user avatar
  • 3,991
12 votes
Accepted

Simple customer program in C (using binary files)

I see a number of things that may help you improve your code. Eliminate function prototypes by ordering Since you put the acadd and ...
Edward's user avatar
  • 66.4k
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: ...
Mr Cochese's user avatar
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 ...
J_H's user avatar
  • 25.6k
10 votes
Accepted

Inserting a DBNull value into a database

All you have to do is to use the ?: (ternary operator): ...
t3chb0t's user avatar
  • 44.3k
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 ...
SylvainD's user avatar
  • 29.2k
10 votes

Simple Key Value Database using C

Enable more compiler warnings: Adding: ...
Harith's user avatar
  • 5,844
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 ...
vnp's user avatar
  • 56.4k
9 votes

Event scheduler in C

Self-documenting code char h1 = { (e.hour / 10) + '0' }; // Extract the first digit and convert to char (if any, else 0) As you considered the division by ten ...
Caridorc's user avatar
  • 27.5k
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 ...
Reinderien's user avatar
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 ...
AJNeufeld's user avatar
  • 33.6k
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 ...
Toby Speight's user avatar
  • 75.1k
8 votes

Counting rows in a CSV file that correspond to a database row, each with a million records

A few comments: Avoid memory intensive data types Instead of using a DataTable for dt, just read from the csv directly, one line at a time (readLine() and then split(','). This will greatly cut ...
Zack's user avatar
  • 1,853
8 votes

Invoicing Program Python

What happens if the user types "s"? Your program says: Enter Buyer Name: Oops! It was supposed to be uppercase, wasn't it? I'm not sure why you want it to be ...
zondo's user avatar
  • 3,797
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 ...
dfhwze's user avatar
  • 13.9k
7 votes
Accepted

Check existence of a row then update a column

Obviously, you already know about SQL injection. So let's forget about that. Ideally, please do defend against it, it's easy enough that it's not worth doing it any other way. Code that is not public ...
Sjoerd Job Postmus's user avatar
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 ...
Maxim's user avatar
  • 2,542
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 ...
Gareth Rees's user avatar
  • 49.6k
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 ...
Stefan Pochmann's user avatar
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 ...
Alex Waygood's user avatar
  • 1,029
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 ...
Edward's user avatar
  • 66.4k
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 ...
Grajdeanu Alex's user avatar
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 ...
Harith's user avatar
  • 5,844
6 votes

Perl DBI insert of hash

This might be a good candidate to use SQL::Abstract in, as per DBIx::Class. ...
Kent Fredric's user avatar
6 votes
Accepted

Saving and Loading data with SQLite

...
Malachi's user avatar
  • 28.6k

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