In my 20 years of experience in software industry, I have met two kinds of programmers. Although they all call themselves software engineers or programmers, they exhibit very different behaviors and ways of thinking when it comes to programming.

I call the first kind “coders”, and the second kind “hackers”.

How do “coders” think and behave?

Since we live in 2019, not 1999, your users probably expect to login with email, as opposed to assigning themselves a user name that looks like “kennthji2018348”. They probably also want to just login to your app with their Google or Facebook account.

Well, if you are stuck with using…

In Celery official document, the way to interactively debug Celery tasks is to use rdb in combination with telnet (hello! Are we still in 1980's?). This can be really pain in the butt.

There is a way to debug Celery tasks effectively but somehow it is not well documented.

  1. Insert import ipdb; ipdb.set_trace() where you want a breakpoint in the task in question.
  2. Enter interactive debug shell without the async mess:
python manage.py shell_plus
>>> from myapp.tasks import task_to_debug
>>> task_to_debug.apply(args=[arg1, arg2], kwargs={'kwarg1': 'x', 'kwarg2': 'y'}))

Please note that arg1, arg2 and/or {'kwarg1': 'x', 'kwarg2': 'y'}`are the arguments that task takes. Do NOT do task_to_debug.apply(arg1, arg2, ...) . Otherwise it won’t work!

Thanks to Daniel Pink’s popular TED talk, everyone in software now knows that autonomy is important for keeping the motivation high for engineers. And it’s not surprising that every software company nowadays declares “autonomy is an important part of our company culture”.

At least that’s what they tell the public.

There is actually a way to install OpenCV 3 on Ubuntu 16.04 using apt-get and pip. Somehow most of the articles I found online describe the process of building from source code, which is painfully long and error-prone.

It can be as simple as:

sudo apt-get install libopencv-dev python-opencv
sudo pip3 install opencv-python

That’s it! Enjoy your freshly minted OpenCV 3! :)

Kenneth Jiang

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store