Can You Solve This?
Today when I was riding the bus I thought “would it be possible to efficiently utilize the seats so that each individual would sit as long as possible?”. The short answer is for reality is probably “NO!” but let’s have fun with the problem in theory at least :) Let’s say that we have a bus route with 50 stops and the distance between each consecutive pair is constant. The bus has 20 seats (Let’s focus on one bus for now). Then at each stop (including the terminals) we get the data on how many people are getting on and at which stop they’re getting off. At each stop tell each passenger to sit (optionally) or let them stay standing by default. ...
How GitLens enhanced my commits
I’ve been using GitLens on VS Code since always! The reason I Installed GitLens is being one of the most popular and recommended extensions on the marketplace. But recently I’ve noticed how its current line blame feature has made my whole committing process much better. Of course, I knew about Git blame long before even GitLens came into existence. Although it’s a great tool to exploit git history, It’s not handy and easy to use and so it’s not commonly used. Or at least, not as common as seeing the current line blame at all times. ...
The journey of blogging for fun
As long as I remember, I’ve always enjoyed blogging and wanted to do it more. But unfortunately, it never happened. Recently, I came to realize that the high standards I had for the quality of my posts were possibly the most important reason not to write. Basically, I had always wanted a professional blog! By professional, I mean a blog which the author makes a living out it; and maybe some other people as well! And the effort I was willing to make was just a little bit more than tweeting! ...
The story of a nil pointer receiver
Let’s assume we want to store Gender as an attribute for our users. And since we use PostgreSQL we can define an enum for gender like this: ...
Fun Hack: Copy commands to a local VM without clipboard
I was following an instruction to deploy an application on a Virtualbox VM and I wanted to execute the long commands. By default it’s not possible to copy those command into the VM. VirtualBox has a shared clipboard feature which I tried to get it working but it didn’t happen so I didn’t dig into it and I came up with a funny hack :D I sent the commands through a socket :) ...
The Battlefield
Battlefield is a project that I’ve started in TehPUG. you can read the story behind it and see how I decided to start this project here. So far till now I experienced some projects and activities that didn’t work out as I expected. I asked my self what are the requirements to activate and motivate TehPUG. I came up with a few answers… It should be suitable for everyone. from the very beginner that learned something about python today to the python expert. they all should be able to participate. It should be able to engage as many people as possible It should be endless. it shouldn’t be a project that we do for a while and when it’s done it’s there are nothing else to do. It should be fun and attractive and also useful and helpful So based on these criteria I came up with an idea. A battlefield. A field for robots to fight. ...
The TehPUG
Let me introduce TehPUG. TehPUG is the Tehran Python Users Group like any other PUG around the world. People who love python or have heard it recently and want to learn more about it. We have meetups every month. Come and join us if you love python too. A little background I was new to python when I joined TehPUG in its early days. There were people who helped me learn more about python and even give me a chance to do some practical stuffs. I’m very grateful to each one of them individually. Time passed by and I integrated more and more with TehPUG and finally became one of it’s core member. Now I had the chance to help others as I was helped ...