Skip to content

Instantly share code, notes, and snippets.

@mangecoeur
mangecoeur / concurrent.futures-intro.md
Last active January 9, 2024 16:04
Easy parallel python with concurrent.futures

Easy parallel python with concurrent.futures

As of version 3.3, python includes the very promising concurrent.futures module, with elegant context managers for running tasks concurrently. Thanks to the simple and consistent interface you can use both threads and processes with minimal effort.

For most CPU bound tasks - anything that is heavy number crunching - you want your program to use all the CPUs in your PC. The simplest way to get a CPU bound task to run in parallel is to use the ProcessPoolExecutor, which will create enough sub-processes to keep all your CPUs busy.

We use the context manager thusly:

with concurrent.futures.ProcessPoolExecutor() as executor:
@vlandham
vlandham / part1.md
Last active March 21, 2024 12:57
Feature Branches and Pull Requests : Walkthrough

Here's a little walkthrough of how Yannick and I are using feature branches and pull requests to develop new features and adding them to the project. Below are the steps I take when working on a new feature. Hopefully this, along with watching the process on Github, will serve as a starting point to having everyone use a similar workflow.

Questions, comments, and suggestions for improvements welcome!

Start with the latest on master

When starting a new feature, I make sure to start with the latest and greatest codebase:

git checkout master
@emlazzarin
emlazzarin / bonfire_books.md
Last active April 26, 2024 19:18
pmarca's books for understanding The Bonfire Of The Universities
title author link
1 The Captive Mind Czesław Miłosz Amazon
2 Private Truths, Public Lies: The Social Consequences of Preference Falsification Timur Kuran Amazon
3 When Reason Goes on Holiday: Philosophers in Politics Neven Sesardić Amazon
4 Intellectuals and Society Thomas Sowell Amazon
5 Intellectuals: From Marx and Tolsoy to Sartre and Chomsky Paul Johnson Amazon
6 The Making of an American Thinking Class: Intellectuals and Intelligentsia in Puritan Massachusetts Darren Staloff [Amazon](ht