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
Yesterday I was crafting some puzzles for my girlfriends, and I was looking for letter-based ones where I a secret word would be revealed once solved.
With this same goal, I had already once worked on an open-source JS word search generator: https://lucas-c.github.io/wordfind/
(pour les francophones …
Over the past years, on software programming projects where my end users where developers (other than myself or my team), I have tried to follow the advice of this website : keepachangelog(.com)
A changelog is defined by Wikipedia as :
a log or record of all notable changes made to a …
Avec ce tutoriel vous verez comment rendre votre site web plus rapide : de l’optimisation des requêtes, à l’affichage de la page, en passant par la génération des pages web et l’affichage correct des pages sur tous les terminaux.
Here is a patch to the pdfjam
shell script to make it work under Cygwin:
--- pdfjam.original 2019-01-07 16:12:47.894523500 +0100
+++ pdfjam.patched-for-cygwin 2019-01-07 16:12:33.492142300 +0100
@@ -949,6 +949,9 @@
(umask 077 && mkdir "$PDFJAM_TEMP_DIR")
fi
umask $original_umask
+case `uname` in
+ *CYGWIN*) PDFJAM_TEMP_DIR=`cygpath -w "$PDFJAM_TEMP_DIR"`;;
+esac
##
## TEMPORARY DIRECTORY ALL DONE
##
@@ -1073,7 +1076,10 @@
sourceFullPath="$sourceDir"/"$pdfName"
uniqueName="source-$counter.pdf"
uniqueName="$PDFJAM_TEMP_DIR"/"$uniqueName"
- ln -s "$sourceFullPath" "$uniqueName"
+ case `uname` in
+ *CYGWIN*) cp "$sourceFullPath" "$uniqueName";;
+ *) ln -s "$sourceFullPath" "$uniqueName";;
+ esac
;;
esac
filePageList="$filePageList","$uniqueName","$pageSpec"
@@ -1123,6 +1129,7 @@
texFile="$fileName".tex
msgFile="$fileName".msgs
tempFile="$PDFJAM_TEMP_DIR"/temp.tex
+backslashsafe_filePageList=$(echo $filePageList | sed 's~\\~/~g')
(cat <<EndTemplate
\batchmode
\documentclass[$documentOptions]{article}
@@ -1137,7 +1144,7 @@
\usepackage{pdfpages}
$preamble
\begin{document}
-\includepdfmerge[$miscOptions]{$filePageList}
+\includepdfmerge[$miscOptions]{$backslashsafe_filePageList}
\end{document}
EndTemplate
) > $texFile
I just added a favicon to this site, representing a glider of Conway's Game of Life.
This GIF was made with a Python script. The source code is on GitHub, and uses Zhao Liang's gifmaze.py.
Feel free to reuse the code to make you own favicons 😉
<style> article img { transform …</style>tl;dr :
- Start using [your software] in production in a non-critical capacity (by sending a small percentage of traffic to it, on a less critical service, etc)
- try to have each incident only once
- Understand what is ok to break and isn’t
For example, with Kubernetes:
- ok to break:
- any stateless control plane component can crash or be cycled out or go down for 5 minutes at any time
- kubernetes networking can break as much as it wants because we decided not to use it to start
- not ok to break
- for us, if etcd goes down for 10 minutes, that’s ok
- containers not starting or crashing on startup
- containers not having access to the resources they need
- pods being terminated unexpectedly by Kubernetes
With Envoy, the breakdown is pretty different:
Almost a year ago, GitHub introduced security alerts. They are an awesome feature.
They function as notifications you receive whenever a vulnerability affecting one of your project dependencies.
But long after receiving a notification, how to list all security alerts affecting your repositories ?
I didn't found an out-of-the box solution …
Some time ago, I used the overblog platform in order to create a blog for a long trip in Ireland.
Despite being sometimes very slow, it was overall a good platform, very easy to grasp for beginners. The blog is now old and unused, but before destroying it I wanted …
Yesterday I've stumbled upon a very surprising bug in some Python 2 code,
related to the use of the __del__
method in a vendor library we employ at work.
Here is some minimal code that reproduces the issue I met:
class MyClass:
def __init__(self):
raise RuntimeError('Woops')
def __del__ …
Not very insightful, but I'm retaining some quotes:
But IT operations includes much more than the limited “ops” functions we typically fold into a DevOps team. I’m talking about things like ticket management, incident handling, user management and authorization, backups and recovery, network management, security operations, infrastructure procurement and cost optimization, compliance reporting, and much more. In today’s IT organization, where do these responsibilities fall?
You want DevOps teams to have a streamlined, low lead-time, lean pipeline to production. Devoting team capacity to this broader set of operational functions may slow down this pipeline. There are also efficiencies to be gained by sharing these practices across the work of all the DevOps teams.
All of this is to say that a portion of IT operations still exists independently of the DevOps teams, performing those “ops” functions that are not in “DevOps” while the DevOps teams focus on that subset of ops functions specifically related to deploying code and responding to code-related incidents
Record, replay, and stub HTTP interactions.
- 🚀 Fetch & XHR Support
- ⚡️️ Simple, Powerful, & Intuitive API
- 💎 First Class Mocha & QUnit Test Helpers
- 🔥 Intercept, Pass-Through, and Attach Events
- 📼 Record to Disk or Local Storage
- ⏱ Slow Down or Speed Up Time
- 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.