Add it in your root build.gradle at the end of repositories: dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { mavenCentral() maven { url 'https://jitpack.io' } } }
WP One Metric WP One Metricっていうコンテンツの評価を可視化するWordPressプラグインを作りました。Github > WP One Metric Webコンテンツの成果を評価するたった1つの指標「One Metric」の記事に書いてある指標の計算ロジックをそのままWordPressプラグインにしてます。 縦軸が評価指標、横軸が各記事です。縦軸の50を基準に良し悪しの判断の指標とすればよいです。 使い方 使い方は「設定>WP One Metric」からGAに関する情報を設定するだけです。 View IDはGoogle Analyticsの「アナリティクス設定 > ビュー設定」にあるビューIDに記載してある数字を入れてください。 そして。「ダッシュボード>WP One Metric」からAnalyzeボタンを押すと解析が走ってグラフが表示されます。 解析は過去4
2月5日、Firefoxの開発者向け機能であるリモートデバッグプロトコルをNode.jsから利用するためのツール集「node-firefox」がリリースされた。統合開発環境(IDE)よりもターミナルを好む開発者向けのツールという。 2月1日までベルギーで開催されたフリー/オープンソースソフトウェア開発イベント「FOSDEM 2015」で発表されたもの。Mozillaが進めるモバイルプラットフォーム「Firefox OS」向けのアプリケーション開発を容易にすることを目標としており、最終的には、ブラウザデバッグのためのアドオン「Valence」(Firefoxツールアダプタ)経由でコマンドラインからWebブラウザの制御やデバッグを可能にすることを目指す。 Firefoxのランタイムにはリモートデバッグサーバーが備わっている。デフォルトではセキュリティ上の理由から無効化となっているが、有効にする
Go を使うとサーバーとアプリケーションの境界が無くなり、アプリケーションサーバーを書けるようになります。 それは良いことなのですが、アプリケーションを書く人が、従来サーバーを書く人が設計していた機能を理解して実現できないと、運用できないサーバーができあがる結果になってしまいます。 例えば Apache は、 master, worker プロセスが分離していて、設定変更を反映させるときなどは新しい worker を作ってから古い worker を殺すことで、サービスを一瞬も止めずに worker を再起動していました。これを graceful restart と呼びます。 Go で 1024 以下のポートを Listen するアプリを作る で触れたとおり、 Go はプロセス管理システムを作るのには少し向いていない面がありますし、せっかくアプリケーションプログラマーが簡単にサーバーを書ける
Codes Rust. Many Cryptography & Databases. Likes History. Lifts heavy things, puts them down again. Plays the drums. Occasionally makes music. Random Items of Interest polyglot programmer many buzzwords enthusiastic drummer occasional powerlifter older than he seems frequently hilarious (citation needed)
August 13, 2014 - golang TL;DR goの構造体につけるタグは、フォーマットが不正だと読み込まれない(当然) json.Marshalは、構造体のjsonタグがあればその値をキーとしてJSON文字列を生成する json.Unmarshalは、構造体のjsonタグがあればその値を対応するフィールドにマッピングする jsonタグがなければ、完全一致もしくはcase-insensitiveなフィールドにマッピングする では、ひとつづつ確認していきます。 goの構造体につけるタグは、フォーマットが不正だと読み込まれない(当然) goの構造体にはタグの機能があって、型の後に特定のフォーマットでアノテーションが記述できます type MyType struct { Hoge string `foo:"1" bar:"2"` } key:"value"をスペース区切りで複数かけ
型の後ろに「xml:"hoge"」と書けば,Marshal・Unmarshal時に対応づけてくれる. type Foo struct { Hoge string `xml:"hoge"` } jsonもOK. type Foo struct { Hoge string `json:"hoge"` } xmlとjson両方設定する場合はスペースで区切る. type Foo struct { Hoge string `xml:"hoge" json:"hoge"` } type Foo struct { Hoge string `xml:"hoge" json:"hoge"` }
Andrew Gerrand 25 January 2011 Introduction JSON (JavaScript Object Notation) is a simple data interchange format. Syntactically it resembles the objects and lists of JavaScript. It is most commonly used for communication between web back-ends and JavaScript programs running in the browser, but it is used in many other places, too. Its home page, json.org, provides a wonderfully clear and concise
Removing (most of) the software stack from the cloud Clive is an operating system designed to work in distributed and cloud computing environments. It’s main design guidelines are: There is no software stack in the cloud. Applications and services are compiled along with libraries that permit them to run on the bare hardware.System nterfaces are designed along a CSP-like style. Applications and co
resp, err := http.DefaultClient.Do(req) if err != nil { return err } defer resp.Body.Close() HTTPレスポンスを受け取ったとき、err != nilのときresp.Bodyは常に非nilである(たとえBodyが0バイトであっても)。このresp.Body を Close するのは呼び出し側の責務である。Body.Close を怠ると、Keep-Alive(デフォルトで有効)のためにTCPコネクションが再利用されない。…ということが ドキュメントに口を酸っぱくして書いてある。 同一ホストへのコネクション数はデフォルトで最大2に制限されている 同一ホストへのコネクション数はhttp.DefaultMaxIdleConnsPerHost定数によりデフォルトで2に制限されている。 // DefaultMa
Goの標準のHTTPサーバの機能を使ったアプリケーションのテスト Goの標準のHTTPサーバの機能を使ったアプリケーションのテストをするにはどうするか。というテーマが少なそうだったので、ちょっと調べてみました。 サンプルコードその1 サーバ側のコードもテストコードもダミーなのですが、標準的に使うには以下のようにするようです。(Goのnet/httpパッケージにも実際に使われています) ポイントは、httptest.NewServer([ハンドラ])を呼び出すところです。 後は、普通にリクエストを送信して下さい。 // 本来の処理のダミーその1 var sampleHandler = http.HandlerFunc(func (w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello HTTP Test") }) fun
Andrew Gerrand 12 July 2011 Introduction If you have written any Go code you have probably encountered the built-in error type. Go code uses error values to indicate an abnormal state. For example, the os.Open function returns a non-nil error value when it fails to open a file. func Open(name string) (file *File, err error) The following code uses os.Open to open a file. If an error occurs it call
golangいまどき例外ないの頭おかしいって思ってたけどようするにgoroutineと例外がうまくいかないからgoroutineのほう取って例外捨てたってことかねえ。 — Urabe, Shyouhei (@shyouhei) April 15, 2014 FAQ に書いてあります。 Why does Go not have exceptions? - Frequently Asked Questions (FAQ) - The Go Programming Language We believe that coupling exceptions to a control structure, as in the try-catch-finally idiom, results in convoluted code. It also tends to encourage programme
Intro Go にはベンチマークを取る仕組みが標準で備わっています。 テストを書く仕組みも標準で備わっており、 testing モジュールと go test コマンドで行いますが、 ベンチも同じような形で実行することができます。 今回は簡単なベンチ取り方を紹介します。 テストについては、そのうちちゃんと触れます。 参考ソースとして、こちらを使います。 https://github.com/Jxck/swrap 対象のコード 例えば以下のようなコードがあって、そのベンチを取るとします。 // swrap.go type SWrap []byte func (sw *SWrap) Add(a byte) { *sw = append(*sw, a) } func (sw *SWrap) Len() int { return len(*sw) } Slice にメソッドを生やしただけです。 ベ
Goには、ひとつの端末上でMacやLinux、Windowsなど他のOS向けのバイナリをコンパイルする、クロスコンパイルの機能があります。ただしこのクロスコンパイル、Goをインストールしただけでは利用できず初期設定が必要、かつクロスコンパイルのインターフェイスも覚えにくいなど、やや使いにくいところがあります。 Go のクロスコンパイル環境構築 - Qiita しかし本稿で紹介するgox(ミシェルハシモトさん作)を使えばセットアップもクロスコンパイルも簡単に実行でき、かつ複数のプラットフォーム向けのバイナリを同時・並列にコンパイルする事も出来ます。 mitchellh/gox goxをインストール+ツールチェインをビルド $ go get github.com/mitchellh/gox $ sudo gox -build-toolchain Password: The toolchain
The best tools for the job The flexibility to choose the resource class that matches the CPU and RAM you need on each individual job. Ship faster by completing runs on hundreds of Docker tasks at once using parallelism and test splitting. Optimize developer time Get faster image downloads using CircleCI’s pre-built Docker convenience images. Docker layer caching means unchanged layers of your Dock
// slice作成 第二引数は初期の大きさ urls := make([]Target, 0) // 追加するにはappendを使う urls = append(urls, Target{"http://tdoc.info/blog/", "setAccount"}) // 順々にアクセス for i, u := range urls{ // iはindex番号。0から始まる fmt.Println(i, u) } for { select { case receive := <-receiver: log.Println(receive) case <-time.After(time.Second): log.Println("timeout") return } } func worker(msg string) <-chan string { limit := make(chan
JavaScript library enabling SVG icons to morph from one to the other. It implements Material Design's Delightful Details transitions. View on GitHub
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く