Effectively Using Matplotlib


Thoughts to follow…


Visual Studio 2017 – 7 lesser known debugging tips


2 point on “Data Breakpoints” is really useful. Sometimes we just want to debug a single instance of a type. The ability to assign an ID to an object (e.g. $1) we want to trace and set this=="$1" is just brilliant!

VS2017 has spent a lot of effort trying to make the debugger more developer friendly for multi-threaded application. Appreciate your effort, Microsoft 🙂

Redis on Windows

Website: https://redis.io/


  1. Redis supports Unix system so in order to support Windows it requires some tweaks. You can download the MSI at https://github.com/MSOpenTech/redis#redis-on-windows
  2. In python environment:
    pip install redis

One simple example to set and get string values

import redis

r = redis.Redis()
r.set('foo', 'bar')
value = r.get('foo').decode('utf-8')

Note: r.get('foo') will return b'bar' which is a byte string – redis will auto-encode a unicode string for you on the way in. r.get('foo').decode('utf-8') decode it using utf-8.

Ref: https://stackoverflow.com/questions/25745053/about-char-b-prefix-in-python3-4-1-client-connect-to-redis

You can even save objects

class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def grow(self):
        self.age += 1

    def __repr__(self):
        return str.format("Name={name}, Age={age}", name=self.name, age=self.age)

p = Person("Han", 32)
r.set('han', p)

Have fun!