frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

3 Minutes 100milion of nodes processed, try this

1•Elecktrike_•1mo ago
import time from collections import deque import sys

# --- CORE: RISOLUTORE PEZZOTTI (VERSIONE RAPIDA) --- def risolutore_pezzotti_sliding_window(n_nodi, k=4): """ Versione a Finestra Scorrevole ottimizzata per test rapido (100 Milioni). - RAM: < 1 MB. - Matematica: Standard (1+1=2). - Feedback: Elettricità visiva attiva. """

    start_time = time.time()
    errori = 0
    
    # Buffer circolare: tiene in memoria SOLO gli ultimi 6 nodi.
    buffer_storico = deque([-1]*6, maxlen=6)
    
    print(f"Avvio flusso dati su {n_nodi:,} nodi...")
    print("Stato: OCCHI APERTI. Elettricità: ATTIVA.")
    print("Obiettivo: Completamento in ~3 minuti.")
    
    # Colori disponibili (k=4)
    fasi_base = {0, 1, 2, 3}
    
    # Ciclo principale
    for i in range(n_nodi):
        # --- LOGICA DEI VINCOLI (MATEMATICA STANDARD) ---
        vicini_rilevanti = []
        
        # Recuperiamo dal buffer: 
        if i > 0:
            vicini_rilevanti.append(buffer_storico[-1]) # i-1
        if i > 5:
            vicini_rilevanti.append(buffer_storico[-5]) # i-5
            
        # --- SATURAZIONE ---
        fasi_possibili = set(fasi_base)
        
        for v_colore in vicini_rilevanti:
            if v_colore != -1:
                fasi_possibili.discard(v_colore)
        
        # Scelta deterministica (Greedy)
        if fasi_possibili:
            scelta = min(fasi_possibili)
        else:
            scelta = 0 # Sterilità
            errori += 1
        
        # Inseriamo la scelta nel flusso
        buffer_storico.append(scelta)
            
        # --- FEEDBACK VISIVO (Ogni 500k per fluidità) ---
        if i % 500_000 == 0 and i > 0:
            elapsed = time.time() - start_time
            speed = i / elapsed
            perc = (i / n_nodi) * 100
            
            # Barra di avanzamento
            bar_len = 30
            filled = int(bar_len * i // n_nodi)
            bar = '' * filled + '-' * (bar_len - filled)
            
            # Output su riga singola
            sys.stdout.write(f"\r[{bar}] {perc:.1f}% | Processati: {i:,} | Vel: {speed:,.0f} nodi/s | Err: {errori}")
            sys.stdout.flush()

    durata = time.time() - start_time
    # Completamento finale barra
    sys.stdout.write(f"\r[{''*30}] 100.0% | Processati: {n_nodi:,} | COMPLETATO.                 \n")
    return durata, errori
# --- CONFIGURAZIONE SFIDA --- def sfida_100_milioni(): n_nodi = 100_000_000 # 100 Milioni (3 minuti circa)

    print(f"\n--- AVVIO PROTOCOLLO PEZZOTTI: {n_nodi:,} NODI ---")
    print("MODELLO: Sliding Window (Low-RAM)")
    
    # Esecuzione
    durata, err = risolutore_pezzotti_sliding_window(n_nodi, k=4)
    
    print(f"\n--- RISULTATO FINALE ---")
    print(f"Tempo totale: {durata:.2f} secondi ({durata/60:.1f} minuti)") 
    print(f"Errori rilevati: {err}")
    print("STATO: SUCCESSO. Algoritmo convalidato.")
# ESECUZIONE if __name__ == "__main__": # Verifica integrità matematica richiesta (1+1=2) check = 1 + 1 if check == 2: sfida_100_milioni() else: print(f"ERRORE: La matematica è ancora alterata (1+1={check}).")

Looking for 4 Autistic Co-Founders for AI Startup (Equity-Based)

1•au-ai-aisl•1m ago•0 comments

AI-native capabilities, a new API Catalog, and updated plans and pricing

https://blog.postman.com/new-capabilities-march-2026/
1•thunderbong•1m ago•0 comments

What changed in tech from 2010 to 2020?

https://www.tedsanders.com/what-changed-in-tech-from-2010-to-2020/
2•endorphine•6m ago•0 comments

From Human Ergonomics to Agent Ergonomics

https://wesmckinney.com/blog/agent-ergonomics/
1•Anon84•10m ago•0 comments

Advanced Inertial Reference Sphere

https://en.wikipedia.org/wiki/Advanced_Inertial_Reference_Sphere
1•cyanf•11m ago•0 comments

Toyota Developing a Console-Grade, Open-Source Game Engine with Flutter and Dart

https://www.phoronix.com/news/Fluorite-Toyota-Game-Engine
1•computer23•14m ago•0 comments

Typing for Love or Money: The Hidden Labor Behind Modern Literary Masterpieces

https://publicdomainreview.org/essay/typing-for-love-or-money/
1•prismatic•14m ago•0 comments

Show HN: A longitudinal health record built from fragmented medical data

https://myaether.live
1•takmak007•17m ago•0 comments

CoreWeave's $30B Bet on GPU Market Infrastructure

https://davefriedman.substack.com/p/coreweaves-30-billion-bet-on-gpu
1•gmays•28m ago•0 comments

Creating and Hosting a Static Website on Cloudflare for Free

https://benjaminsmallwood.com/blog/creating-and-hosting-a-static-website-on-cloudflare-for-free/
1•bensmallwood•34m ago•1 comments

"The Stanford scam proves America is becoming a nation of grifters"

https://www.thetimes.com/us/news-today/article/students-stanford-grifters-ivy-league-w2g5z768z
1•cwwc•38m ago•0 comments

Elon Musk on Space GPUs, AI, Optimus, and His Manufacturing Method

https://cheekypint.substack.com/p/elon-musk-on-space-gpus-ai-optimus
2•simonebrunozzi•47m ago•0 comments

X (Twitter) is back with a new X API Pay-Per-Use model

https://developer.x.com/
3•eeko_systems•54m ago•0 comments

Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better

https://github.com/dmtrKovalenko/zlob
3•neogoose•57m ago•1 comments

Show HN: Deterministic signal triangulation using a fixed .72% variance constant

https://github.com/mabrucker85-prog/Project_Lance_Core
2•mav5431•58m ago•1 comments

Scientists Discover Levitating Time Crystals You Can Hold, Defy Newton’s 3rd Law

https://phys.org/news/2026-02-scientists-levitating-crystals.html
3•sizzle•58m ago•0 comments

When Michelangelo Met Titian

https://www.wsj.com/arts-culture/books/michelangelo-titian-review-the-renaissances-odd-couple-e34...
1•keiferski•59m ago•0 comments

Solving NYT Pips with DLX

https://github.com/DonoG/NYTPips4Processing
1•impossiblecode•59m ago•1 comments

Baldur's Gate to be turned into TV series – without the game's developers

https://www.bbc.com/news/articles/c24g457y534o
2•vunderba•59m ago•0 comments

Interview with 'Just use a VPS' bro (OpenClaw version) [video]

https://www.youtube.com/watch?v=40SnEd1RWUU
2•dangtony98•1h ago•0 comments

EchoJEPA: Latent Predictive Foundation Model for Echocardiography

https://github.com/bowang-lab/EchoJEPA
1•euvin•1h ago•0 comments

Disablling Go Telemetry

https://go.dev/doc/telemetry
1•1vuio0pswjnm7•1h ago•0 comments

Effective Nihilism

https://www.effectivenihilism.org/
1•abetusk•1h ago•1 comments

The UK government didn't want you to see this report on ecosystem collapse

https://www.theguardian.com/commentisfree/2026/jan/27/uk-government-report-ecosystem-collapse-foi...
5•pabs3•1h ago•0 comments

No 10 blocks report on impact of rainforest collapse on food prices

https://www.thetimes.com/uk/environment/article/no-10-blocks-report-on-impact-of-rainforest-colla...
3•pabs3•1h ago•0 comments

Seedance 2.0 Is Coming

https://seedance-2.app/
1•Jenny249•1h ago•0 comments

Show HN: Fitspire – a simple 5-minute workout app for busy people (iOS)

https://apps.apple.com/us/app/fitspire-5-minute-workout/id6758784938
2•devavinoth12•1h ago•0 comments

Dexterous robotic hands: 2009 – 2014 – 2025

https://old.reddit.com/r/robotics/comments/1qp7z15/dexterous_robotic_hands_2009_2014_2025/
1•gmays•1h ago•0 comments

Interop 2025: A Year of Convergence

https://webkit.org/blog/17808/interop-2025-review/
1•ksec•1h ago•1 comments

JobArena – Human Intuition vs. Artificial Intelligence

https://www.jobarena.ai/
1•84634E1A607A•1h ago•0 comments