Git Product home page Git Product logo

biq-data-backend's Introduction

biq-data-backend's People

Contributors

ryota-murakami avatar

Watchers

 avatar  avatar

biq-data-backend's Issues

開発→デプロイフローの構築

  • アプリケーション全体のクラスタをdockerで表現する方法を調べる
  • 開発環境 → Staging環境 → 本番環境へのデプロイをAWS用いて最も手軽に行える方法を考える
  • デプロイフローに合わせて各環境のインフラ構成を調整する

考える事

  • dockerfileは使いたくない。ローカルやCI上でプロビジョン済みのコンテナイメージを各環境にpullする方式にしたい。
  • docker-composeやteraform上でwebとsparkクラスタは分ける方が良い?
  • docker composeで開発環境を構築する方法は分かるが、開発したコードをコンテナイメージにビルドする方法は?
    → A. アプリケーションコードは実行環境のコンテナとは別に、githubベースで管理する。
  • RDSやElastic Cacheの代替はどうやってローカル環境に用意する
    → A. RDSやElastic Cacheは高いので使わ無い方針で....

kuromojiで謎のアラビア文字のようなものがコンソールに出力されるのを直す

概要

このページのコードをコピペして動かしてみたんだけどアラビア文字コンソール出力に出てしまう。http://www.intellilink.co.jp/article/column/bigdata-kk01.html
これを直したい。

2016-12-13 19 41 20


コンソール出力している部分のコードは以下の様になっているから、 文字列の末尾にアラビア文字みたいなのが表示されるのは普通に見ておかしい。
topList.foreach{case (count, tag) => println(s"$tag ($count tweets)")}

調査ログ

文字コードの設定はどうなってる?

A. ちゃんとUTF-8になっている。もちろんソースファイルもUTF-8。

ryota.murakami@murakami ~/r/twitterpulse> activator console
[info] Loading project definition from /Users/ryota.murakami/repository/twitterpulse/project
[info] Updating {file:/Users/ryota.murakami/repository/twitterpulse/project/}twitterpulse-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to otkm (in build file:/Users/ryota.murakami/repository/twitterpulse/)
[info] Updating {file:/Users/ryota.murakami/repository/twitterpulse/}twitterpulse...
[info] Resolving jline#jline;2.12 ...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/ryota.murakami/repository/twitterpulse/target/scala-2.11/classes...
[info] Starting scala interpreter...
[info] 
import main._
Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_92).
Type in expressions to have them evaluated.
Type :help for more information.

scala> scala.io.Codec.default.charSet
res0: java.nio.charset.Charset = UTF-8

scala> 

kuromojiで生成された変数をprintln()から外したらどうなる?

A. アラビア文字っぽいのは出なくなった。kuromojiが原因の可能性が高い。

  • コード
            //topList.foreach{case (count, tag) => println(s"$tag ($count tweets)")}
            topList.foreach{case (count, tag) => println("tag (count tweets)")}
  • 出力
16/12/13 19:58:53 INFO TwitterStreamImpl: Establishing connection.
16/12/13 19:58:53 INFO TwitterStreamImpl: Establishing connection.
¥n Popular topics in last 60*60 seconds (2091 words):
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)
tag (count tweets)

やっぱりアラビア語?

unicorde番号調べてたらやっぱりアラビア語っぽい。
以下ページの06番台の文字がリストに格納されている。
https://ja.wikipedia.org/wiki/Unicode%E4%B8%80%E8%A6%A7_0000-0FFF

TwitterStreamからアラビア語のツイートも取得されているようなので、これが結果のリストに含まれているのでは?

2016-12-13 20 52 56

なんかタイ語も取れてるwしかも「ひらがなが含まれているツイートのみ」入るはずのif文を通過しているぞ

2016-12-13 21 07 17

ひらがなが含まれていないのに「ひらがなが含まれているツイートのみ」if文がtrueになってるぞ!

2016-12-13 22 26 41

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.