AndroidStudio自体の色や、コードのColorThemeを変更する方法

AndroidStudioのColorThemeをいい感じにしたい その場合は以下のサイトから適当なテーマをダウンロードして、AndroidStudioの「File > Import Setting」から簡単に設定出来る color-themes.com AndroidStudio自体の色を変えたい + アイコンをAtomIconっぽく…

DockerでUnicodeError(Ubuntu)

問題 DockerでUbuntuのイメージを作成したところUnicodeErrorが出てしまう。 UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128) 解決策 % apt-get install language-pack-ja % update-locale LANG=ja_…

【Python】リストから空白のものを取り除く

removed_space_list = [t for t in include_space_list if t]

gitのコミットログで絵文字を使う(2ステップ)

git

色々書いてあるところが多いがポイントは以下の2つのみ。 1. テンプレートを作成 github.com その他にテンプレートを作りたい際には以下のサイトが参考になる。 gitmoji.carloscuesta.me 2. configに設定 特定リポジトリで使用 あるリポジトリで使いたい場合…

【エラー】google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application

エラー $ docker-compose up <SEVICE_NAME> google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more info</sevice_name>…

【MySQL】ERROR 1253 (42000): COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'utf8mb4'

エラー内容 mysqlにログインし、READMEに沿ってデータベースを作成する際に以下のエラーが発生した。 mysql> create database sns_manager default character set utf8mb4 collate utf8_general_ci; ERROR 1253 (42000): COLLATION 'utf8_general_ci' is not…

【Docker】ERROR: unauthorized: authentication required

環境 Mac: Mojave 10.Mojave 10.14.1 Doker: 18.09.0 エラー内容 あるプロジェクトをcloneしてきて以下のコマンドを打ったところでエラー発生。 $ docker-compose run init Creating network "docker_default" with the default driver Pulling db (mysql:5.…

【Kerasエラー】Your generator is NOT thread-safe.Keras requires a thread-safe generator when`use_multiprocessing=False, workers > 1`.For more information see issue #1638.

環境 Ubuntu: 16.04 Python: 3.6 Tensorflow: 1.9.0 Keras: 2.2.0 NVIDIA Driver: 410.72 CUDA: 10.0 エラー内容 GCPで学習していたら、他のサーバでは出なかったエラーに遭遇した。 Epoch1の重みを保存した後にEpoch2〜38に以下のエラーが一気に出力され、E…

【GCP】ssh_exchange_identification: read: Connection reset by peer

環境 クライアント:Mac OS Mojave 10.14.1 サーバー:Ubuntu 16.04 エラー 今までは以下のコマンドでGCPに入れたのに、何故か突然エラーを吐き出すようになった。 $ gcloud compute --project "<PROJECT_NAME>" ssh --zone "<REGION_NAME>" "<VM_NAME>" ssh_exchange_identification: read: Conn</vm_name></region_name></project_name>…

エラー「ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory」

問題点 $ python >>> import tensorflow as tf Traceback (most recent call last): File "/home/saneatsu_wakana/PConv-Keras/venv/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_ten</module>…

Seleniumでスクレイピングするときに「is not clickable at point (772, 590). Other element would receive the click:」的なものが出る問題

エラー発生 Seleniumでスクレイピングをする際にheadlessのオプションを追加すると以下のようなエラーが出てくる。 product_src_url_and_img_url_hash[:src_url]: https://~~. Error: unknown error: Element <a href="#" id="ms_001" style="outline:none;" title="...(M)">36</a> is not clickable at point (772, 590). Othe…

【Rails v5.2】bundle install時の「ERROR: While executing gem ... (Errno::EACCES)」を解消

環境 ruby: 2.4.2p198 Rails: 5.2.1 エラー発生 $ bundle install : : Fetching mysql2 0.4.10 Installing mysql2 0.4.10 with native extensions Errno::EACCES: Permission denied @ rb_sysopen - /usr/local/var/rbenv/versions/2.4.2/lib/ruby/gems/2.4.…

【keras】weightの中身をみるために「RuntimeError: maximum recursion depth exceeded」と「RecursionError: cannot set the recursion limit the limit is too low」を解決

やりたいこと 画像補完のプログラムを作成しているが、学習によって作成されたweightの中にnanが混ざり込んでいてうまく画像が生成されず真っ黒の画像が出てきてしまう。 そこでweight(h5ファイル)の中身を見てどこがnanになっているか確認したい。 方針1:g…

【自分用メモ】gitで色々詰まったときにみる

自分の.gitconfig github.com 取り消す系 直前のcommitをやり直す $ git add -A $ git commit --amend -m "Commit message" git commitをやり直しする&取り消しする(「git commit --amend」と「git reset」) addを取り消す $ git reset HEAD <FILENAME> git add の取</filename>…

【自分用メモ】MySQLのエラー色々「ERROR 1045」「ERROR 2002 」

エラーと攻略方法 雑にメモ。 $ mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) MySQLを停止 $ sudo mysql.server stop $ mysql -u root -p Enter password: ERROR 2002 (HY000): …

【Rails】rake db:create時にMysql2のエラーが発生(ERROR! The server quit without updating PID file)

問題内容 以下のコマンドを実行した結果,MySQL2のエラーが発生した. $ rake db:create : Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5,…

