python

Weird Comparison Issue in Python

Hi guys! I am back with a new article. This time I will tackle a problem which seems easy enough at first but will surprize some of you. Suppose you have the following piece of code: Continue reading

Advertisements
Standard
python

PyCon Pakistan & The First Meetup in Lahore

20229711_856550481164064_8693122100347106884_o

Hi there guys! I will be starting my bachelors at Colgate University in Hamilton, US from this month. I have been pretty busy lately with making all of the required arrangements. However, during this time I got a chance to attend the first ever Python meetup in Lahore, Pakistan. It was hosted on July 22nd. I am a bit late with this write-up so without any further ado let’s get right into it. Continue reading

Standard
python

Making a Reddit + Facebook Messenger Bot

Hi guys! I haven’t been programming a lot lately because of exams. However, on the past weekend I managed to get a hold of my laptop and crank out something useful. It was a Facebook messenger bot which servers you fresh memes, motivational posts, jokes and shower thoughts. It was the first time I had delved into bot creation. In this post I will teach you most of the stuff you need to know in order to get your bot off the ground. Continue reading

Standard
python

Recovering lost Python source code if it’s still resident in-memory

I read this on GitHub Gist the other day. I don’t know whether I will ever use it but I am still putting this on my blog for the sake of bookmarking it. Who knows? Someone from the audience might end up using it!

I screwed up using git (“git checkout –” on the wrong file) and managed to delete the code I had just written… but it was still running in a process in a docker container. Continue reading

Standard
python

Importing with ctypes in Python: fighting overflows

Introduction

On some cold winter night, we’ve decided to refactor a few examples and tests for Python wrapper in Themis, because things have to be not only efficient and useful, but elegant as well. One thing after another, and we ended up revamping Themis error codes a bit.

Internal error and status flags sometimes get less attention than crypto-related code: they are internals for internal use. Problem is, when they fail, they might break something more crucial in a completely invisible way. Continue reading

Standard