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
# ジョッキーの複勝率の計算 | |
def cal_jockey(jid, rdt): | |
query = Result.objects.filter(jockey_id=jid, race__race_dt__lt=rdt).exclude(rank=0) | |
run_all = query.count() | |
run_t3 = query.filter(rank__lte=3).count() | |
ratio = round(run_t3 / run_all, 2) if run_all != 0 else 0 | |
return ratio | |
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 sys | |
from requests import Session, HTTPError | |
from django.core.management.base import BaseCommand, CommandError | |
session = Session() | |
class Command(BaseCommand): | |
can_import_settings = True | |
def handle(self, *args, **options): | |
login_netkeiba() |
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
# NETKEIBA Login Information (LOCAL) | |
# http://www.netkeiba.com/ | |
NETKEIBA_USER = "<YOUR_EMAIL>" | |
NETKEIBA_PASS = "<YOUR_PASSOWRD>" | |
LOGIN_INFO = { | |
'pid': 'login', | |
'action': 'auth', | |
'login_id': NETKEIBA_USER, | |
'pswd': NETKEIBA_PASS |
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 django.test import LiveServerTestCase | |
from selenium import webdriver | |
class PollsTest(LiveServerTestCase): | |
def setUp(self): | |
self.browser = webdriver.PhantomJS() | |
self.browser.implicitly_wait(3) | |
def tearDown(self): |
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
/* universal */ | |
body { | |
padding-top: 45px; | |
} | |
/* header */ | |
.navbar { | |
min-height: 40px !important | |
} |
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
<header class="navbar navbar-fixed-top navbar-inverse" role="navigation"> | |
<div class="container"> | |
<!-- ページタイトル --> | |
<%= link_to "mypage", root_path, class: "navbar-brand" %> | |
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> | |
<!-- リンク --> | |
<ul class="nav navbar-nav navbar-left"> | |
<li><%= link_to "画面1", root_path %></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
/* | |
GetDate: 2015/04/07 | |
Site: http://j1.ax.xrea.com/l.j?id=300012781 | |
Referer: http://lists.clean-mx.com/pipermail/viruswatch/20100102/012754.html | |
*/ | |
function sCk(key, c, p) { | |
d = 365; | |
path = ""; | |
e = new Date(); |
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
# Application definition | |
INSTALLED_APPS = ( | |
'django.contrib.admin', | |
'django.contrib.auth', | |
'django.contrib.contenttypes', | |
'django.contrib.sessions', | |
'django.contrib.messages', | |
'django.contrib.staticfiles', | |
'polls' | |
) |
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 django.contrib import admin | |
from polls.models import Choice, Question | |
class ChoiceInline(admin.StackedInline): | |
model = Choice | |
extra = 3 | |
class QuestionAdmin(admin.ModelAdmin): |
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
# Application definition | |
INSTALLED_APPS = ( | |
'django.contrib.admin', | |
'django.contrib.auth', | |
'django.contrib.contenttypes', | |
'django.contrib.sessions', | |
'django.contrib.messages', | |
'django.contrib.staticfiles', | |
'polls' |
NewerOlder