cho.sh
2,244 notes
Liked on XI made a mistake. When Jack and I decided to organize this $100K Hackathon, my biggest concern was cheating. Unlike a regular hackathon, everyone participates from home. And because the winner is whoever makes the most PROFIT (not revenue), there are so many ways to manipulate the numbers. So I added a $99 entry fee. One thing I’ve learned from building businesses is that people tend to be more committed when they pay for something. I thought it would filter out spam, attract serious builders, and make the competition fairer for everyone. But I completely missed the other side. 3 years ago, I was a living with my apps. Today, I’m financially free. My life changed so much that somewhere along the way, I lost perspective on what $99 means to someone else. For someone in India, someone struggling to pay their bills, or someone trying to make their first dollar online, $99 can be a lot of money. And those are exactly the people I want to help! I’ve spent years sharing what I’ve learned, reviewing random people’s landing pages, and organizing free meetups around the world. Not because there’s money to make, but because I genuinely love seeing people build things and succeed. And somehow, I was so focused on keeping cheaters out that I didn’t realize I was also keeping genuine builders out. That’s my mistake. So I’ve decided to make the $100K Hackathon completely FREE :) Everyone who already paid got a full refund. I’m still worried about cheating. That problem hasn’t disappeared, and Jack and I will have to figure out better ways to verify profits and keep the leaderboard fair. But that’s our problem to solve. Thank you to everyone who shared their thoughts. Sometimes you need people to remind you of things you’ve forgotten. I genuinely hope this hackathon changes someone’s life. ❤️Liked on XIt’s time to bring back Cafe CursorPosted on Xyo @pendev i can't live share edit a .pen file? it's the most needed featurePosted on XI'm coining a word "Agentsplaining" Agents condescendingly assuming the user don't know fuck and repeating the obviousReplied on X@jayhxmo @raycast Hard to explain. It's the small detailsPosted on X@raycast iOS keyboard is insanely good. Might resub Raycast pro just cuz of thisReplied on X@ishuagra02 I saw a theory that F5.2 is a post train of 5.1, but O5.5 is a distillation of F5.5(unreleased new pretrain) and thats why O5.5 > F5.2Liked on X@anaclumos don't know what is actually improved 👀Posted on Xam i the only one underimpressed with 5.2 fableReplied on X@bvvst great minds think alike https://t.co/YRFWhb1mcOLiked on XClaude Fable 5.2 is out and it's the perfect time to run this god-level prompt on your codebase: "I want you to audit our codebase, is anything here unnecessary, overly complicated in our current setup, or based on weak assumptions? Challenge them. - What can be deleted entirely? - What can be simplified now that unnecessary pieces are gone? Then make the changes. Prefer deleting over simplifying, simplifying over optimizing, and optimizing over automating. This product is being used by thousands of customers, do not cut any corners." This prompt is one I run often and leads to the best results.Replied on X@akshayadinesh19 @bot can we please BYOM for botsLiked on XTo be fair, the Chinese models have a much lower refusal rateLiked on XF*CK IT, im creating a library of AI slop indicators. my feed is full of taste larpers. stay tuned https://t.co/5Muv8nQRm3Liked on XJENSEN! THATS NOT WHAT WE MEANT BY CHINESE MODELS!!!!!!!Liked on Xmy parents had to declare bankruptcy when I was a kid, so they had every reason to pressure me towards a more stable career path instead, they were so patient with me, even as i failed startup after startup for years so getting to tell my mom that everything turned out okay was a really special moment :) for those who can't read Korean, her first message roughly translates to: "Really!!! Congratulations my son. So much :') Thank you God!" i know I've been posting about my exit for like a week now, but it really is a big deal for me and my family! i'll share more about how this all happened and some tactical advice later this week, but for now i'm just riding out all the emotions to quote my mom, thank you God!!!!Liked on X@thefarmers_Dog it stands for Egg GzampleLiked on X🦍 Introducing Memorilla: memory as a modality for LLMs Memorilla turns everything a frozen LLM needs to remember into just 16 memory embeddings ⚡ It uses up to 4,212× fewer tokens and is 27× faster than full context inference while more accurate 🎯 Pushes the Pareto frontier over RAG and agentic memory in personalization, long-document and knowledge QA A thread 🧵:Liked on XThere's a huge product opportunity downstream of Tailscale etc too. At @tldraw we've started designing for "high trust networks" and it's been a beautiful thing. 1. Features that would be a nightmare on the internet are okay on my computer and mostly okay on private networks. Websites that execute user-generated scripts, control production systems, allow for users to send desktop notifications, spend tokens, or directly prompt my agent. Crazy stuff that would only make sense if everyone was in a committed polycule. 2. When everyone on the server can be trusted to have _external_ reasons for good behavior (eg keeping their job, or maintaining friends, family, church, mafia org), the software can be designed in a default social way. Most apps default to isolation, low horizontal visibility, highly restricted collaboration. Makes sense if the social contracts are inside of the app, but if you can trust that they live outside of the app then you can get wild. Example being small group chat names as an emergent comedy phenomenon because anyone in the group can change the name. 3. This can work for commercial products, too, not just internal stuff. Security matters more than ever but the way we've seen that manifest is that more companies are more confident in their own solutions than anything we could provide, to the point where owning data and access is a better value proposition than having it managed. Always has been true for big companies but now even small companies can get a good secure network set up pretty easily, and the hooks we need to build are easy enough. tldraw offline got us started down this road (and shout out to @pendev for first introducing me to the idea of desktop + mcp). We've been bringing that product to private networks and it's been exciting to see how much we can get away with. Keep an eye outReplied on X@saradu birds eye viewLiked on XApplications close in 2 days!! If you have a cool bio idea, and $5-10k will go a long way for you, please apply!!! https://t.co/NCvmrNC53cLiked on XWe've been early adopters of Rust since 2018 and a lot of our infra, voice tech, and even some of the current client is already Rust, the holy grail was getting the whole client there. That means Electron goes away, and so does React Native, mobile keeps native UI but shares app code with desktop via Rust. We hope to get it into testing with users soon™. (And it's not Tauri, it's GPUI, so good guess everyone.) Alright, back to staring at the WoW Forever login screen.Reposted on XOh boy. https://t.co/X7SSskGuGvLiked on XRIP .si domain squatters
Discrete Mathematics

