From 3be33d0311bc291fb394d4a8de313de35974f47d Mon Sep 17 00:00:00 2001 From: xAlpharax <42233094+xAlpharax@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:25:59 +0200 Subject: Infrastructure coming together. Changes to be committed: modified: README.md modified: config.toml modified: content/about.md new file: content/posts/How I made this Blog with Zola.md modified: content/posts/_index.md modified: content/posts/code_test.md deleted: content/posts/good_first_post.md deleted: content/posts/later_posts.md modified: content/posts/typography.md modified: rsync_to_testing new file: static/diffusion.pdf new file: static/nst.pdf modified: templates/index.html modified: templates/page.html --- content/posts/code_test.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'content/posts/code_test.md') diff --git a/content/posts/code_test.md b/content/posts/code_test.md index be9b5cd..761c536 100644 --- a/content/posts/code_test.md +++ b/content/posts/code_test.md @@ -1,13 +1,14 @@ +++ -title="Test code syntax highlight" -date=2020-10-13 -draft=false +title = "Test code syntax highlight" +date = 2020-10-13 +draft = false [taxonomies] -tags=["test", "code"] +tags = ["test", "code"] [extra] disable_comments = true +toc = false +++ ```rust @@ -22,3 +23,14 @@ fn factorial(n: u64) -> u64 { ```typescript const sum = (n: number) => n * (n + 1) / 2 ``` + +```python +### multi-threading + +import os ; n_cores = os.cpu_count() // 2 ; + +from concurrent.futures import ThreadPoolExecutor + +with ThreadPoolExecutor(max_workers=n_cores) as executor: + executor.map(render, range(0, len(image_array))) +``` -- cgit v1.2.3