This file contains 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
import pandas as pd | |
import numpy as np | |
def add_individual_rows(): | |
heights = range(150, 211) | |
satisfaction_baseline = 150 | |
d = {} | |
l = [] | |
df = pd.DataFrame(columns=['height', 'satisfaction']) | |
for h in heights: |
This file contains 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
from stocks import wsgi | |
from django.core.exceptions import ObjectDoesNotExist | |
from api.models import Stock, Company | |
import csv | |
csvpath = r'prices.csv' | |
batch_size = 500 | |
t1 = time.time() |
This file contains 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
actions : { | |
createTourney (context, payload) { | |
return new Promise (resolve, reject) { | |
// prepare data to be sent | |
axios({ | |
// mthod,url, data.... | |
validateStatus: function (status) { | |
return (status >= 200 && status < 300) || (status === 400) | |
} | |
}).then(response => { |
This file contains 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
<template> | |
<div id="register-players"> | |
<h2>Tournament: {{ tournamentName }}</h2> | |
<div id="add-players" v-if="!playersRegistered"> | |
<input type="text" v-model="playerName" /> | |
<button type="button" @click="addPlayer">Add player</button> | |
<div id="temporary-player-list"> | |
<ul> | |
<li v-for="player in temporaryPlayerList">{{ player }}</li> | |
</ul> |
This file contains 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
<template> | |
<div id="register-tournament"> | |
<input type="text" v-model="tournamentName"/> | |
<button type="button" v-on:click="createTournament">Create Tournament</button> | |
<div id="tournament-created" v-if="createdTournamentName"> | |
<p>{{ createdTournamentName }} has been created</p> | |
<router-link to='/register-players'><button type="button">Proceed to add players >> </button></router-link> | |
</div> | |
</div> | |
</template> |
This file contains 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
import Vue from 'vue'; | |
import Vuex from 'vuex'; | |
import axios from 'axios'; | |
import createPersistedState from 'vuex-persistedstate'; | |
Vue.use(Vuex) | |
export const store = new Vuex.Store({ | |
// plugins: [createPersistedState()], | |
state: { |
This file contains 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
<template> | |
<div id="register-tournament"> | |
<input type="text" v-model="tournamentName"/> | |
<button type="button" v-on:click="createTournament">Create Tournament</button> | |
</div> | |
</template> | |
<script> | |
import axios from 'axios'; |
This file contains 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 Match(models.Model): | |
WHITE = 'White', | |
BLACK = 'Black', | |
DRAW = 'Draw', | |
UNDETERMINED = 'Undetermined' | |
MATCH_RESULT_CHOICES = ( | |
(WHITE, 'White Won'), | |
(BLACK, 'Black Won'), |