Posts

Showing posts from 2018

Using cheap Intel ComputeStick STCK1A8LFC with Lubuntu 18.04

Image
I bought a cheap Intel Compute Stick PC(STCK1A8LFC, 1GB RAM/8GB storage) to make it a remote 3D printer host for my M3D micro+(https://printm3d.com/themicro/). Since M3D micro+ only works on Windows and Linux now (Mac version is incompatible to Mojave), I installed a Lubuntu to it. Although, there is a blog about the a script (isorespin.sh) for customizing bootable iso image to Atom base PC(http://linuxiumcomau.blogspot.com/2017/06/customizing-ubuntu-isos-documentation.html), it seems we don't need it anymore. So, here is what I did. 1. Update bios download latest bios image from https://downloadcenter.intel.com/download/28070/BIOS-Update-FCBYT10H-86A-?product=84815 . Choose Recovery BIOS update [FC0038.bio]. save it to a USB flash drive. restart ComputeStick hitting F7 from BIOS update menu, choose USB and FC00XX.bio. 2. Install Lubuntu Download lubuntu alternate image from https://lubuntu.me/downloads/ . We cannot install from normal lubuntu iso bec

How to format IPython starck trace. (IPythonのスタックトレースを見やすくする)

Image
Problem IPython is absolutely great tool to create Python code interactively, but when I use complicated libraries like pandas or scipy, its stack trace gets very very long and it's hard to find where was the original mistake, thanks to the verbose rich texts explaining errors. Moreover, although there are several libraries which can format the stack traces, they don't work with IPython, because IPython skip standard sys.excepthook. https://stackoverflow.com/questions/1261668/cannot-override-sys-excepthook Here is how to make it work, using one of those formatting tool TBVaccine ( https://github.com/skorokithakis/tbvaccine ). I wrote following at the python initial code(script set for $PYTHONSTARTUP). try: import tbvaccine kargs = {"code_dir":os.getenv('PWD'), "isolate":True, "show_vars":False} tbvaccine.add_hook(**kargs) if get_ipython(): # IPYTHON tbv = tbvaccine.TBVaccine(**kargs) def f(*args, **argv): tbv.prin

Python pip stop working because of SSL Error on Mac (with Homebrew)

I bought a new MacBook pro, and recover from an old MacBook ends successfully, but "pip" stopped working because of the SSL Error . pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Even upgrading pip like this pip install --upgrade pip fails. It seems homebrew python is upgraded and SSL was old too. see links Change from pip 3.4 to 3.5 , Unable to install Python libraries Here is how I fixed. brew reinstall openssl curl https://bootstrap.pypa.io/get-pip.py | python3

AGE phone for Mac setting(NTT Hikari)

Image
just reminder for myself... 電話番号は内線番号のことです。 パスワードはルーターの設定から内線番号ごとに割り振られています。

Very very simple example of TensorFlow conv1d.

import tensorflow as tf import numpy as np X = np.zeros((10,10)) + 1 filter = np.zeros((5,),dtype=np.float32) + 1 x = tf.placeholder(tf.float32, shape=[None, 10, 1]) f = tf.placeholder(tf.float32, shape = [5, 1, 1]) conv = tf.nn.conv1d(x, f, 1,'SAME') session = tf.Session() result = session.run(conv, feed_dict={x:X.reshape((10,10,1)), f:filter.reshape((5,1,1))}) result.reshape((10,10)) result array([[ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.], [ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.], [ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.], [ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.], [ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.], [ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.], [ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.], [ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.], [ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.], [ 3., 4., 5., 5., 5., 5., 5., 5., 4., 3.