alexrustic
Knowing better, doing worse: the science behind self-sabotaging behaviour
Missing link to 'blobs' deep within Earth
Malware in DNS
China's Baidu to bring its driverless cars to Uber globally
Order Within Chaos in Double Pendulum (Island of Stability Simulation) [video]
Duck.ai Privacy Policy
Photo Finish Explained [video]
Clever Custom Software Used to Reconstruct First Recorded Sounds (2010)
Amazon Introduces SWE-PolyBench, a Multilingual Benchmark for AI Coding Agents
Napster pioneered music sharing over 25 years ago. It just got bought for $207M
Blake Scholl Built the First Independent Supersonic Jet [video]
Sabine Hossenfelder – I was asked to keep this confidential [video]
Open source AI: Red Hat's point-of-view
Google brings real-time information from The Associated Press to Gemini
US Cyber Trust Mark launches as the Energy Star of smart home security
An LLM is just a processor [video]
Epic Games' app store will be preinstalled on Android phones
Tim Cook Wants Apple to Save Your Life
To interact with SQLite, Jinbase uses LiteDBC [1] an SQL interface compliant with the DB-API 2.0 specification described by PEP 249 [2], itself wrapping Python's sqlite3 [3] module for a more intuitive interface and multithreading support by default. I wrote for LiteDBC a stress test [4] involving concurrency with Asyncpal [5].
[1] https://github.com/pyrustic/litedbc
[2] https://peps.python.org/pep-0249/
[3] https://docs.python.org/3/library/sqlite3.html
[4] https://github.com/pyrustic/litedbc/blob/master/tests/test_s...
Protobuf relies heavily on predefined schemas and this rigidity goes against the flexibility of Jinbase's schema-less philosophy.
MessagePack (or CBOR) seems more convincing but Paradict has some subtleties that I don't find there. For example, Paradict preserves UTC offsets [1], handles integer bases, allowing for the representation of integers in decimal, binary, octal, and hexadecimal formats, has an extension mechanism that I find more interesting, etc.
Soon I will be adding a command line interface to Jinbase. From the CLI one will be able to read and write any type of data and this will only be possible because Paradict has a twin text format. MessagePack, from what I know, started with 1:1 compatibility with JSON and then over time it added things that are not present in JSON, thus breaking the 1:1 compatibility with JSON.
If I understand Peter Naur's take on programming [2] correctly, Jinbase is a software idea that I'm trying to implement (bring to life) one iteration at a time, and for that I need to have some level of control over the components (like the serialization format) so that I can adjust things accordingly. For example, the Paradict binary format is originally intended to serialize and deserialize only dictionaries (P...dict), but I changed that detail so that Jinbase users can freely store other things than dictionaries.
Once the core idea is fully implemented, we will see how to reproduce it elsewhere, one contribution/compilation after another...
[1] https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a...
Show HN: Jinbase – Multi-model transactional embedded database
https://github.com/pyrustic/jinbase
Hi HN ! Alex here. I'm excited to show you Jinbase (https://github.com/pyrustic/jinbase), my multi-model transactional embedded database.Almost a year ago, I introduced Paradict [1], my take on multi-format streaming serialization. Given its readability, the Paradict text format appears de facto as an interesting data format for config files. But using Paradict to manage config files would end...
WWDC17: Essential Design Principles – Apple [video]
Xavier Niel, a Driving Force of French AI, Is Now Shaping TikTok
Windows App now available on all major platforms
Kaspersky offloads U.S. antivirus customers to Pango Group
When you are doing parallelism, don't forget to protect the 'entry point' of the program by using "if __name__ == '__main__'", and also avoid the __main__.py file [1]
# this file isn't `__main__.py` !
from asyncpal import ProcessPool
def square(x):
return x**2
if __name__ == "__main__": # very important !
with ProcessPool(4) as pool:
numbers = range(1000)
# note that 'map_all' isn't lazy
iterator = pool.map(square, numbers) # map is lazy
result = tuple(iterator)
assert result == tuple(map(square, numbers))
[1] https://discuss.python.org/t/why-does-multiprocessing-not-wo...The stdlib's pools only grow in size and do not shrink, making them non-elastic. Therefore, I would not want to keep them alive in the background for sporadic workloads [1].
Discussions on 'concurrent.futures' vs 'multiprocessing.pool.Pool' highlight that each has unique features. While 'concurrent.futures' is the modern package, it omits some niceties found in 'multiprocessing.pool.Pool'. For example, 'concurrent.futures' has only one 'map' [2] method, which works eagerly and therefore not suitable for very long iterables [3][4]. However, I acknowledge the superiority of 'concurrent.futures.Future' [5] over 'multiprocessing.pool.AsyncResult' [6] because tasks cannot be cancelled with the latter (among other things).
[1] https://www.cloudcomputingpatterns.org/unpredictable_workloa... (related)
[2] https://docs.python.org/3/library/concurrent.futures.html#co...
[3] https://docs.python.org/3/library/multiprocessing.html#multi...
[4] https://docs.python.org/3/library/multiprocessing.html#multi...
[5] https://docs.python.org/3/library/concurrent.futures.html#fu...
[6] https://docs.python.org/3/library/multiprocessing.html#multi...