m5l.eu is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.
This server runs the snac software and there is no automatic sign-up process.
I have a question about Python libraries and testing scope.
If I'm importing 'serial' in my library, and use it like the following to create a connection to a sensor:
--- start code ---
import serial
class Sensor:
def __init__(self, serial_device):
self.__serial_device = serial_device
try:
self.__connection = serial.Serial(
port=serial_device,
baudrate=9600,
bytesize=serial.EIGHTBITS,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
)
except serial.SerialException:
print("Could not establish serial connection to sensor")
--- end code ---
how much testing should I do around the serial connection? Just mock up a few buffers (byte streams), and see how my class handles unexpected input?
One the one hand, I want to make the library as solid as possible. On the other hand, I don't want to run tests on code I don't control (the library module). I know of the 'mock-serial' utility, but haven't used it.
The aim is to make a Python version of my Arduino library for the CozIR Ambient CO2 sensor:
My partner is looking for work. I'd appreciate boosts.
He's looking to move into #appsec, but will accept short #webdev or #devops contracts (<12 months). Location: Melbourne Australia, or remote. For a short enough contract he'd go anywhere though.
He's a senior full stack web dev (Linux/python/django/js/elm, ~12 years).
Experienced in dev ops, dev sec ops and automation (ansible, selenium, etc etc).
He has experience with OWASP ZAP, bandit and Snyk, and is part way through the PortSwigger academy.
FOSS contributions include writing a django authentication function for OWASP ZAP, making a wrapper to improve accessibility and usability for selenium (Elemental), and other bits and bobs.
He isn't on any socials, but if you want to get in touch I can share his email or signal ID (or give him yours).
He and I have been the security people for little apps without any dedicated security team, for the last decade or so. If you're in security you might have met him (or me) at conferences (Disobey, BSides, CCC, Defcon and Ruxmon), because we've been attending since we launched our own app in 2014, picking up everything we can to protect our users.
(Yep, he is aware a move to security from senior dev roles will be a step down in seniority and $. He just really likes security.)
Amigos, me ajudem por gentileza a divulgar meu curso online promovido pelo Museu de Arte Moderna de São Paulo (MAM-SP) que começa agora em março e estão prestes a se encerrar as inscrições:
https://mam.org.br/curso/desenhando-com-codigo-programacao-criativa-2/
É um curso introdutório, sem pré-requisitos, de #ProgramaçãoCriativa usando #Python com #py5, minhas ferramentas prediletas.
Source code analysis
cpython
doc/c-api/abstract.rsc
.. highlight:: c
.. _abstract:
Abstract Objects Layer
The functions in this chapter interact with Python objects regardless of their
type, or with wide classes of object types (e.g. all numerical types, or all
sequence types). When used on object types for which they do not apply, they
will raise a Python exception.
It is not possible to use these functions on objects that are not properly
initialized, such as a list object that has been created by :c:func:PyList_New,
but whose items have not been set to some non-\ NULL value yet.
.. toctree::
object.rst
call.rst
number.rst
sequence.rst
mapping.rst
iter.rst
buffer.rst
objbuffer.rst
▸Chapter 1 — Understanding CPython Before Code
CPython is both a compiler and an interpreter. It compiles Python source code to bytecode, then executes that bytecode on a stack-based virtual machine. Understanding this dual nature reveals how Python achieves its balance between high-level expressiveness and runtime efficiency.
Everything is an object: Integers, functions, classes, modules, even types themselves are objects with a uniform interface
The GIL: A mutex that protects Python objects, simplifying memory management but limiting CPU-bound parallelism
Memory Management: Reference counting (immediate) + cyclic garbage collection (for cycles)
Compilation Pipeline: Source → Tokens → AST → Bytecode → Execution
motivation
I used explorar.dev in this example, but you don't need the internet to analyse source code. Just download them once, then read at your leasure offline
The screencaps are included to show how it can be done via explorar.
Sources:
https://explorar.dev/python/cpython
#python #cpython #programming #source #code #analysis #environment #mathematics #physics #Lineair #Algebra #technology #Linux #BSD #freeBSD #ghostBSD #OpenSource
Seeking advice for FreeBSD as a daily driver on an ASUS X580VD
(Intel HD 630 + GTX 1050 Optimus)
Five questions at <https://www.reddit.com/r/freebsd/comments/1r9j67j/advice_for_running_freebsd_as_daily_driver_on_an/>, and:
"… Goals / use-case: - Prefer GNOME (but open to recommendations if another DE/DM is more reliable here) - Intel as primary + NVIDIA for on-demand/offload use (if possible) - Web dev stack: Java, Node/React, Python, Go - Occasional virtualization and Linuxulator for Linux-only tooling. …"
After polishing ytRss, I had to give some love to QuickTube.
🚀
Now fully refactored with a clean Python architecture, a snappy native TUI, and finally: Batch Download support! Feed it a text file list and let it handle the rest.
Check it out:
🔗 https://github.com/coffe/QuickTube
#python #cli #opensource #coding #quicktube #TUI #FastAsAShark
This took way more time than planned to get working: ESP32 Dev Kit microcontroller programmed from the command-line, using esptool and platformio running in a Python venv.
Inspired by https://github.com/rgl/platformio-esp32-arduino-hello-world
Well, once I became the person to guess that and I'm simply translating some textures with #Cpp everything is butter smooth again.
Another update of the Pyriodic Backend project:
Feedback and contributions are most welcome 
See it working at https://marsh-sim.github.io/bibliography/
Because everything is written in regular files, the editor can autocomplete citation keys without any special tooling - they are just sections in another file. This kind of interoperability is why simple tools like text files and #ssg are so great.
I'm not a fan of hosting it on GitHub anymore, but there are already links in various places that I can't update, so this is the reasonable thing to do.
- switching between #Zig versions, I liked it more than the dedicated anyzig
- #Python venv activation – it's silly but feels so good, and collaborates with uv
- ensuring I have the right language server and formatter for a project, be it #Lua, #TypeScript, and trying out various options for Python
- setting LANG="C.UTF-8" only in the specific project folder because #Ansible refused to work with Polish...
The final boss was getting a really comfortable Tree-sitter setup: get the #Rust CLI, write grammar in #JavaScript, re-generate and run tests on source change as a mise Task. And then I only cloned the repo on another machine and was ready to go!
This post was written as a more cultured outlet for my excitement instead of aggresively committing mise.toml into every repository I touch
Join the fun at: https://paste.sr.ht/~maarrk/2f1125139c62ebc567d15eac5e066a73ef638845
What made me finally try something else than raw pip and venv was easy installing of multiple Python versions. I was completing a PR to a library that (admirably) wants to support the old ones as well. Once I had the tool, I tried it for releasing a new version of my own PyPI package, and I wasn't ready for how fast and convenient it would be.
I did enjoy the ease of setup of TkInter, and compatibility with Matplotlib, but I was missing the simplicity of immediate mode libraries. In trying to emulate these, now a few callbacks trigger "given this dataclass with state, the widgets should look like this".
The micro-management gremlin is whining that it's repeating useless work, but more importantly the window is complete and I can go on with the experiment.