Undying Dusk is a video game in a PDF format, with a gameplay based on exploration and logic puzzles, in the tradition of dungeon crawlers.
A curse set by the Empress keeps the world in an eternal dusk. You are have recently found shelter in an eerie monastery.
Featuring:
- ~ 200 …
What happens if malicious code is uploaded to npm under these names? Is it possible that some of PayPal’s internal projects will start defaulting to the new public packages instead of the private ones?
Today, I am happy to announce version 2.3.0 of fpdf2, code name: Unbreakable!
https://github.com/pyfpdf/fpdf2/ Doc: https://pyfpdf.github.io/fpdf2/
Why Unbreakable?
- As a tribute to M. Night Shyamalan movie
- Because using
fpdf2
, your Python code can never break!
...
Just kidding, I would be …
fpdf2
, the library I mentioned in my previous post, cannot parse existing PDF files.
However, other Python libraries can be combined with fpdf2
in order to add new content to existing PDF files.
This page provides several examples of doing so using pdfrw
,
a great zero-dependency pure Python library dedicated …
Effectively find upstream & downstream dependencies of a Pypi package
More about it: https://blog.acolyer.org/2020/09/21/watchman/
Alt: https://github.com/DavHau/pypi-deps-db
libraries.io also provides this information, possibly less accurate
Today, I am happy to announce a new version 2.2.0 of fpdf2 !
https://github.com/alexanderankin/pyfpdf/ Doc: https://alexanderankin.github.io/pyfpdf/
During the last few months, I contributed a few improvements to fpdf2
,
David Ankin fork of PyFPDF
,
the user-friendly Python library to generate PDFs:
from …
Download ready-to-use dictionaries for dictd (GoldenDict etc.)
Very useful for me to work on translations offline, in the train!
And I found the Wiktionary far more complete than FreeDict.
An alternative : parsing Wiktionary data dumps with tatuylonen/wiktextract, a Python tool.
Linkback protocols are an old breed. They were born in a time where MySpace, Wikipedia & WordPress had just been born, and Friendster was more popular than this new website called Facebook.
The latest linkback protocol, Webmention, is relatively recent though, as it became a W3C …
Covering :
- Persistent Connections
- Parallelism
- Asynchronicity
- Performances:
Time needed for `serialized' called: 12.12s Time needed for `Session' called: 11.22s Time needed for `FuturesSession w/ 2 workers' called: 5.65s Time needed for `FuturesSession w/ max workers' called: 1.25s Time needed for `aiohttp' called: 1.19s
- Streaming
if you’re using Python, Alpine Linux will quite often:
- Make your builds much slower.
- Make your images bigger.
- Waste your time.
- On occassion, introduce obscure runtime bugs.
We faced an issue with DNS on alpine images too at work...
cf. https://wiki.musl-libc.org/functional-differences-from-glibc.html#Name-Resolver/DNS
So with that, I want to humbly challenge all of the programmers and members of the open source community to expand your thinking around inclusion and diversity. I proudly stand before you today as the representative of a demographic that most people don’t think about—formerly incarcerated people. But we exist, and we are eager to prove our value, and, above all else, we are looking to be accepted.
The video is on Youtube and is really a must-see.
Moving and fascinating:
The library was one of the most secure places at the prison.
Issue #2 is out !
Paged Out! is a new experimental (one article == one page) free magazine about programming (especially programming tricks!), hacking, security hacking, retro computers, modern computers, electronics, demoscene, and other similar topics.
Include a crazy prime Python quine ! (page 35) O.O
At work, we needed to retrieve the full list of jobs a given Jenkins instance was hosting.
Our first solution was to use the jenkinsapi Python package:
import xml.etree.ElementTree as XmlElementTree
from jenkinsapi.jenkins import Jenkins
def get_all_jenkins_jobs(server_url):
jenkins = Jenkins(server_url, lazy=True, timeout=30,
username=os …
The iframe
above displays some graphs I've built last week,
in order to get some insight on some GitHub projects issues & pull requests evolution.
They are directly inspired by nf-core project activity statistics.
Une analyse claire, détaillée et visuelle des données publiques issues du grand débat national.
Le code source en Python de Myriam Begel : https://gitlab.begel.fr/myriam/grand-debat
En parallèle, l'analyse du site du gouvernement :
https://www.gouvernement.fr/on-fait-le-point-sur-la-restitution-du-grand-debat-national
I met a very strange Python module loading behaviour in Pelican today :
https://github.com/getpelican/pelican/blob/3395e71/pelican/settings.py#L21
Here is some minimal code reproducing the issue. It requires 5 files :
bug_repro.py
dir_a/__init__.py
dir_a/test_data/pelicanconf.py
dir_b/__init__.py
dir_b/test_data/pelicanconf.py
bug_repro.py
contains:
import dir_a
import dir_b
dir_a/__init__.py
and dir_b/__init__.py
both contain this code:
import os
from importlib.machinery import SourceFileLoader
print(SourceFileLoader('pelicanconf', os.path.dirname(__file__) + '/test_data/pelicanconf.py').load_module().THEME)
dir_a/test_data/pelicanconf.py
contains only the line THEME = 'localized_theme'
and dir_b/test_data/pelicanconf.py
is empty.
What will produces python3.7 bug_repro.py
? 😉
Turns out PHP standard crc32
method is non-standard (while crc32b
is).
Here is how to implement it in Python:
def php_crc32(a):
'''
References:
- https://www.php.net/manual/en/function.hash-file.php#104836
- https://stackoverflow.com/a/50843127/636849
'''
crc = 0xffffffff
for x in a:
crc ^= x << 24;
for k in range(8):
crc = (crc << 1) ^ 0x04c11db7 if crc & 0x80000000 else crc << 1
crc = ~crc
crc &= 0xffffffff
# Convert from big endian to little endian:
return int.from_bytes(crc.to_bytes(4, 'big'), 'little')
from random import*;import time,sys;import curses as h;w=h.initscr();h.noecho() #
P,Q,m,s,e,p,a,q=20,10,5,300,{0:"· ",1:"██"},[[[1,1]]*2,[[0,1,0],[1]*3,[0]*3],[[1#
,0,0],[1]*3,[0]*3],[[0,0,1],[1]*3,[0]*3],[[1,1,0],[0,1,1],[0]*3],[[0,1,1],[1,1,0#
],[0]*3],[[0]*4,[1]*4,[0]*4,[0]*4]],range,len;M,b=p[randint(0,6)],[[0]*Q for r #
in a(P)];h.cbreak();y,R,C,cr,l,d,n=lambda z,x,y:e[z[x][y]],0,4,0,1,s,p[randint(0#
,6)];w.nodelay(1);w.keypad(1);h.curs_set(0);A,B,sw=list,zip,{'U':'if not k(R,C'+#
',A(B(*M[::-1]))):M=A(B(*M[::-1]))','D':'V();R+=1','L':'if not k(R,C-1,M):C-=1',#
'R':'if not k(R,C+1,M):C+=1'};exec(('def k(R,C,se):\n for(r,c)in[(r,c)for c in '#
'a(q(M))for r in a(q(M))]:\n if se[r][c]>0 and(not(0<=R+r<P and 0<=C+c<Q)or b['#
'R+r][C+c]>0):return 1\ndef V():\n global R,C,M,n,l,d\n if(k(R+1,C,M)and R<1 an'#
'd sys.exit())or k(R+1,C,M):\n for(r,c)in[(r,c)for c in a(q(M))for r in a(q(M)'#
')]:\n if R+r in a(P)and C+c in a(Q)and M[r][c]>0:b[R+r][C+c]=M[r][c]\n M,n,'#
'R,C,d=n,p[randint(0,6)],-1,4,s+m-l*m\n for i in[j for j in a(P)if sum(b[j])>9'#
']:b[1:i+1]=b[:i];b[0],l=[0]*Q,l+1\ntry:\n while 1:\n o,z=a(q(n)),a(q(M));u=[('#
'r,c)for c in z for r in z];time.sleep(.001)\n for(r,c)in[(r,c)for c in a(Q)fo'#
'r r in a(P)]:`(r,c*q(e),y(b,r,c))\n for(r,c)in[(r,c)for(r,c)in u if M[r][c]>0'#
']:`(R+r,(C+c)*2,y(M,r,c))\n for(r,c)in[(r,c)for c in o for r in o]:`(r,22+c*2'#
',y(n,r,c)+"· · ")\n try:cr=(cr+1)%d;ch=w.getkey();exec(sw[ch[4:5]]);raise\n '#
'except:exec("if cr<1:V();R+=1");`(P,0,"level "+str(l))\nexcept:h.echo();w.keyp'#
'ad(0);h.nocbreak();h.endwin();print("level "+str(l))').replace('`','w.addstr'))#
Amazing ! Reminds me of the International Obfuscated C Code Contest
This article shows how to construct a non-recursive zip bomb that achieves a high compression ratio by overlapping files inside the zip container. "Non-recursive" means that it does not rely on a decompressor's recursively unpacking zip files nested within zip files: it expands fully after a single round of decompression. The output size increases quadratically in the input size, reaching a compression ratio of over 28 million (10 MB → 281 TB) at the limits of the zip format. Even greater expansion is possible using 64-bit extensions. The construction uses only the most common compression algorithm, DEFLATE, and is compatible with most zip parsers.
$ python3 -m zipfile -e overlap.zip .
Traceback (most recent call last):
...
__main__.BadZipFile: File name in directory 'B' and header b'A' differ.