slight changes, redis impl

This commit is contained in:
matteo-id committed 2022-05-28 14:10:38 -04:00
1 parent e91ee1acbd
commit cf3dc3ee35
31 files changed
+88 -43

No files matched your search

@@ -1,2 +1,2 @@
Winning_Numbers,Chance
14-18-22-23-5-9,[0.19480519480519481]
14-18-22-23-5-9,347/177100
1 Winning_Numbers Chance
2 14-18-22-23-5-9 [0.19480519480519481] 347/177100
@@ -1,4 +1,5 @@
# WVLottopy: Matteo DiBiagio
from fractions import Fraction as frac
from sheet2dict import Worksheet
import pandas as pd
import requests
@@ -69,7 +70,7 @@ for n in range(0, 25):
sorted_nums = sorted(likely_nums)
total_freq = sum(frequency)
Chance = [(total_freq / 177100) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
Chance = frac(total_freq, 177100) # Chance = number call freq / all possible numbers i.e. 11238513
Winning_Numbers = str("-".join(sorted_nums))
#print("Likely numbers are . . . ", sorted_nums, "\n", "With percent chance of winning being", chance[0]*100, "%")
Binary file not shown.
@@ -1,2 +1,2 @@
Winning_Numbers,Chance
0-4-6,[0.33]
0-3-6,17/5000
1 Winning_Numbers Chance
2 0-4-6 0-3-6 [0.33] 17/5000
@@ -1,2 +1,2 @@
Winning_Numbers,Chance
3-5-6-8,[5.35]
3-5-6-8,267/5000
1 Winning_Numbers Chance
2 3-5-6-8 [5.35] 267/5000
@@ -1,4 +1,5 @@
# WVLottopy: Matteo DiBiagio
from fractions import Fraction as frac
from sheet2dict import Worksheet
import pandas as pd
import requests
@@ -69,7 +70,7 @@ for n in range(0, 10):
sorted_nums = sorted(likely_nums)
total_freq = sum(frequency)
Chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
Chance = frac(total_freq, 10000) # Chance = number call freq / all possible numbers i.e. 11238513
Winning_Numbers = str("-".join(sorted_nums))
#print("Likely numbers are . . . ", sorted_nums, "\n", "With percent chance of winning being", chance[0]*100, "%")
Binary file not shown.
@@ -1,4 +1,5 @@
# WVLottopy: Matteo DiBiagio
from fractions import Fraction as frac
from sheet2dict import Worksheet
import pandas as pd
import requests
@@ -69,7 +70,7 @@ for n in range(0, 9):
sorted_nums = sorted(likely_nums)
total_freq = sum(frequency)
Chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
Chance = frac(total_freq, 10000) # Chance = number call freq / all possible numbers i.e. 11238513
Winning_Numbers = str("-".join(sorted_nums))
#print("Likely numbers are . . . ", sorted_nums, "\n", "With percent chance of winning being", chance[0]*100, "%")
Binary file not shown.
@@ -1,2 +1,2 @@
Winning_Numbers,SB,Chance
1-10-32-36-8,[3],[0.00036937852063902485]
1-10-32-49-8,[3],1/270725
1 Winning_Numbers SB Chance
2 1-10-32-36-8 1-10-32-49-8 [3] [0.00036937852063902485] 1/270725
Binary file not shown.
@@ -1,5 +1,6 @@
# WVLottopy: Matteo DiBiagio
#from django_lottopy.lottopy_site.lottopy.lottopy_web_edition.megamil import Winning_Numbers
from fractions import Fraction as frac
from sheet2dict import Worksheet
import pandas as pd
import requests
@@ -70,7 +71,7 @@ for n in range(0, 10):
sorted_nums = sorted(likely_nums)
total_freq = sum(frequency + frequency_pb)
Chance = [(total_freq / 25989600) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
Chance = frac(total_freq, 25989600) # Chance = number call freq / all possible numbers i.e. 11238513
Winning_Numbers = str("-".join(sorted_nums))
#print("Likely numbers are . . . ", sorted_nums, "SB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%")
@@ -1,10 +1,14 @@
# WVLottopy: Matteo DiBiagio
from fractions import Fraction as frac
from sheet2dict import Worksheet
import pandas as pd
import requests
from collections import Counter
import csv
def fraction_ratio(i):
return i/sum(i)
url = 'https://wvlottery.com/draw-games/powerball/?game-analyze=powerball&what-to-search=historysearch&date-range=-1'
header = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36",
@@ -69,7 +73,7 @@ for n in range(0, 26):
sorted_nums = sorted(likely_nums)
total_freq = sum(frequency + frequency_pb)
Chance = [(total_freq / 292201338) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
Chance = frac(total_freq, 292201338) # Chance = number call freq / all possible numbers i.e. 11238513
Winning_Numbers = str("-".join(sorted_nums))
#print("Likely numbers are . . . ", sorted_nums, "PB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%")
@@ -1,4 +1,5 @@
# WVLottopy megamil: Matteo DiBiagio
from fractions import Fraction as frac
from sheet2dict import Worksheet
import pandas as pd
import requests
@@ -69,7 +70,7 @@ for n in range(0, 25):
sorted_nums = sorted(likely_nums)
total_freq = sum(frequency + frequency_pb)
Chance = [(total_freq / 302575350) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
Chance = frac(total_freq, 302575350) # Chance = number call freq / all possible numbers i.e. 11238513
Winning_Numbers = str("-".join(sorted_nums))
#print("Likely numbers are . . . ", sorted_nums, "MB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%")
@@ -1,2 +1,2 @@
Winning_Numbers,MB,Chance
17-21-26-52-7,[24],[2.478721416004311e-05]
17-26-40-52-7,[24],1/4034338
1 Winning_Numbers MB Chance
2 17-21-26-52-7 17-26-40-52-7 [24] [2.478721416004311e-05] 1/4034338
@@ -1,2 +1,2 @@
Winning_Numbers,PB,Chance
21-39-59-61-63,[17],[3.216959944242281e-05]
21-33-39-59-63,[17],16/48700223
1 Winning_Numbers PB Chance
2 21-39-59-61-63 21-33-39-59-63 [17] [3.216959944242281e-05] 16/48700223
+2 -2
View File
@@ -2,7 +2,7 @@ from django.urls import path
from . import views
urlpatterns = [
path('', views.base, name='base'),
path('home/', views.home, name='home'),
#path('', views.base, name='base'),
path('', views.home, name='home'),
path('about/', views.about, name="about"),
]
+8 -10
View File
@@ -1,25 +1,22 @@
# Create your views here.
from django.http import HttpResponse
from django.shortcuts import render
from django.conf import settings
from django.core.cache.backends.base import DEFAULT_TIMEOUT
from django.views.decorators.cache import cache_page
import os
import csv
#f = "~/projects/django_lottopy/lottopy_site/lottopy/lottopy_web_edititon/pb_ans.csv"
#def files(f):
# reader = csv.DictReader(open(f))
# for row in reader:
# global numbers, pb, chance
# numbers = row[0-5]
# pb = row[6]
# chance = row[7]
# pbdata = pbdata(numbers=numbers,pb=pb,chance=chance)
# pbdata.save()
# MAKE SURE TO START REDIS BEFORE SITE LOADS
def base(request):
return render(request, 'lottopy/base.html',
{'nbar': 'home'})
CACHE_TTL = getattr(settings, 'CACHE_TTL', DEFAULT_TIMEOUT)
@cache_page(CACHE_TTL)
def home(request):
# Powerball
module_dir = os.path.dirname(__file__)
@@ -77,7 +74,8 @@ def home(request):
'lanumbers': lanumbers,
'd3numbers': d3numbers,
'd4numbers': d4numbers,
'c25numbers': c25numbers
'c25numbers': c25numbers,
'active': 'active'
}
return render(request, 'lottopy/home.html', context)
+13
View File
@@ -52,6 +52,8 @@ MIDDLEWARE = [
]
ROOT_URLCONF = 'lottopy_site.urls'
SESSION_COOKIE_SECURE = os.getenv('SESSION_COOKIE_SECURE_ENABLED') != 'False'
CSRF_COOKIE_SECURE = os.getenv('CSRF_COOKIE_SECURE_ENABLED') != 'False'
# Templates Directory
TEMPLATE_DIR = os.path.join(BASE_DIR,"templates")
@@ -132,3 +134,14 @@ STATICFILES_DIRS = [
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# Redis
#REDIS_HOST = 'localhost'
#REDIS_PORT = 6379
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.redis.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379',
}
}
CACHE_TTL = 60 * 60 * 24
Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

@@ -194,6 +194,19 @@ p {
margin-bottom: 1rem;
}
feature {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
border: 1px solid #e9ecef;
}
feature:hover {
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
border: 2px solid #ffffff !important;
}
abbr[title],
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted;
File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

+11 -2
View File
@@ -2,6 +2,15 @@
{% load static %}
{% block about %}
<title>About</title>
<h1>"THIS IS MY FUCKING ABOUT PAGE"</h1>
<p>"I'm testing it out"</p>
<h1 class="text-white">About this site</h1>
<div class="container bg-light">
<body>
<p>This site was made initally as a project to familiarize myself with Django, and to publicly make available a script I had written to find the most often returned lottery combinations.</p>
<p>It started after two close friends of mine peaked my interest with their own ways to win the jackpot. One who thought it was all in location, and another who simply pulled numbers from his dreams and meditation (some winning +$10,000!)</p>
<p>Although I do not claim to have a universal link or the secret to winning numbers, my goal is to give the best edge available using statistical and historical analysis on the lottery.</p>
<p>The site is still in development, and I am working on adding more features, and improving the site's functionality.</p>
<p>If you have any suggestions or comments, please feel free to contact me at <a> site email dot com </a></p>
<a>wallets</a>
</body>
</div>
{% endblock about %}
+8 -7
View File
@@ -22,32 +22,33 @@
"sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS"
crossorigin="anonymous"> -->
</head>
<body>
<!-- Responsive navbar-->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
<div class="container">
<a class="navbar-brand" href="{% url 'home' %}">
<img src="{% static 'bootstrap/pics/WVOut.svg' %}" id="navbarSupportedContent" width="25" float="left">
West Virginia Lottery Predictions</a>
<img src="{% static 'bootstrap/pics/wvout.png' %}" width="30" id="" style="padding-top:2px" float="left">
WV State Lottery Predictions</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item"><a class="nav-link active" aria-current="page" href="{% url 'home' %}">Home</a></li>
<li class="nav-item"><a class="nav-link" aria-current="page" href="{% url 'home' %}">Home</a></li>
<li class="nav-item"><a class="nav-link" href="{% url 'about'%}">About</a></li>
<li class="nav-item dropdown">
<li class="nav-item nav-link" target="_blank" rel="noreferrer noopener" href="https://wvlottery.com/">Official WV Lottery Site</li>
<!-- <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#" >Login</a></li>
<li><a class="dropdown-item" href="#">Contact (WIP)</a></li>
<li><hr class="dropdown-divider" /></li>
<li><a class="dropdown-item" target="_blank" rel="noreferrer noopener" href="https://wvlottery.com/">WV Lottery Site</a></li>
<li><a class="dropdown-item" target="_blank" rel="noreferrer noopener" href="https://wvlottery.com/">WV Lottery Site</a></li> -->
</ul>
</li>
</ul>
</div>
</div>
</nav>
<body class="" style="background-attachment:fixed;background-color:rgb(163, 161, 161);background-image: url(https://static.vecteezy.com/system/resources/previews/000/200/589/original/vector-retro-pattern-background.jpg);" >
<!-- Page content-->
<div class="container">
<div class="text-center mt-5">
+12 -10
View File
@@ -1,8 +1,10 @@
{% extends 'lottopy/base.html' %}
{% block content %}
<div class="container bg-light">
<h1>Find your lucky numbers and hit big!</h1>
<p class="lead">The purpose of this site is to analyze existing West Virginia winning lottery numbers, and return only the most likely combinations. This can be used to gain an edge on the lottery system, and help you win big!</p>
<section class="py-5 border-top" id="features">
<p class="lead border-bottom">The purpose of this site is to analyze existing West Virginia winning lottery numbers, and return only the most likely combinations. This can be used to gain an edge on the lottery system, and help you win big!</p>
</div>
<section class="py-5" id="features">
<div class="container px-5 my-5">
<content class="row gx-5 ">
<div class="col-lg-4 mb-5 mb-lg-0">
@@ -13,7 +15,7 @@
Draws every Monday, Wednesday, and Saturday at 11:00 PM {# Last draw: {{ pb_date }} #}
<i class="bi bi-arrow-right"></i>
</a>
</div>
</div>
</div>
<div class="col-lg-4 mb-5 mb-lg-0">
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-building"></i>
@@ -23,7 +25,7 @@
Draws every Tuesday and Friday night at 10:59 PM {# Last draw: {{ mm_date }} #}
<i class="bi bi-arrow-right"></i>
</a>
</div>
</div>
</div>
<div class="col-lg-4 mb-5 mb-lg-0">
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-toggles2"></i>
@@ -33,7 +35,7 @@
Draws every Wednesday and Saturday night at 10:30 PM {# Last draw: {{ la_date }} #}
<i class="bi bi-arrow-right"></i>
</a>
</div>
</div>
</div>
<div class="col-lg-4 mb-5 mb-lg-0">
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-collection"></i>
@@ -43,7 +45,7 @@
Draws every weekday but Sunday at 6:59 PM {# Last draw: {{ d3_date }} #}
<i class="bi bi-arrow-right"></i>
</a>
</div>
</div>
</div>
<div class="col-lg-4 mb-5 mb-lg-0">
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-building"></i>
@@ -53,9 +55,9 @@
Draws every weekday but Sunday at 6:59 PM {# Last draw: {{ d4_date }} #}
<i class="bi bi-arrow-right"></i>
</a>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="col-lg-4 mb-5 mb-lg-0">
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-toggles2"></i>
<h2 class="col-auto" width=200>Cash25</h2>
<p>{{ c25numbers|linebreaks }}</p>
@@ -63,7 +65,7 @@
Draws every weekday but Sunday at 6:59 PM {# Last draw: {{ c25_date }} #}
<i class="bi bi-arrow-right"></i>
</a>
</div>
</div>
</div>
<div class="col-lg-4 mb-5 mb-lg-0" style="margin:auto">
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-building"></i>
@@ -74,5 +76,5 @@
</content>
</div>
</section>
<h6 class="card-footer" text-align=bottom>Disclaimer: WV Lottopy developers do not guarantee a win on the first or even the fortieth set of numbers. This is used to gain an <b><i>edge </i></b> over those who do not use this program.</h6>
<h6 class="card-footer bg-light" text-align=bottom>Disclaimer: WV Lottopy developers do not guarantee a win on the first or even the fortieth set of numbers. This is used to gain an <b><i>edge </i></b> over those who do not use this program.</h6>
{% endblock content %}