- What it was / was'nt designed to do?
The key takeaway should be that type hints are designed to improve developer experience, not to influence how your script evaluates. It creates happy developers, not faster code!
- What kind of type system?
- Gotchas
- Tools
- Input injection
- Parsing XML
- Assert statements
- Timing attacks
- A polluted site-packages or import path
- Temporary files
- Using yaml.load
- Pickles
- Using the system Python runtime and not patching it
- Not patching your dependencies
Crows Crows Crows est un studio de jeu vidéo créé en 2015, à l'origine entre autres du jeu complètement déjanté Dr. Langeskov, The Tiger, and The Terribly Cursed Emerald: A Whirlwind Heist et le créateur du studio, William Pugh, est également un des auteurs de The Stanley Parable.
En 2016 …
When I migrated this blog to Pelican, I noted one thing that I missed from Ghost: tags autocompletion, to help reusing tags I already defined in other articles.
Because nowadays I mostly use Notepad++ or vim
to write my blog posts,
I found out an easy solution that works for …
At work we have a component not yet migrated to Python 3, and we recently had some difficulties diagnosing a problem with the MySQL connector.
Because we were catching the mysql.connector.errors.Error
and raising a custom exception,
we were loosing the underlying stacktrace and hence couldn't troubleshoot the …
Based on Clean Architecture, by Robert Martin,
with code examples and detailed explanations.
Voici une petite dépêche que j'ai écrite sur le site LinuxFr : https://linuxfr.org/news/generateurs-de-puzzles-libres
We’ll be learning about Locks , RLocks , Semaphores , Events , Conditions and Barriers
flask
httpie
requests
simplejson
botocore
scrapy
docker-compose
ansible
What are those diagrams ?
They show dependencies between the internal modules of various well-known Python libraries.
They goal is to provide a global overview of a Python project architecture, as a map of modules & packages, the top-level code abstractions.
Note that all …
Turn a GitHub repo into a collection of interactive notebooks
Have a repository full of Jupyter notebooks? With Binder, open those notebooks in an executable environment, making your code immediately reproducible by anyone, anywhere.
allows to parse sentences written in natural language and extracts structured information.
manage groups of collaborators and associate each private repo with one of those groups + enable all of your contributors to manage who is and isn't a collaborator.
Example of project combining:
- Github API usage & its AWS SNS integration
- AWS Lambda written in Python
Les éditeurs « classiques » [d'articles scientifiques] ont auss réagi par rapport au libre accès. Toutes sortes « d’exceptions » ont été mises en place. Par exemple pour la revue Artificial Intelligence In Medicine (édité par Elsevier) où j’ai publié :
- les auteurs peuvent payer pour avoir leur article en libre accès (N. B. : hors de prix, mais certains projets de recherche, notamment européen, exigent que ce soit le cas) ;
- un lien est fourni aux auteurs qui permet de télécharger gratuitement l’article pendant 50 jours, et ce lien peut être diffusé à volonté ;
- après six mois d’embargo, une « version auteur » (même contenu que le vrai article, mais sans la mise en forme de l’éditeur) peut être mise à disposition librement sur des serveurs comme HAL (Hyper‐Archives en Ligne) ;
- les auteurs ont le droit de mettre une « version auteur » sur leur site personnel dès la parution de l’article, sous licence Creative Commons Attribution Non‐Commercial No Derivatives ».
En commentaire, de chouettes visualisations d'ontologies OWL en ligne : https://hal.archives-ouvertes.fr
Finding and extracting well-looping segments from a movie requires much attention and patience, and will likely leave you like this in front of your computer:
To make things easier I wrote a Python script which automates the task. This post explains the math behind the algorithm and provides a few examples of use.
This week I discovered the fantastic glitch art Reddit community (for a little more context on glitch art, wikipedia has a page). These are the pieces I love the most (click on them to find the source):
This one above reminds me of The Great Wave off Kanagawa. Like many …
On my personnal server, I used to send myself alerts by email using the handy standard mail
command.
However, recently it appeared that my server became categorized as "spammer" by some online service providers,
due to the alerts frequency (a little bit more than one per day).
Hence, I got …
A bot generated tens of notifications in one of your Slack channels ?
This handy Python CLI script is just what you need !
slack-cleaner --token $SLACK_TOKEN --message --channel jenkins --bot --perform
There is also a NodeJS version
Ces dernières 24h, j'ai eu cette lubie stupide de vouloir utiliser l'API Tickets Restaurant. Une API qui n'est pas documentée. Dont le site est en ASP.NET (beurk). Qui a une app officielle android.
Ahah !
Bref, j'ai tenté de reverse-engineer un APK alors que je n'ai même pas de smartphone …
Plusieurs solutions:
- L’API C de CPython. Y’en a qu’ont essayé, ils ont eu des problèmes…
En utilisant cette méthode, vous aurez accès à tout l’interpréteur Python et vous pourrez tout faire… mais à quel prix ?
Je ne vous recommande pas cette approche, je me suis cassé les dents pendant 4 mois dessus avec un succès mitigé.- Cython est une bonne solution mais plus orienté sur l’optimisation de code.
- CFFI: le saint Graal, alléluia!
Il y a trois moyens d’utiliser CFFI, comprenez bien cela car c’est la partie tricky:
- Le mode ABI/Inline
- Le mode API/Out-of-line
- Le mode ABI/Out-of-line