blog / posts /empty.html
wop's picture
Update posts/empty.html
bd6f342 verified
Raw
History Blame Contribute Delete
14.1 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Unavailable</title>
<!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" crossorigin="anonymous"
onload="renderMathInElement(document.body,{delimiters:[{left:'$$',right:'$$',display:true},{left:'$',right:'$',display:false}],throwOnError:false});"></script>
<link rel="stylesheet" href="../style.css">
</head>
<body><script src="../script.js" defer></script>
<div class="background"></div>
<main class="article">
<a class="back" href="../index.html">&larr; Back</a>
<div class="meta">Not found &middot; Bench Labs</div>
<h1>Oops, the content is not ready yet, come back later.</h1>
<!-- Logo -->
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="110.000000pt" height="95.000000pt" viewBox="0 0 1710.000000 945.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,945.000000) scale(0.100000,-0.100000)"
fill="#fff" stroke="none">
<path d="M1160 8395 c-1 0 -1 -254 -1 -563 l-1 -564 498 1 c275 1 527 4 562 8
34 3 62 2 62 -3 6 -309 3 -1134 -5 -1134 -5 -1 -260 0 -567 0 l-556 1 1 -571
2 -571 559 1 c307 1 560 -1 562 -3 7 -7 4 -3830 -3 -3912 l-6 -75 574 0 574 0
0 1995 0 1996 565 0 565 0 2 -1423 2 -1423 572 -3 572 -2 -6 83 c-7 85 -10
2757 -4 2763 5 5 5709 5 5714 1 6 -7 3 -2678 -4 -2764 l-6 -83 564 -2 c310 -2
569 -2 574 0 7 1 10 486 10 1428 l0 1425 555 0 c305 -1 561 -1 568 -1 10 0 12
-391 12 -1992 l-1 -1993 572 -3 572 -2 -6 83 c-7 90 -10 3897 -3 3904 2 2 256
4 565 3 l561 -1 2 556 c0 305 1 561 2 568 1 9 -119 12 -562 14 -310 1 -566 4
-568 6 -8 8 -5 1120 3 1126 5 3 253 4 553 1 300 -3 550 -4 555 -2 7 1 10 196
9 562 l-2 560 -7381 3 c-4059 1 -7381 2 -7381 2z m14627 -138 c17 -17 18 -45
15 -420 -3 -380 -4 -403 -22 -418 -16 -14 -67 -17 -337 -23 -175 -4 -373 -6
-439 -5 -73 0 -130 -3 -142 -10 -11 -6 -30 -11 -41 -11 -25 0 -72 -40 -91 -77
-8 -15 -21 -36 -30 -47 -13 -16 -15 -84 -18 -505 -1 -267 0 -510 3 -539 6 -48
12 -59 58 -104 29 -28 66 -56 83 -64 25 -10 128 -14 475 -15 244 -1 454 -5
466 -10 12 -5 25 -19 28 -31 9 -41 13 -802 3 -820 -19 -37 -39 -39 -499 -38
-445 0 -452 0 -488 -21 -20 -12 -54 -41 -77 -65 -36 -37 -41 -48 -42 -89 0
-26 -5 -52 -11 -58 -8 -8 -11 -540 -11 -1857 l0 -1847 -21 -19 c-20 -18 -42
-19 -424 -19 -326 0 -405 3 -418 14 -16 12 -17 111 -18 1225 -1 666 -4 1522
-8 1902 l-6 690 -45 54 c-71 85 -60 83 -500 88 -212 2 -419 -1 -460 -6 -43 -6
-79 -6 -84 -1 -14 12 -53 11 -61 -2 -4 -6 -19 -7 -35 -4 -32 7 -80 -18 -80
-41 0 -8 -7 -14 -14 -14 -8 0 -27 -16 -42 -36 -24 -31 -29 -48 -35 -137 -4
-56 -8 -656 -8 -1333 l-1 -1231 -26 -24 -26 -24 -385 3 c-414 3 -436 6 -448
55 -3 12 -6 609 -8 1327 l-2 1305 -35 52 c-19 29 -45 55 -57 59 -11 3 -23 14
-26 23 -2 10 -18 21 -36 24 -49 10 -5580 7 -5630 -2 -24 -5 -48 -16 -53 -25
-5 -9 -15 -16 -23 -16 -19 0 -87 -82 -80 -98 3 -7 0 -23 -6 -35 -9 -16 -9 -22
0 -25 15 -5 14 -29 -1 -34 -10 -4 -14 -274 -18 -1291 -4 -1036 -8 -1289 -18
-1299 -10 -10 -99 -13 -416 -13 -373 0 -405 1 -423 18 -20 17 -20 44 -27 1340
-6 1044 -11 1328 -21 1352 -7 17 -30 46 -51 66 -54 51 -181 88 -199 59 -4 -7
-13 -7 -24 -1 -25 14 -828 13 -837 0 -4 -6 -20 -8 -41 -4 -35 6 -113 -20 -113
-38 0 -6 -15 -25 -34 -43 -18 -18 -36 -47 -40 -66 -4 -18 -9 -877 -12 -1908
-5 -1609 -8 -1877 -20 -1890 -13 -13 -75 -15 -418 -18 -386 -3 -404 -2 -427
17 l-24 19 -5 1889 c-4 1653 -7 1891 -20 1915 -8 16 -18 28 -23 28 -4 0 -12
11 -17 25 -5 14 -21 30 -35 35 -14 5 -25 13 -25 17 0 25 -92 31 -493 33 -230
0 -431 3 -447 7 -16 3 -37 14 -47 25 -17 18 -18 51 -21 401 -2 277 0 388 9
409 22 54 37 56 503 56 312 0 436 4 463 13 43 14 103 58 103 75 0 6 7 18 16
25 25 20 37 61 22 70 -10 7 -10 11 0 21 9 9 12 123 12 489 0 263 -4 480 -9
483 -4 3 -6 16 -4 28 6 33 -46 101 -104 135 l-48 28 -457 5 c-506 6 -482 2
-496 71 -4 19 -5 202 -2 407 l5 374 23 19 c23 18 180 18 7242 16 6923 -2 7220
-3 7237 -20z"/>
<path d="M3640 7391 c-121 -4 -203 -10 -215 -18 -42 -25 -114 -111 -120 -144
-3 -19 -5 -266 -3 -550 l3 -516 29 -41 c23 -33 32 -40 42 -31 14 12 18 7 15
-22 -2 -17 29 -33 89 -45 46 -9 10122 -8 10152 2 37 11 96 64 123 110 l26 43
-3 534 -3 534 -29 41 c-15 23 -51 56 -79 74 l-52 33 -4890 1 c-2689 1 -4978
-2 -5085 -5z m10032 -679 c2 -310 0 -566 -4 -568 -3 -2 -2312 -4 -5130 -4
l-5123 0 -3 567 -2 568 5130 0 5130 0 2 -563z"/>
</g>
</svg>
<script> /* ========================================================== SYNTAX HIGHLIGHTING ========================================================== */ const PY_KW = new Set([ 'def','class','return','if','elif','else','for','while','import','from','as', 'try','except','finally','with','yield','lambda','pass','break','continue', 'raise','and','or','not','in','is','global','nonlocal','assert','del', 'async','await' ]); const JS_KW = new Set([ 'const','let','var','function','return','if','else','for','while','do', 'switch','case','break','continue','new','class','extends','import','export', 'from','default','try','catch','finally','throw','typeof','instanceof', 'in','of','async','await','yield','void','delete','with' ]); const PY_BI = new Set([ 'print','len','range','int','str','float','list','dict','set','tuple','bool', 'type','isinstance','input','open','map','filter','zip','enumerate','sorted', 'reversed','sum','min','max','abs','round','any','all','super','property', 'staticmethod','classmethod','True','False','None','Exception','ValueError', 'TypeError','KeyError','IndexError','AttributeError','NotImplementedError', 'RuntimeError','StopIteration','FileNotFoundError','object' ]); const JS_BI = new Set([ 'console','Math','Array','Object','String','Number','Boolean','Date','RegExp', 'Error','TypeError','RangeError','SyntaxError','JSON','Promise','Map','Set', 'Symbol','Proxy','Reflect','parseInt','parseFloat','isNaN','isFinite', 'undefined','null','true','false','NaN','Infinity' ]); function escapeHtml(s) { return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); } function detectLang(code) { let py = 0, js = 0; const pyP = /\b(def |class |import |from \w+ import|elif |print\(|True|False|None|self[\.\[])\b/g; const jsP = /\b(const |let |var |function |=>|console\.|undefined|null|async |await )\b/g; let m; while ((m = pyP.exec(code)) !== null) py++; while ((m = jsP.exec(code)) !== null) js++; if (py > js) return 'python'; if (js > 0) return 'javascript'; return 'text'; } function highlight(code) { const lang = detectLang(code); const kw = lang === 'python' ? PY_KW : lang === 'javascript' ? JS_KW : new Set(); const bi = lang === 'python' ? PY_BI : lang === 'javascript' ? JS_BI : new Set(); const tokens = []; let i = 0; const len = code.length; while (i < len) { if (lang === 'python') { const t3 = code.slice(i, i + 3); if (t3 === '"""' || t3 === "'''") { const end = code.indexOf(t3, i + 3); const span = end !== -1 ? code.slice(i, end + 3) : code.slice(i); tokens.push({ type: 'string', text: span }); i += span.length; continue; } } { const pm = code.slice(i).match(/^[frbFRB]{0,3}/); if (pm) { const pLen = pm[0].length; const nc = code[i + pLen]; if (nc === '"' || nc === "'") { const q = nc; const isF = pm[0].toLowerCase().includes('f'); let depth = 0, k = i + pLen + 1; let found = false; while (k < len) { const ch = code[k]; if (ch === '\\') { k += 2; continue; } if (isF) { if (ch === '{') { depth++; k++; continue; } if (ch === '}') { depth = Math.max(0, depth - 1); k++; continue; } } if (ch === q && depth === 0) { found = true; break; } k++; } if (found) { tokens.push({ type: 'string', text: code.slice(i, k + 1) }); i = k + 1; continue; } } } } if (lang === 'python' && code[i] === '#') { let end = code.indexOf('\n', i); if (end === -1) end = len; tokens.push({ type: 'comment', text: code.slice(i, end) }); i = end; continue; } if (lang === 'javascript' && code.slice(i, i + 2) === '//') { let end = code.indexOf('\n', i); if (end === -1) end = len; tokens.push({ type: 'comment', text: code.slice(i, end) }); i = end; continue; } if (lang === 'javascript' && code.slice(i, i + 2) === '/*') { let end = code.indexOf('*/', i + 2); if (end === -1) end = len; else end += 2; tokens.push({ type: 'comment', text: code.slice(i, end) }); i = end; continue; } { const m = code.slice(i).match( /^(0x[0-9a-fA-F_]+|0b[01_]+|0o[0-7_]+|\d[\d_]*\.?\d*(?:e[+-]?\d+)?)/ ); if (m) { tokens.push({ type: 'number', text: m[0] }); i += m[0].length; continue; } } if (lang === 'python' && code[i] === '@') { const m = code.slice(i).match(/^@[\w.]+/); if (m) { tokens.push({ type: 'decorator', text: m[0] }); i += m[0].length; continue; } } { const m = code.slice(i).match(/^\w+/); if (m) { const w = m[0]; let type = 'plain'; if (kw.has(w)) type = 'keyword'; else if (bi.has(w)) type = 'builtin'; else if (w === 'self' || w === 'cls' || w === 'this') type = 'self'; else { let j = i + w.length; while (j < len && code[j] === ' ') j++; if (code[j] === '(') type = 'function'; } tokens.push({ type, text: w }); i += w.length; continue; } } { const m = code.slice(i).match(/^[+\-*/%=<>!&|^~:]+/); if (m) { tokens.push({ type: 'operator', text: m[0] }); i += m[0].length; continue; } } if ('(){}[],;.'.includes(code[i])) { tokens.push({ type: 'punctuation', text: code[i] }); i++; continue; } { const m = code.slice(i).match(/^\s+/); if (m) { tokens.push({ type: 'plain', text: m[0] }); i += m[0].length; } else { tokens.push({ type: 'plain', text: code[i] }); i++; } } } return tokens.map(t => { const esc = escapeHtml(t.text); return t.type === 'plain' ? esc : <span class="tok-${t.type}">${esc}</span>; }).join(''); } document.querySelectorAll('pre code').forEach(block => { block.innerHTML = highlight(block.textContent); }); /* ========================================================== LIGHTBOX ========================================================== */ class Lightbox { constructor() { this.images = []; this.currentIndex = 0; this.isOpen = false; this._build(); this._bindImages(); this._bindKeys(); this._bindSwipe(); } _build() { this.el = document.createElement('div'); this.el.className = 'lightbox-overlay'; this.el.setAttribute('role', 'dialog'); this.el.setAttribute('aria-modal', 'true'); this.el.setAttribute('aria-label', 'Image viewer'); this.el.innerHTML = <button class="lightbox-btn lightbox-close" aria-label="Close"> <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"> <line x1="18" y1="6" x2="6" y2="18"/> <line x1="6" y1="6" x2="18" y2="18"/> </svg> </button> <button class="lightbox-btn lightbox-arrow lightbox-prev" aria-label="Previous image"> <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"> <polyline points="15 18 9 12 15 6"/> </svg> </button> <button class="lightbox-btn lightbox-arrow lightbox-next" aria-label="Next image"> <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"> <polyline points="9 6 15 12 9 18"/> </svg> </button> <img class="lightbox-img" src="" alt=""> <div class="lightbox-counter"></div> ; document.body.appendChild(this.el); this.imgEl = this.el.querySelector('.lightbox-img'); this.counterEl = this.el.querySelector('.lightbox-counter'); this.prevBtn = this.el.querySelector('.lightbox-prev'); this.nextBtn = this.el.querySelector('.lightbox-next'); this.closeBtn = this.el.querySelector('.lightbox-close'); this.closeBtn.addEventListener('click', () => this.close()); this.prevBtn.addEventListener('click', (e) => { e.stopPropagation(); this.prev(); }); this.nextBtn.addEventListener('click', (e) => { e.stopPropagation(); this.next(); }); this.el.addEventListener('click', (e) => { if (e.target === this.el) this.close(); }); } _bindImages() { this.images = Array.from(document.querySelectorAll('.article img')); this.images.forEach((img, idx) => { img.addEventListener('click', () => this.open(idx)); }); } _bindKeys() { document.addEventListener('keydown', (e) => { if (!this.isOpen) return; if (e.key === 'Escape') this.close(); if (e.key === 'ArrowLeft') this.prev(); if (e.key === 'ArrowRight') this.next(); }); } _bindSwipe() { let startX = 0; this.el.addEventListener('touchstart', (e) => { startX = e.changedTouches[0].clientX; }, { passive: true }); this.el.addEventListener('touchend', (e) => { const dx = startX - e.changedTouches[0].clientX; if (Math.abs(dx) > 60) { dx > 0 ? this.next() : this.prev(); } }, { passive: true }); } open(idx) { this.currentIndex = idx; this.isOpen = true; this._update(); requestAnimationFrame(() => { this.el.classList.add('active'); }); document.body.style.overflow = 'hidden'; this.closeBtn.focus(); } close() { this.isOpen = false; this.el.classList.remove('active'); document.body.style.overflow = ''; this.images[this.currentIndex]?.focus(); } prev() { this.currentIndex = (this.currentIndex - 1 + this.images.length) % this.images.length; this._update(); } next() { this.currentIndex = (this.currentIndex + 1) % this.images.length; this._update(); } _update() { const srcImg = this.images[this.currentIndex]; this.imgEl.style.opacity = '0'; this.imgEl.style.transform = 'scale(0.96)'; setTimeout(() => { this.imgEl.src = srcImg.src; this.imgEl.alt = srcImg.alt; this.imgEl.removeAttribute('loading'); this.imgEl.style.opacity = '1'; this.imgEl.style.transform = 'scale(1)'; }, 120); const total = this.images.length; if (total > 1) { this.counterEl.textContent = ${this.currentIndex + 1} / ${total}; this.prevBtn.style.display = ''; this.nextBtn.style.display = ''; } else { this.counterEl.textContent = ''; this.prevBtn.style.display = 'none'; this.nextBtn.style.display = 'none'; } } } new Lightbox(); </script>
</body>
</html>