Giter VIP home page Giter VIP logo

doya's Introduction

Doyo

pppp

doya's People

Contributors

vortispy avatar dictav avatar

Watchers

 avatar James Cloos avatar  avatar

doya's Issues

Refactoring案

DoyaRankItemAdapter.S3GetImage は不要じゃないか?

S3のデータはURLで参照できるので S3 を直接叩く必要はないんじゃないか?

DoyaRankItemAdapter.getView は重いんじゃないか?

getView() は描画される度に呼び出されるメソッドなので、その中に通信処理を埋め込むのは重いと思う。特に Jedis に関してはコンスタントラクタで一度に読み込めば良いのでそちらに移すべきじゃないか?

使っていないコードを捨てる

beta 版をリリースする

ビルドして確認するのが面倒に思うことがあるし、他にも協力者ができるかもしれないので、開発途中版をベータ版としてリリースする

アップロード画像を制限する

アップロード画像を以下のように制限する

  • MaxWidth: 600px
  • MaxHeight: 600px
  • Size: 400Kbytes

これより大きな画像が選択された場合には画像処理で小さくする。

Redisでrankingを実装する

Redisにはランキングにピッタリの zscore という形式がある。
scoreの値を操作する ZINCRBY key increment member というコマンドでランキングを実装できる。

key を image_ranking とすれば以下のようにランク付けできる。(image_url3が最もrankが上)

redis> ZINCRBY image_ranking 1 image_url1
redis> ZINCRBY image_ranking 5 image_url2
redis> ZINCRBY image_ranking 100 image_url3

これを取ってくるには以下のようにする。

redis> ZREVRANGEBYSCORE image_ranking -inf +inf WITHSCORES LIMIT 0 10

これで、スコアの高い方から10個までのアイテムをスコア付きで取得できる。

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.