MongoDB count queries can slow down your API

Posted on Fri, 23 Sep 2016 in Other • Tagged with mongo, api, rest

Sometimes front-end team or other API clients ask to show them total number of objects in API replies. But if you use MongoDB, try not to do this. It slows down your API.


Continue reading

Don't use dicts so much

Posted on Fri, 09 Sep 2016 in Python • Tagged with python, dict, rest

Python developers tend to use dicts too much. Mainly I tell about pass data through application as dicts not objects. It's a bad design witch causes many problems.


Continue reading

Move from Python to Java. First impressions

Posted on Fri, 26 Aug 2016 in Java • Tagged with java, python, spring

I've added Java to my technology stack at work recently. We decided to do our new project using Spring Framework. For me it is a very interesting challenge, cause I've used Java only in my pet projects before. There are my very first impressions.


Continue reading

How to use mypy on Python 2.7 project

Posted on Fri, 29 Jul 2016 in Python • Tagged with python, mypy, type hinting

If you work on a big Python project, type hinting can help you to find many design and function usage problems. Of course, you have to use external tools for static analysis, such as mypy. This is a great tool, but supports Python 3 mainly. Support for 2.7 branch isn't so straightforward. There are a couple of tricks that allows you to use it for 2.7.


Continue reading

Writing code for Unity3d in Sublime Text 3

Posted on Fri, 22 Jul 2016 in Editors & IDE • Tagged with game development, unity, sublime text

Using MonoDevelop IDE is the worst part of game developing on Unity. There is an alternative for Windows users. They can use Visual Studio. But should we, Mac users, do? Switch to Sublime Text.


Continue reading

TrueType Fonts in LibGDX

Posted on Thu, 14 Jul 2016 in Java • Tagged with game development, libgdx, kotlin

LibGDX is a beautiful library. It's easy to use. However some aspects of it isn't so clean. Dealing with fonts is an example of such aspects. I spent hours before I found reasonable solution that makes fonts looks good on an Android and on a desktop.


Continue reading

PyCon Russia 2016

Posted on Thu, 07 Jul 2016 in Python • Tagged with python, conference, pycon

PyConRu 2016 finished. It was the best PyConRu conference. Usually If there are two useful talks, conference is good. This time I found useful many amazing talks enough to fill an entire day-long session.


Continue reading

Build own iterator over enumerate

Posted on Mon, 27 Jun 2016 in Python • Tagged with python, iterators

Couple days ago one of my colleagues asked me to implement simple self-logging iterator inherited from enumerate. I tried to inherit directly from it and failed. I absolutely forgot how to use __new__ magic method. It was so embarrassing. I was in a hurry, so I promised myself to solve this puzzle. And I can tell you it is a simple task. Actually it takes 18 lines of code only.


Continue reading

My top 7 of PyCon 2016 videos

Posted on Tue, 14 Jun 2016 in Python • Tagged with pycon, python, conference

There is my list with 7 best PyCon 2016 videos. I don't say that other videos not good. I say that these videos are more useful for me or impress me more than others. And as you can see I prefer talks about Python internals. I hope you'll find this list helpful.


Continue reading

Mutable types as default params in Python

Posted on Thu, 09 Jun 2016 in Python • Tagged with Python, default params

Do you ask yourself why you souldn't use mutable types as default value for parameters in Python? I'm sure you ask at least if you are not a junior. Probably, your answer is "It causes to strange side effects". However, only a tiny part of python developers makes step throw and figure out how it works under the hood.


Continue reading