A few hours back I stumbled into a problem where I had to perform a lookahead of n elements in a list to do some calculations. The first thought: Just take the current index and get all elements until i+n. I started writing.. for i in range(len(iterable)): ---- SNAP ---- Stop. This is awfully unpythonic.… Continue reading N-wise Iteration in Python
Tag: python
Parsing KMZ Track Data in Python
A few days back I stumbled across an interesting problem. I was asked to develop a solution that was doing some analysis work on geolocation data stored in KMZ format. Existing solutions like fastkml (64KB) and pykml (42KB) seemed nice at the first glance, proved to be unnecessary overhead, however. They’re mostly meant to manipulate… Continue reading Parsing KMZ Track Data in Python
Visualizing IP Network Graphs in Python
For some research on botnet host detection in large-scale networks, I found myself in the situation that I had to apply a set of algorithms to a huge packet dump. To comprehend an amazing paper, I started to play around with the dataset and tried to reproduce the results presented in the whitepaper. Quickly I… Continue reading Visualizing IP Network Graphs in Python
The “Pythonic” GOTO
Nope, I’m not going to join the goto war. Even though it’s shunned among developers, there are still some situations where it makes sense. A good friend of mine with a background in C recently came to me with a very simple problem that still made him scratch his head when he tried to express… Continue reading The “Pythonic” GOTO
Code Checking with Git Hooks and Flake8
We all have that special someone in our life. Someone who dares to commit and push something like this into the master-branch: import math, os, sys def test_function(one, two, three, four, five): from test.utils import * print x; print y if two==three and (four!=five or one!=three) and (sqrt(four)==two or sqrt(two)==one): return math.ldexp( one, two )… Continue reading Code Checking with Git Hooks and Flake8
HackTheBox Bashed Write-up
Bashed is a great entry-level box for people who are just getting started with HackTheBox. If you are just getting started with penetration testing, the value of this box is less in its technical content but rather in giving you the chance to exercise through your processes once. A bit like jumping into the water… Continue reading HackTheBox Bashed Write-up
Some thoughts on the CodeFEST8 in Dresden
What is it? The CodeFEST is a hackathon held by Volkswagen. Basically, you're joining a team and with the help of some mentors, you tickle your brain for 26 hours of pure work until a great, innovative idea comes out. After reaching the deadline, you give a short five-minute presentation about the problem, your solution,… Continue reading Some thoughts on the CodeFEST8 in Dresden