{"instruction": "Ukaž čistý Python kód: clamp value.", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} {"instruction": "Vysvětli pojem CI/CD česky a stručně.", "input": "", "output": "CI automaticky testuje a buildí při změně kódu. CD automaticky nasazuje (nebo připravuje nasazení) po úspěšném CI."} {"instruction": "Kolik je 16 × 12?", "input": "", "output": "16 × 12 = 192"} {"instruction": "Write a Python function `write_text` that zapíše text do souboru.", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} {"instruction": "Spočítej: 11 + 13 = ?", "input": "", "output": "11 + 13 = 24"} {"instruction": "Kolik je 12 × 7?", "input": "", "output": "12 × 7 = 84"} {"instruction": "Spočítej: 25 + 2 = ?", "input": "", "output": "25 + 2 = 27"} {"instruction": "Implementuj v Pythonu bubble sort.", "input": "", "output": "```python\ndef bubble_sort(a: list[int]) -> list[int]:\n a = a[:]\n n = len(a)\n for i in range(n):\n for j in range(0, n - i - 1):\n if a[j] > a[j + 1]:\n a[j], a[j + 1] = a[j + 1], a[j]\n return a\n```"} {"instruction": "What is 11 - 5?", "input": "", "output": "11 - 5 = 6"} {"instruction": "Spočítej 8×10", "input": "", "output": "8 × 10 = 80"} {"instruction": "Kolik je 8 × 14?", "input": "", "output": "8 × 14 = 112"} {"instruction": "Kolik je 10 × 5?", "input": "", "output": "10 × 5 = 50"} {"instruction": "Kolik je 6 × 10?", "input": "", "output": "6 × 10 = 60"} {"instruction": "Spočítej 20×7", "input": "", "output": "20 × 7 = 140"} {"instruction": "Spočítej: 29 + 13 = ?", "input": "", "output": "29 + 13 = 42"} {"instruction": "Kolik je 10 - 2?", "input": "", "output": "10 - 2 = 8"} {"instruction": "Umíš německy / francouzsky / španělsky / polsky / ruštinu? Buď upřímný.", "input": "", "output": "Ne na úrovni, se kterou by ses mohl spolehnout. Komunikuju česky a anglicky. Ostatní jazyky radši nepřekládám, abych nepletl."} {"instruction": "Vysvětli terminál?", "input": "", "output": "Terminál je textové rozhraní pro spouštění příkazů v systému."} {"instruction": "Implement `sum_list` in Python (sečte čísla v seznamu).", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} {"instruction": "Spočítej 11×10", "input": "", "output": "11 × 10 = 110"} {"instruction": "Co je cache?", "input": "", "output": "Cache dočasně ukládá výsledky, aby se nemusely počítat/stahovat znovu."} {"instruction": "What is 19 - 4?", "input": "", "output": "19 - 4 = 15"} {"instruction": "Spočítej: 8 + 13 = ?", "input": "", "output": "8 + 13 = 21"} {"instruction": "JS: sum array", "input": "", "output": "```javascript\nconst sum = arr => arr.reduce((a,b)=>a+b, 0);\n```"} {"instruction": "Jaké jsou základní datové typy v Pythonu?", "input": "", "output": "int, float, bool, str, list, tuple, dict, set, NoneType. Od 3.9+ i type hints jako list[int], dict[str, Any]."} {"instruction": "Umíš Rust?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Rust spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Kolik je 29 - 13?", "input": "", "output": "29 - 13 = 16"} {"instruction": "Co je branch?", "input": "", "output": "Branch je větev historie — oddělená linka vývoje, kterou pak sloučíš do main."} {"instruction": "Co je commit? (stručně)", "input": "", "output": "Commit je uložený snímek změn v Gitu s popisem, co a proč se změnilo."} {"instruction": "Semantic HTML: článek s header a footer.", "input": "", "output": "```html\n
\n

Titulek

Úvod

\n

Text článku…

\n \n
\n```"} {"instruction": "Spočítej: 9 + 3 = ?", "input": "", "output": "9 + 3 = 12"} {"instruction": "Napiš JS: vrať pole čísel 1..16.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 16}, (_, i) => i + 1);\n```"} {"instruction": "Napiš SQL: vyber 2 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 2;\n```"} {"instruction": "Potřebuju Python helper `retry`: zavolá fn max n-krát při výjimce.", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} {"instruction": "Napiš v JavaScriptu: parse JSON safe.", "input": "", "output": "```javascript\nfunction safeJson(s, fallback=null) {\n try { return JSON.parse(s); } catch { return fallback; }\n}\n```"} {"instruction": "Implementuj v Pythonu unique preserve order.", "input": "", "output": "```python\ndef unique(seq):\n seen = set()\n out = []\n for x in seq:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out\n```"} {"instruction": "Spočítej: 22 + 11 = ?", "input": "", "output": "22 + 11 = 33"} {"instruction": "Napiš 3 tipy na produktivitu při programování.", "input": "", "output": "1) Rozděl problém na malé kroky.\n2) Piš testy nebo aspoň rychlé ověření.\n3) Commituj často a pojmenovávej změny srozumitelně."} {"instruction": "XSS — co to je a jak bránit v PHP/HTML?", "input": "", "output": "XSS = útočník vloží JS do stránky. Bránit: escapovat výstup (`htmlspecialchars`), Content-Security-Policy, nevěřit HTML od uživatele."} {"instruction": "Zdravím tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Spočítej: 16 + 14 = ?", "input": "", "output": "16 + 14 = 30"} {"instruction": "Napiš Python funkci: vrátí prvních n prvků (`first_n`).", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} {"instruction": "Spočítej: 4 + 5 = ?", "input": "", "output": "4 + 5 = 9"} {"instruction": "Umíš Scala?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Scala spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Co je HTTP?", "input": "", "output": "HTTP je protokol, kterým si prohlížeč a server posílají webové stránky a API data. Metody: GET (čtení), POST (odeslání), PUT/PATCH (úprava), DELETE (smazání)."} {"instruction": "Ahoj!", "input": "", "output": "Ahoj! S čím pomoct?"} {"instruction": "Spočítej: 8 + 4 = ?", "input": "", "output": "8 + 4 = 12"} {"instruction": "Write a Python function `strip_ws` that odstraní whitespace.", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} {"instruction": "Co je cache? (stručně)", "input": "", "output": "Cache dočasně ukládá výsledky, aby se nemusely počítat/stahovat znovu."} {"instruction": "Napiš mini CLI TODO v Pythonu (add/list) v paměti. Komentáře piš česky.", "input": "", "output": "```python\nclass Todo:\n def __init__(self):\n self.items = []\n def add(self, title: str) -> None:\n self.items.append({\"title\": title, \"done\": False})\n def list(self) -> None:\n for i, it in enumerate(self.items, 1):\n mark = \"x\" if it[\"done\"] else \" \"\n print(f\"{i}. [{mark}] {it['title']}\")\n\nif __name__ == \"__main__\":\n t = Todo()\n t.add(\"Naučit se Python\")\n t.add(\"Napsat testy\")\n t.list()\n```"} {"instruction": "Spočítej 17×10", "input": "", "output": "17 × 10 = 170"} {"instruction": "Kolik je 16 × 2?", "input": "", "output": "16 × 2 = 32"} {"instruction": "Ukaž Python kód — is palindrome.", "input": "", "output": "```python\ndef is_palindrome(s):\n t = ''.join(c.lower() for c in s if c.isalnum())\n return t == t[::-1]\n```"} {"instruction": "Hello tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Kolik je 13 - 11?", "input": "", "output": "13 - 11 = 2"} {"instruction": "Kolik je 14 × 14?", "input": "", "output": "14 × 14 = 196"} {"instruction": "Napiš funkci v Pythonu: clamp value.", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} {"instruction": "Přelož do angličtiny: Zítra jdu k lékaři.", "input": "", "output": "Tomorrow I'm going to the doctor."} {"instruction": "Spočítej: 18 + 6 = ?", "input": "", "output": "18 + 6 = 24"} {"instruction": "zdravím", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Čau! tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Spočítej 5×2", "input": "", "output": "5 × 2 = 10"} {"instruction": "Čau tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "JS: Cannot read property of undefined", "input": "", "output": "Saháš na vlastnost `undefined`. Zkontroluj optional chaining: `user?.name`, nebo nejdřív existenci objektu."} {"instruction": "HTML formulář: jméno + e-mail + submit.", "input": "", "output": "```html\n
\n \n \n \n
\n```"} {"instruction": "Python requests GET s timeoutem.", "input": "", "output": "```python\nimport requests\nr = requests.get(\"https://example.com\", timeout=10)\nr.raise_for_status()\nprint(r.text[:500])\n```"} {"instruction": "Translate to German: Hello", "input": "", "output": "Němčinu spolehlivě neumím. Anglicky: Hello. Česky: Ahoj. Pokud potřebuješ němčinu, použij překladač nebo rodilého mluvčího."} {"instruction": "Kolik je 27 - 3?", "input": "", "output": "27 - 3 = 24"} {"instruction": "Potřebuju Python helper `count_vowels`: spočítej samohlásky v textu.", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} {"instruction": "Spočítej 15×6", "input": "", "output": "15 × 6 = 90"} {"instruction": "Umíš Rust?", "input": "", "output": "Ne. Specializuju se na Python, JavaScript, HTML a PHP. S Rustem ti spolehlivě nepomůžu — zkus oficiální docs nebo někoho, kdo Rust umí."} {"instruction": "Ukaž čistý kód: zopakuje řetězec n-krát. Pojmenuj funkci `repeat_str`.", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} {"instruction": "Spočítej: 3 + 9 = ?", "input": "", "output": "3 + 9 = 12"} {"instruction": "Kolik je 22 - 2?", "input": "", "output": "22 - 2 = 20"} {"instruction": "Kolik je 10 × 8?", "input": "", "output": "10 × 8 = 80"} {"instruction": "Napiš řešení v Pythonu: Best time to buy/sell stock once.", "input": "", "output": "```python\ndef max_profit(prices: list[int]) -> int:\n best = 0\n lo = prices[0]\n for p in prices[1:]:\n best = max(best, p - lo)\n lo = min(lo, p)\n return best\n```"} {"instruction": "hey", "input": "", "output": "Ahoj! Napiš úkol — klidně česky nebo anglicky, případně kód v Python/JS/HTML/PHP."} {"instruction": "Spočítej: 18 + 3 = ?", "input": "", "output": "18 + 3 = 21"} {"instruction": "Vysvětli API?", "input": "", "output": "API je rozhraní, přes které spolu programy komunikují — často přes HTTP a JSON."} {"instruction": "Spočítej 14×10", "input": "", "output": "14 × 10 = 140"} {"instruction": "Kolik je 24 - 4?", "input": "", "output": "24 - 4 = 20"} {"instruction": "Kolik je 6 × 7?", "input": "", "output": "6 × 7 = 42"} {"instruction": "Spočítej: 17 + 7 = ?", "input": "", "output": "17 + 7 = 24"} {"instruction": "Spočítej 10×7", "input": "", "output": "10 × 7 = 70"} {"instruction": "Co je SQL JOIN?", "input": "", "output": "JOIN spojuje řádky z více tabulek podle podmínky. INNER JOIN jen shody, LEFT JOIN všechny z levé + případné z pravé."} {"instruction": "Napiš JS: vrať pole čísel 1..6.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 6}, (_, i) => i + 1);\n```"} {"instruction": "Write C# code for a hello world.", "input": "", "output": "I don't cover C#. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Kolik je 26 - 2?", "input": "", "output": "26 - 2 = 24"} {"instruction": "Implement `group_by` in Python (seskupí list dictů podle klíče).", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} {"instruction": "Zdravím tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "Jaký je rozdíl mezi == a === v JavaScriptu?", "input": "", "output": "`==` porovnává s převodem typů, `===` bez převodu (striktní). Preferuj `===`, ať se vyhneš překvapením."} {"instruction": "Kolik je 17 - 11?", "input": "", "output": "17 - 11 = 6"} {"instruction": "Oprav češtinu: potrebuju pomoct s pythonem", "input": "", "output": "Potřebuju pomoct s Pythonem."} {"instruction": "Ahoj", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Spočítej: 17 + 4 = ?", "input": "", "output": "17 + 4 = 21"} {"instruction": "Napiš v Pythonu flatten nested list one level.", "input": "", "output": "```python\ndef flatten(xs):\n out = []\n for x in xs:\n if isinstance(x, list):\n out.extend(x)\n else:\n out.append(x)\n return out\n```"} {"instruction": "Čau, co děláš?", "input": "", "output": "Ahoj! Jsem připravený pomoct — s kódem, češtinou, vysvětlením nebo čímkoli dalším."} {"instruction": "Kolik je 22 × 2?", "input": "", "output": "22 × 2 = 44"} {"instruction": "Kolik je 26 - 6?", "input": "", "output": "26 - 6 = 20"} {"instruction": "Implementuj `group_by` v Pythonu — seskupí list dictů podle klíče.", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} {"instruction": "Kolik je 15 - 9?", "input": "", "output": "15 - 9 = 6"} {"instruction": "Kolik je 23 - 3?", "input": "", "output": "23 - 3 = 20"} {"instruction": "Kolik je 18 - 2?", "input": "", "output": "18 - 2 = 16"} {"instruction": "Napiš krátký e-mail: omluva za zpoždění dodávky.", "input": "", "output": "Předmět: Omluva za zpoždění\n\nDobrý den,\nomlouváme se za zpoždění dodávky. Zboží odešleme co nejdříve a dáme vědět tracking.\n\nS pozdravem"} {"instruction": "Write Haskell code for a hello world.", "input": "", "output": "I don't cover Haskell. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Kolik je 14 × 10?", "input": "", "output": "14 × 10 = 140"} {"instruction": "Spočítej: 2 + 10 = ?", "input": "", "output": "2 + 10 = 12"} {"instruction": "Kolik je 6 × 3?", "input": "", "output": "6 × 3 = 18"} {"instruction": "Kolik je 4 × 12?", "input": "", "output": "4 × 12 = 48"} {"instruction": "Napiš regex pro e-mail (jednoduchý).", "input": "", "output": "Jednoduchý vzor: `^[\\w.+-]+@[\\w-]+\\.[\\w.-]+$`. Pro produkci raději knihovnu/validátor — plná RFC regex je složitá."} {"instruction": "Přepiš spisovně: napsal jsem kod", "input": "", "output": "Napsal jsem kód."} {"instruction": "Oprav kód:\n```python\nx = 1\nif x = 1: print('ok')\n```", "input": "", "output": "Použij porovnání `==`: `if x == 1: print('ok')`.\n\nOpravená verze podle vysvětlení výše."} {"instruction": "Přelož do češtiny: How do I install packages?", "input": "", "output": "Jak nainstaluju balíčky?"} {"instruction": "Umíš TypeScript? Buď upřímný.", "input": "", "output": "TypeScript beru jako nadstavbu JS — jednoduché typy ano, ale nejsem TS specialista. Spolehlivě: JavaScript, Python, HTML, PHP."} {"instruction": "Write a Python function `first_n` that vrátí prvních n prvků.", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} {"instruction": "Proč tento kód padá?\n```python\nprint 'hello'\n```", "input": "", "output": "V Pythonu 3 musíš volat funkci: `print('hello')`."} {"instruction": "Kolik je 8 × 2?", "input": "", "output": "8 × 2 = 16"} {"instruction": "Spočítej 20×6", "input": "", "output": "20 × 6 = 120"} {"instruction": "Ukaž JavaScript — sleep.", "input": "", "output": "```javascript\nconst sleep = ms => new Promise(r => setTimeout(r, ms));\n```"} {"instruction": "Spočítej: 17 + 13 = ?", "input": "", "output": "17 + 13 = 30"} {"instruction": "Python: list comprehension sudá čísla 0..20.", "input": "", "output": "```python\nevens = [x for x in range(21) if x % 2 == 0]\n```"} {"instruction": "Spočítej 20×11", "input": "", "output": "20 × 11 = 220"} {"instruction": "Implement `strip_ws` in Python (odstraní whitespace).", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} {"instruction": "Co je branch? (stručně)", "input": "", "output": "Branch je větev historie — oddělená linka vývoje, kterou pak sloučíš do main."} {"instruction": "Fix: list = [1,2,3]; list.append(list)", "input": "", "output": "That creates a self-referential list (infinite nesting when printed). Append a copy or another value:\n```python\nlst = [1, 2, 3]\nlst.append(4)\n# or lst.extend([4, 5])\n```\nAlso avoid shadowing builtin `list`."} {"instruction": "Spočítej: 5 + 13 = ?", "input": "", "output": "5 + 13 = 18"} {"instruction": "Co je API?", "input": "", "output": "API je rozhraní, přes které spolu programy komunikují — často přes HTTP a JSON."} {"instruction": "Jak v Pythonu udělám deep copy slovníku?", "input": "", "output": "```python\nimport copy\nnew = copy.deepcopy(original)\n```\nPozor: `dict(original)` nebo `original.copy()` je jen mělká kopie."} {"instruction": "Spočítej 17×5", "input": "", "output": "17 × 5 = 85"} {"instruction": "What is 23 - 8?", "input": "", "output": "23 - 8 = 15"} {"instruction": "Dobrý den tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "jsi kokot?", "input": "", "output": "Ne. Pojďme k věci — s čím pomoct?"} {"instruction": "Kolik je 22 × 6?", "input": "", "output": "22 × 6 = 132"} {"instruction": "Kolik je 20 × 6?", "input": "", "output": "20 × 6 = 120"} {"instruction": "Umíš Swift?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Swift spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Díky", "input": "", "output": "Není zač."} {"instruction": "Spočítej 20×8", "input": "", "output": "20 × 8 = 160"} {"instruction": "Kolik je 4 × 5?", "input": "", "output": "4 × 5 = 20"} {"instruction": "Napiš Python funkci: převod na velká písmena (`to_upper`).", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} {"instruction": "Napiš řešení v Pythonu: Two Sum: najdi indexy dvou čísel se součtem target.", "input": "", "output": "```python\ndef two_sum(nums: list[int], target: int) -> list[int]:\n seen = {}\n for i, x in enumerate(nums):\n need = target - x\n if need in seen:\n return [seen[need], i]\n seen[x] = i\n raise ValueError(\"nenalezeno\")\n```"} {"instruction": "Napiš v Pythonu clamp value.", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} {"instruction": "Oprav kód:\n```python\nd = {}\nprint(d['a'])\n```", "input": "", "output": "Klíč nemusí existovat — použij `d.get('a')` nebo `if 'a' in d`.\n\nOpravená verze podle vysvětlení výše."} {"instruction": "Vysvětli pojem REST vs GraphQL česky a stručně.", "input": "", "output": "REST má více endpointů pro zdroje. GraphQL má jeden endpoint a klient si řekne přesně o pole, která chce — méně over-fetchingu, složitější server."} {"instruction": "Kolik je 12 - 2?", "input": "", "output": "12 - 2 = 10"} {"instruction": "Kolik je 2 × 13?", "input": "", "output": "2 × 13 = 26"} {"instruction": "Kolik je 17 - 3?", "input": "", "output": "17 - 3 = 14"} {"instruction": "Spočítej: 26 + 7 = ?", "input": "", "output": "26 + 7 = 33"} {"instruction": "Napiš JS: vrať pole čísel 1..8.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 8}, (_, i) => i + 1);\n```"} {"instruction": "Spočítej: 19 + 14 = ?", "input": "", "output": "19 + 14 = 33"} {"instruction": "Shrň v 2 větách, co je umělá inteligence.", "input": "", "output": "Umělá inteligence jsou systémy, které se učí vzory z dat a řeší úlohy jako text, obraz nebo rozhodování. Dnes často běží na neuronových sítích trénovaných na velkých korpusech."} {"instruction": "Kolik je 24 × 7?", "input": "", "output": "24 × 7 = 168"} {"instruction": "Spočítej: 27 + 9 = ?", "input": "", "output": "27 + 9 = 36"} {"instruction": "thx", "input": "", "output": "Anytime."} {"instruction": "Kolik je 16 - 8?", "input": "", "output": "16 - 8 = 8"} {"instruction": "Napiš SQL: vyber 18 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 18;\n```"} {"instruction": "Python function for: word count", "input": "", "output": "```python\nfrom collections import Counter\nimport re\ndef word_count(text):\n return dict(Counter(re.findall(r'\\w+', text.lower())))\n```"} {"instruction": "Jaké je počasí?", "input": "", "output": "Počasí v reálném čase nemám. Zkus meteo.cz, yr.no nebo předpověď v telefonu."} {"instruction": "Python FastAPI hello endpoint.", "input": "", "output": "```python\nfrom fastapi import FastAPI\napp = FastAPI()\n\n@app.get(\"/\")\ndef root():\n return {\"ok\": True, \"msg\": \"hello\"}\n```"} {"instruction": "Kolik je 24 × 6?", "input": "", "output": "24 × 6 = 144"} {"instruction": "Přelož do češtiny: The train leaves at noon.", "input": "", "output": "Vlak odjíždí v poledne."} {"instruction": "Kolik je 2 × 5?", "input": "", "output": "2 × 5 = 10"} {"instruction": "Zdravím tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Ahoj!", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "Kolik je 14 × 7?", "input": "", "output": "14 × 7 = 98"} {"instruction": "Co je latency?", "input": "", "output": "Latence je zpoždění — jak dlouho trvá, než přijde odpověď."} {"instruction": "Kolik je 12 × 12?", "input": "", "output": "12 × 12 = 144"} {"instruction": "Kolik je 28 - 4?", "input": "", "output": "28 - 4 = 24"} {"instruction": "What is 7 - 4?", "input": "", "output": "7 - 4 = 3"} {"instruction": "Spočítej 15×10", "input": "", "output": "15 × 10 = 150"} {"instruction": "Vymysli odpověď v japonštině.", "input": "", "output": "Japonštinu neumím. Můžu odpovědět česky nebo anglicky."} {"instruction": "Implement `last_n` in Python (vrátí posledních n prvků).", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} {"instruction": "Jak funguje for cyklus?", "input": "", "output": "For prochází sekvenci prvek po prvku. V Pythonu: `for x in items: ...`. V C-like jazycích často `for (init; cond; step)`."} {"instruction": "What is 24 - 3?", "input": "", "output": "24 - 3 = 21"} {"instruction": "Napiš Python decorator @timer, který změří běh funkce.", "input": "", "output": "```python\nimport time\nfrom functools import wraps\n\ndef timer(fn):\n @wraps(fn)\n def wrapper(*args, **kwargs):\n t0 = time.perf_counter()\n try:\n return fn(*args, **kwargs)\n finally:\n dt = time.perf_counter() - t0\n print(f\"{fn.__name__} took {dt:.3f}s\")\n return wrapper\n```"} {"instruction": "Kolik je 16 × 5?", "input": "", "output": "16 × 5 = 80"} {"instruction": "Spočítej: 15 + 9 = ?", "input": "", "output": "15 + 9 = 24"} {"instruction": "Kolik je 22 × 3?", "input": "", "output": "22 × 3 = 66"} {"instruction": "Implementuj `sum_list` v Pythonu — sečte čísla v seznamu.", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} {"instruction": "Kolik je 2 × 8?", "input": "", "output": "2 × 8 = 16"} {"instruction": "Ukaž Python kód — sum list.", "input": "", "output": "```python\ndef sum_list(xs):\n return sum(xs)\n```"} {"instruction": "Write a Python function `sum_list` that sečte čísla v seznamu.", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} {"instruction": "Napiš Python funkci: sečte čísla v seznamu (`sum_list`).", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} {"instruction": "Write MATLAB code for a hello world.", "input": "", "output": "I don't cover MATLAB. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Kolik je 19 - 5?", "input": "", "output": "19 - 5 = 14"} {"instruction": "Kolik je 25 - 13?", "input": "", "output": "25 - 13 = 12"} {"instruction": "Python function for: csv avg", "input": "", "output": "```python\nimport csv\ndef avg_col(path, col):\n with open(path, newline='', encoding='utf-8') as f:\n vals = [float(r[col]) for r in csv.DictReader(f)]\n return sum(vals)/len(vals) if vals else 0.0\n```"} {"instruction": "Python function for: read lines", "input": "", "output": "```python\ndef read_lines(path):\n with open(path, encoding='utf-8') as f:\n return f.read().splitlines()\n```"} {"instruction": "Kolik je 12 × 5?", "input": "", "output": "12 × 5 = 60"} {"instruction": "Spočítej 6×5", "input": "", "output": "6 × 5 = 30"} {"instruction": "Ukaž čistý Python kód: reverse string.", "input": "", "output": "```python\ndef rev(s: str) -> str:\n return s[::-1]\n```"} {"instruction": "Zdravím", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Kolik je 28 × 6?", "input": "", "output": "28 × 6 = 168"} {"instruction": "Napiš SQL: vyber 12 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 12;\n```"} {"instruction": "Python: přečti JSON soubor.", "input": "", "output": "```python\nimport json\nwith open(\"data.json\", encoding=\"utf-8\") as f:\n data = json.load(f)\n```"} {"instruction": "Napiš SQL: vyber 4 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 4;\n```"} {"instruction": "Napiš Python funkci: prohodí klíče a hodnoty (unikátní) (`invert_dict`).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} {"instruction": "Vysvětli třída?", "input": "", "output": "Třída je šablona pro objekty — definuje data (atributy) a chování (metody)."} {"instruction": "Napiš mini CLI TODO v Pythonu (add/list) v paměti.", "input": "", "output": "```python\nclass Todo:\n def __init__(self):\n self.items = []\n def add(self, title: str) -> None:\n self.items.append({\"title\": title, \"done\": False})\n def list(self) -> None:\n for i, it in enumerate(self.items, 1):\n mark = \"x\" if it[\"done\"] else \" \"\n print(f\"{i}. [{mark}] {it['title']}\")\n\nif __name__ == \"__main__\":\n t = Todo()\n t.add(\"Naučit se Python\")\n t.add(\"Napsat testy\")\n t.list()\n```"} {"instruction": "Ukaž JavaScript — query sel.", "input": "", "output": "```javascript\nconst $ = sel => document.querySelector(sel);\n```"} {"instruction": "Co je knihovna? (stručně)", "input": "", "output": "Knihovna je sada funkcí/modulů, které použiješ ve svém kódu (requests, numpy)."} {"instruction": "Translate to that language (korejsky): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "Spočítej: 22 + 5 = ?", "input": "", "output": "22 + 5 = 27"} {"instruction": "Kolik je 23 - 13?", "input": "", "output": "23 - 13 = 10"} {"instruction": "Spočítej 18×10", "input": "", "output": "18 × 10 = 180"} {"instruction": "Kolik je 2 × 14?", "input": "", "output": "2 × 14 = 28"} {"instruction": "Spočítej 5×11", "input": "", "output": "5 × 11 = 55"} {"instruction": "Translate to that language (ukrajinsky): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "Kolik je 18 - 8?", "input": "", "output": "18 - 8 = 10"} {"instruction": "Kolik je 6 × 12?", "input": "", "output": "6 × 12 = 72"} {"instruction": "Spočítej 15×4", "input": "", "output": "15 × 4 = 60"} {"instruction": "Spočítej: 21 + 6 = ?", "input": "", "output": "21 + 6 = 27"} {"instruction": "Vysvětli databáze?", "input": "", "output": "Databáze ukládá strukturovaná data tak, aby šla spolehlivě číst, zapisovat a dotazovat."} {"instruction": "Napiš SQL: vyber 3 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 3;\n```"} {"instruction": "Spočítej 22×10", "input": "", "output": "22 × 10 = 220"} {"instruction": "Spočítej: 23 + 4 = ?", "input": "", "output": "23 + 4 = 27"} {"instruction": "Co je bug?", "input": "", "output": "Bug je chyba v programu, kvůli které se chová jinak, než autor chtěl."} {"instruction": "Kolik je 26 - 12?", "input": "", "output": "26 - 12 = 14"} {"instruction": "Co je merge? (stručně)", "input": "", "output": "Merge spojuje změny z jedné větve do druhé a může vyžadovat řešení konfliktů."} {"instruction": "Napiš JS: vrať pole čísel 1..19.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 19}, (_, i) => i + 1);\n```"} {"instruction": "Kolik je 8 × 6?", "input": "", "output": "8 × 6 = 48"} {"instruction": "Write Java code for a hello world.", "input": "", "output": "I don't cover Java. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "kolik je 2+2?", "input": "", "output": "2 + 2 = 4."} {"instruction": "Hello!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Ukaž PHP — sum array.", "input": "", "output": "```php\nfunction sum_array(array $a): float {\n return array_sum($a);\n}\n```"} {"instruction": "Napiš binary search v Pythonu.", "input": "", "output": "```python\ndef binary_search(arr: list[int], target: int) -> int:\n lo, hi = 0, len(arr) - 1\n while lo <= hi:\n mid = (lo + hi) // 2\n if arr[mid] == target:\n return mid\n if arr[mid] < target:\n lo = mid + 1\n else:\n hi = mid - 1\n return -1\n```"} {"instruction": "Kolik je 22 × 5?", "input": "", "output": "22 × 5 = 110"} {"instruction": "Spočítej: 25 + 14 = ?", "input": "", "output": "25 + 14 = 39"} {"instruction": "Napiš v Pythonu: csv avg.", "input": "", "output": "```python\nimport csv\ndef avg_col(path, col):\n with open(path, newline='', encoding='utf-8') as f:\n vals = [float(r[col]) for r in csv.DictReader(f)]\n return sum(vals)/len(vals) if vals else 0.0\n```"} {"instruction": "Translate to that language (francouzsky): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "Proč tento kód padá?\n```python\nxs = [1,2,3]\nfor i in range(4): print(xs[i])\n```", "input": "", "output": "Index 3 neexistuje. `range(len(xs))` nebo iteruj `for x in xs`."} {"instruction": "Napiš FastAPI CRUD kostru pro poznámky (in-memory). Komentáře piš česky.", "input": "", "output": "```python\nfrom fastapi import FastAPI, HTTPException\nfrom pydantic import BaseModel\n\napp = FastAPI()\nDB: dict[int, dict] = {}\n_seq = 0\n\nclass NoteIn(BaseModel):\n text: str\n\n@app.get(\"/notes\")\ndef list_notes():\n return list(DB.values())\n\n@app.post(\"/notes\")\ndef create_note(body: NoteIn):\n global _seq\n _seq += 1\n DB[_seq] = {\"id\": _seq, \"text\": body.text}\n return DB[_seq]\n\n@app.get(\"/notes/{note_id}\")\ndef get_note(note_id: int):\n if note_id not in DB:\n raise HTTPException(404)\n return DB[note_id]\n```"} {"instruction": "Ukaž čistý kód: seskupí list dictů podle klíče. Pojmenuj funkci `group_by`.", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} {"instruction": "Kolik je 14 × 11?", "input": "", "output": "14 × 11 = 154"} {"instruction": "Napiš v JavaScriptu: groupBy.", "input": "", "output": "```javascript\nfunction groupBy(arr, key) {\n return arr.reduce((m, x) => {\n (m[x[key]] ||= []).push(x);\n return m;\n }, {});\n}\n```"} {"instruction": "PHP PDO connect MySQL.", "input": "", "output": "```php\n PDO::ERRMODE_EXCEPTION]\n);\n```"} {"instruction": "Kolik je 16 - 12?", "input": "", "output": "16 - 12 = 4"} {"instruction": "Přelož do češtiny: Create a new branch.", "input": "", "output": "Vytvoř novou větev."} {"instruction": "Spočítej 12×10", "input": "", "output": "12 × 10 = 120"} {"instruction": "Kolik je 8 × 9?", "input": "", "output": "8 × 9 = 72"} {"instruction": "What is 18 - 3?", "input": "", "output": "18 - 3 = 15"} {"instruction": "Ukaž čistý kód: seřadí klíče slovníku. Pojmenuj funkci `dict_keys`.", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} {"instruction": "Spočítej 5×3", "input": "", "output": "5 × 3 = 15"} {"instruction": "Kolik je 22 - 8?", "input": "", "output": "22 - 8 = 14"} {"instruction": "Write a Python function `group_by` that seskupí list dictů podle klíče.", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} {"instruction": "Co všechno programuješ?", "input": "", "output": "Primárně: Python, JavaScript, HTML a PHP. Web front (HTML/JS/CSS), jednoduchý backend (PHP/Python), skripty. Ne: mobilní nativní appky, embedded, Rust/Go/Java/C++ jako hlavní stack."} {"instruction": "Kolik je 12 × 14?", "input": "", "output": "12 × 14 = 168"} {"instruction": "Potřebuju Python helper `strip_ws`: odstraní whitespace.", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} {"instruction": "CSS: responsive container max 960px.", "input": "", "output": "```css\n.container {\n width: min(100% - 2rem, 960px);\n margin-inline: auto;\n}\n```"} {"instruction": "Vysvětli Python?", "input": "", "output": "Python je vysokoúrovňový programovací jazyk s jednoduchou syntaxí. Hodí se na web, data, skripty i AI."} {"instruction": "Vysvětli open source?", "input": "", "output": "Open source znamená, že je dostupný zdrojový kód a licence dovoluje studium i úpravy."} {"instruction": "Kolik je 11 - 5?", "input": "", "output": "11 - 5 = 6"} {"instruction": "Jak udělat venv v Pythonu?", "input": "", "output": "```bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```"} {"instruction": "Napiš HTML: script defer.", "input": "", "output": "```html\n\n```"} {"instruction": "Ahoj tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "What is 17 - 2?", "input": "", "output": "17 - 2 = 15"} {"instruction": "Kolik je 15 - 3?", "input": "", "output": "15 - 3 = 12"} {"instruction": "Napiš SQL: vyber 16 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 16;\n```"} {"instruction": "JS: query sel", "input": "", "output": "```javascript\nconst $ = sel => document.querySelector(sel);\n```"} {"instruction": "Spočítej: 23 + 13 = ?", "input": "", "output": "23 + 13 = 36"} {"instruction": "Spočítej: 12 + 12 = ?", "input": "", "output": "12 + 12 = 24"} {"instruction": "Kolik je 28 - 10?", "input": "", "output": "28 - 10 = 18"} {"instruction": "Ukaž HTML — nav list.", "input": "", "output": "```html\n\n```"} {"instruction": "Kolik je 22 × 9?", "input": "", "output": "22 × 9 = 198"} {"instruction": "Umíš TypeScript?", "input": "", "output": "TypeScript beru jako nadstavbu JS — jednoduché typy ano, ale nejsem TS specialista. Spolehlivě: JavaScript, Python, HTML, PHP."} {"instruction": "Vysvětli IDE?", "input": "", "output": "IDE je vývojové prostředí s editorem, debuggerem a nástroji (VS Code, PyCharm)."} {"instruction": "Kolik je 24 × 3?", "input": "", "output": "24 × 3 = 72"} {"instruction": "Write a Python function `repeat_str` that zopakuje řetězec n-krát.", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} {"instruction": "Kolik je 12 × 11?", "input": "", "output": "12 × 11 = 132"} {"instruction": "Kolik je 18 × 4?", "input": "", "output": "18 × 4 = 72"} {"instruction": "Potřebuju Python helper `repeat_str`: zopakuje řetězec n-krát.", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} {"instruction": "Kolik je 14 - 10?", "input": "", "output": "14 - 10 = 4"} {"instruction": "Ahoj! tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "co umíš?", "input": "", "output": "Pomáhám s programováním, vysvětlováním, češtinou, návrhem kódu a debugováním. Napiš konkrétní úkol."} {"instruction": "Jak uložit heslo v PHP?", "input": "", "output": "```php\n$hash = password_hash($password, PASSWORD_DEFAULT);\n// ověření:\npassword_verify($password, $hash);\n```\nNikdy plaintext."} {"instruction": "Kolik je 20 - 2?", "input": "", "output": "20 - 2 = 18"} {"instruction": "Kolik je 8 × 13?", "input": "", "output": "8 × 13 = 104"} {"instruction": "Ahoj!", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Kolik je 20 × 2?", "input": "", "output": "20 × 2 = 40"} {"instruction": "Díky moc.", "input": "", "output": "Není zač. Když budeš něco dalšího, napiš."} {"instruction": "Napiš Python funkci: zapíše text do souboru (`write_text`).", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} {"instruction": "Kolik je 28 - 6?", "input": "", "output": "28 - 6 = 22"} {"instruction": "čau", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Spočítej 10×3", "input": "", "output": "10 × 3 = 30"} {"instruction": "Zdravím!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Napiš v Pythonu bubble sort.", "input": "", "output": "```python\ndef bubble_sort(a: list[int]) -> list[int]:\n a = a[:]\n n = len(a)\n for i in range(n):\n for j in range(0, n - i - 1):\n if a[j] > a[j + 1]:\n a[j], a[j + 1] = a[j + 1], a[j]\n return a\n```"} {"instruction": "Napiš JS: vrať pole čísel 1..14.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 14}, (_, i) => i + 1);\n```"} {"instruction": "Napiš v JavaScriptu: sleep.", "input": "", "output": "```javascript\nconst sleep = ms => new Promise(r => setTimeout(r, ms));\n```"} {"instruction": "Spočítej 6×10", "input": "", "output": "6 × 10 = 60"} {"instruction": "Spočítej: 22 + 8 = ?", "input": "", "output": "22 + 8 = 30"} {"instruction": "Super, díky", "input": "", "output": "Jasně — kdyby co, napiš."} {"instruction": "Jak se správně vítá v obchodním e-mailu česky?", "input": "", "output": "Běžně: „Dobrý den,“ a na konci „S pozdravem“ + jméno. Mezi známými lze „Ahoj,“."} {"instruction": "Jak bezpečně uložit heslo do databáze?", "input": "", "output": "Nikdy plaintext. Použij pomalý hash s solí: Argon2id, bcrypt nebo scrypt. V Pythonu např. `argon2-cffi` nebo `passlib`."} {"instruction": "Write C++ code for a hello world.", "input": "", "output": "I don't cover C++. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Vysvětli framework?", "input": "", "output": "Framework je připravená kostra aplikace s pravidly a nástroji (Django, React, Spring)."} {"instruction": "PHP session start example.", "input": "", "output": "```php\n list[int]:\n seen = {}\n for i, x in enumerate(nums):\n need = target - x\n if need in seen:\n return [seen[need], i]\n seen[x] = i\n raise ValueError(\"nenalezeno\")\n```"} {"instruction": "Napiš HTML: nav list.", "input": "", "output": "```html\n\n```"} {"instruction": "Translate to English: Vytvoř novou větev.", "input": "", "output": "Create a new branch."} {"instruction": "Kolik je 20 × 5?", "input": "", "output": "20 × 5 = 100"} {"instruction": "Kolik je 18 × 9?", "input": "", "output": "18 × 9 = 162"} {"instruction": "Kolik je 8 × 10?", "input": "", "output": "8 × 10 = 80"} {"instruction": "Hey tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Write Rust code for a hello world.", "input": "", "output": "I don't cover Rust. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Vysvětli OOP česky.", "input": "", "output": "Objektově orientované programování modeluje svět jako objekty: třídy definují šablonu, objekty jsou instance. Důležité koncepty: zapouzdření, dědičnost, polymorfismus."} {"instruction": "Spočítej: 7 + 2 = ?", "input": "", "output": "7 + 2 = 9"} {"instruction": "Spočítej: 21 + 3 = ?", "input": "", "output": "21 + 3 = 24"} {"instruction": "HTML snippet: script defer", "input": "", "output": "```html\n\n```"} {"instruction": "Napiš skript, který spočítá řádky ve všech .py souborech ve složce. Komentáře piš česky.", "input": "", "output": "```python\nfrom pathlib import Path\n\ndef count_py_lines(root: str = \".\") -> int:\n total = 0\n for p in Path(root).rglob(\"*.py\"):\n total += sum(1 for _ in p.open(encoding=\"utf-8\", errors=\"ignore\"))\n return total\n\nif __name__ == \"__main__\":\n print(count_py_lines())\n```"} {"instruction": "Přelož do češtiny: The server is down.", "input": "", "output": "Server neběží / je vypnutý."} {"instruction": "kdo je debil?", "input": "", "output": "To nehodnotím. Můžu pomoct s programováním nebo otázkou."} {"instruction": "říkej pořád jak se jmenuješ", "input": "", "output": "Stačí se zeptat na jméno, když to potřebuješ. Jinak jdu rovnou k úkolu. Co řešíme?"} {"instruction": "Napiš v Pythonu: word count.", "input": "", "output": "```python\nfrom collections import Counter\nimport re\ndef word_count(text):\n return dict(Counter(re.findall(r'\\w+', text.lower())))\n```"} {"instruction": "Mluv polsky.", "input": "", "output": "Tohle jazyk spolehlivě neovládám. Můžu česky nebo anglicky."} {"instruction": "JS: sleep", "input": "", "output": "```javascript\nconst sleep = ms => new Promise(r => setTimeout(r, ms));\n```"} {"instruction": "Spočítej: 16 + 2 = ?", "input": "", "output": "16 + 2 = 18"} {"instruction": "Díky!", "input": "", "output": "Není zač. Kdybys něco potřeboval, klidně napiš."} {"instruction": "Kolik je 14 - 6?", "input": "", "output": "14 - 6 = 8"} {"instruction": "Ukaž HTML — image alt.", "input": "", "output": "```html\n\"Popis\n```"} {"instruction": "Kolik je 21 - 3?", "input": "", "output": "21 - 3 = 18"} {"instruction": "Hello", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "What is 20 - 8?", "input": "", "output": "20 - 8 = 12"} {"instruction": "Kolik je 28 × 2?", "input": "", "output": "28 × 2 = 56"} {"instruction": "Napiš funkci v Pythonu: flatten nested list one level.", "input": "", "output": "```python\ndef flatten(xs):\n out = []\n for x in xs:\n if isinstance(x, list):\n out.extend(x)\n else:\n out.append(x)\n return out\n```"} {"instruction": "Kolik je 19 - 3?", "input": "", "output": "19 - 3 = 16"} {"instruction": "Co je algoritmus? (stručně)", "input": "", "output": "Algoritmus je přesný postup kroků k vyřešení úlohy."} {"instruction": "Kolik je 2 × 11?", "input": "", "output": "2 × 11 = 22"} {"instruction": "Spočítej 16×10", "input": "", "output": "16 × 10 = 160"} {"instruction": "Kolik je 12 × 3?", "input": "", "output": "12 × 3 = 36"} {"instruction": "Napiš funkci v Pythonu: bubble sort.", "input": "", "output": "```python\ndef bubble_sort(a: list[int]) -> list[int]:\n a = a[:]\n n = len(a)\n for i in range(n):\n for j in range(0, n - i - 1):\n if a[j] > a[j + 1]:\n a[j], a[j + 1] = a[j + 1], a[j]\n return a\n```"} {"instruction": "Python function for: merge dicts", "input": "", "output": "```python\ndef merge(a, b):\n return {**a, **b}\n```"} {"instruction": "Vysvětli pojem hash map česky a stručně.", "input": "", "output": "Hash mapa (dict) ukládá klíče přes hash do přihrádek — průměrně O(1) lookup. Klíče musí být hashable (neměnné)."} {"instruction": "Kolik je 8 × 7?", "input": "", "output": "8 × 7 = 56"} {"instruction": "PHP snippet: slugify", "input": "", "output": "```php\nfunction slugify(string $s): string {\n $s = strtolower(trim($s));\n $s = preg_replace('/[^a-z0-9]+/', '-', $s);\n return trim($s, '-');\n}\n```"} {"instruction": "Zdravím tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Kolik je 20 - 14?", "input": "", "output": "20 - 14 = 6"} {"instruction": "What is 10 - 7?", "input": "", "output": "10 - 7 = 3"} {"instruction": "Kolik je 24 × 4?", "input": "", "output": "24 × 4 = 96"} {"instruction": "Kolik je 18 - 12?", "input": "", "output": "18 - 12 = 6"} {"instruction": "Napiš Python funkci, která spočítá součet sudých čísel v seznamu.", "input": "", "output": "```python\ndef sum_even(nums: list[int]) -> int:\n return sum(x for x in nums if x % 2 == 0)\n```"} {"instruction": "Implementuj v Pythonu safe get nested dict.", "input": "", "output": "```python\ndef dig(d, *keys, default=None):\n cur = d\n for k in keys:\n if not isinstance(cur, dict) or k not in cur:\n return default\n cur = cur[k]\n return cur\n```"} {"instruction": "Mluv německy.", "input": "", "output": "Tohle jazyk spolehlivě neovládám. Můžu česky nebo anglicky."} {"instruction": "Kolik je 10 × 2?", "input": "", "output": "10 × 2 = 20"} {"instruction": "Implement `dict_keys` in Python (seřadí klíče slovníku).", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} {"instruction": "Write a Python function `count_vowels` that spočítej samohlásky v textu.", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} {"instruction": "Dobrý den", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "What is 20 - 5?", "input": "", "output": "20 - 5 = 15"} {"instruction": "Napiš SQL: vyber 10 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 10;\n```"} {"instruction": "Kolik je 20 - 10?", "input": "", "output": "20 - 10 = 10"} {"instruction": "Kolik je 20 × 3?", "input": "", "output": "20 × 3 = 60"} {"instruction": "Vysvětli branch?", "input": "", "output": "Branch je větev historie — oddělená linka vývoje, kterou pak sloučíš do main."} {"instruction": "Spočítej 5×8", "input": "", "output": "5 × 8 = 40"} {"instruction": "JS: groupBy", "input": "", "output": "```javascript\nfunction groupBy(arr, key) {\n return arr.reduce((m, x) => {\n (m[x[key]] ||= []).push(x);\n return m;\n }, {});\n}\n```"} {"instruction": "Co je terminál? (stručně)", "input": "", "output": "Terminál je textové rozhraní pro spouštění příkazů v systému."} {"instruction": "Oprav pravopis: Dneska jdu do skoly nakupit rohliki.", "input": "", "output": "Dneska jdu do školy nakoupit rohlíky."} {"instruction": "Spočítej: 25 + 11 = ?", "input": "", "output": "25 + 11 = 36"} {"instruction": "Potřebuju Python helper `is_even`: vrátí True pokud je sudé.", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} {"instruction": "What is 13 - 10?", "input": "", "output": "13 - 10 = 3"} {"instruction": "Write a Python function `is_even` that vrátí True pokud je sudé.", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} {"instruction": "Spočítej: 7 + 11 = ?", "input": "", "output": "7 + 11 = 18"} {"instruction": "Kolik je 12 - 6?", "input": "", "output": "12 - 6 = 6"} {"instruction": "Kolik je 21 - 13?", "input": "", "output": "21 - 13 = 8"} {"instruction": "Kolik je 25 - 11?", "input": "", "output": "25 - 11 = 14"} {"instruction": "Co je terminál?", "input": "", "output": "Terminál je textové rozhraní pro spouštění příkazů v systému."} {"instruction": "Napiš JS: vrať pole čísel 1..13.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 13}, (_, i) => i + 1);\n```"} {"instruction": "Co je refaktoring? (stručně)", "input": "", "output": "Refaktoring vylepšuje strukturu kódu bez změny vnějšího chování."} {"instruction": "Spočítej: 10 + 11 = ?", "input": "", "output": "10 + 11 = 21"} {"instruction": "Ukaž JavaScript — parse JSON safe.", "input": "", "output": "```javascript\nfunction safeJson(s, fallback=null) {\n try { return JSON.parse(s); } catch { return fallback; }\n}\n```"} {"instruction": "Česky stručně: co dělá git clone?", "input": "", "output": "`git clone` zkopíruje vzdálený repozitář k tobě na disk včetně historie."} {"instruction": "Napiš v Pythonu: merge dicts.", "input": "", "output": "```python\ndef merge(a, b):\n return {**a, **b}\n```"} {"instruction": "What is 15 - 6?", "input": "", "output": "15 - 6 = 9"} {"instruction": "Implementuj `last_n` v Pythonu — vrátí posledních n prvků.", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} {"instruction": "Kolik je 4 - 2?", "input": "", "output": "4 - 2 = 2"} {"instruction": "Kolik je 14 × 5?", "input": "", "output": "14 × 5 = 70"} {"instruction": "Napiš JS funkci debounce(fn, ms).", "input": "", "output": "```javascript\nfunction debounce(fn, ms) {\n let t;\n return (...args) => {\n clearTimeout(t);\n t = setTimeout(() => fn(...args), ms);\n };\n}\n```"} {"instruction": "Čau", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "Kolik je 27 - 13?", "input": "", "output": "27 - 13 = 14"} {"instruction": "Napiš v Pythonu reverse string.", "input": "", "output": "```python\ndef rev(s: str) -> str:\n return s[::-1]\n```"} {"instruction": "Ukaž PHP — json response.", "input": "", "output": "```php\nfunction json_out($data, int $code=200): void {\n http_response_code($code);\n header('Content-Type: application/json; charset=utf-8');\n echo json_encode($data, JSON_UNESCAPED_UNICODE);\n}\n```"} {"instruction": "Ukaž čistý Python kód: bubble sort.", "input": "", "output": "```python\ndef bubble_sort(a: list[int]) -> list[int]:\n a = a[:]\n n = len(a)\n for i in range(n):\n for j in range(0, n - i - 1):\n if a[j] > a[j + 1]:\n a[j], a[j + 1] = a[j + 1], a[j]\n return a\n```"} {"instruction": "Ukaž JavaScript — sum array.", "input": "", "output": "```javascript\nconst sum = arr => arr.reduce((a,b)=>a+b, 0);\n```"} {"instruction": "Napiš v Pythonu fibonacci iterative.", "input": "", "output": "```python\ndef fib(n: int) -> int:\n if n < 0:\n raise ValueError\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n```"} {"instruction": "Kolik je 17 - 5?", "input": "", "output": "17 - 5 = 12"} {"instruction": "Kolik je 14 × 13?", "input": "", "output": "14 × 13 = 182"} {"instruction": "Jaké je dnes datum?", "input": "", "output": "Aktuální datum na tvém zařízení nevidím. Najdeš ho v systémovém kalendáři."} {"instruction": "Napiš SQL stored procedure v PL/pgSQL.", "input": "", "output": "Pokročilé SQL procedury a jiné DB dialekty neberu jako svou specializaci. Základní SELECT/INSERT v SQL ti můžu naznačit, ale pro PL/pgSQL radši oficiální docs. Hlavní stack: Python, JS, HTML, PHP."} {"instruction": "Umíš Perl?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Perl spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Jak načtu JSON soubor v Pythonu?", "input": "", "output": "```python\nimport json\nwith open(\"data.json\", encoding=\"utf-8\") as f:\n data = json.load(f)\n```"} {"instruction": "Kolik je 2 × 10?", "input": "", "output": "2 × 10 = 20"} {"instruction": "Kolik je 16 × 10?", "input": "", "output": "16 × 10 = 160"} {"instruction": "Kolik je 11 - 9?", "input": "", "output": "11 - 9 = 2"} {"instruction": "What is 11 - 2?", "input": "", "output": "11 - 2 = 9"} {"instruction": "Co je databáze?", "input": "", "output": "Databáze ukládá strukturovaná data tak, aby šla spolehlivě číst, zapisovat a dotazovat."} {"instruction": "Implementuj `avg_list` v Pythonu — spočítej průměr.", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} {"instruction": "Ahoj tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Kolik je 27 - 9?", "input": "", "output": "27 - 9 = 18"} {"instruction": "Ukaž Python funkci factorial(n).", "input": "", "output": "```python\ndef factorial(n: int) -> int:\n if n < 0:\n raise ValueError(\"n >= 0\")\n r = 1\n for i in range(2, n + 1):\n r *= i\n return r\n```"} {"instruction": "PHP snippet: sum array", "input": "", "output": "```php\nfunction sum_array(array $a): float {\n return array_sum($a);\n}\n```"} {"instruction": "Kolik je 22 - 12?", "input": "", "output": "22 - 12 = 10"} {"instruction": "Spočítej: 7 + 14 = ?", "input": "", "output": "7 + 14 = 21"} {"instruction": "Kolik je 16 × 7?", "input": "", "output": "16 × 7 = 112"} {"instruction": "Co je databáze? (stručně)", "input": "", "output": "Databáze ukládá strukturovaná data tak, aby šla spolehlivě číst, zapisovat a dotazovat."} {"instruction": "What is 9 - 6?", "input": "", "output": "9 - 6 = 3"} {"instruction": "Write a Python function `invert_dict` that prohodí klíče a hodnoty (unikátní).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} {"instruction": "Kolik je 18 × 8?", "input": "", "output": "18 × 8 = 144"} {"instruction": "Kolik je 28 - 2?", "input": "", "output": "28 - 2 = 26"} {"instruction": "What is 16 - 10?", "input": "", "output": "16 - 10 = 6"} {"instruction": "Čau tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Co je IDE? (stručně)", "input": "", "output": "IDE je vývojové prostředí s editorem, debuggerem a nástroji (VS Code, PyCharm)."} {"instruction": "Kolik je 8 × 5?", "input": "", "output": "8 × 5 = 40"} {"instruction": "Co je proměnná?", "input": "", "output": "Proměnná je pojmenované místo pro hodnotu v paměti, např. `x = 10`."} {"instruction": "Spočítej: 4 + 2 = ?", "input": "", "output": "4 + 2 = 6"} {"instruction": "Kolik je 7 - 5?", "input": "", "output": "7 - 5 = 2"} {"instruction": "Ukaž Python kód — read lines.", "input": "", "output": "```python\ndef read_lines(path):\n with open(path, encoding='utf-8') as f:\n return f.read().splitlines()\n```"} {"instruction": "Co je Python? (stručně)", "input": "", "output": "Python je vysokoúrovňový programovací jazyk s jednoduchou syntaxí."} {"instruction": "Vysvětli knihovna?", "input": "", "output": "Knihovna je sada funkcí/modulů, které použiješ ve svém kódu (requests, numpy)."} {"instruction": "Odpověz pouze česky, stručně: kolik je 15 * 12?", "input": "", "output": "15 × 12 = 180."} {"instruction": "Spočítej 10×10", "input": "", "output": "10 × 10 = 100"} {"instruction": "Kolik je 4 × 3?", "input": "", "output": "4 × 3 = 12"} {"instruction": "What is 24 - 9?", "input": "", "output": "24 - 9 = 15"} {"instruction": "Translate to that language (polsky): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "What is 9 - 3?", "input": "", "output": "9 - 3 = 6"} {"instruction": "Napiš SQL: vyber 17 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 17;\n```"} {"instruction": "Napiš SQL: vyber 13 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 13;\n```"} {"instruction": "Kolik je 20 - 4?", "input": "", "output": "20 - 4 = 16"} {"instruction": "Spočítej: 11 + 7 = ?", "input": "", "output": "11 + 7 = 18"} {"instruction": "Hey", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Kolik je 26 × 2?", "input": "", "output": "26 × 2 = 52"} {"instruction": "Umíš Lua?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Lua spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "ahoj", "input": "", "output": "Ahoj! Napiš úkol — klidně česky nebo anglicky, případně kód v Python/JS/HTML/PHP."} {"instruction": "Spočítej 15×3", "input": "", "output": "15 × 3 = 45"} {"instruction": "Co je HTTP status 404?", "input": "", "output": "404 Not Found — server nenašel požadovanou stránku/zdroj."} {"instruction": "Vysvětli algoritmus?", "input": "", "output": "Algoritmus je přesný postup kroků k vyřešení úlohy."} {"instruction": "Čau", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Kolik je 2 × 9?", "input": "", "output": "2 × 9 = 18"} {"instruction": "Spočítej 16×5", "input": "", "output": "16 × 5 = 80"} {"instruction": "Translate to that language (německy): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "Jsi expert na všechno? Buď upřímný.", "input": "", "output": "Ne. Jsem silný v češtině, angličtině a v Python / JavaScript / HTML / PHP. U ostatního řeknu, že to nevím, místo aby se to tvářilo jako jistota."} {"instruction": "Jak seřadím seznam slovníků podle klíče age?", "input": "", "output": "```python\npeople.sort(key=lambda p: p[\"age\"])\n# nebo nový seznam:\nsorted(people, key=lambda p: p[\"age\"])\n```"} {"instruction": "What is 19 - 7?", "input": "", "output": "19 - 7 = 12"} {"instruction": "Dobrý den", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Ukaž čistý Python kód: safe get nested dict.", "input": "", "output": "```python\ndef dig(d, *keys, default=None):\n cur = d\n for k in keys:\n if not isinstance(cur, dict) or k not in cur:\n return default\n cur = cur[k]\n return cur\n```"} {"instruction": "Kolik je 12 × 10?", "input": "", "output": "12 × 10 = 120"} {"instruction": "Napiš JS: vrať pole čísel 1..11.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 11}, (_, i) => i + 1);\n```"} {"instruction": "Kolik je 5 - 3?", "input": "", "output": "5 - 3 = 2"} {"instruction": "Kolik je 24 × 2?", "input": "", "output": "24 × 2 = 48"} {"instruction": "Dobrý den", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Hey!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Napiš Python funkci: odstraní whitespace (`strip_ws`).", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} {"instruction": "Kolik je 14 × 6?", "input": "", "output": "14 × 6 = 84"} {"instruction": "Spočítej: 19 + 5 = ?", "input": "", "output": "19 + 5 = 24"} {"instruction": "Napiš Python funkci: seřadí klíče slovníku (`dict_keys`).", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} {"instruction": "Kolik je 24 - 12?", "input": "", "output": "24 - 12 = 12"} {"instruction": "Kolik je 2 × 6?", "input": "", "output": "2 × 6 = 12"} {"instruction": "Write a Python function `dict_keys` that seřadí klíče slovníku.", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} {"instruction": "Hi!", "input": "", "output": "Hi! I can help in English or Czech, and with Python, JavaScript, HTML, and PHP."} {"instruction": "Python function for: retry", "input": "", "output": "```python\nimport time\ndef retry(fn, n=3):\n for i in range(n):\n try:\n return fn()\n except Exception:\n if i == n-1: raise\n time.sleep(0.1)\n```"} {"instruction": "Odpověz pouze česky, stručně: hlavní město ČR?", "input": "", "output": "Hlavní město České republiky je Praha."} {"instruction": "Potřebuju Python helper `first_n`: vrátí prvních n prvků.", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} {"instruction": "Mluv korejsky.", "input": "", "output": "Tohle jazyk spolehlivě neovládám. Můžu česky nebo anglicky."} {"instruction": "Kolik je 4 × 14?", "input": "", "output": "4 × 14 = 56"} {"instruction": "Ukaž čistý kód: spočítej samohlásky v textu. Pojmenuj funkci `count_vowels`.", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} {"instruction": "Spočítej 20×3", "input": "", "output": "20 × 3 = 60"} {"instruction": "Spočítej: 27 + 3 = ?", "input": "", "output": "27 + 3 = 30"} {"instruction": "Kolik je 14 × 4?", "input": "", "output": "14 × 4 = 56"} {"instruction": "Vysvětli, co je rekurze, jednoduše česky.", "input": "", "output": "Rekurze je, když funkce volá sama sebe, dokud nedosáhne jednoduchého základního případu. Třeba výpočet faktoriálu: n! = n × (n-1)!, a 0! = 1."} {"instruction": "Spočítej 20×5", "input": "", "output": "20 × 5 = 100"} {"instruction": "Co je proměnná? (stručně)", "input": "", "output": "Proměnná je pojmenované místo pro hodnotu v paměti, např."} {"instruction": "Kolik je 16 × 4?", "input": "", "output": "16 × 4 = 64"} {"instruction": "Kolik je 20 × 4?", "input": "", "output": "20 × 4 = 80"} {"instruction": "Kolik je 2 × 4?", "input": "", "output": "2 × 4 = 8"} {"instruction": "Co je Docker?", "input": "", "output": "Docker balí aplikaci se závislostmi do kontejneru, který běží stejně na různých strojích. Image = šablona, container = běžící instance."} {"instruction": "Kolik je 4 × 6?", "input": "", "output": "4 × 6 = 24"} {"instruction": "Kolik je 19 - 9?", "input": "", "output": "19 - 9 = 10"} {"instruction": "Napiš Python: přečti CSV a vypiš průměr sloupce price.", "input": "", "output": "```python\nimport csv\nfrom pathlib import Path\n\ndef avg_price(path: str) -> float:\n prices = []\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n for row in csv.DictReader(f):\n prices.append(float(row[\"price\"]))\n return sum(prices) / len(prices) if prices else 0.0\n```"} {"instruction": "Kolik je 13 - 9?", "input": "", "output": "13 - 9 = 4"} {"instruction": "Spočítej 21×10", "input": "", "output": "21 × 10 = 210"} {"instruction": "Ukaž čistý kód: spočítej průměr. Pojmenuj funkci `avg_list`.", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} {"instruction": "Mluv čínsky.", "input": "", "output": "Tohle jazyk spolehlivě neovládám. Můžu česky nebo anglicky."} {"instruction": "Implement `repeat_str` in Python (zopakuje řetězec n-krát).", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} {"instruction": "Spočítej: 6 + 12 = ?", "input": "", "output": "6 + 12 = 18"} {"instruction": "Kolik je 9 - 7?", "input": "", "output": "9 - 7 = 2"} {"instruction": "Spočítej 11×5", "input": "", "output": "11 × 5 = 55"} {"instruction": "Spočítej: 29 + 4 = ?", "input": "", "output": "29 + 4 = 33"} {"instruction": "Spočítej: 27 + 6 = ?", "input": "", "output": "27 + 6 = 33"} {"instruction": "Vysvětli cache?", "input": "", "output": "Cache dočasně ukládá výsledky, aby se nemusely počítat/stahovat znovu."} {"instruction": "Kolik je 20 × 7?", "input": "", "output": "20 × 7 = 140"} {"instruction": "Hi!", "input": "", "output": "Ahoj! S čím pomoct?"} {"instruction": "Dobrý den tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Array map/filter příklad.", "input": "", "output": "```javascript\nconst nums = [1, 2, 3, 4, 5];\nconst doubledEvens = nums.filter(n => n % 2 === 0).map(n => n * 2);\n// [4, 8]\n```"} {"instruction": "Co je open source? (stručně)", "input": "", "output": "Open source znamená, že je dostupný zdrojový kód a licence dovoluje studium i úpravy."} {"instruction": "Jak propojit HTML form s PHP?", "input": "", "output": "Ve formuláři `method=\"post\" action=\"save.php\"`. V `save.php` čti `$_POST`, validuj, ulož (PDO), vrať HTML nebo redirect. Nikdy nedůvěřuj vstupu — escapuj výstup (`htmlspecialchars`)."} {"instruction": "Jak ošetřit dělení nulou v Pythonu?", "input": "", "output": "```python\ndef safe_div(a, b):\n try:\n return a / b\n except ZeroDivisionError:\n return None # nebo raise vlastní chybu\n```"} {"instruction": "Umíš německy / francouzsky / španělsky / polsky / ruštinu?", "input": "", "output": "Ne na úrovni, se kterou by ses mohl spolehnout. Komunikuju česky a anglicky. Ostatní jazyky radši nepřekládám, abych nepletl."} {"instruction": "Kolik je 20 × 9?", "input": "", "output": "20 × 9 = 180"} {"instruction": "Napiš Python funkci: seskupí list dictů podle klíče (`group_by`).", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} {"instruction": "Napiš SQL: všichni uživatelé starší 18 let.", "input": "", "output": "```sql\nSELECT * FROM users WHERE age > 18;\n```"} {"instruction": "Vysvětli rekurzi jednoduše.", "input": "", "output": "Rekurze je, když funkce volá sama sebe, dokud nedojde k jednoduchému konci (base case). Příklad: faktoriál n! = n × (n−1)!, a 0! = 1."} {"instruction": "Difference between == and === in JavaScript?", "input": "", "output": "`==` coerces types; `===` does not. Prefer `===` for predictable comparisons."} {"instruction": "Kolik je 13 - 3?", "input": "", "output": "13 - 3 = 10"} {"instruction": "Vysvětli merge?", "input": "", "output": "Merge spojuje změny z jedné větve do druhé a může vyžadovat řešení konfliktů."} {"instruction": "Kolik je 27 - 11?", "input": "", "output": "27 - 11 = 16"} {"instruction": "Write a Python class Stack.", "input": "", "output": "```python\nclass Stack:\n def __init__(self):\n self._d = []\n def push(self, x):\n self._d.append(x)\n def pop(self):\n if not self._d:\n raise IndexError(\"empty\")\n return self._d.pop()\n def peek(self):\n return self._d[-1]\n```"} {"instruction": "Co všechno programuješ? Buď upřímný.", "input": "", "output": "Primárně: Python, JavaScript, HTML a PHP. Web front (HTML/JS/CSS), jednoduchý backend (PHP/Python), skripty. Ne: mobilní nativní appky, embedded, Rust/Go/Java/C++ jako hlavní stack."} {"instruction": "Čau! tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "Co je třída?", "input": "", "output": "Třída je šablona pro objekty — definuje data (atributy) a chování (metody)."} {"instruction": "Spočítej 15×2", "input": "", "output": "15 × 2 = 30"} {"instruction": "Napiš Python funkci: spočítej průměr (`avg_list`).", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} {"instruction": "What is 18 - 6?", "input": "", "output": "18 - 6 = 12"} {"instruction": "Kolik je 18 - 6?", "input": "", "output": "18 - 6 = 12"} {"instruction": "Co je merge?", "input": "", "output": "Merge spojuje změny z jedné větve do druhé a může vyžadovat řešení konfliktů."} {"instruction": "Napiš unit test (pytest) pro funkci add(a,b).", "input": "", "output": "```python\nfrom mymodule import add\n\ndef test_add_positive():\n assert add(2, 3) == 5\n\ndef test_add_zero():\n assert add(0, 0) == 0\n```"} {"instruction": "Vysvětli latency?", "input": "", "output": "Latence je zpoždění — jak dlouho trvá, než přijde odpověď."} {"instruction": "Spočítej 7×10", "input": "", "output": "7 × 10 = 70"} {"instruction": "dobrý den", "input": "", "output": "Ahoj! Napiš úkol — klidně česky nebo anglicky, případně kód v Python/JS/HTML/PHP."} {"instruction": "Write a Python function to check prime numbers.", "input": "", "output": "```python\ndef is_prime(n: int) -> bool:\n if n < 2:\n return False\n if n % 2 == 0:\n return n == 2\n i = 3\n while i * i <= n:\n if n % i == 0:\n return False\n i += 2\n return True\n```"} {"instruction": "Spočítej 15×8", "input": "", "output": "15 × 8 = 120"} {"instruction": "Napiš Dockerfile pro jednoduchou Python FastAPI app.", "input": "", "output": "```dockerfile\nFROM python:3.12-slim\nWORKDIR /app\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\nCOPY . .\nCMD [\"uvicorn\", \"main:app\", \"--host\", \"0.0.0.0\", \"--port\", \"8000\"]\n```"} {"instruction": "Implementuj `invert_dict` v Pythonu — prohodí klíče a hodnoty (unikátní).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} {"instruction": "Kolik je 29 - 3?", "input": "", "output": "29 - 3 = 26"} {"instruction": "Ukaž HTML — link css.", "input": "", "output": "```html\n\n```"} {"instruction": "Kolik je 8 - 4?", "input": "", "output": "8 - 4 = 4"} {"instruction": "Napiš v Pythonu: is palindrome.", "input": "", "output": "```python\ndef is_palindrome(s):\n t = ''.join(c.lower() for c in s if c.isalnum())\n return t == t[::-1]\n```"} {"instruction": "Spočítej: 21 + 12 = ?", "input": "", "output": "21 + 12 = 33"} {"instruction": "Kolik je 19 - 11?", "input": "", "output": "19 - 11 = 8"} {"instruction": "Napiš Android app v Kotlinu. Buď upřímný.", "input": "", "output": "Kotlin/Android nedělám. Můžu pomoct s webem (HTML/JS/PHP) nebo Python skripty."} {"instruction": "Ahoj!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Kolik je 15 - 13?", "input": "", "output": "15 - 13 = 2"} {"instruction": "Write R code for a hello world.", "input": "", "output": "I don't cover R. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Napiš skript, který spočítá řádky ve všech .py souborech ve složce.", "input": "", "output": "```python\nfrom pathlib import Path\n\ndef count_py_lines(root: str = \".\") -> int:\n total = 0\n for p in Path(root).rglob(\"*.py\"):\n total += sum(1 for _ in p.open(encoding=\"utf-8\", errors=\"ignore\"))\n return total\n\nif __name__ == \"__main__\":\n print(count_py_lines())\n```"} {"instruction": "Ukaž čistý Python kód: unique preserve order.", "input": "", "output": "```python\ndef unique(seq):\n seen = set()\n out = []\n for x in seq:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out\n```"} {"instruction": "Napiš funkci v Pythonu: chunk list.", "input": "", "output": "```python\ndef chunked(xs, n):\n return [xs[i:i+n] for i in range(0, len(xs), n)]\n```"} {"instruction": "Čau, co umíš?", "input": "", "output": "Česky a anglicky chat, plus programování v Pythonu, JavaScriptu, HTML a PHP. Jiné jazyky/stack radši nepřeháním."} {"instruction": "Ukaž čistý kód: odstraní whitespace. Pojmenuj funkci `strip_ws`.", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} {"instruction": "Kolik je 2 × 2?", "input": "", "output": "2 × 2 = 4"} {"instruction": "What is 17 - 8?", "input": "", "output": "17 - 8 = 9"} {"instruction": "Spočítej: 19 + 2 = ?", "input": "", "output": "19 + 2 = 21"} {"instruction": "Napiš JS: vrať pole čísel 1..12.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 12}, (_, i) => i + 1);\n```"} {"instruction": "Spočítej 10×2", "input": "", "output": "10 × 2 = 20"} {"instruction": "Kolik je 18 × 11?", "input": "", "output": "18 × 11 = 198"} {"instruction": "Kolik je 18 - 10?", "input": "", "output": "18 - 10 = 8"} {"instruction": "Potřebuju Python helper `last_n`: vrátí posledních n prvků.", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} {"instruction": "What is 20 - 11?", "input": "", "output": "20 - 11 = 9"} {"instruction": "Hello", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Spočítej: 3 + 12 = ?", "input": "", "output": "3 + 12 = 15"} {"instruction": "Spočítej: 29 + 10 = ?", "input": "", "output": "29 + 10 = 39"} {"instruction": "Spočítej: 24 + 3 = ?", "input": "", "output": "24 + 3 = 27"} {"instruction": "Jsi expert na všechno?", "input": "", "output": "Ne. Jsem silný v češtině, angličtině a v Python / JavaScript / HTML / PHP. U ostatního řeknu, že to nevím, místo aby se to tvářilo jako jistota."} {"instruction": "Kolik je 10 × 11?", "input": "", "output": "10 × 11 = 110"} {"instruction": "Kolik je 10 × 4?", "input": "", "output": "10 × 4 = 40"} {"instruction": "What is 6 - 3?", "input": "", "output": "6 - 3 = 3"} {"instruction": "JS async function example.", "input": "", "output": "```javascript\nasync function loadUser(id) {\n const res = await fetch(`/api/users/${id}`);\n if (!res.ok) throw new Error(\"failed\");\n return res.json();\n}\n```"} {"instruction": "Kolik je 24 - 2?", "input": "", "output": "24 - 2 = 22"} {"instruction": "Kolik je 16 - 6?", "input": "", "output": "16 - 6 = 10"} {"instruction": "Spočítej: 19 + 8 = ?", "input": "", "output": "19 + 8 = 27"} {"instruction": "Kolik je 18 - 14?", "input": "", "output": "18 - 14 = 4"} {"instruction": "Kolik je 20 - 6?", "input": "", "output": "20 - 6 = 14"} {"instruction": "Ahoj", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "Ukaž čistý kód: vrátí True pokud je sudé. Pojmenuj funkci `is_even`.", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} {"instruction": "Napiš JS: vrať pole čísel 1..4.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 4}, (_, i) => i + 1);\n```"} {"instruction": "Umíš C#?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. C# spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Implementuj `count_vowels` v Pythonu — spočítej samohlásky v textu.", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} {"instruction": "Spočítej 10×11", "input": "", "output": "10 × 11 = 110"} {"instruction": "Umíš C++?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. C++ spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Translate to English: Server neběží / je vypnutý.", "input": "", "output": "The server is down."} {"instruction": "Čau!", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Implementuj `is_even` v Pythonu — vrátí True pokud je sudé.", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} {"instruction": "Kolik je 26 - 4?", "input": "", "output": "26 - 4 = 22"} {"instruction": "Kolik je 29 - 7?", "input": "", "output": "29 - 7 = 22"} {"instruction": "Implement `is_even` in Python (vrátí True pokud je sudé).", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} {"instruction": "Napiš JS: vrať pole čísel 1..2.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 2}, (_, i) => i + 1);\n```"} {"instruction": "Hello", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Frontend volá Python API — jak?", "input": "", "output": "Python (FastAPI/Flask) vystaví JSON endpoint. JS:\n```javascript\nconst r = await fetch(\"http://localhost:8000/api/items\");\nconst data = await r.json();\n```\nPozor na CORS."} {"instruction": "Kolik je 20 × 8?", "input": "", "output": "20 × 8 = 160"} {"instruction": "What is 17 - 11?", "input": "", "output": "17 - 11 = 6"} {"instruction": "Potřebuju Python helper `write_text`: zapíše text do souboru.", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} {"instruction": "Kolik je 10 × 6?", "input": "", "output": "10 × 6 = 60"} {"instruction": "Implementuj `strip_ws` v Pythonu — odstraní whitespace.", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} {"instruction": "Spočítej: 6 + 9 = ?", "input": "", "output": "6 + 9 = 15"} {"instruction": "Spočítej 14×5", "input": "", "output": "14 × 5 = 70"} {"instruction": "Spočítej 15×7", "input": "", "output": "15 × 7 = 105"} {"instruction": "Vysvětli async/await jednoduše.", "input": "", "output": "Async umožní čekat na I/O (síť, disk) bez blokování celého programu. `await` pozastaví funkci, dokud operace neskončí, a mezitím běží jiné úlohy."} {"instruction": "Spočítej: 9 + 9 = ?", "input": "", "output": "9 + 9 = 18"} {"instruction": "Umíš Kotlin?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Kotlin spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Kolik je 10 - 8?", "input": "", "output": "10 - 8 = 2"} {"instruction": "Explain what a REST API is in 2 sentences.", "input": "", "output": "A REST API exposes resources via URLs and standard HTTP methods like GET and POST. Clients exchange data (often JSON) in a stateless way."} {"instruction": "Oprav kód:\n```python\nxs = [1,2,3]\nfor i in range(4): print(xs[i])\n```", "input": "", "output": "Index 3 neexistuje. `range(len(xs))` nebo iteruj `for x in xs`.\n\nOpravená verze podle vysvětlení výše."} {"instruction": "Implement `first_n` in Python (vrátí prvních n prvků).", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} {"instruction": "Spočítej: 10 + 5 = ?", "input": "", "output": "10 + 5 = 15"} {"instruction": "What is 24 - 6?", "input": "", "output": "24 - 6 = 18"} {"instruction": "Kolik je 6 × 4?", "input": "", "output": "6 × 4 = 24"} {"instruction": "Napiš JS: vrať pole čísel 1..5.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 5}, (_, i) => i + 1);\n```"} {"instruction": "Spočítej: 27 + 12 = ?", "input": "", "output": "27 + 12 = 39"} {"instruction": "Napiš HTML: link css.", "input": "", "output": "```html\n\n```"} {"instruction": "Napiš JS: vrať pole čísel 1..20.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 20}, (_, i) => i + 1);\n```"} {"instruction": "Napiš v PHP: sum array.", "input": "", "output": "```php\nfunction sum_array(array $a): float {\n return array_sum($a);\n}\n```"} {"instruction": "Kolik je 25 - 3?", "input": "", "output": "25 - 3 = 22"} {"instruction": "Kolik je 25 - 7?", "input": "", "output": "25 - 7 = 18"} {"instruction": "Kolik je 6 × 6?", "input": "", "output": "6 × 6 = 36"} {"instruction": "Spočítej: 24 + 12 = ?", "input": "", "output": "24 + 12 = 36"} {"instruction": "Ukaž čistý Python kód: flatten nested list one level.", "input": "", "output": "```python\ndef flatten(xs):\n out = []\n for x in xs:\n if isinstance(x, list):\n out.extend(x)\n else:\n out.append(x)\n return out\n```"} {"instruction": "Mluv španělsky.", "input": "", "output": "Tohle jazyk spolehlivě neovládám. Můžu česky nebo anglicky."} {"instruction": "Implement `read_lines` in Python (načte řádky souboru).", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} {"instruction": "Kolik je 15 - 7?", "input": "", "output": "15 - 7 = 8"} {"instruction": "Kolik je 28 × 4?", "input": "", "output": "28 × 4 = 112"} {"instruction": "Umíš Rust? Buď upřímný.", "input": "", "output": "Ne. Specializuju se na Python, JavaScript, HTML a PHP. S Rustem ti spolehlivě nepomůžu — zkus oficiální docs nebo někoho, kdo Rust umí."} {"instruction": "Kolik je 8 × 8?", "input": "", "output": "8 × 8 = 64"} {"instruction": "What is 13 - 7?", "input": "", "output": "13 - 7 = 6"} {"instruction": "Co je Python?", "input": "", "output": "Python je vysokoúrovňový programovací jazyk s jednoduchou syntaxí. Hodí se na web, data, skripty i AI."} {"instruction": "Kolik je 25 - 5?", "input": "", "output": "25 - 5 = 20"} {"instruction": "Spočítej: 13 + 14 = ?", "input": "", "output": "13 + 14 = 27"} {"instruction": "Spočítej 4×10", "input": "", "output": "4 × 10 = 40"} {"instruction": "Spočítej: 15 + 3 = ?", "input": "", "output": "15 + 3 = 18"} {"instruction": "Ahoj tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Hey", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "Ahoj! tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "Kolik je 14 - 12?", "input": "", "output": "14 - 12 = 2"} {"instruction": "Napiš funkci v Pythonu: safe get nested dict.", "input": "", "output": "```python\ndef dig(d, *keys, default=None):\n cur = d\n for k in keys:\n if not isinstance(cur, dict) or k not in cur:\n return default\n cur = cur[k]\n return cur\n```"} {"instruction": "Vysvětli commit?", "input": "", "output": "Commit je uložený snímek změn v Gitu s popisem, co a proč se změnilo."} {"instruction": "Čau! tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Umíš Go?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Go spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Spočítej 5×4", "input": "", "output": "5 × 4 = 20"} {"instruction": "Spočítej 10×6", "input": "", "output": "10 × 6 = 60"} {"instruction": "Spočítej 23×5", "input": "", "output": "23 × 5 = 115"} {"instruction": "Napiš příklad fetch v moderním JavaScriptu.", "input": "", "output": "```javascript\nconst res = await fetch(\"/api/items\");\nif (!res.ok) throw new Error(`HTTP ${res.status}`);\nconst data = await res.json();\n```"} {"instruction": "Dobrý den tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Thanks", "input": "", "output": "You're welcome!"} {"instruction": "Kolik je 11 - 3?", "input": "", "output": "11 - 3 = 8"} {"instruction": "Vysvětli funkce?", "input": "", "output": "Funkce je pojmenovaný blok kódu, který bere vstupy a vrací výsledek. Umožňuje znovupoužití logiky."} {"instruction": "Spočítej 19×10", "input": "", "output": "19 × 10 = 190"} {"instruction": "Python function for: is palindrome", "input": "", "output": "```python\ndef is_palindrome(s):\n t = ''.join(c.lower() for c in s if c.isalnum())\n return t == t[::-1]\n```"} {"instruction": "Write Perl code for a hello world.", "input": "", "output": "I don't cover Perl. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "jsi kokot?", "input": "", "output": "Ne. Pojďme zůstat u věcné diskuze — s čím pomoct?"} {"instruction": "Kolik je 28 × 5?", "input": "", "output": "28 × 5 = 140"} {"instruction": "Ukaž čistý Python kód: fibonacci iterative.", "input": "", "output": "```python\ndef fib(n: int) -> int:\n if n < 0:\n raise ValueError\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n```"} {"instruction": "Kolik je 8 × 11?", "input": "", "output": "8 × 11 = 88"} {"instruction": "Napiš SQL: top 5 nejprodávanějších produktů.", "input": "", "output": "```sql\nSELECT product_id, SUM(qty) AS total\nFROM order_items\nGROUP BY product_id\nORDER BY total DESC\nLIMIT 5;\n```"} {"instruction": "Kolik je 11 - 7?", "input": "", "output": "11 - 7 = 4"} {"instruction": "Python: IndentationError", "input": "", "output": "Špatné odsazení — míchej jen mezery (4) nebo jen taby, ne obojí. Bloky pod `if/for/def` musí být odsazené."} {"instruction": "Proč tento kód padá?\n```python\nx = 1\nif x = 1: print('ok')\n```", "input": "", "output": "Použij porovnání `==`: `if x == 1: print('ok')`."} {"instruction": "Jaký je rozdíl mezi seznamem a n-ticí v Pythonu?", "input": "", "output": "List (`[]`) je měnitelný (můžeš přidávat/mazat prvky). Tuple (`()`) je neměnný. Tuple se hodí na pevné skupiny hodnot a jako klíče ve slovníku."} {"instruction": "Implement `write_text` in Python (zapíše text do souboru).", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} {"instruction": "Zdravím", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "What is 20 - 2?", "input": "", "output": "20 - 2 = 18"} {"instruction": "What is 22 - 4?", "input": "", "output": "22 - 4 = 18"} {"instruction": "Jaké jazyky umíš?", "input": "", "output": "Dobře komunikuju česky a anglicky. Programuju hlavně v Pythonu, JavaScriptu, HTML a PHP. Jiné programovací jazyky a cizí jazyky spolehlivě neumím — radši to řeknu rovnou, než abych si vymýšlel."} {"instruction": "Vysvětli proměnná?", "input": "", "output": "Proměnná je pojmenované místo pro hodnotu v paměti, např. `x = 10`."} {"instruction": "Ukaž čistý kód: vrátí posledních n prvků. Pojmenuj funkci `last_n`.", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} {"instruction": "What is 21 - 6?", "input": "", "output": "21 - 6 = 15"} {"instruction": "Co je unit test?", "input": "", "output": "Unit test ověřuje malou část kódu (funkci/metodu) automaticky a opakovatelně."} {"instruction": "Kolik je 17 - 9?", "input": "", "output": "17 - 9 = 8"} {"instruction": "Napiš Python class Stack s push/pop/peek.", "input": "", "output": "```python\nclass Stack:\n def __init__(self):\n self._data = []\n def push(self, x):\n self._data.append(x)\n def pop(self):\n if not self._data:\n raise IndexError(\"prázdný stack\")\n return self._data.pop()\n def peek(self):\n return self._data[-1]\n def __len__(self):\n return len(self._data)\n```"} {"instruction": "Spočítej: 20 + 4 = ?", "input": "", "output": "20 + 4 = 24"} {"instruction": "Kolik je 24 - 10?", "input": "", "output": "24 - 10 = 14"} {"instruction": "Kolik je 6 × 8?", "input": "", "output": "6 × 8 = 48"} {"instruction": "tak mluv česky pouze", "input": "", "output": "Dobře, dál budu odpovídat jen česky. Na co se chceš zeptat?"} {"instruction": "Co je framework?", "input": "", "output": "Framework je připravená kostra aplikace s pravidly a nástroji (Django, React, Spring)."} {"instruction": "Spočítej 20×9", "input": "", "output": "20 × 9 = 180"} {"instruction": "Spočítej: 14 + 13 = ?", "input": "", "output": "14 + 13 = 27"} {"instruction": "Implement `retry` in Python (zavolá fn max n-krát při výjimce).", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} {"instruction": "Co je REST API?", "input": "", "output": "REST API je styl webových služeb: zdroje mají URL, operace se dělají HTTP metodami a data často chodí jako JSON."} {"instruction": "What is 23 - 2?", "input": "", "output": "23 - 2 = 21"} {"instruction": "Co je latency? (stručně)", "input": "", "output": "Latence je zpoždění — jak dlouho trvá, než přijde odpověď."} {"instruction": "Jak se v češtině skloňuje slovo „algoritmus“?", "input": "", "output": "1. algoritmus, 2. algoritmu, 3. algoritmu, 4. algoritmus, 5. algoritme, 6. algoritmu, 7. algoritmem. Množné: algoritmy, algoritmů…"} {"instruction": "Napiš v PHP: slugify.", "input": "", "output": "```php\nfunction slugify(string $s): string {\n $s = strtolower(trim($s));\n $s = preg_replace('/[^a-z0-9]+/', '-', $s);\n return trim($s, '-');\n}\n```"} {"instruction": "Kolik je 10 - 4?", "input": "", "output": "10 - 4 = 6"} {"instruction": "Potřebuju Python helper `avg_list`: spočítej průměr.", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} {"instruction": "ještě jednou", "input": "", "output": "Zopakuju rád. Pošli prosím znovu otázku nebo kousek kódu, ať trefim přesně."} {"instruction": "Kolik je 16 × 3?", "input": "", "output": "16 × 3 = 48"} {"instruction": "Kolik je 8 × 12?", "input": "", "output": "8 × 12 = 96"} {"instruction": "Spočítej: 28 + 2 = ?", "input": "", "output": "28 + 2 = 30"} {"instruction": "Spočítej: 19 + 11 = ?", "input": "", "output": "19 + 11 = 30"} {"instruction": "Kolik je 10 × 12?", "input": "", "output": "10 × 12 = 120"} {"instruction": "What is 5 - 2?", "input": "", "output": "5 - 2 = 3"} {"instruction": "Kolik je 26 - 10?", "input": "", "output": "26 - 10 = 16"} {"instruction": "Vysvětli pojem GIL česky a stručně.", "input": "", "output": "GIL (Global Interpreter Lock) v CPythonu brání běhu více bytecode vláken najednou v jednom procesu. Pro CPU-bound paralelismus spíš multiprocessing nebo jiný runtime; pro I/O stačí threading/async."} {"instruction": "Spočítej: 16 + 8 = ?", "input": "", "output": "16 + 8 = 24"} {"instruction": "Kolik je 28 - 14?", "input": "", "output": "28 - 14 = 14"} {"instruction": "Oprav češtinu: napsal jsem kod", "input": "", "output": "Napsal jsem kód."} {"instruction": "Kolik je 16 × 9?", "input": "", "output": "16 × 9 = 144"} {"instruction": "What is 15 - 3?", "input": "", "output": "15 - 3 = 12"} {"instruction": "Hello tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "Ukaž čistý Python kód: chunk list.", "input": "", "output": "```python\ndef chunked(xs, n):\n return [xs[i:i+n] for i in range(0, len(xs), n)]\n```"} {"instruction": "Hey tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Spočítej: 24 + 9 = ?", "input": "", "output": "24 + 9 = 33"} {"instruction": "Spočítej: 10 + 2 = ?", "input": "", "output": "10 + 2 = 12"} {"instruction": "Implementuj `repeat_str` v Pythonu — zopakuje řetězec n-krát.", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} {"instruction": "Kolik je 24 - 14?", "input": "", "output": "24 - 14 = 10"} {"instruction": "Spočítej: 13 + 11 = ?", "input": "", "output": "13 + 11 = 24"} {"instruction": "Implement `to_upper` in Python (převod na velká písmena).", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} {"instruction": "Kolik je 23 - 11?", "input": "", "output": "23 - 11 = 12"} {"instruction": "Napiš JS: vrať pole čísel 1..7.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 7}, (_, i) => i + 1);\n```"} {"instruction": "Kolik je 6 × 14?", "input": "", "output": "6 × 14 = 84"} {"instruction": "Hello", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Ukaž čistý kód: prohodí klíče a hodnoty (unikátní). Pojmenuj funkci `invert_dict`.", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} {"instruction": "Kolik je 22 × 8?", "input": "", "output": "22 × 8 = 176"} {"instruction": "Mluv italsky.", "input": "", "output": "Tohle jazyk spolehlivě neovládám. Můžu česky nebo anglicky."} {"instruction": "Write a Python function `to_upper` that převod na velká písmena.", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} {"instruction": "Co je JSON?", "input": "", "output": "JSON je textový formát pro data: objekty `{}`, pole `[]`, řetězce, čísla, true/false/null. Používá se v API a konfiguracích."} {"instruction": "Ahoj!", "input": "", "output": "Ahoj! Jak ti můžu pomoct — kód (Python/JS/HTML/PHP) nebo něco česky/anglicky?"} {"instruction": "hello", "input": "", "output": "Ahoj! Napiš úkol — klidně česky nebo anglicky, případně kód v Python/JS/HTML/PHP."} {"instruction": "Ukaž čistý kód: vrátí prvních n prvků. Pojmenuj funkci `first_n`.", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} {"instruction": "Oprav kód:\n```python\nimport json\njson.loads(\"{a:1}\")\n```", "input": "", "output": "JSON vyžaduje uvozovky u klíčů: `json.loads('{\"a\": 1}')`.\n\nOpravená verze podle vysvětlení výše."} {"instruction": "Kolik je 16 × 6?", "input": "", "output": "16 × 6 = 96"} {"instruction": "Přepiš spisovně: zitra bude hezky", "input": "", "output": "Zítra bude hezky."} {"instruction": "Co je open source?", "input": "", "output": "Open source znamená, že je dostupný zdrojový kód a licence dovoluje studium i úpravy."} {"instruction": "Kolik je 7 - 3?", "input": "", "output": "7 - 3 = 4"} {"instruction": "Kolik je 29 - 5?", "input": "", "output": "29 - 5 = 24"} {"instruction": "Napiš PHP hello world.", "input": "", "output": "```php\n dict[str, int]:\n words = re.findall(r\"\\w+\", text.lower())\n return dict(Counter(words))\n```"} {"instruction": "Kolik je 20 - 8?", "input": "", "output": "20 - 8 = 12"} {"instruction": "JS: unique", "input": "", "output": "```javascript\nconst unique = arr => [...new Set(arr)];\n```"} {"instruction": "dobrý den", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Napiš funkci v Pythonu: unique preserve order.", "input": "", "output": "```python\ndef unique(seq):\n seen = set()\n out = []\n for x in seq:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out\n```"} {"instruction": "What is 16 - 7?", "input": "", "output": "16 - 7 = 9"} {"instruction": "Spočítej: 5 + 4 = ?", "input": "", "output": "5 + 4 = 9"} {"instruction": "Ukaž čistý kód: zavolá fn max n-krát při výjimce. Pojmenuj funkci `retry`.", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} {"instruction": "Napiš funkci v Pythonu: reverse string.", "input": "", "output": "```python\ndef rev(s: str) -> str:\n return s[::-1]\n```"} {"instruction": "Hello!", "input": "", "output": "Ahoj! S čím pomoct?"} {"instruction": "Translate to that language (italsky): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "Write a kernel module in C. Buď upřímný.", "input": "", "output": "That's outside my stack. I don't do low-level C/kernel work. I can help with Python, JavaScript, HTML or PHP instead."} {"instruction": "Hey", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Translate to that language (španělsky): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "Umíš Haskell?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Haskell spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Kolik je hodin?", "input": "", "output": "Nemám přístup k aktuálnímu času na tvém zařízení. Podívej se prosím na hodiny v systému nebo v prohlížeči."} {"instruction": "Kolik je 6 - 2?", "input": "", "output": "6 - 2 = 4"} {"instruction": "Python solution: Best time to buy/sell stock once.", "input": "", "output": "```python\ndef max_profit(prices: list[int]) -> int:\n best = 0\n lo = prices[0]\n for p in prices[1:]:\n best = max(best, p - lo)\n lo = min(lo, p)\n return best\n```"} {"instruction": "Kolik je 8 - 6?", "input": "", "output": "8 - 6 = 2"} {"instruction": "Spočítej: 26 + 10 = ?", "input": "", "output": "26 + 10 = 36"} {"instruction": "Kolik je 10 × 10?", "input": "", "output": "10 × 10 = 100"} {"instruction": "Ukaž Python kód — csv avg.", "input": "", "output": "```python\nimport csv\ndef avg_col(path, col):\n with open(path, newline='', encoding='utf-8') as f:\n vals = [float(r[col]) for r in csv.DictReader(f)]\n return sum(vals)/len(vals) if vals else 0.0\n```"} {"instruction": "Napiš funkci merge_sorted(a, b) — sloučení dvou seřazených seznamů.", "input": "", "output": "```python\ndef merge_sorted(a: list[int], b: list[int]) -> list[int]:\n i = j = 0\n out = []\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n out.append(a[i]); i += 1\n else:\n out.append(b[j]); j += 1\n out.extend(a[i:])\n out.extend(b[j:])\n return out\n```"} {"instruction": "Přepiš spisovně: potrebuju pomoct s pythonem", "input": "", "output": "Potřebuju pomoct s Pythonem."} {"instruction": "Napiš Python funkci: zopakuje řetězec n-krát (`repeat_str`).", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} {"instruction": "Implementuj `read_lines` v Pythonu — načte řádky souboru.", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} {"instruction": "Hey tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "Napiš JS: vrať pole čísel 1..18.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 18}, (_, i) => i + 1);\n```"} {"instruction": "Napiš bash skript: záloha složky do tar.gz s datem.", "input": "", "output": "```bash\n#!/usr/bin/env bash\nset -euo pipefail\nSRC=${1:-.}\nDST=\"backup-$(date +%Y%m%d-%H%M%S).tar.gz\"\ntar -czf \"$DST\" \"$SRC\"\necho \"Hotovo: $DST\"\n```"} {"instruction": "What is 22 - 10?", "input": "", "output": "22 - 10 = 12"} {"instruction": "How do I center a div in CSS?", "input": "", "output": "Modern way:\n```css\n.container {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100vh;\n}\n```"} {"instruction": "Kolik je 4 × 8?", "input": "", "output": "4 × 8 = 32"} {"instruction": "Kolik je 13 - 7?", "input": "", "output": "13 - 7 = 6"} {"instruction": "Write Go code for a hello world.", "input": "", "output": "I don't cover Go. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Přepiš spisovně: mel bych jit domu", "input": "", "output": "Měl bych jít domů."} {"instruction": "Kolik je 12 - 4?", "input": "", "output": "12 - 4 = 8"} {"instruction": "představ se celou větou a pak mlč", "input": "", "output": "Jsem AI asistent na programování a češtinu. Co potřebuješ?"} {"instruction": "Rozdíl mezi GET a POST?", "input": "", "output": "GET typicky čte data (parametry v URL). POST posílá data v těle požadavku (formuláře, API zápisy)."} {"instruction": "Vysvětli HTTP status 404 a 500.", "input": "", "output": "404 Not Found = zdroj neexistuje. 500 Internal Server Error = chyba na serveru (bug, pád, špatná konfigurace)."} {"instruction": "Umíš Java?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Java spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Spočítej: 14 + 7 = ?", "input": "", "output": "14 + 7 = 21"} {"instruction": "Kolik je 26 × 4?", "input": "", "output": "26 × 4 = 104"} {"instruction": "Odpověz pouze česky, stručně: voda vaří při jaké teplotě?", "input": "", "output": "Při standardním tlaku vaří voda při 100 °C."} {"instruction": "Kolik je 10 × 14?", "input": "", "output": "10 × 14 = 140"} {"instruction": "Spočítej: 16 + 5 = ?", "input": "", "output": "16 + 5 = 21"} {"instruction": "Kolik je 15 - 5?", "input": "", "output": "15 - 5 = 10"} {"instruction": "Spočítej: 9 + 12 = ?", "input": "", "output": "9 + 12 = 21"} {"instruction": "Čau!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Oprav bug: `for i in range(len(items)): print(items[i+1])`", "input": "", "output": "Padá na IndexError u posledního prvku. Možnosti:\n```python\nfor i in range(len(items) - 1):\n print(items[i + 1])\n# nebo\nfor a, b in zip(items, items[1:]):\n print(b)\n```"} {"instruction": "Kolik je 12 - 8?", "input": "", "output": "12 - 8 = 4"} {"instruction": "Write Scala code for a hello world.", "input": "", "output": "I don't cover Scala. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "What is 15 - 9?", "input": "", "output": "15 - 9 = 6"} {"instruction": "Co je API? (stručně)", "input": "", "output": "API je rozhraní, přes které spolu programy komunikují — často přes HTTP a JSON."} {"instruction": "Napiš v PHP: env get.", "input": "", "output": "```php\nfunction env(string $key, $default=null) {\n $v = $_ENV[$key] ?? getenv($key);\n return ($v === false || $v === null || $v === '') ? $default : $v;\n}\n```"} {"instruction": "Kolik je 14 × 3?", "input": "", "output": "14 × 3 = 42"} {"instruction": "hi", "input": "", "output": "Ahoj! Napiš úkol — klidně česky nebo anglicky, případně kód v Python/JS/HTML/PHP."} {"instruction": "What languages do you speak? Buď upřímný.", "input": "", "output": "I communicate well in Czech and English. For programming I focus on Python, JavaScript, HTML and PHP. I don't reliably cover other natural languages or other programming languages — I'll say so instead of guessing."} {"instruction": "Spočítej: 12 + 6 = ?", "input": "", "output": "12 + 6 = 18"} {"instruction": "Implement `invert_dict` in Python (prohodí klíče a hodnoty (unikátní)).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} {"instruction": "Napiš JS: vrať pole čísel 1..9.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 9}, (_, i) => i + 1);\n```"} {"instruction": "Napiš v Pythonu: clamp.", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} {"instruction": "Oprav: for i in range(len(a)): print(a[i+1])", "input": "", "output": "Poslední index spadne na IndexError. Použij:\n```python\nfor x in a[1:]:\n print(x)\n# nebo range(len(a)-1)\n```"} {"instruction": "Spočítej: 13 + 2 = ?", "input": "", "output": "13 + 2 = 15"} {"instruction": "Kolik je 4 × 7?", "input": "", "output": "4 × 7 = 28"} {"instruction": "nesedí to", "input": "", "output": "OK, ladíme. Pošli chybovou hlášku / očekávané vs skutečné chování a kousek kódu."} {"instruction": "Kolik je 18 × 5?", "input": "", "output": "18 × 5 = 90"} {"instruction": "Kolik je 28 × 3?", "input": "", "output": "28 × 3 = 84"} {"instruction": "Napiš krátký e-mail česky: omluvím se za zpoždění.", "input": "", "output": "Předmět: Omluva za zpoždění\n\nDobrý den,\nomlouvám se za zpoždění s odpovědí/dodáním. Doplním to co nejdříve.\n\nS pozdravem"} {"instruction": "Spočítej 5×9", "input": "", "output": "5 × 9 = 45"} {"instruction": "Kolik je 26 × 5?", "input": "", "output": "26 × 5 = 130"} {"instruction": "Kolik je 4 × 11?", "input": "", "output": "4 × 11 = 44"} {"instruction": "Spočítej 7×5", "input": "", "output": "7 × 5 = 35"} {"instruction": "Spočítej: 12 + 3 = ?", "input": "", "output": "12 + 3 = 15"} {"instruction": "Spočítej 19×5", "input": "", "output": "19 × 5 = 95"} {"instruction": "What is 17 - 5?", "input": "", "output": "17 - 5 = 12"} {"instruction": "Write Ruby code for a hello world.", "input": "", "output": "I don't cover Ruby. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Kolik je 27 - 5?", "input": "", "output": "27 - 5 = 22"} {"instruction": "ahoj", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Napiš v JavaScriptu: unique.", "input": "", "output": "```javascript\nconst unique = arr => [...new Set(arr)];\n```"} {"instruction": "Implementuj v Pythonu reverse string.", "input": "", "output": "```python\ndef rev(s: str) -> str:\n return s[::-1]\n```"} {"instruction": "Spočítej 15×11", "input": "", "output": "15 × 11 = 165"} {"instruction": "HTML snippet: link css", "input": "", "output": "```html\n\n```"} {"instruction": "Napiš v JavaScriptu: sum array.", "input": "", "output": "```javascript\nconst sum = arr => arr.reduce((a,b)=>a+b, 0);\n```"} {"instruction": "Jak se máš?", "input": "", "output": "Funguju v pohodě, díky. Co potřebuješ vyřešit?"} {"instruction": "What is 21 - 3?", "input": "", "output": "21 - 3 = 18"} {"instruction": "Kolik je 8 × 3?", "input": "", "output": "8 × 3 = 24"} {"instruction": "Spočítej: 20 + 7 = ?", "input": "", "output": "20 + 7 = 27"} {"instruction": "Can you write Java / C++ / C# / Kotlin / Swift?", "input": "", "output": "No. I stick to Python, JavaScript, HTML and PHP. I won't invent code in languages I don't cover well."} {"instruction": "Napiš JS: vrať pole čísel 1..17.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 17}, (_, i) => i + 1);\n```"} {"instruction": "Proč tento kód padá?\n```python\nimport json\njson.loads(\"{a:1}\")\n```", "input": "", "output": "JSON vyžaduje uvozovky u klíčů: `json.loads('{\"a\": 1}')`."} {"instruction": "Kolik je 23 - 7?", "input": "", "output": "23 - 7 = 16"} {"instruction": "Spočítej: 14 + 10 = ?", "input": "", "output": "14 + 10 = 24"} {"instruction": "What is 21 - 9?", "input": "", "output": "21 - 9 = 12"} {"instruction": "Kolik je 22 - 4?", "input": "", "output": "22 - 4 = 18"} {"instruction": "Napiš v Pythonu chunk list.", "input": "", "output": "```python\ndef chunked(xs, n):\n return [xs[i:i+n] for i in range(0, len(xs), n)]\n```"} {"instruction": "Potřebuju Python helper `to_upper`: převod na velká písmena.", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} {"instruction": "Napiš SQL: vyber 8 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 8;\n```"} {"instruction": "What is 19 - 10?", "input": "", "output": "19 - 10 = 9"} {"instruction": "Potřebuju Python helper `sum_list`: sečte čísla v seznamu.", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} {"instruction": "Spočítej 13×10", "input": "", "output": "13 × 10 = 130"} {"instruction": "Kolik je 26 - 14?", "input": "", "output": "26 - 14 = 12"} {"instruction": "Spočítej: 5 + 7 = ?", "input": "", "output": "5 + 7 = 12"} {"instruction": "Kolik je 6 × 9?", "input": "", "output": "6 × 9 = 54"} {"instruction": "Kolik je 4 × 10?", "input": "", "output": "4 × 10 = 40"} {"instruction": "Napiš Python funkci, která spočítá faktoriál.", "input": "", "output": "```python\ndef factorial(n: int) -> int:\n if n < 0:\n raise ValueError(\"n musí být >= 0\")\n result = 1\n for i in range(2, n + 1):\n result *= i\n return result\n```"} {"instruction": "Hello tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Kolik je 22 - 10?", "input": "", "output": "22 - 10 = 12"} {"instruction": "Proč nepoužívat mysql_* funkce?", "input": "", "output": "Jsou odstraněné z moderního PHP a nejsou bezpečné (SQL injection). Používej PDO nebo mysqli s prepared statements."} {"instruction": "Ukaž Python kód — retry.", "input": "", "output": "```python\nimport time\ndef retry(fn, n=3):\n for i in range(n):\n try:\n return fn()\n except Exception:\n if i == n-1: raise\n time.sleep(0.1)\n```"} {"instruction": "Spočítej: 5 + 10 = ?", "input": "", "output": "5 + 10 = 15"} {"instruction": "Implementuj v Pythonu clamp value.", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} {"instruction": "Spočítej: 13 + 5 = ?", "input": "", "output": "13 + 5 = 18"} {"instruction": "Can you write Java / C++ / C# / Kotlin / Swift? Buď upřímný.", "input": "", "output": "No. I stick to Python, JavaScript, HTML and PHP. I won't invent code in languages I don't cover well."} {"instruction": "PHP: prepared statement SELECT.", "input": "", "output": "```php\nprepare(\"SELECT id, email FROM users WHERE id = ?\");\n$stmt->execute([$id]);\n$user = $stmt->fetch(PDO::FETCH_ASSOC);\n```"} {"instruction": "Spočítej: 26 + 13 = ?", "input": "", "output": "26 + 13 = 39"} {"instruction": "Spočítej: 28 + 11 = ?", "input": "", "output": "28 + 11 = 39"} {"instruction": "Odpovídej jen česky. Co je smyčka while?", "input": "", "output": "While opakuje blok, dokud platí podmínka. Hodí se, když neznáš předem počet opakování."} {"instruction": "Spočítej 21×5", "input": "", "output": "21 × 5 = 105"} {"instruction": "Kolik je 4 × 13?", "input": "", "output": "4 × 13 = 52"} {"instruction": "Implementuj `first_n` v Pythonu — vrátí prvních n prvků.", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} {"instruction": "PHP snippet: env get", "input": "", "output": "```php\nfunction env(string $key, $default=null) {\n $v = $_ENV[$key] ?? getenv($key);\n return ($v === false || $v === null || $v === '') ? $default : $v;\n}\n```"} {"instruction": "Kolik je 12 × 4?", "input": "", "output": "12 × 4 = 48"} {"instruction": "Napiš regex pro české PSČ (123 45 nebo 12345).", "input": "", "output": "`^\\d{3}\\s?\\d{2}$`"} {"instruction": "What is 12 - 6?", "input": "", "output": "12 - 6 = 6"} {"instruction": "Kolik je 24 - 8?", "input": "", "output": "24 - 8 = 16"} {"instruction": "Kolik je 15 - 11?", "input": "", "output": "15 - 11 = 4"} {"instruction": "Kolik je 20 - 12?", "input": "", "output": "20 - 12 = 8"} {"instruction": "Napiš SQL: vyber 6 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 6;\n```"} {"instruction": "Spočítej 15×9", "input": "", "output": "15 × 9 = 135"} {"instruction": "Spočítej: 13 + 8 = ?", "input": "", "output": "13 + 8 = 21"} {"instruction": "Spočítej: 8 + 10 = ?", "input": "", "output": "8 + 10 = 18"} {"instruction": "Translate to English: Potřebuju pomoct s bugem.", "input": "", "output": "I need help with a bug."} {"instruction": "Napiš Python funkci: načte řádky souboru (`read_lines`).", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} {"instruction": "Spočítej: 15 + 12 = ?", "input": "", "output": "15 + 12 = 27"} {"instruction": "Kolik je 10 × 7?", "input": "", "output": "10 × 7 = 70"} {"instruction": "Python function for: sum list", "input": "", "output": "```python\ndef sum_list(xs):\n return sum(xs)\n```"} {"instruction": "Napiš JS: vrať pole čísel 1..10.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 10}, (_, i) => i + 1);\n```"} {"instruction": "What is a promise?", "input": "", "output": "A Promise represents a future value from async work. It becomes fulfilled with a result or rejected with an error. Use then/catch or async/await."} {"instruction": "Kolik je 16 × 11?", "input": "", "output": "16 × 11 = 176"} {"instruction": "Proč tento kód padá?\n```python\nd = {}\nprint(d['a'])\n```", "input": "", "output": "Klíč nemusí existovat — použij `d.get('a')` nebo `if 'a' in d`."} {"instruction": "What is 14 - 2?", "input": "", "output": "14 - 2 = 12"} {"instruction": "Kolik je 26 × 3?", "input": "", "output": "26 × 3 = 78"} {"instruction": "JS: parse JSON safe", "input": "", "output": "```javascript\nfunction safeJson(s, fallback=null) {\n try { return JSON.parse(s); } catch { return fallback; }\n}\n```"} {"instruction": "Kolik je 18 × 3?", "input": "", "output": "18 × 3 = 54"} {"instruction": "What is 11 - 8?", "input": "", "output": "11 - 8 = 3"} {"instruction": "Ahoj!", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Kolik je 18 × 2?", "input": "", "output": "18 × 2 = 36"} {"instruction": "Spočítej: 28 + 14 = ?", "input": "", "output": "28 + 14 = 42"} {"instruction": "Napiš Python funkci: zavolá fn max n-krát při výjimce (`retry`).", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} {"instruction": "CSS grid 3 sloupce.", "input": "", "output": "```css\n.grid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 1rem;\n}\n```"} {"instruction": "Mluv japonsky.", "input": "", "output": "Tohle jazyk spolehlivě neovládám. Můžu česky nebo anglicky."} {"instruction": "Napiš Python funkci: spočítej samohlásky v textu (`count_vowels`).", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} {"instruction": "Napiš v Pythonu: sum list.", "input": "", "output": "```python\ndef sum_list(xs):\n return sum(xs)\n```"} {"instruction": "can u speak czech?", "input": "", "output": "Ano, umím česky. Můžu odpovídat jen česky."} {"instruction": "Kolik je 13 - 5?", "input": "", "output": "13 - 5 = 8"} {"instruction": "Kolik je 24 × 8?", "input": "", "output": "24 × 8 = 192"} {"instruction": "Přepiš spisovně: prisel jsem pozde", "input": "", "output": "Přišel jsem pozdě."} {"instruction": "Co je unit test? (stručně)", "input": "", "output": "Unit test ověřuje malou část kódu (funkci/metodu) automaticky a opakovatelně."} {"instruction": "Kolik je 6 - 4?", "input": "", "output": "6 - 4 = 2"} {"instruction": "Napiš v Pythonu safe get nested dict.", "input": "", "output": "```python\ndef dig(d, *keys, default=None):\n cur = d\n for k in keys:\n if not isinstance(cur, dict) or k not in cur:\n return default\n cur = cur[k]\n return cur\n```"} {"instruction": "Napiš async funkci v Pythonu, která stáhne URL pomocí httpx.", "input": "", "output": "```python\nimport httpx\n\nasync def fetch_text(url: str) -> str:\n async with httpx.AsyncClient(timeout=30) as client:\n r = await client.get(url)\n r.raise_for_status()\n return r.text\n```"} {"instruction": "Napiš Python funkci: vrátí True pokud je sudé (`is_even`).", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} {"instruction": "What is 23 - 11?", "input": "", "output": "23 - 11 = 12"} {"instruction": "Napiš Python: najdi maximum bez použití max().", "input": "", "output": "```python\ndef my_max(nums: list[int]) -> int:\n if not nums:\n raise ValueError(\"prázdný seznam\")\n m = nums[0]\n for x in nums[1:]:\n if x > m:\n m = x\n return m\n```"} {"instruction": "Spočítej: 22 + 2 = ?", "input": "", "output": "22 + 2 = 24"} {"instruction": "Kolik je 14 × 2?", "input": "", "output": "14 × 2 = 28"} {"instruction": "Co je funkce? (stručně)", "input": "", "output": "Funkce je pojmenovaný blok kódu, který bere vstupy a vrací výsledek."} {"instruction": "Kolik je 6 × 2?", "input": "", "output": "6 × 2 = 12"} {"instruction": "Spočítej 9×5", "input": "", "output": "9 × 5 = 45"} {"instruction": "Spočítej 20×10", "input": "", "output": "20 × 10 = 200"} {"instruction": "Kolik je 6 × 11?", "input": "", "output": "6 × 11 = 66"} {"instruction": "Umíš Ruby?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. Ruby spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Spočítej: 24 + 6 = ?", "input": "", "output": "24 + 6 = 30"} {"instruction": "Napiš motivující větu pro začátečníka v programování.", "input": "", "output": "Každý expert byl začátečník — piš malé programy denně a chyby ber jako učitele, ne jako prohru."} {"instruction": "Spočítej: 3 + 6 = ?", "input": "", "output": "3 + 6 = 9"} {"instruction": "Spočítej: 12 + 9 = ?", "input": "", "output": "12 + 9 = 21"} {"instruction": "Translate to English: Prosím o review mého pull requestu.", "input": "", "output": "Please review my pull request."} {"instruction": "Write a Python function `retry` that zavolá fn max n-krát při výjimce.", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} {"instruction": "Kolik je 10 - 6?", "input": "", "output": "10 - 6 = 4"} {"instruction": "Jaký je rozdíl mezi frontend a backend?", "input": "", "output": "Frontend je to, co vidí uživatel (HTML/CSS/JS, UI). Backend je serverová logika, databáze a API, které frontend volá."} {"instruction": "Kolik je 29 - 9?", "input": "", "output": "29 - 9 = 20"} {"instruction": "Kolik je 27 - 7?", "input": "", "output": "27 - 7 = 20"} {"instruction": "Spočítej: 11 + 10 = ?", "input": "", "output": "11 + 10 = 21"} {"instruction": "Kolik je 26 × 6?", "input": "", "output": "26 × 6 = 156"} {"instruction": "What is 16 - 4?", "input": "", "output": "16 - 4 = 12"} {"instruction": "Implementuj `to_upper` v Pythonu — převod na velká písmena.", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} {"instruction": "What languages do you speak?", "input": "", "output": "I communicate well in Czech and English. For programming I focus on Python, JavaScript, HTML and PHP. I don't reliably cover other natural languages or other programming languages — I'll say so instead of guessing."} {"instruction": "Kolik je 4 × 9?", "input": "", "output": "4 × 9 = 36"} {"instruction": "Umíš R?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. R spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "Oprav kód:\n```python\nprint 'hello'\n```", "input": "", "output": "V Pythonu 3 musíš volat funkci: `print('hello')`.\n\nOpravená verze podle vysvětlení výše."} {"instruction": "Co je IDE?", "input": "", "output": "IDE je vývojové prostředí s editorem, debuggerem a nástroji (VS Code, PyCharm)."} {"instruction": "Napiš SQL: vyber 1 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 1;\n```"} {"instruction": "Kolik je 16 - 2?", "input": "", "output": "16 - 2 = 14"} {"instruction": "Spočítej 8×5", "input": "", "output": "8 × 5 = 40"} {"instruction": "CORS error v prohlížeči při volání API. Co dělat?", "input": "", "output": "Prohlížeč blokuje cross-origin request. Na backendu nastav CORS (např. FastAPI `CORSMiddleware`) s povoleným origin frontendu, nebo proxy přes stejnou doménu."} {"instruction": "Napiš SQL: vyber 7 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 7;\n```"} {"instruction": "Kolik je 14 × 12?", "input": "", "output": "14 × 12 = 168"} {"instruction": "Umíš MATLAB?", "input": "", "output": "Ne. Můj programovací stack je Python, JavaScript, HTML a PHP. MATLAB spolehlivě neumím — nebudu si vymýšlet kód."} {"instruction": "What is 12 - 3?", "input": "", "output": "12 - 3 = 9"} {"instruction": "Spočítej: 29 + 7 = ?", "input": "", "output": "29 + 7 = 36"} {"instruction": "speak english please", "input": "", "output": "Sure — I can speak English. What do you need?"} {"instruction": "Python function for: clamp", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} {"instruction": "Napiš SQL stored procedure v PL/pgSQL. Buď upřímný.", "input": "", "output": "Pokročilé SQL procedury a jiné DB dialekty neberu jako svou specializaci. Základní SELECT/INSERT v SQL ti můžu naznačit, ale pro PL/pgSQL radši oficiální docs. Hlavní stack: Python, JS, HTML, PHP."} {"instruction": "Spočítej: 2 + 13 = ?", "input": "", "output": "2 + 13 = 15"} {"instruction": "Kolik je 9 - 5?", "input": "", "output": "9 - 5 = 4"} {"instruction": "Napiš SQL: vyber 15 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 15;\n```"} {"instruction": "Čau", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Co je refaktoring?", "input": "", "output": "Refaktoring vylepšuje strukturu kódu bez změny vnějšího chování."} {"instruction": "Napiš SQL: vyber 5 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 5;\n```"} {"instruction": "Kolik je 22 - 14?", "input": "", "output": "22 - 14 = 8"} {"instruction": "Mám `NoneType has no attribute append`. Co to znamená?", "input": "", "output": "Voláš `.append` na `None`. Typicky funkce nic nevrací (`return` chybí) nebo jsi přepsal proměnnou. Zkontroluj, že list opravdu existuje před append."} {"instruction": "Spočítej: 28 + 5 = ?", "input": "", "output": "28 + 5 = 33"} {"instruction": "Hello tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Simple PHP JSON API response.", "input": "", "output": "```php\n true, \"items\" => [1, 2, 3]], JSON_UNESCAPED_UNICODE);\n```"} {"instruction": "Spočítej: 9 + 6 = ?", "input": "", "output": "9 + 6 = 15"} {"instruction": "Spočítej: 4 + 14 = ?", "input": "", "output": "4 + 14 = 18"} {"instruction": "Kolik je 12 × 13?", "input": "", "output": "12 × 13 = 156"} {"instruction": "hello", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Napiš JS: vrať pole čísel 1..3.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 3}, (_, i) => i + 1);\n```"} {"instruction": "Translate to that language (rusky): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "Kolik je 4 × 2?", "input": "", "output": "4 × 2 = 8"} {"instruction": "HTML snippet: image alt", "input": "", "output": "```html\n\"Popis\n```"} {"instruction": "Co je framework? (stručně)", "input": "", "output": "Framework je připravená kostra aplikace s pravidly a nástroji (Django, React, Spring)."} {"instruction": "Kolik je 19 - 7?", "input": "", "output": "19 - 7 = 12"} {"instruction": "Uživatel se ptá na Python. Nejdřív pozdrav a zeptej se, co přesně řeší.", "input": "", "output": "Ahoj! Jasně, s Pythonem rád pomůžu. Co přesně potřebuješ — syntax, bug, návrh API, nebo něco jiného?"} {"instruction": "Spočítej 3×5", "input": "", "output": "3 × 5 = 15"} {"instruction": "What is 14 - 5?", "input": "", "output": "14 - 5 = 9"} {"instruction": "Ukaž JavaScript — unique.", "input": "", "output": "```javascript\nconst unique = arr => [...new Set(arr)];\n```"} {"instruction": "Proč `if x = 1` v Pythonu nefunguje?", "input": "", "output": "V Pythonu je `=` přiřazení, ne porovnání. Použij `==` pro rovnost: `if x == 1:`. Od 3.8 existuje walrus `:=` pro přiřazení ve výrazech, ale ne místo `==` v klasické podmínce."} {"instruction": "Implementuj v Pythonu fibonacci iterative.", "input": "", "output": "```python\ndef fib(n: int) -> int:\n if n < 0:\n raise ValueError\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n```"} {"instruction": "Spočítej: 23 + 10 = ?", "input": "", "output": "23 + 10 = 33"} {"instruction": "Napiš SQL: vyber 9 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 9;\n```"} {"instruction": "Napiš SQL: vyber 11 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 11;\n```"} {"instruction": "Event listener na button click.", "input": "", "output": "```javascript\ndocument.querySelector(\"#btn\").addEventListener(\"click\", () => {\n console.log(\"clicked\");\n});\n```"} {"instruction": "Napiš v Pythonu: retry.", "input": "", "output": "```python\nimport time\ndef retry(fn, n=3):\n for i in range(n):\n try:\n return fn()\n except Exception:\n if i == n-1: raise\n time.sleep(0.1)\n```"} {"instruction": "Napiš Python funkci: vrátí posledních n prvků (`last_n`).", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} {"instruction": "Vysvětli unit test?", "input": "", "output": "Unit test ověřuje malou část kódu (funkci/metodu) automaticky a opakovatelně."} {"instruction": "Spočítej: 14 + 4 = ?", "input": "", "output": "14 + 4 = 18"} {"instruction": "Odpověz pouze česky, stručně: barvy české vlajky?", "input": "", "output": "Česká vlajka má bílou, červenou a modrou."} {"instruction": "Kolik je 23 - 5?", "input": "", "output": "23 - 5 = 18"} {"instruction": "Spočítej: 2 + 4 = ?", "input": "", "output": "2 + 4 = 6"} {"instruction": "Ukaž čistý kód: sečte čísla v seznamu. Pojmenuj funkci `sum_list`.", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} {"instruction": "Napiš FastAPI CRUD kostru pro poznámky (in-memory).", "input": "", "output": "```python\nfrom fastapi import FastAPI, HTTPException\nfrom pydantic import BaseModel\n\napp = FastAPI()\nDB: dict[int, dict] = {}\n_seq = 0\n\nclass NoteIn(BaseModel):\n text: str\n\n@app.get(\"/notes\")\ndef list_notes():\n return list(DB.values())\n\n@app.post(\"/notes\")\ndef create_note(body: NoteIn):\n global _seq\n _seq += 1\n DB[_seq] = {\"id\": _seq, \"text\": body.text}\n return DB[_seq]\n\n@app.get(\"/notes/{note_id}\")\ndef get_note(note_id: int):\n if note_id not in DB:\n raise HTTPException(404)\n return DB[note_id]\n```"} {"instruction": "Kolik je 22 - 6?", "input": "", "output": "22 - 6 = 16"} {"instruction": "Spočítej: 26 + 4 = ?", "input": "", "output": "26 + 4 = 30"} {"instruction": "Čau", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Ukaž Python kód — merge dicts.", "input": "", "output": "```python\ndef merge(a, b):\n return {**a, **b}\n```"} {"instruction": "Spočítej: 20 + 13 = ?", "input": "", "output": "20 + 13 = 33"} {"instruction": "Mluv ukrajinsky.", "input": "", "output": "Tohle jazyk spolehlivě neovládám. Můžu česky nebo anglicky."} {"instruction": "Přelož do češtiny: I need help with a bug.", "input": "", "output": "Potřebuju pomoct s bugem."} {"instruction": "Vysvětli refaktoring?", "input": "", "output": "Refaktoring vylepšuje strukturu kódu bez změny vnějšího chování."} {"instruction": "Co je funkce?", "input": "", "output": "Funkce je pojmenovaný blok kódu, který bere vstupy a vrací výsledek. Umožňuje znovupoužití logiky."} {"instruction": "Kolik je 28 - 12?", "input": "", "output": "28 - 12 = 16"} {"instruction": "Spočítej 13×5", "input": "", "output": "13 × 5 = 65"} {"instruction": "Kolik je 17 - 7?", "input": "", "output": "17 - 7 = 10"} {"instruction": "Kolik je 26 × 7?", "input": "", "output": "26 × 7 = 182"} {"instruction": "Kolik je 6 × 5?", "input": "", "output": "6 × 5 = 30"} {"instruction": "Napiš JS: vrať pole čísel 1..1.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 1}, (_, i) => i + 1);\n```"} {"instruction": "Kolik je 9 - 3?", "input": "", "output": "9 - 3 = 6"} {"instruction": "Mám pomalý Python kód v cyklu. Co zkusit první?", "input": "", "output": "1) Změř hotspoty (`cProfile`, `time`).\n2) Nahraď čisté Python smyčky NumPy/pandas, pokud jde o čísla.\n3) Cache opakované výpočty.\n4) Vyhni se zbytečným alokacím v těle smyčky."} {"instruction": "Spočítej: 23 + 7 = ?", "input": "", "output": "23 + 7 = 30"} {"instruction": "Zdravím", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} {"instruction": "What is 8 - 5?", "input": "", "output": "8 - 5 = 3"} {"instruction": "Spočítej: 2 + 7 = ?", "input": "", "output": "2 + 7 = 9"} {"instruction": "Napiš TypeScript typ User s id, name, email?.", "input": "", "output": "```typescript\ntype User = {\n id: number;\n name: string;\n email?: string;\n};\n```"} {"instruction": "Potřebuju Python helper `invert_dict`: prohodí klíče a hodnoty (unikátní).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} {"instruction": "Spočítej 12×5", "input": "", "output": "12 × 5 = 60"} {"instruction": "Napiš SQL: vyber 14 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 14;\n```"} {"instruction": "Ahoj! tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} {"instruction": "Přelož do češtiny: Please review my pull request.", "input": "", "output": "Prosím o review mého pull requestu."} {"instruction": "Vysvětli pojem mutability česky a stručně.", "input": "", "output": "Mutabilita znamená, že objekt lze změnit po vytvoření (list, dict). Immutable typy (tuple, str, int) po vytvoření neměníš — operace vrací novou hodnotu."} {"instruction": "Jak se učit programovat?", "input": "", "output": "1) Malé projekty denně. 2) Čti chyby, ne jen výsledek. 3) Piš a spusť kód, netoliko sleduj tutoriály. 4) Začni Pythonem nebo JS — obojí umím pomoct."} {"instruction": "Jak vytvořím virtuální prostředí v Pythonu?", "input": "", "output": "```bash\npython3 -m venv .venv\nsource .venv/bin/activate # Windows: .venv\\Scripts\\activate\npip install -r requirements.txt\n```"} {"instruction": "HTML accessibility: button vs div onclick.", "input": "", "output": "Použij `\n );\n}\n```"} {"instruction": "Write Kotlin code for a hello world.", "input": "", "output": "I don't cover Kotlin. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Kolik je 6 × 13?", "input": "", "output": "6 × 13 = 78"} {"instruction": "Jen česky: k čemu je pip?", "input": "", "output": "pip je správce balíčků pro Python — instaluje knihovny z PyPI (`pip install název`)."} {"instruction": "Ukaž Python kód — word count.", "input": "", "output": "```python\nfrom collections import Counter\nimport re\ndef word_count(text):\n return dict(Counter(re.findall(r'\\w+', text.lower())))\n```"} {"instruction": "Napiš HTML: image alt.", "input": "", "output": "```html\n\"Popis\n```"} {"instruction": "Write a Python function `avg_list` that spočítej průměr.", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} {"instruction": "pokračuj", "input": "", "output": "Jasně — v čem mám pokračovat? Doplň prosím kontext (kód/úkol)."} {"instruction": "Kolik je 12 × 2?", "input": "", "output": "12 × 2 = 24"} {"instruction": "Kolik je 16 - 4?", "input": "", "output": "16 - 4 = 12"} {"instruction": "Write Swift code for a hello world.", "input": "", "output": "I don't cover Swift. I can do Python, JavaScript, HTML, or PHP instead."} {"instruction": "Implementuj `retry` v Pythonu — zavolá fn max n-krát při výjimce.", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} {"instruction": "What is 14 - 8?", "input": "", "output": "14 - 8 = 6"} {"instruction": "Čau tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Spočítej: 10 + 8 = ?", "input": "", "output": "10 + 8 = 18"} {"instruction": "Napiš v Pythonu: read lines.", "input": "", "output": "```python\ndef read_lines(path):\n with open(path, encoding='utf-8') as f:\n return f.read().splitlines()\n```"} {"instruction": "Implement `avg_list` in Python (spočítej průměr).", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} {"instruction": "hey", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} {"instruction": "Ahoj! tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} {"instruction": "Spočítej 4×5", "input": "", "output": "4 × 5 = 20"} {"instruction": "Kolik je 2 × 12?", "input": "", "output": "2 × 12 = 24"} {"instruction": "Translate to that language (čínsky): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "Python solution: Valid parentheses.", "input": "", "output": "```python\ndef valid_parens(s: str) -> bool:\n pairs = {')':'(', ']':'[', '}':'{'}\n st = []\n for ch in s:\n if ch in '([{':\n st.append(ch)\n elif ch in pairs:\n if not st or st[-1] != pairs[ch]:\n return False\n st.pop()\n return not st\n```"} {"instruction": "Spočítej: 28 + 8 = ?", "input": "", "output": "28 + 8 = 36"} {"instruction": "Spočítej: 17 + 10 = ?", "input": "", "output": "17 + 10 = 27"} {"instruction": "What is 23 - 5?", "input": "", "output": "23 - 5 = 18"} {"instruction": "Kolik je 12 - 10?", "input": "", "output": "12 - 10 = 2"} {"instruction": "Vysvětli pojem big O česky a stručně.", "input": "", "output": "Big O popisuje, jak roste čas/paměť s velikostí vstupu. O(1) konstantní, O(n) lineární, O(n log n) typicky dobré řazení, O(n²) vnořené smyčky."} {"instruction": "Kolik je 14 - 8?", "input": "", "output": "14 - 8 = 6"} {"instruction": "Spočítej 24×10", "input": "", "output": "24 × 10 = 240"} {"instruction": "Translate to German: Hello Buď upřímný.", "input": "", "output": "Němčinu spolehlivě neumím. Anglicky: Hello. Česky: Ahoj. Pokud potřebuješ němčinu, použij překladač nebo rodilého mluvčího."} {"instruction": "Kolik je 4 × 4?", "input": "", "output": "4 × 4 = 16"} {"instruction": "Write a Python function `read_lines` that načte řádky souboru.", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} {"instruction": "Write a Python function `last_n` that vrátí posledních n prvků.", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} {"instruction": "Napiš Python: context manager pro změnu pracovního adresáře.", "input": "", "output": "```python\nimport os\nfrom contextlib import contextmanager\n\n@contextmanager\ndef cwd(path):\n prev = os.getcwd()\n os.chdir(path)\n try:\n yield\n finally:\n os.chdir(prev)\n```"} {"instruction": "Kolik je 10 × 9?", "input": "", "output": "10 × 9 = 90"} {"instruction": "Potřebuju Python helper `read_lines`: načte řádky souboru.", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} {"instruction": "Kolik je 10 × 13?", "input": "", "output": "10 × 13 = 130"} {"instruction": "Show a Python class Stack.", "input": "", "output": "```python\nclass Stack:\n def __init__(self):\n self._d = []\n def push(self, x):\n self._d.append(x)\n def pop(self):\n if not self._d:\n raise IndexError(\"empty\")\n return self._d.pop()\n def peek(self):\n return self._d[-1]\n```"} {"instruction": "Napiš v Pythonu unique preserve order.", "input": "", "output": "```python\ndef unique(seq):\n seen = set()\n out = []\n for x in seq:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out\n```"} {"instruction": "Kolik je 21 - 7?", "input": "", "output": "21 - 7 = 14"} {"instruction": "Translate to English: Jak nainstaluju balíčky?", "input": "", "output": "How do I install packages?"} {"instruction": "Translate to that language (japonsky): Good morning", "input": "", "output": "Překlad do tohoto jazyka nezaručím. Anglicky: Good morning. Česky: Dobré ráno."} {"instruction": "JS: unikátní hodnoty v poli.", "input": "", "output": "```javascript\nconst unique = [...new Set(arr)];\n```"} {"instruction": "Napiš minimální HTML5 stránku s nadpisem.", "input": "", "output": "```html\n\n\n\n \n \n Moje stránka\n\n\n

Ahoj světe

\n\n\n```"} {"instruction": "Kolik je 22 × 7?", "input": "", "output": "22 × 7 = 154"} {"instruction": "Mluv francouzsky.", "input": "", "output": "Tohle jazyk spolehlivě neovládám. Můžu česky nebo anglicky."} {"instruction": "Kolik je 21 - 5?", "input": "", "output": "21 - 5 = 16"} {"instruction": "Spočítej 5×10", "input": "", "output": "5 × 10 = 50"} {"instruction": "What is 18 - 9?", "input": "", "output": "18 - 9 = 9"} {"instruction": "Kolik je 21 - 9?", "input": "", "output": "21 - 9 = 12"} {"instruction": "Kolik je 8 - 2?", "input": "", "output": "8 - 2 = 6"} {"instruction": "Kolik je 21 - 11?", "input": "", "output": "21 - 11 = 10"} {"instruction": "What is 10 - 4?", "input": "", "output": "10 - 4 = 6"}