Git Product home page Git Product logo

atcoder-tarareba's Introduction

monkukui

Trophy

monkukui

Languages

monkukui

Stats

 monkukui

Streak

monkukui

atcoder-tarareba's People

Contributors

m-shinzato avatar monkukui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

m-shinzato olphe

atcoder-tarareba's Issues

架空のレートランキング機能を追加

WHAT

架空のレートを DB に登録する。登録されたレートだけを用いてランキングを表示する。

ランキング表示のビジネスロジックを、まるっとマイクロサービスにしてしまう。
このマイクロサービスは、以下の責務を受けもつ

  • ユーザー名とレートからなるランキングを表示
  • ランキングにユーザーを登録
  • DB を用意

olphe さん、開発の相談

#2

全体のアーキテクチャの説明

開発環境

  • Go(バックエンド)
  • yarn(フロントエンド)

開発の進め方

バックエンド

cd tarareba-competition-history
go run server/main.go
cd tarareba-algorithm
go run server/main.go
cd tarareba-bff
go run server.go

フロントエンド

cd tarareba-frontend
yarn
yarn start

今日やりたいこと

  • 全体の説明
  • 環境構築
  • 機能案の相談(僕が今想定しているものでいいのか、追加で案があるか)
  • 担当してもらうことの相談
    • tarareba-algorithms の開発
    • tarareba-frontend の開発

参加当時に unrated だったコンテストの、パフォーマンスの計算

What

参加当時に unrated のコンテストは、パフォーマンスが 0 で帰ってくる

isRated が false の場合、

  • レートの関係で unrated なのか
  • コンテスト不備で unrated なのか

が判別できない。

前者については、以下のような api で、自分より順位が下で一番パフォーマンスが高い人のやつで代用できそう
https://atcoder.jp/contests/arc109/results/json

ただ、これにも問題があって、一人のユーザーに対して、unrated なコンテストの回数分だけ AtCoder にリクエストが飛ぶことになる。
1 秒間に 100 以上のアクセスは、もはや攻撃である。

対策としては、コンテストデータを自前でメモリに乗せて、それを読むようにする(コンテストが開催されるたびに、コンテスト情報を update するバッチ処理を走らせる)

リリースまでにやるべきこと

tarareba-algorithms

  • レート推移計算の実装
    • 実際のレート推移と比較して、ただしく計算できているかの検証 <- ユニットテストができるとよい
    • レート推移計算の説明をどこかにい書いてほしい(サイト上で説明があると、ユーザーが安心できる)
  • レート最大化(最大化ではない?)アルゴリズムの実装
    • これも、n <= 16 くらいのユーザーで O*(2^n) の愚直と比較するユニットテストを書く
    • アルゴリズムの説明をどこかに書いてほしい(サイト上で説明を掲載したい)

tarareba-competition-history

  • gRPC のスキーマが変更したので、それに合わせて情報を取得する
  • 毎回 AtCoder の API を叩いていると、おそらくかなりやばい(チェックボックスをクリックするたびに、コンテストの個数分だけリクエストが走る)
    • 自前で DB を立てて、DB に登録されていなかったら API を叩く、DB に登録されていたらそれをリードするようにする
  • Ranking ページ(Optional ではあるが、あると、誰がどれくらい使ってくれているかわかるから楽しい)(DB を用意する必要がある。)

tarareba-bff

  • フロントエンドからのリクエストと、各マイクロサービスへのリクエストを微調整する

tarareba-frontend

  • デザインの微調整
  • How to use ページ(サイトの簡単な使い方)
  • Contact ページ(monkukui と olphe の twitter アカウントを掲載するのと、それぞれがどんな実装をしたかを掲載する)
  • Ranking ページ(Optional ではあるが、あると、誰がどれくらい使ってくれているかわかるから楽しい)

デプロイ

  • 簡単にできると思っていたが、なんか難しかった
  • 助けてくれ

Update gRPC and GraphQL schema

WHAT

rate_change を取得するロジックを書く。

graphql のスキーマを変更する

type Contest {
- isRated: Boolean!
+ rateChange: String!
  place: Int!
  actualOldRating: Int!
  actualNewRating: Int!
  performance: Int!
  innerPerformance: Int!
  contestScreenName: String!
  contestName: String!
  contestNameEn: String!
  endTime: String!
  optimalOldRating: Int!
  optimalNewRating: Int!
  isParticipated: Boolean!
}

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.