【自分用メモ】利用規約を作成する時に参考にしたサイト

テンプレート 【ひな形付】web・アプリ利用規約の書き方と9つのポイントを解説 汎用的なテンプレートの他、にSNS、ECサイト等、種類にテンプレートがあってすごく役立った(DL可)。説明も丁寧で◯ 利用規約 価格.comサイト利用規約 - 価格.com ログインしない…

【自分用メモ】RubyでNokogiriを使ってスクレイピングする時に役に立ったサイトまとめ

大体ここらへんを見れば書き方がわかった。 クローラ作成に必須!XPATHの記法まとめ liの任意の番目の要素を取得する方法とかも載っていて◯ Nokogiriを使用したクローラーめも メソッド一覧が載っていて◯ RubyのNokogiriを使ってサイトをスクレイピングする …

【Keras】ResourceExhaustedError: OOM when allocating tensor with shape[16,64,256,512]

問題点 学習時の画像サイズを256x256から、256x512に変更したところ、エラーが発生した。 tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[16,64,256,512] and type float on /job:localhost/repli…

ssh接続の際に「The authenticity of host [XX....] can't be established.」が発生

問題点 sshでサーバに接続する際に以下のようなエラー文が発生 The authenticity of host '[XX.XX.XX.XX]:XX [XX.XX.XX.XX]:XX' can't be established. ECDSA key fingerprint is SHA256:hogehogehogehogehogehogehogehogehogehogheog. Are you sure you wan…

フォルダ内のファイルをランダムにサンプリングして別のフォルダへコピーしたい

取り敢えずプログラムを動かすために、全ての画像が入っているフォルダから、 学習用、テスト用のフォルダにランダムにサンプリングして移動させたい。 find ./FROM_DIR/ | grep *.jpg | sort -R | tail -n NUM | xargs -n 1 sh -c 'cp -v $0 ./TO_DIR' コマ…

【Python】リストから空白を削除しようとするとオブジェクトが返される

空白を削除しようとしてもオブジェクトが出力される 対象とするのは以下のようなリスト。 最初と最後の中身が空白のものを削除したい。 # ['', # 'ごま', # '原宿', # 'ごまアイス専門店GOMAYAKUKI', # '濃厚ごまスムージー', # '豆乳ベース', # 'まろやかな…

【論文読み】Image Inpainting for Irregular Holes Using Partial Convolutions

Qiitaは以下から. qiita.com 面白そうな論文があったのでまとめてみました. 正直うまく訳せない部分があったり,理解に欠ける部分もあるので,指摘していただけると大変うれしく思います‍♂️ どんな論文? "Image Inpainting"とは,NVIDIAが公開した写真の…

JupyterNotebookで「Unexpected error while saving file」が発生し保存出来なくなった

JupyterNotebookで保存が出来ない ログを見てみると普段は [I 12:08:09.619 NotebookApp] ←Info:黄緑色 なのに、 [W 12:07:15.668 NotebookApp] ←Warning:オレンジ [E 12:07:15.668 NotebookApp] ←Error:赤 となっている(色は環境により異なる)。 具体的…

lxmlを使う時にエラー「bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?」

エラー発生 Traceback (most recent call last): File "scraping.py", line 19, in <module> soup = BeautifulSoup(r.text, 'lxml') File "/home/ubuntu/anaconda3/envs/scraping-flyer/lib/python3.7/site-packages/bs4/__init__.py", line 198, in __init__ % ",".</module>…

「catコマンドをリッチに!batを使う」+「zsh: correct」+「zsh: bad assignment」

batコマンドとは github.com 様々な言語に対応したリッチなcatコマンドという感じ。 以下は公式サイトから引用。 インストール $ brew install bat $ bat ViewController.swift zsh: correct 'bat' to 'at' [nyae]? 「n」とすればbatになるけどいちいち聞か…

【エラー】Jupyterで'conda' not found in path. →command not found: conda

エラー発生 jupyterを立ち上げるとブラウザに表示されるものの赤色で以下のエラーが発生。 [I 20:42:59.937 NotebookApp] Starting initial scan of virtual environments... [E 20:42:59.940 NotebookApp] 'conda' not found in path. # 赤色 はて。 conda…

zshを使用時にbyobuのウィンドウ名が現在のパスになってしまう

ウィンドウ名がリネーム出来ない 下の写真では、keras-deeplab-v3-plusにいると、ウィンドウの名前もそれと同じになってしまい、F8でリネームしようとしても直すことが出来ない。 解決策 ~/.zshrcにて以下の部分のコメントアウトをはずし、有効にする。 # Un…

【エラー】tensorflow.python.framework.errors_impl.InternalError: Failed to create session.

エラー発生 $ python test.py Using TensorFlow backend. 2018-08-27 12:36:30.830945: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AV…

JupyterNotebookを動かしているサーバが日本語化されていなくてフォルダをクリック出来ない時の対処法

フォルダがクリック出来ない scpで送ってもらったフォルダが、日本語名だったためか、JupyterNotebook上でクリックが出来なくて開けないという問題が発生した。 ファイルの最終更新日も書かれていない。 lsすると「?」で表される。 $ ls -al drwxrwxr-x 2 ub…