"""
Complete st.session_state Tutorial App
This app demonstrates ALL use cases of st.session_state with interactive examples.
"""
import streamlit as st
import pandas as pd
from datetime import datetime, timedelta
import random
# ============================================================================
# PAGE CONFIGURATION
# ============================================================================
st.set_page_config(
page_title="Session State Tutorial",
page_icon="/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {number}
*/
var maxLevelSum = function(root) {
// Edge case: if the tree is empty (not typical for this problem)
if (!root) return 0;
// Queue for BFS - start with the root
const queue = [root]
# Option 1: Modern Vibrant Gradient (Sunset Orange to Pink)
st.markdown("""
<div style='
background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 50%, #FFA07A 100%);
padding: 20px;
border-radius: 15px;
box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
text-align: center;
margin-bottom: 20px;
border: 2px solid rgba(255, 255, 255, 0.3);
'>
<h2 style='
color: white;
font-weight: bold;
margin: 0;
font-size: 28px;
l<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.css" />
<!-- Carousel -->
<div class="swiper looping-words">
<div class="swiper-wrapper">
<div class="swiper-slide">Get noticed fast</div>
<div class="swiper-slide">Win more leads</div>
<div class="swiper-slide">Sell with ease</div>
<div class="swiper-slide">Build real trust</div>
<div class="swiper-slide">Grow every day</div>
</div>
</div>
<!-- Swiper Scripts -->
<script srservices:
postgres:
image: postgres:16-alpine
container_name: n8n-postgress
restart: unless-stopped
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- ./postgres_data:/var/lib/postgresql/data
n8n:
image: n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
- package main
import "fmt"
func main() {
fruits := [4]string{"Apple", "Banana", "Orange", "Grapes"}
fmt.Println("Fruits array:", fruits)
}// import fmt #format package
// fmt.Println
package main
import "fmt"
func main() {
var numbers [5]int
fmt.Println("Default values in an integer array:", numbers)
}/*
https://jsbin.com/setohiqiwe/edit?html,css,output
*/
:root {
--color: red;
}
.a, .b, .c {
margin: 1rem;
padding: 0.55rem;
}
.a {
background: hsl(from var(--color) h s 90%);
}
.b {
background: hsl(from var(--color) h s calc(l + 40));
}
.c {
background: hsl(from var(--color) h s l / 0.2);
}
/*
Converted to HSL, red is hsl(0 100% 50%), thus:
Setting l to 90%,
Is just hsl(0 100% 90%).
Adding 40 to l,
Add the l components together:
hsl(0 100% (50% + 40%)) → hsl(0 100% 90%)
Chanfunction Get-IniContent ($filePath) {
$ini = @{}
switch -regex -file $FilePath {
"^\[(.+)\]" {
# Section
$section = $matches[1]
$ini[$section] = @{}
$CommentCount = 0
}
"^(;.*)$" {
# Comment
$CommentCount++
$name = "Comment$($CommentCount)"
$value = $matches[1]
$ini[$section][$name] = $value
}
"(.+?)\s*=(.*)" {
# aaaa
all:
const loadingScreen = document.querySelector('.loading-screen');
if (loadingScreen) {
const CONFIG = {
fadeThreshold: 150,
bufferZone: 50,
reactivateAt: 5,
wheelMultiplier: 0.8,
touchMultiplier: 1.5,
extraVirtualCap: 100
};
const UNLOCK_THRESHOLD = CONFIG.fadeThreshold + CONFIG.bufferZone;
const MAX_VIRTUAL = UNLOCK_THRESHOLD + CONFIG.extraVirtualCap;
const state = {
ticking: false,
virtualY: 0,
locked: false,
savedScrollY: 0,
hasLeftTop: realpath file.txt
# realpath is part of GNU coreutils
# Installed by default on most Linux distributions/**
* @param {number[]} nums
* @return {number}
*/
var sumFourDivisors = function(nums) {
// Helper: return the sum of divisors of n if it has exactly 4 divisors.
// Otherwise return 0.
function sumIfFourDivisors(n) {
let count = 0; // how many divisors we've found
let sum = 0; // sum of those divisors
// Check all possible divisors from 1 up to sqrt(n)
for (let d = 1; d * d <= n; d++) {
if (n % d === 0) {
let other = <p class="text">テキスト</p># メール認証技術(SPF・DKIM・DMARC)学習メモ
---
## 1. SPF(Sender Policy Framework)
### 概要
- 「このドメインからのメールは、これらのIPアドレスから送信される」とDNSで宣言する仕組み
- 受信サーバーが送信元IPをSPFレコードと照合し、正当性を検証する
### なぜ必要か
- SMTPプロトコルは送信元アドレスを検証する仕組みを持たない
- 任意のサーバーから任意の送信元アドレスでメール送信が可能
- SPFにより、ドメイン所有者が「正当な送信元IP」を定義できる
### 設定場所
- ドメインのDNS TXTレコード
### レコード例
```
example.com. IN TXT "v=spf1 ip4:203.0.113.1 include:_spf.google.com -all"
```
| 部分 | 意味 |
|------|------|
| `v=spf1` | SPFバージョン1 |
| `ip4:203.0.113.1` | このIPからの送信を許可 |
| `include: