Jim Cheung

Friday, January 11, 2019

keep vagrant box time in-sync:

vb.customize [ “guestproperty”, “set”, :id, “/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold”, 10000 ]

local docker registry for single node kubernetes:

$ docker image pull registry:2
$ docker container run -d -p 5000:5000 --name registry registry:2
$ docker image build -t myapp .
$ docker image tag myapp localhost:5000/myapp
$ docker image push localhost:5000/myapp
$ kubectl create deployment myapp --image=localhost:5000/myapp

Tuesday, January 15, 2019

two interesting command line tools:

another news aggregator: DevURLs

reading an interesting book: Vertically Integrated Architectures: Versioned Data Models, Implicit Services, and Persistence-Aware Programming

a note from the author: How my book about Vertically Integrated Architectures came into being – Jos Jong – The Future of Software Development

Tuesday, January 22, 2019

Modules · golang/go Wiki · GitHub

initialize a new module, this creates a go.mod file:

$ go mod init github.com/you/hello

go build will fetch and add dependencies to go.mod, no go get required.

common usage:

run node.js code in jupyter notebook, use this module: pixiedust/pixiedust

it doesn't create a new node.js kernel, but instead it uses python kernel and pass %%node block codes to node runtime, and allows node.js variables copied as python variables

this way is much better than using a node.js kernel.

for custom node_modules folder, change PIXIEDUST_HOME environment variable (it still creates a node folder inside it, so have to make soft link to node_modules)

reading Concurrency in .NET: Modern patterns of concurrent and parallel programming

I'm not a .NET developer, but I listened to Software Engineering Radio Episode 348: Riccardo Terrell on Concurrency, decided to give it a try

Thursday, January 24, 2019

joined safari online training Python Data Handling - A Deeper Dive

some notes:

class Stock(object):
  __slots__ = ('name', 'shares', 'price')
  def __init__(self, name, shares, price)
    self.name = name
    self.shares = shares
    self.price = price


from collections import namedtuple

Stock = namedtuple('Stock', ['name', 'shares', 'price'])

it creates a class that you use to make instances:

s = Stock('GOOG', 100, 490.1)


import tracemalloc
// do something here

Monday, January 28, 2019

found a good website on mysql stuffs: Mydbops – Scaling database Operations

another one is for golang: Golang – Jexia

some random links from twitter:

reading Deep Learning with PyTorch, I found PyTorch is little bit easier to understand than tensorflow

and Practical Deep Learning for Coders 2019 also uses PyTorch

also reading Deep Learning and the Game of Go

in order to get a better foundation, reading Good Math: A Geek's Guide to the Beauty of Numbers, Logic, and Computation as well

Thursday, January 31, 2019

create thumbnails for many photos:

$ mkdir thumbs
$ mogrify -path thumbs/ -thumbnail 500x500 *.jpg

vim, create new file under nerdtree:

  1. toggle nerdtree
  2. cursor on target directory, press m to toggle menu
  3. press a to create new node (file)
Blog Archive