December 23, 2016

Testing Brotli compression


What is it?

It's another compression, emphasis on use for HTTP compression.

Please note that I just wanted to test it on my Windows machine for fun, not to prove whether it's better or worse than other compression algorithms.

Source Code


Binaries for Windows: 

I tested this file: sqlite3.exe (size: 488,960 bytes).

C:\bin>brotli --in sqlite3.exe --out test.br

and with 7zip:

C:\bin>7z a -t7z test.7z sqlite3.exe

And the result:

219,905 -- test.7z
238,039 -- test.br


RESOURCE




December 17, 2016

IPython-Jupyter on Windows

What is it?

Install on Windows

  1. install python first
  2. pip install jupyter

Start Jupyter

  1. move to jupyter notebook folder.
    e.g.) C:\> cd notebook
  2. type in: jupyter notebook

Configuration

  • Generate configuration file:
    jupyter notebook --generate-config

    This will generate file as: C:\Users\<USERNAME>\.jupyter\jupyter_notebook_config.py
  • Change default notebook directory:
    e.g.) edit the configuration file entry:
    c.NotebookApp.notebook_dir = u'D:/dev/code/workspace.jupyter'

"Pin to Start"

Once it's all installed and customized, to run it, you need to open cmd.exe then type in "jupyter notebook".  Simple batch file like this will help:

e.g.) "jupyter.bat"
@echo off
start "Jupyter Console" "C:\opt\Python27\Scripts\jupyter.exe" notebook

However, you can't add batch file to Windows 10's Start menu.  I converted this batch file with an icon to an executable file using "Bat To Exe" (see link below).  Once it's compiled, add to Win 10's Start menu.  For icon files, google it: https://www.google.com/#newwindow=1&q=jupyter+filetype:ico

This batch file will still leave command window open -- it's preferable as I can stop Jupyter process with CTRL-C.

RESOURCES


November 30, 2016

Windows 10, Ubuntu Bash, and TensorFlow

There are many notes and articles on the web how to install Ubuntu Bash on Windows and TensorFlow on it.  This posting is a note to myself to remember how it's done.

Install Ubuntu Bash on Windows 10

  1. Open "Settings"
  2. Click on "Update & Security"
  3. On left bottom, click on "For developers", then select "Developer mode" then close the settings.
  4. Open Control Panel (right mouse click on Windows start button, and choose "Control Panel" 
  5. Click on "Programs"
  6. Click on "Turn Windows features on or off."  "Windows Features" list will pop up.
  7. Click on "Windows Subsystem for Linux (Beta)" and click Ok button.
  8. Follow the instruction, and restart.
Once it's done, you can run "Bash on Ubuntu on Windows" -- type in "bash" in the Windows search box, and this app will be shown.

Use apt-get or apt-cache to search and install Linux software.

Ubuntu Bash directories and Windows directories

From Ubuntu Bash, to Drive C:
cd /mnt/c

From Windows shell to Ubuntu system files:
cd c:\Users\<username>\AppData\Local\Lxss\rootfs

To Ubuntu user account's home:
cd c:\Users\<username>\AppData\Local\Lxss\home\<username>

Install TensorFlow on Bash (using above Ubuntu Bash on Windows 10)

Note that this is for CPU only, Python 2.7, 64-bit.

  1. Open Ubuntu Bash
  2. Type in as following:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0rc0-cp27-none-linux_x86_64.whl
$ sudo apt-get install python-pip python-dev
$ sudo pip install --upgrade $TF_BINARY_URL

Resources