notessqlite.tsx3 matches
1import { sqlite } from "https://esm.town/v/std/sqlite";
23async function getRoom(roomName: string) {
4const result = await sqlite.execute(
5"SELECT content, lastModified FROM rooms WHERE name = ?",
14}
1516async function saveRoom(roomName: string, data: RoomData) {
17await sqlite.execute(
18`
24}
2526async function initDb() {
27await sqlite.execute(`
28CREATE TABLE IF NOT EXISTS rooms(
Glanceriframe.tsx1 match
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
23export function IframeContent({ data, content }) {
4// const { content, contentURL, docsURL } = config;
5// console.log("content: ", content);
Gardenonindex.html13 matches
239
240// Fetch all plants
241async function fetchPlants() {
242try {
243const response = await fetch('/api/plants');
251
252// Render plants on the map and in the list
253function renderPlants() {
254// Clear existing plants (but preserve placeholder)
255gardenMap.querySelectorAll('.plant:not(.placeholder)').forEach(el => el.remove());
331
332// Create a placeholder plant on the map
333function createPlaceholderPlant(x, y) {
334// Remove existing placeholder if any
335removePlaceholderPlant();
364
365// Remove placeholder plant from the map
366function removePlaceholderPlant() {
367if (placeholderPlant && placeholderPlant.element) {
368placeholderPlant.element.remove();
372
373// Select a plant to edit
374function selectPlant(plant) {
375// Cancel move mode if active
376if (isMovingPlant) {
405
406// Clear the form
407function clearForm() {
408// Remove placeholder plant if it exists
409removePlaceholderPlant();
431
432// Start move mode
433function startMoveMode() {
434if (!selectedPlant) {
435alert('Please select a plant to move.');
445
446// Cancel move mode
447function cancelMoveMode() {
448isMovingPlant = false;
449mapInstructions.textContent = 'Tap anywhere on the map to add a plant';
454
455// Move plant to new position
456function movePlantTo(x, y) {
457if (!selectedPlant) return;
458
478
479// Add a new plant at the clicked position
480function addPlantAt(x, y) {
481// Cancel move mode if active
482if (isMovingPlant) {
504
505// Save plant data
506async function savePlant(plantData) {
507try {
508let response;
543
544// Update placeholder plant when diameter changes
545function updatePlaceholderPlant() {
546if (placeholderPlant && placeholderPlant.element) {
547const newDiameter = parseFloat(plantDiameterInput.value) || 50;
553
554// Delete a plant
555async function deletePlant(id) {
556if (!confirm('Are you sure you want to delete this plant?')) {
557return;
10}
1112export function createFullExcelData(data: ExportData): any[][] {
13const { rankings, formatDetected, selectedWeek } = data;
14
79}
8081export function createIddaaOnlyExcelData(data: ExportData): any[][] {
82const { rankings } = data;
83
137}
138139export function createPoissonOnlyExcelData(data: ExportData): any[][] {
140const { rankings } = data;
141
191}
192193export function createAccuracyReportExcelData(data: ExportData): any[][] {
194const { accuracyStats, allWeeksData } = data;
195
219}
220221export function createMultiWeekExcelData(data: ExportData): { [sheetName: string]: any[][] } {
222const { allWeeksData, formatDetected } = data;
223const sheets: { [sheetName: string]: any[][] } = {};
fotmobindex.html13 matches
441let currentWeek = 6;
442443async function processFile() {
444const fileInput = document.getElementById('fileInput');
445const file = fileInput.files[0];
510}
511512function createWeekSelector() {
513const weekButtons = document.getElementById('weekButtons');
514weekButtons.innerHTML = '';
552}
553554async function analyzeWeek(selectedWeek) {
555currentWeek = selectedWeek;
556
585}
586587function displayResults(rankings, week) {
588const tbody = document.getElementById('rankingsBody');
589tbody.innerHTML = '';
648}
649650function updateAccuracyStats() {
651if (!analysisData || !analysisData.accuracyStats) return;
652
665}
666667async function exportToExcel() {
668if (!analysisData) {
669showStatus('Önce analiz yapılmalı!', 'error');
692}
693694async function exportIddaaOnly() {
695if (!analysisData) {
696showStatus('Önce analiz yapılmalı!', 'error');
719}
720721async function exportPoissonOnly() {
722if (!analysisData) {
723showStatus('Önce analiz yapılmalı!', 'error');
746}
747748async function testBettingAccuracy() {
749if (!analysisData) {
750showStatus('Önce analiz yapılmalı!', 'error');
780}
781782function downloadExcel(data, filename, sheetName = 'Sheet1') {
783// Create workbook and worksheet
784const wb = XLSX.utils.book_new();
806}
807808function downloadMultiSheetExcel(sheetsData, filename) {
809// Create workbook
810const wb = XLSX.utils.book_new();
838}
839840function updateProgress(percentage, text) {
841document.getElementById('progressFill').style.width = percentage + '%';
842document.getElementById('statusText').textContent = text;
843}
844845function showStatus(message, type = 'info') {
846const statusDiv = document.getElementById('statusText');
847statusDiv.textContent = message;
225});
226227function organizeMatches(matches: any[][], headers: string[]) {
228const weeklyData: { [key: number]: MatchData[] } = {};
229const allMatches: MatchData[] = [];
308}
309310function calculateWeeklyPowerScoresWithPoisson(
311targetWeek: number,
312allMatches: MatchData[],
344}
345346function calculatePoissonPrediction(
347homeTeam: string,
348awayTeam: string,
420}
421422function calculateAccuracyStats(allMatches: MatchData[], weeklyData: { [key: number]: MatchData[] }) {
423let totalPredictions = 0;
424let exactMatches = 0;
487}
488489function getMatchResult(score: string): string {
490const match = score.match(/(\d+)\s*-\s*(\d+)/);
491if (!match) return 'draw';
497}
498499function getPredictedResult(prediction: any): string {
500if (prediction.homeWinProb > prediction.drawProb && prediction.homeWinProb > prediction.awayWinProb) return 'home';
501if (prediction.awayWinProb > prediction.homeWinProb && prediction.awayWinProb > prediction.drawProb) return 'away';
503}
504505function getActualTotalGoals(score: string): number {
506const match = score.match(/(\d+)\s*-\s*(\d+)/);
507if (!match) return 0;
509}
510511function checkBetSuccess(recommendedBet: string, actualGoals: number, score: string): boolean {
512const hasHomeGoal = score.match(/(\d+)\s*-\s*(\d+)/) && parseInt(score.match(/(\d+)\s*-\s*(\d+)/)![1]) > 0;
513const hasAwayGoal = score.match(/(\d+)\s*-\s*(\d+)/) && parseInt(score.match(/(\d+)\s*-\s*(\d+)/)![2]) > 0;
1920// Initialize database
21async function initDatabase() {
22await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
23id INTEGER PRIMARY KEY AUTOINCREMENT,
fotmobcalculations.ts9 matches
1// Football analysis calculation functions
2import type {
3MatchData,
9} from './types.ts';
1011export function poissonProbability(lambda: number, k: number): number {
12if (lambda <= 0) return 0;
13const numerator = Math.pow(lambda, k) * Math.exp(-lambda);
16}
1718export function factorial(n: number): number {
19if (n <= 1) return 1;
20let result = 1;
25}
2627export function calculateLeagueAverages(allMatches: MatchData[], maxWeek: number): LeagueAverages {
28const validMatches = allMatches.filter(match =>
29match.week < maxWeek &&
72}
7374export function calculateTeamStrength(
75teamName: string,
76isHome: boolean,
139}
140141export function calculateOverUnderAnalysis(homeXgAvg: number, awayXgAvg: number): OverUnderAnalysis {
142let under25 = 0, under35 = 0;
143let bttsNo = 0;
193}
194195export function calculateMostLikelyScore(homeXgAvg: number, awayXgAvg: number): { homeGoals: number; awayGoals: number; probability: number } {
196let maxProbability = 0;
197let bestHomeGoals = 0;
215}
216217export function calculateWinProbabilities(homeXgAvg: number, awayXgAvg: number): WinProbabilities {
218let homeWinProb = 0;
219let drawProb = 0;
243}
244245export function calculatePowerScore(teamName: string, isHome: boolean, targetWeek: number, allMatches: MatchData[]): number {
246if (targetWeek === 1) return 0;
247
LiveStormMCPindex.ts1 match
229230/**
231* Val.town handler function for HTTP requests
232* This will be exposed as a Val.town HTTP endpoint
233*/
LiveStormMCPREADME.md1 match
4950- `index.ts`: Main entry point with HTTP trigger
51- `livestorm.ts`: Functions to fetch and parse the OpenAPI definition
52- `mcp.ts`: MCP server setup and configuration
53