ハイパー日記 あとちょっと技術
日記
財布を人生で初めて無くしてしまった
現金は3000円くらいだったし(貧乏学生には痛い)
クレカキャシュカを速攻で止めて保険証免許証の再発行準備もちゃかちゃか進んでいるが
やはりあんなでかいものを無くしてしまう自分のボケっとしたところに情けなくて落ち込んでいる
あと人生で
TL;DR
いまでかい企業でAIエンジニア兼ソフトウェアエンジニアの仕事をしているのですがでみんなジュピター(ネイティブ:ジュパイタァー)を使っていて、いちいち.pyファイル作ってコンソールから実行している自分は少し時代遅れのようです。
追記
jupytextという素敵なOSSで出ました。やったぜ。
しかし自分にも矜持がありインテリJのオートセーブ機能、関数やクラスの根元にワープできる機能、そして何と言ってもIDEの最強機能入力補完がある為この開発方法を取っています
しかし
調べて見たらjupyterでもちょっと弄れば拡張機能が追加できる模様
アナコンダ必須
$ conda install -y -c conda-forge jupyter_contrib_nbextensions
鍛冶屋さんから何やら大量のライブラリが導入されますがとりあえず待ってれば大丈夫だよ
jinja2とかもあったからウェブ好きな人には嬉しいね😤
おわりに
最近hyperpyというコマンド一発で自分のpython仮想環境のライブラリを一括アップデートできるOSSを作っているよ!!
docker hubみたいに環境に合わせた強いrequirements.txtを投稿できるシステムも作りたいね😝
人生のターニングポイント
ここ最近、研究も蔑ろにして、かといって趣味のプログラムもgithubの芝を生やすためだらだらちょこっと書く程度。
引きこもってyoutube見たり漫画読んだりしている。
後期の大学院の講義もロクに検討していない。
スタートアップしたプログラミング教室の会社も徐々に他人任せになっている。
このままじゃ本当によくない。
他人に優しく自分にも優しくがモットーだったがそれじゃいずれどん詰まりで人生詰む。23でようやく気づいた。
病気ってことに逃げず意識を高めていきたい。
そのための長期インターン😤
とりあえず一ヶ月住む場所も変わって勉強して最大限のアウトプットをしたい。
インターン中にどうしてもきつくてくじけたらまあそれはそれで俺の人生のシンギュラリティである。
引きこもりにありがちな一発逆転一点狙いはあまり感心できない。もし仮に成功したとしても槿花一朝の夢に終わると思っている。
この考えは成功者に対する俺の嫉妬、ケンモイズムからくるものかもしれないが自分は根本から意識を変え、真面目に進みたいと思っている。
とりあえずインターン終わって完全に戦力外だったらまた人生設計練り直す。
最悪実家に帰ってフリーター、非正規すればいいと思ってたけどそれじゃいつか必ず詰む。しかしまたそれも俺の人生なのかもしれない。
ここんとこ色々頭の中でぐるぐるしている。
何がしたいのか9月に明確に決めたいと思う。
pythonのvurtualenv更新のススメ!!!!!!!!
構成
pyenv + anaconda + python3.6
で構築している。
今までenv切り替えのsource activate
がpyenvとcondaで衝突してシェルごと殺される問題があった。
condaの4.4から
conda activate
が実装されシェルのrcにエイリアスとか書く必要がなくなった。
早速私はcondaをアプデした。
ついでにanacondaのバージョンも古いので一新することにした。
自分はenvに突っ込むライブラリをを用途ごとに細かく分けず、大抵の開発物に対応できるように(ウェブ、api、機械学習、画像処理、言語処理、ゲーム、etc...)たくさんのライブラリを一つのenvに突っ込んで大抵の開発をそのenvで行なっている。
これが悪手かどうかは人によって別れるが、私はアリだと思っている。
そのため自己流のrequirements.txtを保存しているので公開する。
大抵の開発物はこれでなんとかなるので是非pip installして見て欲しい。
appnope==0.1.0 asn1crypto==0.24.0 attrs==17.3.0 Automat==0.6.0 beautifulsoup4==4.6.0 bleach==1.5.0 boto==2.48.0 boto3==1.5.8 botocore==1.8.22 bz2file==0.98 cardgame==1.0 cffi==1.11.2 chardet==3.0.4 click==6.7 constantly==15.1.0 cryptography==2.1.4 cssselect==1.0.1 cycler==0.10.0 Cython==0.28.1 decorator==4.1.2 dj-database-url==0.5.0 Django==2.0.6 docutils==0.14 dominate==2.3.1 entrypoints==0.2.3 enum34==1.1.6 feedgenerator==1.9 Flask==0.12.2 Flask-Bootstrap==3.3.7.1 future==0.16.0 gensim==3.2.0 google-api-python-client==1.6.4 gunicorn==19.7.1 h5py==2.7.1 html5lib==0.9999999 httplib2==0.10.3 hyperlink==17.3.1 idna==2.6 incremental==17.5.0 ipykernel==4.7.0 ipython==6.2.1 ipython-genutils==0.2.0 ipywidgets==7.1.0 itsdangerous==0.24 Janome==0.3.6 jedi==0.11.1 Jinja2==2.10 jmespath==0.9.3 jsonschema==2.6.0 jupyter==1.0.0 jupyter-client==5.2.0 jupyter-console==5.2.0 jupyter-core==4.4.0 Keras==2.1.2 line-bot-sdk==1.5.0 lxml==4.1.1 Markdown==2.6.9 MarkupSafe==1.0 matplotlib==2.1.1 mistune==0.8.3 nbconvert==5.3.1 nbformat==4.4.0 networkx==2.0 notebook==5.2.2 numpy==1.14.5 oauth2client==4.1.2 opencv-python==3.4.0.12 pandas==0.21.1 pandocfilters==1.4.2 parsel==1.2.0 parso==0.1.1 pexpect==4.3.1 pickleshare==0.7.4 Pillow==5.0.0 pkginfo==1.4.2 pluggy==0.6.0 prompt-toolkit==1.0.15 protobuf==3.5.1 psycopg2==2.7.4 psycopg2-binary==2.7.4 ptyprocess==0.5.2 py==1.5.2 pyasn1==0.4.2 pyasn1-modules==0.2.1 pycparser==2.18 PyDecimal==1.0 PyDispatcher==2.0.5 Pygments==2.2.0 pymongo==3.6.0 PyMsgBox==1.0.6 PyMySQL==0.8.0 pyobjc==4.1 pyobjc-core==4.1 pyOpenSSL==17.5.0 pyparsing==2.2.0 PyScreeze==0.1.14 pytest==3.3.1 python-dateutil==2.6.1 python-dotenv==0.8.2 PyTweening==1.0.3 pytz==2017.3 PyWavelets==0.5.2 PyYAML==3.12 pyzmq==16.0.3 qtconsole==4.3.1 queuelib==1.4.2 requests==2.18.4 requests-toolbelt==0.8.0 robobrowser==0.5.3 rsa==3.4.2 s3transfer==0.1.12 scikit-image==0.13.1 scikit-learn==0.19.1 scipy==1.1.0 Scrapy==1.4.0 selenium==3.8.0 service-identity==17.0.0 simplegeneric==0.8.1 six==1.11.0 sklearn==0.0 smart-open==1.5.6 tensorflow==1.4.0 tensorflow-tensorboard==0.4.0rc3 terminado==0.8.1 testpath==0.3.1 tornado==4.5.2 tqdm==4.20.0 traitlets==4.3.2 twine==1.11.0 uritemplate==3.0.0 urllib3==1.22 visitor==0.1.3 w3lib==1.18.0 wcwidth==0.1.7 webencodings==0.5 Werkzeug==0.13 whitenoise==3.3.1 widgetsnbextension==3.1.0 zope.interface==4.4.3
$ pip install -r requirements.txt
【Ruby】rbenvから新バージョンをinstallするのに40時間くらいかかった
もうやだ…
敵1 configure: error: cannot compute sizeof (long long)
普通に$rbenv install 2.5.1
を実行
MacBook-Pro:~ umemiya$ rbenv install 2.5.1 ruby-build: use openssl from homebrew Downloading ruby-2.5.1.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2 Installing ruby-2.5.1... ruby-build: use readline from homebrew BUILD FAILED (OS X 10.13.2 using ruby-build 20180601) Inspect or clean up the working tree at /var/folders/lq/7rcttkms3r9106by5s8qqj_40000gn/T/ruby-build.20180609021847.17207 Results logged to /var/folders/lq/7rcttkms3r9106by5s8qqj_40000gn/T/ruby-build.20180609021847.17207.log Last 10 log lines: checking for long long... yes checking for off_t... yes checking char bit... 8 checking size of int... 0 checking size of short... 0 checking size of long... 0 checking size of long long... configure: error: in `/var/folders/lq/7rcttkms3r9106by5s8qqj_40000gn/T/ruby-build.20180609021847.17207/ruby-2.5.1': configure: error: cannot compute sizeof (long long) See `config.log' for more details make: *** No targets specified and no makefile found. Stop.
対策:gccの切り替え
膨大なエラーログを凝視しているとgcc関連で引っかかっていることがわかった
OSXのデフォのgccはclangなのでそっからhomebrewでインスコしたgccに切り替える
$ sudo mv /usr/local/bin/gcc /usr/local/bin/gcc_clangver
mv: rename /usr/local/bin/gcc to /usr/local/bin/gcc_clangver: Operation not permitted
ふざけるな😡
El Capitanくらいからひっそりと導入されたSystem Integrity Protecton(SIP)とかいうわけのわからんプロテクトのせいでroot持ち垢でも/usr/あたりがいじくれないようになっているようだ
敵2 Operation not permitted
マシンをcmd+R押しながらrebootかけてリカバリーモードで起動
シェル起動して$ csrutil disable
さようならSIP😜
そのあと$ reboot
で文字通り再起動
$ ln -s /usr/local/Cellar/gcc/8.1.0/bin/gcc-8 /usr/local/bin/gcc
MacBook-Pro:~ umemiya$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/8.1.0/libexec/gcc/x86_64-apple-darwin17.5.0/8.1.0/lto-wrapper Target: x86_64-apple-darwin17.5.0 Configured with: ../configure --build=x86_64-apple-darwin17.5.0 --prefix=/usr/local/Cellar/gcc/8.1.0 --libdir=/usr/local/Cellar/gcc/8.1.0/lib/gcc/8 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-8 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 8.1.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls Thread model: posix gcc version 8.1.0 (Homebrew GCC 8.1.0)
O.K. 😄
では改めてrbenv install 2.5.1
MacBook-Pro:~ umemiya$ rbenv install 2.5.1 ruby-build: use openssl from homebrew Downloading ruby-2.5.1.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2 Installing ruby-2.5.1... ruby-build: use readline from homebrew BUILD FAILED (OS X 10.13.2 using ruby-build 20180601) Inspect or clean up the working tree at /var/folders/lq/7rcttkms3r9106by5s8qqj_40000gn/T/ruby-build.20180609020031.2281 Results logged to /var/folders/lq/7rcttkms3r9106by5s8qqj_40000gn/T/ruby-build.20180609020031.2281.log Last 10 log lines: checking for long long... yes checking for off_t... yes checking char bit... 8 checking size of int... 0 checking size of short... 0 checking size of long... 0 checking size of long long... configure: error: in `/var/folders/lq/7rcttkms3r9106by5s8qqj_40000gn/T/ruby-build.20180609020031.2281/ruby-2.5.1': configure: error: cannot compute sizeof (long long) See `config.log' for more details make: *** No targets specified and no makefile found. Stop.
ふざけるな😡😡
しゃーない切り替えていく
homebrewの超イケメン機能$ brew doctor
でお医者さんに観てもらおう
診断結果
Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: "config" scripts exist outside your system or Homebrew directories. `./configure` scripts often look for *-config scripts to determine if software packages are installed, and what additional flags to use when compiling and linking. Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew provided script of the same name. We found the following "config" scripts: /opt/local/bin/xml2-config /opt/local/bin/ncursesw6-config /opt/local/bin/ncurses6-config /usr/local/var/pyenv/shims/libdynd-config /usr/local/var/pyenv/shims/python3.5m-config /usr/local/var/pyenv/shims/icu-config /usr/local/var/pyenv/shims/libpng16-config /usr/local/var/pyenv/shims/python3.6m-config /usr/local/var/pyenv/shims/python3.5-config /usr/local/var/pyenv/shims/python-config /usr/local/var/pyenv/shims/python3-config /usr/local/var/pyenv/shims/ncursesw6-config /usr/local/var/pyenv/shims/python3.6-config Warning: You have MacPorts or Fink installed: /opt/local/bin/port This can cause trouble. You don't have to uninstall them, but you may want to temporarily move them out of the way, e.g. sudo mv /opt/local ~/macports Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/big_endian.h /usr/local/include/binary_log_types.h /usr/local/include/byte_order_generic.h /usr/local/include/byte_order_generic_x86.h /usr/local/include/cdefs.h /usr/local/include/decimal.h /usr/local/include/errmsg.h /usr/local/include/iconveh.h /usr/local/include/inline.h /usr/local/include/keycache.h /usr/local/include/little_endian.h /usr/local/include/localcharset.h /usr/local/include/m_ctype.h /usr/local/include/m_string.h /usr/local/include/my_alloc.h /usr/local/include/my_byteorder.h /usr/local/include/my_command.h /usr/local/include/my_compiler.h /usr/local/include/my_config.h /usr/local/include/my_dbug.h /usr/local/include/my_dir.h /usr/local/include/my_getopt.h /usr/local/include/my_global.h /usr/local/include/my_list.h /usr/local/include/my_sys.h /usr/local/include/my_thread.h /usr/local/include/my_thread_local.h /usr/local/include/my_xml.h /usr/local/include/mysql.h /usr/local/include/mysql/client_authentication.h /usr/local/include/mysql/client_plugin.h /usr/local/include/mysql/com_data.h /usr/local/include/mysql/get_password.h /usr/local/include/mysql/group_replication_priv.h /usr/local/include/mysql/innodb_priv.h /usr/local/include/mysql/mysql_lex_string.h /usr/local/include/mysql/plugin.h /usr/local/include/mysql/plugin_audit.h /usr/local/include/mysql/plugin_auth.h /usr/local/include/mysql/plugin_auth_common.h /usr/local/include/mysql/plugin_ftparser.h /usr/local/include/mysql/plugin_group_replication.h /usr/local/include/mysql/plugin_keyring.h /usr/local/include/mysql/plugin_trace.h /usr/local/include/mysql/plugin_validate_password.h /usr/local/include/mysql/psi/mysql_file.h /usr/local/include/mysql/psi/mysql_idle.h /usr/local/include/mysql/psi/mysql_mdl.h /usr/local/include/mysql/psi/mysql_memory.h /usr/local/include/mysql/psi/mysql_ps.h /usr/local/include/mysql/psi/mysql_socket.h /usr/local/include/mysql/psi/mysql_sp.h /usr/local/include/mysql/psi/mysql_stage.h /usr/local/include/mysql/psi/mysql_statement.h /usr/local/include/mysql/psi/mysql_table.h /usr/local/include/mysql/psi/mysql_thread.h /usr/local/include/mysql/psi/mysql_transaction.h /usr/local/include/mysql/psi/psi.h /usr/local/include/mysql/psi/psi_base.h /usr/local/include/mysql/psi/psi_memory.h /usr/local/include/mysql/service_command.h /usr/local/include/mysql/service_locking.h /usr/local/include/mysql/service_my_plugin_log.h /usr/local/include/mysql/service_my_snprintf.h /usr/local/include/mysql/service_mysql_alloc.h /usr/local/include/mysql/service_mysql_keyring.h /usr/local/include/mysql/service_mysql_password_policy.h /usr/local/include/mysql/service_mysql_string.h /usr/local/include/mysql/service_parser.h /usr/local/include/mysql/service_rpl_transaction_ctx.h /usr/local/include/mysql/service_rpl_transaction_write_set.h /usr/local/include/mysql/service_rules_table.h /usr/local/include/mysql/service_security_context.h /usr/local/include/mysql/service_srv_session.h /usr/local/include/mysql/service_srv_session_info.h /usr/local/include/mysql/service_ssl_wrapper.h /usr/local/include/mysql/service_thd_alloc.h /usr/local/include/mysql/service_thd_engine_lock.h /usr/local/include/mysql/service_thd_wait.h /usr/local/include/mysql/service_thread_scheduler.h /usr/local/include/mysql/services.h /usr/local/include/mysql/thread_pool_priv.h /usr/local/include/mysql/thread_type.h /usr/local/include/mysql_com.h /usr/local/include/mysql_com_server.h /usr/local/include/mysql_embed.h /usr/local/include/mysql_time.h /usr/local/include/mysql_version.h /usr/local/include/mysqld_ername.h /usr/local/include/mysqld_error.h /usr/local/include/mysqlx_ername.h /usr/local/include/mysqlx_error.h /usr/local/include/mysqlx_version.h /usr/local/include/plugin.h /usr/local/include/plugin_audit.h /usr/local/include/plugin_ftparser.h /usr/local/include/plugin_group_replication.h /usr/local/include/plugin_keyring.h /usr/local/include/plugin_validate_password.h /usr/local/include/sql_common.h /usr/local/include/sql_state.h /usr/local/include/sslopt-case.h /usr/local/include/sslopt-longopts.h /usr/local/include/sslopt-vars.h /usr/local/include/stdbool.h /usr/local/include/stdint.h /usr/local/include/thr_cond.h /usr/local/include/thr_mutex.h /usr/local/include/thr_rwlock.h /usr/local/include/typelib.h /usr/local/include/version.h /usr/local/include/woe32dll.h Warning: You have unlinked kegs in your Cellar Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: mysql
ほげえええええええええ
病気が多すぎる
やっぱりマシンも人間と同じでこまめに検診を行うことが大事ですな😅
とりあえず/usr/local/include/
のどれかが悪さをしているので吐き出された大量のエラーログから気になったものを$ rm -rf
していく
そんで何度目かわからないrbenv install 2.5.1
MacBook-Pro:~ umemiya$ rbenv install 2.5.1 ruby-build: use openssl from homebrew Downloading ruby-2.5.1.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2 Installing ruby-2.5.1... ruby-build: use readline from homebrew BUILD FAILED (OS X 10.13.2 using ruby-build 20180601) Inspect or clean up the working tree at /var/folders/lq/7rcttkms3r9106by5s8qqj_40000gn/T/ruby-build.20180609023654.22314 Results logged to /var/folders/lq/7rcttkms3r9106by5s8qqj_40000gn/T/ruby-build.20180609023654.22314.log Last 10 log lines: In file included from /usr/local/include/stdbool.h:4: In file included from /usr/local/include/stdbool.h:4: In file included from /usr/local/include/stdbool.h:4: In file included from /usr/local/include/stdbool.h:4: /usr/local/include/stdbool.h:4:10: error: #include nested too deeply #include <stdbool.h> ^ 1 error generated. make: *** [compile.o] Error 1 make: *** Waiting for unfinished jobs....
お、まだおかしいけど進捗あるやんけ!😌
今回ははっきりstdbool.h
ファイルが悪さしていることがわかったので
$ rm -rf /usr/local/include/stdbool.h
からのrbenv install 2.5.1
MacBook-Pro:~ umemiya$ rbenv install 2.5.1 ruby-build: use openssl from homebrew Downloading ruby-2.5.1.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2 Installing ruby-2.5.1... ruby-build: use readline from homebrew Installed ruby-2.5.1 to /Users/umemiya/.rbenv/versions/2.5.1
やっと入った!!
curlやopenssl入れ直したりPATH書きまくったりMacPortにまで手を出してたら丸3日ぐらいかかってしまった
まあシェルの勉強にはなった
最後にrubyのバージョン切り替えて終わり!閉廷!
MacBook-Pro:~ umemiya$ rbenv versions * system (set by /Users/umemiya/.rbenv/version) 2.5.1 MacBook-Pro:~ umemiya$ rbenv global 2.5.1 MacBook-Pro:~ umemiya$ ruby -v ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
完
【動画リンク付き】サウスパークおすすめエピソード01
はじめに
皆さんサウスパークってご存知?
知ってる方もそうでない方も一度見てみてね☺️
今回から私のおすすめエピソードをさらっと紹介していきます
私は下ネタ大好きなので下品な回が多くなると思います😡
Medicinal Fried Chicken(医療用フライドチキン)
サウスパーク内にあるケンタッキーが潰れて医療用大麻の店ができた所から始まる
ランディはこれに歓喜し大麻を吸うため、ありとあらゆる手段でガンになろうとする
結局チンポを電子レンジでチンしたのが効き、キンタマのガンになり彼のキンタマは膨れ上がる
ランディが嬉々として大麻を吸う一方、ケンタッキーが法規制されたことによりカートマンは衰弱していった
挙句、違法化されたケンタッキーを取り扱うちびっこギャング集団に足を踏み入れてしまう
【python3】enumerateオブジェクトはdictとして扱える
知らんかった
fruits = ['apple','banana','orange'] fruits_dict = enumerate(fruits) for k, v in fruits_dict: print(k, v)
↓
0 apple 1 banana 2 orange