This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RoundRobinSchedule | |
| players = %w[a b c] | |
| def schedule(players, pool_size:) | |
| players = players.shuffle | |
| pools = players.each_slice(pool_size).to_a | |
| players.push(nil) if players.size.odd? | |
| pools.size.times do |index| | |
| pool = pools[index] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MIT License | |
| Copyright (c) [2019] [Daniel Hartwich] | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
| ruby '2.5.1' | |
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
| gem 'rails', '~> 5.2.1' | |
| # Use sqlite3 as the database for Active Record | |
| gem 'sqlite3' | |
| # Use Puma as the app server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Get the lastest state from remote | |
| git pull | |
| # if dependencies changed we need to install them again | |
| bundle install --deployment --without development test | |
| # Compile new assets and run any eventual migrations | |
| bundle exec rake assets:precompile db:migrate RAILS_ENV=production |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Round representation that immediately schedules all games that belong to it after creation. | |
| class Round < ApplicationRecord | |
| belongs_to :tournament | |
| has_many :matches | |
| after_create :generate_matches | |
| def generate_matches | |
| if round_number == 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create_table "matches", force: :cascade do |t| | |
| t.integer "home_score" | |
| t.integer "away_score" | |
| t.integer "home_player_user_id" | |
| t.integer "away_player_user_id" | |
| t.integer "winner_user_id" | |
| t.integer "round_id" | |
| t.datetime "created_at", null: false | |
| t.datetime "updated_at", null: false | |
| t.integer "first_pokemon", default: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package de.freenet.databinding | |
| import android.databinding.DataBindingUtil | |
| import android.databinding.ViewDataBinding | |
| import android.support.test.espresso.IdlingResource | |
| import android.support.test.rule.ActivityTestRule | |
| import android.support.v4.app.FragmentActivity | |
| import android.support.v7.widget.RecyclerView | |
| import android.view.View | |
| import android.view.ViewGroup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package de.freenet.databinding | |
| import android.databinding.DataBindingUtil | |
| import android.databinding.ViewDataBinding | |
| import android.support.test.espresso.IdlingResource | |
| import android.support.test.rule.ActivityTestRule | |
| import android.support.v4.app.FragmentActivity | |
| import android.support.v7.widget.RecyclerView | |
| import android.view.View | |
| import android.view.ViewGroup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | Device | Current Usage(%) | |
|---|---|---|---|
| 1 | Samsung Galaxy S7 (G930F) | 15.84% | |
| 2 | Samsung Galaxy S8 (G950F) | 8.53% | |
| 3 | Samsung S6 (SM-G920f) | 6.36% | |
| 4 | Samsung Galaxy S7 Edge (G935F) | 4.86% | |
| 5 | Samsung S5 (SM-G900F) | 3.32% | |
| 6 | Samsung S6 Edge (SM-G925F) | 2.73% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <navigation android:id="@+id/third_feature_graph" | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| app:startDestination="@id/secondFeatureFragment"> | |
| <fragment | |
| android:id="@+id/secondFeatureFragment" | |
| android:name="com.jdapplications.second_feature.SecondFeatureFragment" |
NewerOlder