31 Aug 2017

ಠ_ಠ!!! A Daily (supposedly) Note On Programming


First, thanks to JONATHAN MCGLONE – nice integration of Jekyll & .github.io with markdown style, I dont need to struggle to set up my blog.

Python:

how to load text to ndarray

# this is freakingly slow
records = np.loadtxt(yourFileName, dtype=int, delimiter='\t')
    
# should be OK
from pandas import read_csv
records = read_csv(argv[0], sep='\t', header=None).as_matrix()

make sure pip/pip2 supports the version of the python binary

  • symptom: “No module named sklearn”
  • check
      lpluskira$ python --version
      lpluskira$ Python 2.7.10
        
      lpluskira$ pip2 --version
      lpluskira$ pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
    

recieve the the ‘1st’ value in dict

    dict.itervalues().next()

take some specific col from ndarray

    usrs = records[:,0]
    items = records[:,1]

convert data type

    ratings = records[:,2].astype(float)

uniq an ndarray

    arr = np.uniq(arr)

check lib version

    pip freeze | grep libName

data visualization

should try this

Vim:

how to ‘easily’ grep in vim

  • grep someText yourFile
  • cnext
  • cclose

Tmux:

cheat sheet

Docker:

where is /var/lib/docker on osx?

  • note that it’s powered by VM on osx
  • ref
  • ref2

Chrome:

google search navigator does efficient search with:

  1. j(up) k(down) on search result
  2. ENTER(target the url) OR command + ENTET(open that in a new tab)

clean up cache

    Ctrl(Cmd)+shift+delete

OSX:

keep alive when lid closed on Mac

Git:

markdown

Hearth Stone:

death grip – everything you touch surely dies

favorite stremers/players currently

Name description link
Amaz uh… Amaz
Kripparian uhh… Kripparian
Kibbler uh .. Kibbler and his cute dog
Sowhan Sowhan