codingecho

日々の体験などを書いてます

読書と行動することのROI(Return on Investment)は高い

数年前に「ソフトスキル」という本を買って読んでブログを書くようにしました。SOFT SKILLS ソフトウェア開発者の人生マニュアル 第2版作者:ジョン・ソンメズ日経BPAmazon 2000円ぐらいで買ったと思います。ブログの内容は日々業務で経験したソフトウェア開…

「とっしん本 #1」を技術書典6に出展します

「とっしん本 #1」を技術書典6に出展します。技術書典6にお越しの際はぜひお立ち寄りください! 配置は「 こ31」です。 「とっしん本 #1」の表表紙 内容について ページ数: 約100ページ この本では、勉強会である「とっしんの会」のメンバー3人がそれぞれが…

Photos in New York City in 2015

These are my photos taken in NYC in 2014. I posted these photos to Flickr and re-post here. Because I like these photos and Flickr will change the plan for free users, and my photos over 1000 will be deleted. So I deleted my Flickr's accou…

Cloud Deployment Managerでバケット作成時のパーミッションエラーはバケット名が原因かもしれない

Cloud Deployment Managerでプロビジョニングするとき、エラー表記で少しハマったところについてメモ。 Cloud Storageをプロビジョニングするとき以下のようなエラーが出ることがあります。 $ gcloud deployment-manager deployments create example --confi…

本のカバーはなぜ必要なのか?

カバーといっても書店の店員さんが後からつけてくれるやつではなくて、初めから付いている値段やバーコードが書かれているカバーです。 本を読むときに邪魔になっていたのでなぜ必要なのか以前から気になっていました。 「本を汚れから守る」ようなことを見…

PythonでgRPCのリクエストをする

PythonでgRPCを扱う方法です。クライアント側だけの紹介です。 Protocol Buffersの定義ファイルを用意します。 crawl.proto syntax = 'proto3'; package proto; service Crawler { rpc Crawl(CrawlRequest) returns (CrawlResponse); } message CrawlRequest…

Pythonで文字列に絵文字と半角カタカナが含まれているか判定する

ここではPython 3.7を使った方法を紹介します。 絵文字の判定 現時点の最新版であるUnicode® Emoji Charts v11.0では、絵文字のUnicodeは1F600から1F3F4の範囲でコードが振られています。 なので、Unicodeの範囲を指定すればいけるじゃんと思っていたのです…

RNNと時系列データを使った気温の予測

時系列データをRNNで扱うサンプルです。過去の気温から未来の気温予想を予測します。 以下のサンプルはGoogle Colaboratory上で実行しています。 気象データセットのダウンロードします。 ちなみに !<command> のようにするとnotebook上でコマンドが使えます。 !wget </command>…

Google App Engineを使って運用が辛くならない社内向けWebアプリを作る

Google App Engineが社内のWeb Appやちょっとしたツールを公開したいときにとても良さそうだったので紹介したいと思います。 問題点 社内でちょっとWebアプリを提供する環境が欲しいと言ったことはないでしょうか? Amazon Web ServiceのEC2やGoogle Cloud P…

Node.jsのrequestでShift JISやバイナリーデータを正しく取得する方法

Node.jsのrequestでShift JIS、EUC-JPやバイナリーデータを取得しようとすると強制的にUTF-8に変換されてしまうので、正しく取得する方法を紹介します。

Cloud Machine Learning Engineを使用した機械学習のシステムアーキテクチャ