Discrete Mathematics

Warning

Over a year old. May be outdated

Dynamic Programming

  • Optimal substructure. The optimal solution to a problem consists of optimal solutions to subproblems.
  • Overlapping subproblems. few subproblems in total, many recurring instances of each.

Bellman-Ford

shortest path, negative possible.

OPT[v,k]=min⁡(OPT[v,k−1],OPT[u,v]+w(u,v))\text{OPT}[v,k] = \min(\text{OPT}[v, k-1], \text{OPT}[u, v] + w(u,v))

Chain Matrix Multiplication

OPT[i,j]=OPT[i,k]+OPT[k+1,j]+combine\text{OPT}[i, j] = \text{OPT}[i, k] + \text{OPT}[k+1, j] + \text{combine}

Min Cut

The set of vertices reachable from source s in the residual graph is one part of the partition. Cut capacity cap(A,B)=∑out Ac(e)\text{cap}(A, B) = \sum_{\text{out A}} c(e).

∣f∣=∑e out of Xf(e)−∑e into Xf(e)|f| = \sum_{e~\text{out of X}} f(e) - \sum_{e~\text{into X}} f(e)
  • maxflow = Min cap(A,B)\text{cap}(A, B).

Ford-Fulkerson

Given (G,s,t,c∈N+)(G, s, t, c \in \mathbb{N}+), start with f(u,v)=0f(u,v)=0 and Gf=GG_f =G. While an augmenting path is in GfG_f, find a bottleneck. Augment the flow along this path and update the residual graph GfG_f. O(∣f∣(V+E))\mathcal{O}(|f| (V+E)).

Edmond-Karp

Ford-Fulkerson, but choose the shortest augmenting path.

For any flow ff and any (A,B)(A,B) cut, ∣f∣≤cap(A,B)|f| ≤ \text{cap}(A,B). For any flow ff and any (A,B)(A,B) cut, ∣f∣=∑f(s,v)=∑u∈A, v∈Bf(u,v)−∑u∈A, v∈Bf(v,u)|f| = \sum_f (s, v) = \sum_{u \in A,~v \in B} f(u, v) - \sum_{u \in A,~v \in B} f(v, u)

Solving by Reduction

To reduce a problem YY to a problem XX (Y≤pXY \leq_{p} X) we want a function ff that maps YY to XX such that ff is a polynomial time computable and ∀y∈Y\forall y \in Y is solvable if and only if f(y)∈Xf(y) \in X is solvable.

Reduction to NF

Describe how to construct a flow network. Claim "This is feasible if and only if the max flow is …". Prove both directions.

Bipartite to Max Flow

  • Max Matching ⟹ Max Flow. If k edges are matched, then there is a flow of value k.
  • Max matching ⟸ Max flow. If there is a flow f of value k, there is a matching with k edges.
  • O(∣f∣(E′+V′))\mathcal{O}(|f| (E' + V'))
  • ∣f∣=V|f| = V
  • V′=2V+2V' = 2V + 2
  • E′=E+2VE' = E + 2V
  • O(V(E+2V+2V+2))=O(VE+V2)=O(VE)\mathcal{O}(V (E + 2V + 2V + 2)) = \mathcal{O}(V E + V^2) = \mathcal{O}(V E)

Circulation

  • d(v)>0d(v) > 0 if demand
  • d(v)<0d(v) < 0 if supply
  • Capacity Constraint 0≤f(e)≤c(e)0 \leq f(e) \leq c(e)
  • Conservation Constraint fin(v)−fout(v)=d(v)f^{\text{in}} (v) - f^{\text{out}} (v) = d(v).
  • For every feasible circulation ∑v∈Vd(v)=0\sum_{v \in V} d(v) = 0, there is a feasible circulation with demands d(v)d(v) in GG if and only if the maximum s−ts-t flow in G′G' has value D=∑d(v)>0d(v)D = \sum_{d(v)>0} d(v).

