Tutorials
Programming
Programming tutorials for people who want code that actually runs, not code that only looks right. Pick a language, start at the beginning, and don't skip the basics. They are where most problems come from.
0 likes
Likes for this tutorial.
Reading a Large Text File in Python Line by Line
Level: Intermediate
for line in file reads one line at a time, so a 10 GB file uses almost no memory. read() and readlines() load everything. Count, filter and stop early without building a list, and read in blocks when there are no lines.
6 min read
0 likes
Likes for this tutorial.
Paginate Without OFFSET
Level: Intermediate
Page through a table with keyset pagination: filter on the last row you showed and add a tie-breaker. After this, a later page costs the same as the first and rows do not repeat or vanish between pages.
4 min read