Google Cloud PlatformのCloud Machine Learning Engineを使用した機械学習のシステムアーキテクチャについて考える機会があったので紹介したいと思います。 前提条件 Google Cloud Platformを使用する オンライン予測が短時間に集中するが頻度は高くない (1…

本の紹介

美術品でたどる マリー・アントワネットの生涯 以前六本木の森美術館で開催されたマリー・アントワネット展に行きました。マリー・アントワネットについて知識がなかったので書籍で知識を得るために、「美術品でたどる マリー・アントワネットの生涯」を読み…

Flutter 1.0.0でCloud Functionsの非同期処理のレスポンスが返ってこないとき

Flutter上でCloud Functionsを使用しするとき非同期で取得しますが、結果が返ってこないときの対処法を紹介します。 Flutterのバージョン: 1.0.0 TL;DR cloud_functionsパッケージを使ったCloud Functionsの呼び出しが完了しないpubspec.yamlのdependencies…

Use Cloud Functions on Flutter 1.0.0

When you use Cloud Functions on Flutter, you might add some dependencies in pubspec.yaml. My Flutter app's versionFlutter: 1.0.0 Below is my code uses FutureBuilder. FutureBuilder( future: CloudFunctions.instance.call(functionName: 'hello'…

App Engineが502を返すときに確認すること

TL;DR インスタンスリソース (CPU, Memory size, etc...) がどれぐらい必要か確認して十分なサイズを設定するエラーが出た時はStackdriver Loggingのログをよく確認すること gcloud app deployでデプロイした後ブラウザからアクセスすると以下のような502エ…

GAE, GKE と Cloud Dataflow を比較する

やりたかったこと リクエストするためにREST APIを使用したいリクエストはほとんど 0 req/sec だが1日に数度 50 req/sec ぐらいになるプロジェクトには専属の開発や運用をする人はいないGoogle Cloud Platformを使いたい TL;DR やりたかったことにフィットし…

Apache Beamで自作パッケージを使う方法

Cloud Dataflow pipeline上で自作パッケージを使う場合は setup.py を作成して --setup-file オプションで指定しなければなりません。 以下のようなディレクトリ構成で main.py が my-package に依存していたとします。 Dataflow |- my-package/ |- helper.p…

Google Cloud Dataflow上でReadFromDatastoreを使わずにCloud Datastoreからデータを取得する

TL;DR google-cloud-datastoreの代わりにCloud Datastore’s helper methodを使用する。 より詳しく Apache Beam pipelineのインスタンスを作る直前にCloud Datastoreからデータを取得したいと思い ReadFromDatastore を Cloud Dataflow上のapache_beam.io.gc…

何を勉強して何を勉強しないか

仕事をしていてかつ勉強したいことが複数あり、それに優先度をつける時の私の考え方をまとめてみました! TL;DR 今必要になっていることを勉強する今後必要になるかもしれないことは、その時が来てからでいいもし英会話を優先すべきか仕事のスキルを優先すべ…

App Engine returns 502 response

TL;DR Configure your instance resources (CPU, Memory size, etc…) properlyIf you occur errors check Stackdriver Logging I tried to run my docker image in Google App Engine as App Engine Flexible Environment. Deployed my app with gcloud app …

Compare GAE, GKE and Cloud Dataflow

Requirements for us Use REST API for receiving requestsRequests a system we are developing spike up about 50 req/sec or almost 0 req/secThe project doesn't have a developer or operator exclusivelyWe use Google Cloud Platform TL;DR We decid…

Run Apache Beam process with local dependency

If you run Cloud Dataflow pipeline with some your local package, you must create setup.py and specify --setup-file option. Assume that you have a directory structure like below and main.py depends on under the my-package packages. Dataflow…

Read data from Google Cloud Datastore without ReadFromDatastore On Google Cloud Dataflow

TL;DR Use Cloud Datastore's helper method instead of google-cloud-datastore. More Details I wanted to read data from Datastore before running an Apache Beam's pipeline that uses ReadFromDatastore from apache_beam.io.gcp.datastore.v1.datast…

What you should study and should not study

TL;DR You should study what you need nowYou should not study what you may need futureIf you think you should study either foreign language or skill, you should study skill Abstract This article assumes that you have some subjects to study …

IntelliJ IDEAを使ったGo言語のセットアップ

Go言語のlocalへのインストール方法からIntelliJ IDEAへのプロジェクトのインポートと設定について記述します。 Go言語のインストール Go言語のインストールにはgoenvを使用します。 $ git clone https://github.com/syndbg/goenv.git ~/.goenv bashを使用し…

機械学習システムのアーキテクチャ設計

アーキテクチャの考え方 Machine Learning Systemsを読みました。ここで紹介されているアプリケーションのアーキテクチャの設計方法を紹介します。 こちらの書籍ではScala, Akka, Sparkを使ってリアクティブなアプリケーションを作成していますが、ここでは…

Docker daemon cannot start on Ubuntu 16.04 Linux kernel 4.4

My Docker version is Docker CE 18.06.1. $ sudo apt list --installed | grep -i docker docker-ce/xenial,now 18.06.1~ce~3-0~ubuntu amd64 [installed] Start dockerd. $ sudo systemctl start docker I got an error in syslog and cannnot start docke…

さくらのレンタルサーバのPHPモジュールモードとCGIモードのレンダリング速度を比較

TL;DR リプレイスされ新しくなったさくらのレンタルサーバに移行した新しいさくらのレンタルサーバと、古いさくらのレンタルサーバを使ってWordPressのレンダリング速度を比較した新しいさくらのレンタルサーバは古いさくらのレンタルサーバに比べて約2.1倍…

A DSP implementation for studying depends on RTB v2.3

This repository is my implementation refers to 作りながら学ぶ広告サーバ - DSP その2. This implementation uses Scala and Akka-http. It's very simple but I made sense of the outline of DSP (Demand Side Platform).

Rotation and shear mapping of Linear algebra

I created simple examples of the rotation and shear mapping of linear algebra for understanding. My examples this repository. This visualized example was very helpful for understanding eigenvectors and eigenvalues. Rotation The rotation us…