-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmart.json
More file actions
216 lines (216 loc) · 37.1 KB
/
smart.json
File metadata and controls
216 lines (216 loc) · 37.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
{
"knowledge": {
"programming": {
"javascript closure": "A closure allows a function to remember variables from its outer scope even after the outer function has returned. Example: function counter(){ let n=0; return ()=>++n; }",
"javascript promise": "Promises represent eventual completion or failure of async operations. Use .then()/.catch() or async/await. Example: fetch(url).then(r=>r.json()).then(data=>console.log(data));",
"javascript async await": "async/await makes asynchronous code look synchronous. async function getData(){ const res = await fetch(url); return await res.json(); }",
"javascript event loop": "The JavaScript event loop processes asynchronous callbacks via call stack, Web APIs, callback queue, and microtask queue.",
"javascript dom": "DOM manipulation: document.getElementById('id'), document.querySelector('.class'), element.innerHTML, element.style.color, element.addEventListener('click', fn)",
"javascript array methods": "Arrays: map(), filter(), reduce(), forEach(), find(), some(), every(), flat(), flatMap(), includes(), indexOf(), splice(), slice()",
"javascript es6": "ES6+ features: arrow functions, template literals, destructuring, spread/rest, default params, modules (import/export), classes, let/const, optional chaining (?.), nullish coalescing (??)",
"javascript fetch": "fetch(url, {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(data)}).then(r=>r.json()).catch(err=>console.error(err))",
"javascript regex": "Regular expressions: /pattern/flags. Methods: test(), match(), replace(), split(). Example: /^[a-z]+$/i.test('Hello') // true",
"javascript localStorage": "localStorage.setItem('key','value'); localStorage.getItem('key'); localStorage.removeItem('key'); stores strings persistently in browser.",
"javascript prototype": "Every JS object has a prototype chain. Prototypal inheritance: Object.create(proto), class Foo extends Bar{}. Prototype methods are shared across instances.",
"javascript modules": "ES modules: export default function(){}, export const x=1; import Foo from './foo.js'; import {x} from './mod.js'; Dynamic: await import('./mod.js')",
"javascript websocket": "WebSocket for real-time: const ws=new WebSocket('ws://host'); ws.onmessage=e=>console.log(e.data); ws.send('hello');",
"javascript error handling": "try{ riskyCode(); }catch(e){ console.error(e.message); }finally{ cleanup(); } Custom: throw new Error('msg'); class MyError extends Error{}",
"react basics": "React: functional components with hooks. useState for state, useEffect for side effects, useRef for DOM refs, useContext for global state, useMemo/useCallback for optimization.",
"react hooks": "useState(init), useEffect(fn, deps), useRef(init), useContext(ctx), useMemo(fn, deps), useCallback(fn, deps), useReducer(reducer, init), custom hooks: function useName(){}",
"react component": "function MyComp({name}){ const [count,setCount]=useState(0); return <div onClick={()=>setCount(c=>c+1)}>{name}: {count}</div>; }",
"vue basics": "Vue 3 Composition API: setup(), ref(), reactive(), computed(), watch(), onMounted(). Template: v-bind, v-on, v-if, v-for, v-model.",
"node.js basics": "Node.js: server-side JavaScript. require('fs'), require('path'), require('http'). Use npm for packages. CommonJS (require) or ESM (import).",
"node.js express": "Express: const app=require('express')(); app.get('/',(req,res)=>res.json({ok:true})); app.listen(3000); Middleware: app.use(express.json());",
"python basics": "Python: print(), input(), len(), range(), type(). Variables don't need declaration. Indentation defines blocks. f-strings: f'Hello {name}'",
"python functions": "def greet(name, greeting='Hello'): return f'{greeting}, {name}!'\nLambda: fn = lambda x: x*2\n*args and **kwargs for variable arguments.",
"python list comprehension": "[x*2 for x in range(10) if x%2==0] — creates [0,4,8,12,16]. Dict comprehension: {k:v for k,v in items.items()}",
"python classes": "class Animal:\n def __init__(self,name): self.name=name\n def speak(self): return f'{self.name} speaks'\nclass Dog(Animal):\n def speak(self): return 'Woof!'",
"python decorators": "A decorator wraps a function: @decorator above def. Example: def timer(fn): def wrapper(*a): t=time(); fn(*a); print(time()-t); return wrapper",
"python async": "import asyncio\nasync def main(): await asyncio.sleep(1); print('done')\nasyncio.run(main())\naiohttp for async HTTP requests.",
"python data science": "pandas: df=pd.read_csv('file.csv'); df.head(); df.describe(); df.groupby('col').mean(). numpy: np.array(), np.zeros(), np.dot(). matplotlib for plotting.",
"python flask": "from flask import Flask,request,jsonify; app=Flask(__name__)\n@app.route('/api',methods=['POST'])\ndef api(): return jsonify({'result':42})\napp.run(debug=True)",
"python django": "Django: models.py defines DB schema, views.py handles requests, urls.py routes, templates for HTML. Migrations: python manage.py makemigrations && migrate.",
"html basics": "HTML5 semantic: <header>,<nav>,<main>,<article>,<section>,<aside>,<footer>. Forms: <input type='text/email/password/checkbox/radio'>, <select>, <textarea>, <button>.",
"html forms": "<form action='/submit' method='POST'><input name='email' type='email' required><input name='pass' type='password'><button type='submit'>Go</button></form>",
"html canvas": "<canvas id='c'></canvas><script>const ctx=document.getElementById('c').getContext('2d'); ctx.fillStyle='purple'; ctx.fillRect(10,10,100,50);</script>",
"css basics": "CSS selectors: element, .class, #id, [attr], :hover, ::before. Box model: margin, border, padding, content. Cascade: specificity, inheritance, importance.",
"css flexbox": "display:flex; flex-direction:row|column; justify-content:center|space-between|flex-start; align-items:center|stretch; flex-wrap:wrap; gap:16px;",
"css grid": "display:grid; grid-template-columns:repeat(3,1fr); grid-template-rows:auto; gap:16px; grid-column:span 2; place-items:center;",
"css animations": "@keyframes slide{from{transform:translateX(-100%)}to{transform:translateX(0)}} .el{animation:slide 0.3s ease-out forwards;}",
"css variables": ":root{--primary:#7a2cff;--bg:#1b0f33;} .btn{background:var(--primary);} Override: el.style.setProperty('--primary','red');",
"css responsive": "@media(max-width:768px){.grid{grid-template-columns:1fr;}} @media(prefers-color-scheme:dark){body{background:#000;}}",
"typescript basics": "TypeScript adds static types to JS. Types: string, number, boolean, any, unknown, never, void. Interface, type alias, generics<T>, enums. Compile: tsc file.ts",
"typescript interface": "interface User{id:number; name:string; email?:string;} function greet(u:User):string{ return `Hi ${u.name}`; }",
"sql basics": "SELECT name,age FROM users WHERE age>18 ORDER BY name ASC LIMIT 10; INSERT INTO users(name,age) VALUES('Alice',25); UPDATE users SET age=26 WHERE id=1;",
"sql joins": "INNER JOIN: matching rows both tables. LEFT JOIN: all left + matching right. FULL JOIN: all rows both sides. Example: SELECT u.name,o.total FROM users u LEFT JOIN orders o ON u.id=o.user_id;",
"sql indexes": "CREATE INDEX idx_email ON users(email); Speeds up WHERE/ORDER BY on indexed columns. B-tree index (default), hash index, composite index. EXPLAIN to check query plan.",
"sql transactions": "BEGIN; UPDATE accounts SET balance=balance-100 WHERE id=1; UPDATE accounts SET balance=balance+100 WHERE id=2; COMMIT; -- or ROLLBACK on error",
"nosql mongodb": "MongoDB: documents in collections. db.users.insertOne({name:'Alice'}); db.users.find({age:{$gt:18}}); db.users.updateOne({_id:id},{$set:{name:'Bob'}}); Mongoose for Node.js ORM.",
"nosql redis": "Redis: in-memory key-value store. SET key value EX 3600; GET key; DEL key; LPUSH list val; LRANGE list 0 -1; HSET hash field val; Great for caching, sessions, queues.",
"data structures": "Array O(1) access, O(n) search. Linked list O(n) access, O(1) insert at head. Hash map O(1) avg. Binary tree O(log n). Heap O(log n) insert/extract. Graph: BFS/DFS.",
"algorithms sorting": "Bubble O(n²), Selection O(n²), Insertion O(n²) best O(n). Merge O(n log n) stable. Quick O(n log n) avg O(n²) worst. Heap O(n log n). Counting O(n+k).",
"algorithms searching": "Linear O(n). Binary O(log n) — requires sorted array. BFS O(V+E) shortest path unweighted. DFS O(V+E) cycle detect, topo sort. Dijkstra O(E log V).",
"algorithms dynamic programming": "DP: solve subproblems, store results (memoization/tabulation). Classic problems: Fibonacci, knapsack, longest common subsequence, coin change, edit distance.",
"big o notation": "O(1) constant, O(log n) logarithmic, O(n) linear, O(n log n) linearithmic, O(n²) quadratic, O(2^n) exponential. Space complexity same analysis.",
"design patterns": "Singleton: one instance. Factory: create objects. Observer: event system. Strategy: swap algorithms. Decorator: add behavior. MVC: Model-View-Controller separation.",
"git basics": "git init, git clone url, git add ., git commit -m 'msg', git push origin main, git pull, git branch name, git checkout -b new-branch, git merge branch, git log --oneline",
"git advanced": "git rebase main, git cherry-pick hash, git stash / git stash pop, git reset --hard HEAD~1, git reflog, git bisect, git tag v1.0, git submodule add url",
"docker basics": "docker build -t name ., docker run -p 3000:3000 name, docker ps, docker stop id, docker-compose up -d, Dockerfile: FROM node:18, WORKDIR /app, COPY . ., RUN npm install, CMD ['node','index.js']",
"kubernetes basics": "kubectl apply -f deployment.yaml, kubectl get pods, kubectl logs pod-name, kubectl exec -it pod -- bash. Deployment: replicas, rollingUpdate. Service: ClusterIP, NodePort, LoadBalancer.",
"rest api": "REST: GET /users, POST /users, PUT /users/:id, DELETE /users/:id. Status codes: 200 OK, 201 Created, 400 Bad Request, 401 Unauthorized, 404 Not Found, 500 Server Error.",
"graphql": "GraphQL: single endpoint, typed schema. Query: {users{id name}}. Mutation: mutation{createUser(name:'Bob'){id}}. Subscriptions for real-time. Apollo Client/Server popular.",
"websockets": "ws = new WebSocket('wss://host'); ws.onopen=()=>ws.send('hi'); ws.onmessage=e=>console.log(e.data); Server: Node ws package or Socket.io for rooms/namespaces.",
"machine learning": "ML types: supervised (labeled data), unsupervised (clustering), reinforcement (rewards). Libraries: scikit-learn, TensorFlow, PyTorch. Concepts: training/test split, overfitting, cross-validation.",
"neural networks": "Layers: input, hidden, output. Activation: ReLU, sigmoid, softmax. Loss: MSE, cross-entropy. Optimizer: Adam, SGD. Backpropagation updates weights via gradients.",
"system design": "Key concepts: load balancer, CDN, caching (Redis/Memcached), database sharding, microservices, message queues (Kafka/RabbitMQ), API gateway, rate limiting, circuit breaker.",
"cloud aws": "AWS core: EC2 (compute), S3 (storage), RDS (database), Lambda (serverless), API Gateway, CloudFront (CDN), Route53 (DNS), IAM (access control), VPC (networking).",
"security web": "XSS: sanitize input, CSP headers. SQL injection: parameterized queries. CSRF: tokens. Auth: JWT (stateless), sessions (stateful). HTTPS always. bcrypt for passwords. Rate limiting.",
"linux basics": "ls, cd, mkdir, rm -rf, cp, mv, cat, grep, find, chmod, chown, ps aux, kill, top, df -h, du -sh, ssh user@host, scp file user@host:/path, curl, wget, tar -xzf",
"regex": "^start, end$, . any char, * zero+, + one+, ? optional, [abc] class, [^abc] not, \\d digit, \\w word, \\s space, (group), | or, {n,m} count. Flags: g global, i case-insensitive, m multiline.",
"web performance": "Minimize/bundle JS/CSS. Lazy load images. Use CDN. Enable gzip/brotli. HTTP/2. Cache headers. Code splitting. Tree shaking. Critical CSS inline. Service workers for offline.",
"pwa": "Progressive Web App: manifest.json for installability, service worker for offline caching, push notifications, responsive, HTTPS required. Lighthouse score target 90+.",
"testing": "Unit: jest, mocha, pytest. Integration: supertest, Cypress. E2E: Playwright, Selenium. TDD: write test first. Coverage: aim 80%+. Mocking: jest.mock(), unittest.mock.",
"typescript generics": "function identity<T>(arg:T):T{return arg;} interface Box<T>{value:T;} Generic constraints: <T extends {length:number}>. Utility types: Partial<T>, Required<T>, Pick<T,K>, Omit<T,K>.",
"functional programming": "Pure functions (no side effects), immutability, higher-order functions, function composition, map/filter/reduce, currying, monads. Avoids shared mutable state.",
"rust basics": "Rust: memory safety without GC. Ownership, borrowing, lifetimes. let mut x=5; fn add(a:i32,b:i32)->i32{a+b} struct Point{x:f64,y:f64} impl Point{fn dist(&self)->f64{}}",
"go basics": "Go: statically typed, fast compile. package main; import 'fmt'; func main(){ fmt.Println('hello') } Goroutines: go func(){...}() Channels: ch:=make(chan int); ch<-1; val:=<-ch",
"example js file": "// JavaScript Example\nfunction greet(name) {\n return `Hello, ${name}!`;\n}\n\nasync function fetchData(url) {\n const res = await fetch(url);\n return await res.json();\n}\n\nconst nums = [1,2,3,4,5];\nconst doubled = nums.map(n => n * 2);\nconsole.log(greet('Dolores'));\nconsole.log('Doubled:', doubled);",
"example python file": "# Python Example\ndef greet(name):\n return f'Hello, {name}!'\n\ndef add(a, b):\n return a + b\n\nnums = [1,2,3,4,5]\ndoubled = [n*2 for n in nums]\n\nprint(greet('Dolores'))\nprint('Sum:', sum(nums))\nprint('Doubled:', doubled)",
"example html file": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Dolores Page</title>\n <style>\n body { background:#1b0f33; color:white; font-family:Arial,sans-serif; text-align:center; padding:40px; }\n h1 { background:linear-gradient(135deg,#7a2cff,#d38cff); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }\n button { background:#7a2cff; color:white; border:none; padding:10px 24px; border-radius:8px; cursor:pointer; font-size:16px; }\n </style>\n</head>\n<body>\n <h1>Hello from Dolores!</h1>\n <p>Nerevions Assistant</p>\n <button onclick=\"alert('Hello!')\">Click Me</button>\n</body>\n</html>",
"example css file": "/* Dolores Theme CSS */\n:root {\n --purple-dark: #1b0f33;\n --purple-mid: #7a2cff;\n --purple-light: #d38cff;\n}\nbody {\n background: var(--purple-dark);\n color: white;\n font-family: Arial, sans-serif;\n margin: 0; padding: 20px;\n}\nh1 {\n background: linear-gradient(135deg, var(--purple-mid), var(--purple-light));\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n.card {\n background: #2b1a54;\n border-radius: 12px;\n padding: 16px;\n margin: 12px 0;\n}",
"example react file": "import { useState, useEffect } from 'react';\n\nexport default function App() {\n const [count, setCount] = useState(0);\n const [data, setData] = useState(null);\n\n useEffect(() => {\n fetch('https://api.example.com/data')\n .then(r => r.json())\n .then(setData);\n }, []);\n\n return (\n <div>\n <h1>Count: {count}</h1>\n <button onClick={() => setCount(c => c + 1)}>Add</button>\n {data && <pre>{JSON.stringify(data, null, 2)}</pre>}\n </div>\n );\n}",
"example java file": "// Java Example\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class Main {\n public static String greet(String name) {\n return \"Hello, \" + name + \"!\";\n }\n\n public static void main(String[] args) {\n System.out.println(greet(\"Dolores\"));\n List<Integer> nums = Arrays.asList(1,2,3,4,5);\n List<Integer> doubled = nums.stream().map(n->n*2).collect(Collectors.toList());\n System.out.println(\"Doubled: \" + doubled);\n }\n}",
"example cpp file": "// C++ Example\n#include <iostream>\n#include <vector>\n#include <algorithm>\n\nstd::string greet(std::string name) {\n return \"Hello, \" + name + \"!\";\n}\n\nint main() {\n std::cout << greet(\"Dolores\") << std::endl;\n std::vector<int> nums = {1,2,3,4,5};\n std::transform(nums.begin(),nums.end(),nums.begin(),[](int n){return n*2;});\n for(int n:nums) std::cout << n << \" \";\n std::cout << std::endl;\n return 0;\n}"
},
"science": {
"gravity": "Gravity is the force attracting masses together. F=Gm₁m₂/r². Earth's gravity: 9.81 m/s². Described by Newton's law and more precisely by Einstein's general relativity.",
"atom": "Atoms: protons (positive) + neutrons (neutral) in nucleus, electrons (negative) in shells. Atomic number = protons. Isotopes have same protons, different neutrons.",
"quantum mechanics": "QM describes matter at subatomic scales. Wave-particle duality, Heisenberg uncertainty principle, superposition, quantum entanglement, Schrödinger equation. Basis of modern electronics.",
"relativity": "Special relativity: speed of light constant, time dilation, length contraction, E=mc². General relativity: gravity = spacetime curvature, predicts black holes, gravitational waves.",
"thermodynamics": "Laws: 1st energy conserved, 2nd entropy always increases, 3rd absolute zero unattainable. Concepts: heat, work, enthalpy, entropy, Carnot efficiency, heat engines.",
"electromagnetism": "Maxwell's equations unify electricity and magnetism. F=qE+qv×B. Light is electromagnetic wave. Electric potential V, current I=V/R, power P=IV. AC/DC circuits.",
"optics": "Light travels at 3×10⁸ m/s in vacuum. Reflection, refraction (Snell's law), diffraction, interference. Lenses: convex converges, concave diverges. Lasers: coherent light.",
"nuclear physics": "Fission: heavy nuclei split (nuclear reactors, bombs). Fusion: light nuclei combine (sun, fusion reactors). Radioactive decay: alpha, beta, gamma. Half-life concept.",
"chemistry basics": "Periodic table: 118 elements. Groups (columns) share properties. Periods (rows) = electron shells. Metals, nonmetals, metalloids. Electronegativity, ionization energy, atomic radius.",
"chemical bonding": "Ionic: electron transfer (NaCl). Covalent: electron sharing (H₂O, CO₂). Metallic: delocalized electrons. Hydrogen bonds: between H and O/N/F — gives water unique properties.",
"organic chemistry": "Carbon compounds. Functional groups: hydroxyl (-OH), carbonyl (C=O), carboxyl (-COOH), amino (-NH₂), ether (-O-). Alkanes, alkenes, alkynes, aromatics (benzene ring).",
"biology basics": "Cell types: prokaryote (no nucleus, bacteria) and eukaryote (nucleus, plants/animals/fungi). Cell organelles: nucleus, mitochondria, ribosomes, endoplasmic reticulum, Golgi.",
"genetics": "DNA is double helix of base pairs (A-T, G-C). Genes encoded in DNA. Transcription: DNA→RNA. Translation: RNA→protein. Mutation, natural selection, Mendelian inheritance.",
"evolution": "Natural selection: heritable variation + differential reproduction = adaptation. Evidence: fossil record, DNA similarity, comparative anatomy, direct observation of evolution.",
"human anatomy": "Organ systems: skeletal, muscular, circulatory, respiratory, digestive, nervous, endocrine, immune, urinary, reproductive. Heart pumps ~5L blood/min. Brain: ~86 billion neurons.",
"astronomy": "Solar system: Sun + 8 planets. Light year: distance light travels in 1 year (~9.46×10¹² km). Galaxy: ~100–400 billion stars. Observable universe: ~93 billion light years across.",
"black holes": "Black holes form from collapsed massive stars. Event horizon: point of no return. Singularity: infinite density. Hawking radiation: quantum effect causing slow evaporation.",
"climate science": "Greenhouse gases (CO₂, CH₄, N₂O) trap heat. Global warming: avg temp up ~1.2°C since 1880. Effects: sea level rise, extreme weather, ecosystem disruption. Paris Agreement: limit to 1.5°C.",
"physics energy": "Energy types: kinetic (½mv²), potential (mgh), thermal, chemical, nuclear, electromagnetic. Conservation of energy. Power = energy/time. Efficiency = useful output/total input.",
"waves": "Wave properties: wavelength, frequency, amplitude, speed. v=fλ. Mechanical waves need medium (sound). Electromagnetic waves don't (light). Doppler effect: frequency shifts with motion."
},
"math": {
"derivative": "A derivative represents the rate of change. d/dx[xⁿ]=nxⁿ⁻¹. Product rule, chain rule, quotient rule. dy/dx at a point = slope of tangent. Applications: optimization, physics.",
"integral": "Integration is anti-differentiation. ∫xⁿdx = xⁿ⁺¹/(n+1)+C. Definite integral = area under curve. Fundamental theorem: ∫[a,b]f(x)dx = F(b)-F(a). Integration by parts, substitution.",
"matrix": "Matrix: grid of numbers. Addition: element-wise. Multiplication: row×column dot products. Identity matrix I. Inverse: A×A⁻¹=I. Determinant. Applications: linear systems, 3D graphics.",
"linear algebra": "Vectors: magnitude and direction. Dot product: a·b=|a||b|cos θ. Cross product gives perpendicular vector. Eigenvalues/eigenvectors: Av=λv. Basis, span, linear independence.",
"probability": "P(A) = favorable/total. P(A∪B) = P(A)+P(B)-P(A∩B). Conditional: P(A|B)=P(A∩B)/P(B). Bayes theorem. Distributions: normal, binomial, Poisson, uniform.",
"statistics": "Mean = sum/n. Median = middle value. Mode = most frequent. Variance = avg squared deviation. Std dev = √variance. Correlation (-1 to 1). Hypothesis testing: p-value, t-test, chi-square.",
"calculus limits": "lim(x→a)f(x): value f approaches as x→a. L'Hôpital's rule for 0/0 or ∞/∞ forms. Continuity: limit exists, f(a) defined, they're equal. Derivatives defined via limits.",
"number theory": "Prime numbers: divisible only by 1 and themselves. Fundamental theorem of arithmetic: unique prime factorization. GCD, LCM. Modular arithmetic. Fermat's little theorem.",
"discrete math": "Sets, logic (AND/OR/NOT/XOR), propositional calculus, graph theory (nodes/edges), trees, combinatorics (permutations n!, combinations nCr=n!/(r!(n-r)!)), Boolean algebra.",
"geometry": "Euclidean: points, lines, planes, angles, triangles, circles. Pythagorean theorem: a²+b²=c². Circle: area=πr², circumference=2πr. Trigonometry: sin, cos, tan, SOH-CAH-TOA.",
"trigonometry": "sin θ = opposite/hypotenuse, cos θ = adjacent/hypotenuse, tan θ = opposite/adjacent. Unit circle. sin²+cos²=1. sin(a+b)=sin a cos b + cos a sin b. Radians vs degrees.",
"complex numbers": "Complex: a+bi where i=√(-1). Operations like real numbers. Magnitude |z|=√(a²+b²). Euler's formula: e^(iθ)=cos θ+i sin θ. Fundamental theorem of algebra.",
"algebra basics": "Solve equations by inverse operations. Quadratic: ax²+bx+c=0, x=(-b±√(b²-4ac))/2a. Systems of equations: substitution, elimination, matrices. Inequalities, absolute value."
},
"history": {
"world history overview": "Major eras: Prehistoric, Ancient (3000 BCE–500 CE), Medieval (500–1500), Early Modern (1500–1800), Modern (1800–present). Key: agriculture revolution, writing, industrialization, digital age.",
"ancient civilizations": "Mesopotamia (Sumer, Babylon), Ancient Egypt (pharaohs, pyramids), Indus Valley, Ancient China (dynasties), Ancient Greece (democracy, philosophy), Roman Empire.",
"world war 1": "WW1 (1914–1918): triggered by assassination of Archduke Franz Ferdinand. Triple Alliance vs Triple Entente. Trench warfare, 17M+ deaths. Ended with Treaty of Versailles.",
"world war 2": "WW2 (1939–1945): Nazi Germany invaded Poland. Allied vs Axis powers. Holocaust: 6M+ Jewish people killed. Ended with atomic bombs on Japan. Founded UN, Cold War began.",
"cold war": "Cold War (1947–1991): USA vs USSR ideological conflict. Arms race, space race, proxy wars (Korea, Vietnam, Afghanistan). Berlin Wall. Cuban Missile Crisis. Ended with USSR collapse.",
"civil rights movement": "US Civil Rights Movement (1954–1968): ended racial segregation. Key figures: MLK Jr, Rosa Parks, Malcolm X. Brown v Board, March on Washington, Civil Rights Act 1964.",
"industrial revolution": "1760–1840: mechanized production, steam power, urbanization. Began in Britain. Textile mills, railways, steel production. Transformed society from agrarian to industrial.",
"renaissance": "14th–17th century European cultural rebirth. Art (da Vinci, Michelangelo), science (Galileo, Copernicus), literature (Shakespeare). Humanism, perspective, printing press.",
"french revolution": "1789–1799: overthrew French monarchy. Liberty, equality, fraternity. Declaration of Rights of Man. Reign of Terror, guillotine. Led to Napoleon Bonaparte's rise.",
"american history": "1776 Declaration of Independence. Constitution 1787. Civil War 1861–1865 ended slavery. Reconstruction, industrialization, WWI, Great Depression, WWII, Civil Rights, Cold War, 9/11."
},
"geography": {
"world geography": "7 continents: Asia (largest), Africa, North America, South America, Antarctica, Europe, Australia/Oceania. 5 oceans: Pacific (largest), Atlantic, Indian, Southern, Arctic.",
"countries capitals": "USA-Washington DC, UK-London, France-Paris, Germany-Berlin, Japan-Tokyo, China-Beijing, India-New Delhi, Brazil-Brasília, Russia-Moscow, Australia-Canberra, Canada-Ottawa.",
"world rivers": "Longest rivers: Nile (Africa, 6650km), Amazon (S. America, 6400km), Yangtze (China, 6300km), Mississippi (USA, 6275km), Yenisei (Russia), Yellow River (China).",
"world mountains": "Highest peaks: Everest (8849m, Nepal/Tibet), K2 (8611m), Kangchenjunga (8586m). Major ranges: Himalayas, Andes, Alps, Rockies, Appalachians, Atlas, Urals.",
"climate zones": "Tropical (near equator, hot/wet), Subtropical (dry/wet seasons), Temperate (4 seasons), Continental (hot summers, cold winters), Polar (always cold), Tundra, Desert, Mediterranean."
},
"economics": {
"economics basics": "Economics: allocation of scarce resources. Microeconomics: individual/firm decisions. Macroeconomics: national/global economy. Supply and demand, markets, GDP, inflation, unemployment.",
"supply and demand": "Supply increases → price decreases. Demand increases → price increases. Equilibrium: quantity supplied = quantity demanded. Elasticity: how responsive quantity is to price change.",
"gdp": "GDP = C + I + G + (X-M). Consumption + Investment + Government spending + Net exports. Measures economic output. GDP per capita = GDP/population. Real GDP adjusts for inflation.",
"inflation": "Inflation: general rise in price level. CPI measures consumer price changes. Causes: demand-pull, cost-push, monetary. Central banks use interest rates to control inflation. Target ~2%.",
"personal finance": "Budget: income - expenses. Emergency fund: 3-6 months expenses. Invest early (compound interest). Diversify portfolio. 401k/IRA for retirement. Credit score: payment history, utilization, length.",
"investing": "Stocks: ownership shares, higher risk/return. Bonds: loans to companies/govts, lower risk. Index funds: diversified, low cost. Rule of 72: 72/interest rate = years to double. Dollar-cost averaging.",
"cryptocurrency": "Blockchain: distributed ledger of transactions. Bitcoin: first crypto, limited to 21M coins. Ethereum: smart contracts platform. Proof of work vs proof of stake. Highly volatile.",
"stock market": "NYSE, NASDAQ major US exchanges. Bull market: rising prices. Bear market: falling 20%+. P/E ratio: price/earnings per share. Diversification reduces risk. Long-term historically positive."
},
"psychology": {
"psychology basics": "Psychology: study of mind and behavior. Branches: clinical, cognitive, developmental, social, neuropsychology. Methods: experiments, observations, surveys, case studies.",
"cognitive biases": "Common biases: confirmation bias (seek info confirming beliefs), anchoring (rely on first info), availability heuristic (recent events seem more likely), Dunning-Kruger effect.",
"motivation": "Maslow's hierarchy: physiological → safety → belonging → esteem → self-actualization. Intrinsic motivation (internal rewards) vs extrinsic (external rewards). Flow state.",
"memory": "Memory types: sensory (1-3 sec), short-term/working (20 sec, 7±2 items), long-term (unlimited). Encoding, storage, retrieval. Mnemonics, spaced repetition, sleep improves memory.",
"learning": "Classical conditioning (Pavlov), operant conditioning (Skinner: rewards/punishment). Observational learning (Bandura). Growth mindset: intelligence can be developed with effort.",
"mental health": "Common conditions: anxiety disorders (most common), depression, PTSD, OCD, ADHD, bipolar. Treatments: CBT (cognitive behavioral therapy), medication, mindfulness, exercise, social support."
},
"philosophy": {
"philosophy basics": "Major branches: metaphysics (nature of reality), epistemology (knowledge), ethics (morality), logic (reasoning), aesthetics (beauty). Ancient Greeks laid foundations.",
"ethics": "Ethical theories: consequentialism (judge by outcomes, utilitarianism), deontology (duty-based, Kant's categorical imperative), virtue ethics (character), contractarianism (social contract).",
"logic": "Deductive: valid if conclusion follows from premises. Inductive: probable conclusions from observations. Fallacies: ad hominem, straw man, false dichotomy, slippery slope, appeal to authority.",
"famous philosophers": "Socrates (know thyself), Plato (forms, republic), Aristotle (logic, virtue ethics), Descartes (cogito ergo sum), Kant (categorical imperative), Nietzsche (will to power, nihilism).",
"existentialism": "Focus on individual freedom, choice, responsibility. Sartre: existence precedes essence. Camus: absurdism. Heidegger: being and time. We create our own meaning."
},
"writing": {
"writing email": "Subject line clear and specific. Opening: context/reason. Body: one main point per paragraph, be concise. Closing: action item or next step. Sign-off: Best/Thanks/Regards + name.",
"writing essay": "5-paragraph structure: intro (hook + thesis), 3 body paragraphs (claim + evidence + analysis), conclusion (restate thesis + broader significance). Use transitions between paragraphs.",
"writing story": "Story elements: character (want + flaw), conflict (external/internal), setting, plot (inciting incident, rising action, climax, falling action, resolution). Show don't tell. Subtext.",
"writing resume": "One page if under 10 years experience. Sections: summary, experience (STAR format: situation, task, action, result), skills, education. Tailor to each job. Use keywords from posting.",
"grammar tips": "Active voice stronger than passive. Vary sentence length. Avoid filler words (very, really, just, that). Consistent tense. Oxford comma. Em dash for emphasis — like this. Proofread.",
"technical writing": "Technical writing: clarity over style. Define acronyms on first use. Use numbered steps for procedures. Headers and white space improve readability. Know your audience's technical level."
},
"health": {
"nutrition basics": "Macronutrients: carbs (4 cal/g, main energy), protein (4 cal/g, muscle/repair), fat (9 cal/g, hormones/brain). Micronutrients: vitamins, minerals. Hydration: ~2L water/day.",
"exercise": "Cardio: improves heart health, burns calories. Strength training: builds muscle, boosts metabolism. Flexibility: reduces injury. Aim: 150 min moderate or 75 min vigorous cardio + 2x strength/week.",
"sleep": "Adults need 7-9 hours. Sleep stages: light, deep (NREM), REM (dreaming). Functions: memory consolidation, tissue repair, immune function. Tips: consistent schedule, dark/cool room.",
"mental wellness": "Mental health practices: mindfulness/meditation, regular exercise, social connection, therapy/counseling, journaling, limiting alcohol/caffeine, nature exposure, creative activities.",
"vitamins minerals": "Vitamin D: immune/bone health (sunlight, dairy). Vitamin C: antioxidant/immune (citrus). B12: nerve/blood (meat, eggs). Iron: oxygen transport (red meat, leafy greens). Calcium: bones (dairy, leafy greens)."
},
"technology": {
"artificial intelligence": "AI: machines performing tasks requiring human intelligence. ML: learn from data. Deep learning: neural networks with many layers. NLP: language understanding. Computer vision: image recognition.",
"blockchain": "Decentralized ledger of transactions in cryptographically linked blocks. Consensus mechanisms: proof of work, proof of stake. Smart contracts: self-executing code on blockchain.",
"internet of things": "IoT: physical devices connected to internet. Smart home (thermostats, lights), industrial sensors, wearables. Protocols: MQTT, HTTP, CoAP. Security challenges with many endpoints.",
"cybersecurity": "Threats: phishing, ransomware, SQL injection, XSS, DDoS, man-in-the-middle. Defense: firewalls, encryption, 2FA, regular updates, principle of least privilege, security audits.",
"virtual reality": "VR: fully immersive digital environment (headset blocks real world). AR: digital overlay on real world (phone/glasses). MR: physical and digital interact. Applications: gaming, training, medicine.",
"tech history": "1940s: first computers (ENIAC). 1970s: personal computers. 1990s: World Wide Web. 2000s: smartphones, social media. 2010s: cloud, AI, big data. 2020s: AI/LLM revolution, spatial computing."
},
"music": {
"music theory basics": "Notes: A B C D E F G (+ sharps/flats). Octaves: 12 semitones. Scales: major (bright), minor (dark). Intervals: unison, 2nd, 3rd, 4th, 5th, 6th, 7th, octave.",
"music chords": "Chord: 3+ notes played together. Major chord: root + major 3rd + perfect 5th (bright). Minor: root + minor 3rd + perfect 5th (sad). 7th chords, suspended chords, inversions.",
"music rhythm": "Beat: basic pulse. Tempo (BPM): speed. Time signatures: 4/4 (most common), 3/4 (waltz), 6/8. Note values: whole, half, quarter, eighth, sixteenth. Syncopation: off-beat emphasis.",
"music genres": "Classical (Bach, Mozart, Beethoven), Jazz (improvisation, swing), Blues (12-bar), Rock (electric guitar), Hip-hop (beats, rap), Electronic (synthesizers, EDM), Pop (hooks, verse-chorus)."
},
"languages": {
"learning languages": "Most spoken: Mandarin, Spanish, English, Hindi, Arabic, French, Bengali, Russian, Portuguese, Urdu. Tips: immersion, spaced repetition (Anki), speaking from day 1, comprehensible input.",
"english grammar": "Parts of speech: noun, verb, adjective, adverb, pronoun, preposition, conjunction, interjection. Tenses: simple, continuous, perfect, perfect continuous. Active/passive voice.",
"spanish basics": "Hola (hello), gracias (thank you), por favor (please), ¿Cómo estás? (how are you?). Ser vs estar both mean 'to be'. Nouns have gender (masculine/feminine). Verb conjugation by person.",
"french basics": "Bonjour (hello), merci (thank you), s'il vous plaît (please), Comment allez-vous? (how are you?). Silent letters common. Nasal vowels. Gendered nouns. Liaison between words."
}
},
"debug": {
"undefined variable": "Declare the variable using let, const, or var before using it.",
"null reference": "Check if object is null/undefined before accessing properties. Use optional chaining: obj?.property. Use nullish coalescing: value ?? 'default'.",
"cors error": "Enable Access-Control-Allow-Origin headers on the server. For development use a proxy. In Express: app.use(require('cors')()). CORS is a browser security feature.",
"python indentation": "Python requires consistent indentation. Use 4 spaces (PEP8 standard). Don't mix tabs and spaces. IndentationError means wrong level.",
"type error": "TypeError: operating on wrong type. Check variable types with typeof (JS) or type() (Python). Ensure you're not calling non-functions or accessing properties of null.",
"async not waiting": "Forgetting await: use async/await or .then(). Make sure the containing function is async. In loops use Promise.all([promises]) or for...of with await.",
"infinite loop": "Check loop condition terminates. Ensure loop variable is modified. For recursion: verify base case exists and is reachable. Use debugger or add console.log to trace.",
"memory leak": "JS: clear event listeners (removeEventListener), clear intervals (clearInterval), avoid unintended closures holding large data. Node: watch for unclosed connections/streams.",
"404 not found": "Check URL is correct. Verify route is defined on server. Check file path exists. In SPAs configure server to serve index.html for all routes.",
"500 server error": "Server-side error. Check server logs. Add try/catch around async operations. Validate input before processing. Return proper error responses with status codes.",
"git merge conflict": "git status to see conflicted files. Edit files to resolve <<<<<<<, =======, >>>>>>> markers. git add resolved files. git commit to complete merge.",
"npm install error": "Delete node_modules and package-lock.json, run npm install again. Check Node version (nvm use). Try npm cache clean --force. Check for peer dependency conflicts."
}
}