
Latest posts
AI Injection part 2: OpenAI’s APIs are broken by design
Imagine that you’re using a great new chrome extension that reviews a github repository and summarizes what the code inside it does. You run it on some new very useful Python library, and the report was “this library helps you train AI models”. Nice! You start using it, and unknowingly, you actually installed a bitcoin miner on your very strong EC2 instance. Where did that come from?
Read more > AI Injection part 2: OpenAI’s APIs are broken by design
AI Injection: AI completion considered unsafe
Like many others, my feed was also quickly taken over by the excitement around ChatGPT. I must confess, I am also excited about this, and I have a few ideas of my own. Ideas of integrations abound – let’s create a bot that automatically summarizes twitter threads. Let’s create a bot to summarize whatsapp convesations.…
WhatsApp Top Posters
A few years ago I joined a CTO WhatsApp group. I think I was the 14th person there or so. These days this group has more than 270 members. It is an amazing group, with a lot of valuable content. People have repeatedly asked for an easily searchable index of the group’s history, and at…
Favourites
Rhyme and Reason with Python
After reading xkcd’s blog, I went to LimerickDB.com. It looks and works just like bash.org, but for limericks. Quite amused with some of the limericks available, I wanted to try and compose my own. The first one came out fine, but I got stuck without a rhyme for the second one: a man named guido…
Manually fuzzing my own compiler
As I mentioned before, I had to write a compiler for simplified CPL. An obvious requirement was that the compiler generate correct code. A less obvious requirement, but important none-the-less, was that after a syntax error, the compiler will keep parsing the source program. Now, the default behavior of a parser generated by Bison for…
Fractals in 10 minutes no. 3 – The Dragon
When first I looked through the pages of the book “Hacker’s Delight”, I found myself looking at the chapter about bases. There I learned a very curious fact – with the digits of 0,1 and the base of -2, you can represent any integer. Right afterwards I learned something even more interesting – with the…
Fractals in 10 minutes No. 2 – Recursive Spring
Imagine a straight wire. Bend this wire until its ends meet. You get a ring. Next stage. Take another straight wire, bend it as before, but this time, don’t let the ends meet, instead continue bending the wire more and more, until you get a spring. Now, Think of this spring as the first wire,…
Python module usage statistics – Cont.
Well, very embarrassingly for me, turns out I had a bug in my original post and code. As per Doug’s suggestion, I tried running the script I wrote on the standard library, and got results I didn’t quite believe. So I checked them, opened socket.py, and there was an “import _socket”. However module “_socket” was…
Python module usage statistics
IMPORTANT UPDATE: The code I used to create these statistics had some bugs. The fixed statistics are available here. After reading Doug Hellman’s post about python stdlib modules he needs the documentation to, I commented there that I need the documentation for logging because I don’t use it too frequently. Later, I thought a little…