Circulation with Demands and Lower Bounds.

  • Capacity Constraint l(e)≤f(e)≤c(e)l(e) \leq f(e) \leq c(e)
  • Conservation Constraint fin(v)−fout(v)=d(v)f^{\text{in}} (v) - f^{\text{out}} (v) = d(v)
  • Given GG with lower bounds, we subtract the lower bound l(e)l(e) from the capacity of each edge.
  • Subtract f0in(v)−f0out(v)=L(v)f_0^{\text{in}}(v) − f_0^{\text{out}}(v) = L(v) from the demand of each node.
  • Solve the circulation problem on this new graph to get a flow ff.
  • Add l(e)l(e) to every f(e)f(e) to get a flow for the original graph.

Existence of Linear Programming Solution.

  • Given an Linear Programming problem with a feasible set and an objective function PP.
  • If SS is empty, Linear Programming has no solution.
  • If SS is unbounded, Linear Programming may or may not have the solution.
  • If SS is bounded, Linear Programming has one or more solutions.

Standard Form Linear Programming

  • max⁡(c1x1+⋯+cnxn)\max (c_1x_1 + \cdots + c_nx_n)
  • subject to
  • a11x1+⋯+a1nxn≤b1a_{11}x_1 + \cdots + a_{1n}x_n ≤ b_1
  • all the way to
  • am1x1+⋯+amnxn≤bma_{m1}x_1 + \cdots + a_{mn}x_n ≤ b_m.
  • Also, x1≥0,⋯ ,xn≥0x_1 \geq 0, \cdots, x_n \geq 0.

Matrix Form Linear Programming

  • max⁡(cTx)\max(c^T x)
  • subject to
  • Ax≤bAx \leq b
  • x≥0x \geq 0
  • x∈Rx \in \mathbb{R}

Integer Linear Program

  • all variables ∈N\in \mathbb{N}
  • is NP-Hard

Dual Program

  • min⁡(bTy)\min(b^T y)
  • subject to
  • ATy≥cA^T y \geq c
  • y≥0y \geq 0
  • y∈Ry \in \mathbb{R}

Weak Duality

  • The optimum of the dual is an upper bound to the optimum of the primal.
  • OPT(primal)≤OPT(dual)\text{OPT}(\text{primal}) ≤ \text{OPT}(\text{dual}).

Strong duality

  • Let P and D be primal and dual Linear Programming correspondingly. If P and D are feasible, then cTx=bTyc^T x = b^T y.

If a standard problem and its dual are feasible, both are feasibly bounded. If one problem has an unbounded solution, then the dual of that problem is infeasible.

Possibilities of Feasibility

P\DFeasibly BoundedFeasibly UnboundedInfeasible
Feasibly BoundedPossibleImpossibleImpossible
Feasibly UnboundedImpossibleImpossiblePossible
InfeasibleImpossiblePossiblePossible

  • P = set of poly-time solvable problems.
  • NP = set of poly-time verifiable problems.
  • Decision Knapsack is NP-complete, whereas undecidable problems like Halting problems are only NP-Hard (not NP).
  • X is NP-Hard if ∀Y∈NP\forall Y \in NP and Y≤pXY \leq_p X.
  • X is NP-complete if X is NP-Hard and X∈NPX \in NP.
  • If P = NP, then P = NP-complete.
  • NP Problems can be solved in poly-time with NDTM.
  • NP Problems can be verified in poly-time by DTM.

Polynomial Reduction

To reduce a decision problem Y to a decision problem X (Y≤pXY \leq_p X), find a function ff that maps Y to X such that ff is poly-time computable and ∀y∈Y\forall y \in Y is YES if and only if f(y)∈Xf(y) \in X is YES.

Proving NP-Complete

Show X is in NP, Pick problem NP-complete Y, and show Y≤pXY \leq_p X.

Conjunctive Normal Form SAT

  • Conjunction of clauses.
  • Literal: Variable or its negation.
  • Clause: Disjunction of literals.
  • 3-SAT. Each clause has at most three literals.
  • (X1∨¬X3)∧(X1∨X2∨X4)∧⋯(X_1 \lor \neg X_3) \land (X_1 \lor X_2 \lor X_4) \land \cdots

Independent Set

  • Independent Set is a set of vertices in a graph, no two of which are adjacent.
  • The max independent set asks for the size of the largest independent set in a given graph.

Clique

  • Complete graph = every pair of vertices is connected by an edge.
  • The max clique asks for the number of vertices in its largest complete subgraph.

Vertex Cover

  • Vertex Cover of a graph is a set of vertices that includes at least one endpoint of every edge.
  • The min vertex cover asks for the size of the smallest vertex cover in a graph.

Hamiltonian Cycle

  • A cycle that visits each vertex exactly once.
  • Hamiltonian Path visits each vertex exactly once and doesn't need to return to its starting point.

Graph Coloring

  • Given G, can you color the nodes with <k<k colors such that the end points of every edge are colored differently?
Backlinks1