Reddit Programming
199 subscribers
1.22K photos
127K links
I will send you newest post from subreddit /r/programming
Download Telegram
Tab Vacuum - click once to remove every duplicate Chrome tab and auto-group the rest by website
https://www.reddit.com/r/programming/comments/1tzx350/tab_vacuum_click_once_to_remove_every_duplicate/

<!-- SC_OFF -->I had 4 Chrome windows with ~80 tabs each, mostly duplicates of the same Stack Overflow page. Tried OneTab (saves to a list - not what I wanted) and Workona (cloud sync, overkill). So I wrote ~50 lines of vanilla JS. Click the toolbar icon → every duplicate tab across every window is removed (matched by URL) → survivors merge into one window → remaining tabs auto-group by hostname (collapsed). Two permissions: tabs, tabGroups. No background activity, no server, no analytics. Whole source is in the README so you can audit it before installing. Chrome Web Store: https://chromewebstore.google.com/detail/tab-vacuum/apdjhdjcejehjiomcolfgfgjhaedoieb GitHub: https://github.com/mayhsundar/tab-vacuum
Please give your comments <!-- SC_ON --> submitted by /u/mayhsundar (https://www.reddit.com/user/mayhsundar)
[link] (https://chromewebstore.google.com/detail/tab-vacuum/apdjhdjcejehjiomcolfgfgjhaedoieb) [comments] (https://www.reddit.com/r/programming/comments/1tzx350/tab_vacuum_click_once_to_remove_every_duplicate/)
https://www.reddit.com/r/programming/comments/1tzxrpz/building_a_spaced_repetition_system_that_adapts/

<!-- SC_OFF -->I built a flashcard app for interview prep and wanted to share some of the more interesting technical problems I ran into. The app has 1500+ questions across DSA and System Design, and the core challenge was: how do you order cards intelligently without it feeling robotic? Problem 1: Slot Assignment for Spaced Repetition Standard SR (like Anki) just shows the most overdue card next. That works for vocabulary but feels terrible for algorithms because you get 3 Hard questions in a row and want to quit. My approach: generate a target difficulty pattern (Easy, Medium, Easy, Medium, Hard, repeat) based on a 40/40/20 distribution, then assign due cards to matching-difficulty slots. Most-overdue cards get placed first within their tier. Unseen cards fill remaining slots. This means a Hard card that's overdue still lands in a Hard slot, not position 1. You get difficulty variety while still seeing overdue cards at the right time. fun assignSlots(pool: List, dueCards: List): List { val pattern = generatePattern(size = pool.size, distribution = "40/40/20") val dueByDifficulty = dueCards.groupBy { it.difficulty } val result = Array(pattern.size) { null } // Place due cards in matching slots, most overdue first for ((difficulty, cards) in dueByDifficulty) { val sorted = cards.sortedBy { it.nextReviewDate } val availableSlots = pattern.indices.filter { pattern[it] == difficulty && result[it] == null } sorted.zip(availableSlots).forEach { (card, slot) -> result[slot] = findQuestion(card, pool) } } // Fill remaining with unseen // ... } Problem 2: Re-ranking after every swipe without jank After each swipe, the deck needs to re-rank. But the top visible card (position 0) is already animating into view, so you can't move it. Solution: lock position 0, re-rank positions 1+, then check for constraint violations across the boundary (e.g., if locked card is Hard and new position 1 is also Hard, swap position 1 with the first non-Hard card deeper in the deck). This runs on every swipe so it needs to be fast. For 1000 cards, the greedy scoring + constraint check takes Problem 3: Encrypting 1500 questions without startup lag The question bank is AES-256-CBC encrypted in the APK (prevents trivial extraction). Decryption of 1.2MB happens on first load. On older devices this took 400ms, which blocked the UI. Moved it to Dispatchers.IO with a loading skeleton. The key is split across 4 byte arrays in the code to make static analysis harder (not bulletproof, but raises the bar above strings on the APK). Problem 4: Two-deck mode switching with shared progress The app has DSA and System Design as separate decks. Both share the same Room database for progress (same ProgressEntity table, IDs just have different prefixes). When switching modes, the current deck state is cached in memory so you can come back to where you left off. The tricky bit: daily goal and streak count swipes from both decks combined, but the ranker operates independently per deck. Problem 5: Animated sketches synced with code Each question can have a multi-step visual (array state changes, graph traversals). Steps are defined as data (JSON with cell states, highlights, pointers) and rendered by a custom Compose canvas. Code lines are highlighted in sync with each step via a codeLines map per step. The renderer handles 6 visualization types (array, tree, linked list, matrix, graph, string) with a single composable that dispatches by type. Stack: Kotlin, Jetpack Compose (Material 3), Room, Firebase, custom spaced repetition + ranking engine. App: https://play.google.com/store/apps/details?id=com.pixelcraftlabs.algoscroll If anyone's interested in the ranking algorithm details or the sketch rendering system, happy to go deeper. <!-- SC_ON --> submitted by /u/No-Position-7728 (https://www.reddit.com/user/No-Position-7728)
Opening a cloned repo is no longer safe
https://www.reddit.com/r/programming/comments/1u00xhc/opening_a_cloned_repo_is_no_longer_safe/

<!-- SC_OFF -->Solid breakdown of the Miasma worm — one commit, same dropper wired into 7 config files across VS Code, Claude Code, Gemini, Cursor, npm, Composer, and Bundler. No malicious dep needed, just clone + open. Nobody reviews these files in PRs. https://safedep.io/config-files-that-run-code/ Anyone actually treating dotfile diffs as code? <!-- SC_ON --> submitted by /u/No_Plan_3442 (https://www.reddit.com/user/No_Plan_3442)
[link] (https://safedep.io/config-files-that-run-code/) [comments] (https://www.reddit.com/r/programming/comments/1u00xhc/opening_a_cloned_repo_is_no_longer_safe/)
Hot path optimization. When float division beats integer division
https://www.reddit.com/r/programming/comments/1u06itn/hot_path_optimization_when_float_division_beats/

<!-- SC_OFF -->I've started a series of short blog posts about hot path optimizations. This first one covers a counterintuitive optimization: replacing integer division (IDIVQ) with floating-point division (DIVSD). <!-- SC_ON --> submitted by /u/watman12 (https://www.reddit.com/user/watman12)
[link] (https://blog.andr2i.com/posts/2026-06-08-optimization-catalog-when-float-division-beats-integer-division) [comments] (https://www.reddit.com/r/programming/comments/1u06itn/hot_path_optimization_when_float_division_beats/)
System Dynamics Course | Chapter 16: Discrete-Time and Sampled-Data System Dynamics
https://www.reddit.com/r/programming/comments/1u06nad/system_dynamics_course_chapter_16_discretetime/

<!-- SC_OFF -->Used 5 different programming language for this course. GitHub repository link: https://github.com/mohammadijoo/Control_and_Robotics_Tutorials <!-- SC_ON --> submitted by /u/abolfazl1363 (https://www.reddit.com/user/abolfazl1363)
[link] (https://youtu.be/yQ0oKvK3Db8) [comments] (https://www.reddit.com/r/programming/comments/1u06nad/system_dynamics_course_chapter_16_discretetime/)
I analyzed 26 major open source repositories. Every one had at least one bus-factor-1 module
https://www.reddit.com/r/programming/comments/1u0va69/i_analyzed_26_major_open_source_repositories/

<!-- SC_OFF -->I built a CLI called git-archaeologist to analyze ownership concentration, bus factor, coupling, and change history from git repositories. To validate it, I benchmarked 26 major open source projects including Kubernetes, React, VS Code, TensorFlow, PostgreSQL, Spring Boot, and Node.js. The report includes methodology, limitations, repository snapshots, raw JSON outputs, and benchmark data. Happy to hear where the methodology is wrong or what could be improved. <!-- SC_ON --> submitted by /u/Some_Scientist5385 (https://www.reddit.com/user/Some_Scientist5385)
[link] (https://sushantverma7969.github.io/git-archaeologist/) [comments] (https://www.reddit.com/r/programming/comments/1u0va69/i_analyzed_26_major_open_source_repositories/)