frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
617•klaussilveira•12h ago•181 comments

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
921•xnx•17h ago•546 comments

What Is Ruliology?

https://writings.stephenwolfram.com/2026/01/what-is-ruliology/
32•helloplanets•4d ago•23 comments

How we made geo joins 400× faster with H3 indexes

https://floedb.ai/blog/how-we-made-geo-joins-400-faster-with-h3-indexes
108•matheusalmeida•1d ago•26 comments

Jeffrey Snover: "Welcome to the Room"

https://www.jsnover.com/blog/2026/02/01/welcome-to-the-room/
9•kaonwarb•3d ago•3 comments

Unseen Footage of Atari Battlezone Arcade Cabinet Production

https://arcadeblogger.com/2026/02/02/unseen-footage-of-atari-battlezone-cabinet-production/
37•videotopia•4d ago•1 comments

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
216•isitcontent•12h ago•25 comments

Monty: A minimal, secure Python interpreter written in Rust for use by AI

https://github.com/pydantic/monty
208•dmpetrov•13h ago•103 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
319•vecti•14h ago•142 comments

Microsoft open-sources LiteBox, a security-focused library OS

https://github.com/microsoft/litebox
356•aktau•19h ago•181 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
367•ostacke•18h ago•94 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
475•todsacerdoti•20h ago•232 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
271•eljojo•15h ago•159 comments

An Update on Heroku

https://www.heroku.com/blog/an-update-on-heroku/
401•lstoll•18h ago•271 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
12•jesperordrup•2h ago•6 comments

Delimited Continuations vs. Lwt for Threads

https://mirageos.org/blog/delimcc-vs-lwt
25•romes•4d ago•3 comments

Dark Alley Mathematics

https://blog.szczepan.org/blog/three-points/
82•quibono•4d ago•20 comments

PC Floppy Copy Protection: Vault Prolok

https://martypc.blogspot.com/2024/09/pc-floppy-copy-protection-vault-prolok.html
56•kmm•4d ago•3 comments

How to effectively write quality code with AI

https://heidenstedt.org/posts/2026/how-to-effectively-write-quality-code-with-ai/
243•i5heu•15h ago•186 comments

Introducing the Developer Knowledge API and MCP Server

https://developers.googleblog.com/introducing-the-developer-knowledge-api-and-mcp-server/
52•gfortaine•10h ago•18 comments

Was Benoit Mandelbrot a hedgehog or a fox?

https://arxiv.org/abs/2602.01122
11•bikenaga•3d ago•2 comments

I spent 5 years in DevOps – Solutions engineering gave me what I was missing

https://infisical.com/blog/devops-to-solutions-engineering
139•vmatsiiako•17h ago•61 comments

Understanding Neural Network, Visually

https://visualrambling.space/neural-network/
279•surprisetalk•3d ago•37 comments

I now assume that all ads on Apple news are scams

https://kirkville.com/i-now-assume-that-all-ads-on-apple-news-are-scams/
1057•cdrnsf•22h ago•433 comments

Show HN: R3forth, a ColorForth-inspired language with a tiny VM

https://github.com/phreda4/r3
70•phreda4•12h ago•13 comments

Why I Joined OpenAI

https://www.brendangregg.com/blog/2026-02-07/why-i-joined-openai.html
130•SerCe•8h ago•113 comments

Female Asian Elephant Calf Born at the Smithsonian National Zoo

https://www.si.edu/newsdesk/releases/female-asian-elephant-calf-born-smithsonians-national-zoo-an...
28•gmays•7h ago•10 comments

Learning from context is harder than we thought

https://hy.tencent.com/research/100025?langVersion=en
174•limoce•3d ago•94 comments

FORTH? Really!?

https://rescrv.net/w/2026/02/06/associative
63•rescrv•20h ago•22 comments

WebView performance significantly slower than PWA

https://issues.chromium.org/issues/40817676
30•denysonique•9h ago•6 comments
Open in hackernews

Iterative DFS with stack-based graph traversal (2024)

https://dwf.dev/blog/2024/09/23/2024/dfs-iterative-stack-based
39•cpp_frog•5mo ago

Comments

ad-astra•5mo ago
Thanks for sharing! I had come across similar kinds of issues on my annual LeetCode prep and this very clear articulation is very helpful. Props to the author for making this so easy to visualize.
dinobones•5mo ago
I’m surprised this isn’t a more common and well known issue.

I stumbled upon this issue when trying to convert a recursive DFS to iterative because my recursive DFS was running out of stack space.

The solution produced by this iterative version was wrong, completely different from the recursive implementation.

It’s fascinating how many primitive, basic algorithms are probably implemented incorrectly but work just well enough that no one ever cares or notices… reminds me of how so many text books have an incorrect or overflowing version of binary search.

pss314•5mo ago
reminds me of how so many text books have an incorrect or overflowing version of binary search.

Extra, Extra - Read All About It: Nearly All Binary Searches and Mergesorts are Broken https://research.google/blog/extra-extra-read-all-about-it-n...

imtringued•5mo ago
Why would it be a common issue?

People usually implement graph traversal first and only after that do they choose a FIFO queue for BFS or a stack for DFS as their data structure.

almostgotcaught•5mo ago
This is already the standard stack based DFS?

  def dfs(graph, source):
    n = len(graph)
    visited = set()
    stack = [source]
    
    while stack:
      node = stack.pop()
      if node in visited:
        continue 
      visited.add(node)
      for nbr in graph[node]:
        stack.append(nbr)
So I don't know what all the confusion is about...
nicoty•5mo ago
I implemented an iterative, stack-based DFS iterator in JS last year for a project that I didn't end up using it on. Maybe someone else can find some use of it: https://gist.github.com/nothingnesses/5f974a43a2da5d1d8a6b9c...
quibono•5mo ago
So... am I misunderstanding or is it enough to swap the iteration over the neighbours of a node and the visited check?

          for nbr in graph[node]:
            if not visited[nbr]:
into

          if node in visited: continue
          visited.add(node)
          for nbr in graph[node]:
              stack.append(nbr)
DannyBee•5mo ago
It should be enough :)
DannyBee•5mo ago
One thing to keep in mind (which the original cited article in this article gets right, but this article gets wrong) - there is no guarnateed unique ordering of children visitation for nodes with >1 child. The parts they copy from the original article talk about this correctly, the parts they didn't, don't :)

The DFS orderings where the children visitation is swapped, etc, are all still equally correct and valid. That is - a DFS algorithm that randomized the children order is still valid.

IE for example, if you change the "for nbr in graph[node]" line to "for nbr in reversed(sorted(graph[node]))", the resulting DFS ordering is still valid and correct.

If you want them in a specific ordering, you'd usually have to force them into it in the algorithm. It rarely makes sense to try to force the structure to be ordered (as they do here) for the algorithm.

This often hits people who use graphs with pointers, or multiple threads, or ...