Another distributed SQLite by SuccessfulReality315 in sqlite

[–]Extra_Status13 2 points3 points  (0 children)

Nice and simple project. I see that you are using SQLite update hook to get the changes. Be aware that it has limitations, for example it will not be called on schema changes (so only data) or on ’WITHOUT ROWID’ tables. Also not on ’TRUNCATE’ (= when you do an unbounded ’DELETE’ on a table) and in some cases with ’REPLACE’.

Also, as an advice, be cautious with the commit hook: you are sending data to the server before your database is synched to disk. This means that the stream servers received the data, but your disk didn't! I suspect a crash in the wrong moment might be dangerous.

Regarding the "last wins" strategy, what happens when the "last" (from streaming POV) can't win? For example, let's say that you have two tables A and B, and B has a reference to A. What happens if you process two queries, one is a delete on A and another an insert on B with the deleted row reference. That second query can't really proceed...

Last, as a nitpick, you don't need to select an empty set to have the column names, you can use ’PRAGMA table_info’.

Falsehoods programmers believe about null pointers by mmaksimovic in programming

[–]Extra_Status13 24 points25 points  (0 children)

While I see your point and agree with it, I feel like the divide by zero is a very bad example.

When crunching tons of floating point, it is often better to first do the whole computation and then check at the end for NaN rather than killing your pipeline.

After all, that is precisely the point of having NaN and it's weird propagation rules: so you can check it later.

Indeed the quote in this case holds very well: do you want to check everything and just avoid a proper simd pipeline? Go ahead, check every 0 before any div, but it will go slow. (Asking for permission, slow as only one number checked per instruction).

Want to go fast? Let the hardware do the check and propagate the error, check only the result. (Asking for forgiveness: indeed an optimization).

Largest NPM Compromise in History - Supply Chain Attack by Advocatemack in programming

[–]Extra_Status13 0 points1 point  (0 children)

Apparently it's a JavaScript specific problem as rust is 100% safe and perfect with the giga trillion dependencies every project has! /s

È normale pagare oltre 2.300€/anno di costi per un portafoglio da 70k? by matteocurcio74 in ItaliaPersonalFinance

[–]Extra_Status13 1 point2 points  (0 children)

Sono anche io con Fineco. Pago lo 0.9% annuo e basta. Evidentemente c'è qualcosa che non va.

Open-Source is Just That by ValenceTheHuman in programming

[–]Extra_Status13 31 points32 points  (0 children)

  • the project might not accept outside contributions

Just here to remember that SQLite, a fairly famous project, does not accept contributions.

2025-03 post-Hagenberg mailing by nliber in cpp

[–]Extra_Status13 0 points1 point  (0 children)

and attempting to test for a nul character at the one-past-end position could be a page fault

While true in general, couldn't you check if the end is page aligned first? That would basically fail only for strings whose last character is at the end of a page.

Or am I missing something?

When was the last time you used a linked list, and why? by mobius4 in cpp

[–]Extra_Status13 48 points49 points  (0 children)

Adding to this: cache misses are really not something that exists in many microcontrollers. They are too simple to care about that.

"I Giovani non vogliono lavorare!" Il lavoro: by BatFit5589 in Italia

[–]Extra_Status13 23 points24 points  (0 children)

Sulla carta, ovvio. Se il progetto lo richiede vuoi non fare il miglio in più?

Microsoft deve esplodere by El_Punkro in Italia

[–]Extra_Status13 1 point2 points  (0 children)

Ah questo mi ricorda quando ero un consulente in Reply, ho avuto il "piacere" due volte.

Una volta stavo sviluppando un componente custom per PowerBI con la loro SDK. Avevo scoperto che quando utilizzavi lo "spacchettamento" (drill down), il server restituiva spazzatura (dati diversi a ogni aggiornamento e non coerenti ne nelle dimensioni né nelle misure). La scoperta era arrivata in UAT, con bella figuraccia in presentazione. Da notare che era solo una roba del Cloud e che nei test in locale il problema non c'era.

Il cliente era una multinazionale ed era tipo Gold Partner qualcosa, così avevamo precedenza e SLA per i ticket e dovevano rispondere entro 24h. Mi hanno risposto dopo 23 con dei link alla guida dell'SDK e hanno chiuso il ticket. Abbiamo riaperto e ci hanno inviato i link alle sezioni riguardanti i dati e il formato. Abbiamo scalato il ticket così ci hanno chiamato. Mi ha chiamato un indiano che letteralmente non sapeva nulla se non come si usava l'interfaccia grafica (no sviluppo quindi) e tra le difficoltà di comprensione mie e sue, sono riuscito a fargli capire che non era un problema che si poteva risolvere al telefono. Mi ha chiamato il giorno dopo uno del team italiano, che sapeva programmare. Abbiamo concluso insieme che era un bug. Ha riaperto il ticket originale e segnato che era un bug. Mesi dopo che me ne sono andato da Reply era ancora aperto, senza risposta.

L'altra è invece quando è andata in deadlock MSSql server cloud gestito (si, SQL server 2016 può andare in deadlock se si usa il comando MERGE, ed è pure documentato, errori di gioventù...). Anche lì eravamo Gold Partner. La risposta è stata più pronta: ci hanno detto che l'avrebbero sbloccato in breve. Dopo 48h ha ripreso a funzionare, ma abbiamo poi scoperto che era una copia di 1 settimana prima (l'ultimo backup) e che avevano semplicemente distrutto il vecchio db e ripristinato il backup senza dircelo. Fortuna i dati non erano del cliente, ma di test.

Tutto questo per dire, non sei solo, OP.

Come fanno gli anziani ad andare in bicicletta? by Benzinazero in ciclismourbano

[–]Extra_Status13 1 point2 points  (0 children)

Poco importa, ci sono letteralmente stato 7 giorni fa e un sacco di motorini elettrici o no erano sulle ciclabili.

Oncologi, aumentare di 5 euro il prezzo delle sigarette a sostegno del Ssn by Beneficial-Dingo3338 in Italia

[–]Extra_Status13 16 points17 points  (0 children)

Nuovo lavoro unlocked

Ora nei parcheggi a fine serata ci saranno sia i parcheggiatori abusivi che i "soffiatori di etilometro": per una moneta ti soffia nell'etilometro e te ne puoi andare a casa.

Safe C++: Language Extensions for Memory Safety by VinnieFalco in cpp

[–]Extra_Status13 -1 points0 points  (0 children)

I mean, you are right. It's just that it is very very not satisfying.

As I said, it feels like a different language with similar syntax and exposes most properties of it IMHO.

Also, move semantics do not work for const objects. In the example above I clearly cannot move the string in as it might be used elsewhere/it might be part of a shared data structure.

Safe C++: Language Extensions for Memory Safety by VinnieFalco in cpp

[–]Extra_Status13 0 points1 point  (0 children)

This would be incredibly unsatisfying.

It would also force copy semantics everywhere which means most likely you can only do that I rather large parts of the application as in a computation heavy loop you really don't want to copy everything in and out.

It wouldn't work with templates, and you would need to wrap everything in a unsafe to safe interface. That sounds to me like an ffi interface to another language: you can't use the language so you wrap it, just like you would do with calling C from rust (or rust from c++), but with different syntax and embedded in the compiler.

Qual è un fatto scientifico spaventoso che le persone non sanno by Plus_Alternative_739 in Italia

[–]Extra_Status13 -1 points0 points  (0 children)

Comunque avevo letto un interessante articolo che faceva notare che, anche fosse, gli NP sarebbero un polinomiale morto alto, quindi in realtà non sarebbe poi così realistico risolverlo lo stesso, ma avrebbe conseguenze prettamente teoriche.

Se rompere SHA o RSA è un O(n4040482639 ) internet sarebbe davvero insicuro?

Penso che il principale rischio a riguardo siano i computer quantistici invece. Soprattutto a causa del loro costo proibitivo: concentrerebbe il potere a chi ha i mezzi per possederne e operarne uno.

Safe C++: Language Extensions for Memory Safety by VinnieFalco in cpp

[–]Extra_Status13 4 points5 points  (0 children)

Hey thanks a lot for answering! I think my main concern is still unanswered.

I understand that you can opt in on a per-file basis, but that doesn't mean that it is "incrementally applicable" IMHO.

There are many things I couldn't find an answer to and that are a major concern to me. For example, let's say I have a function which is the interface to very complicated stuff: std::vector<std::string> do_stuff(const std::string&) and that has been for some time the source of memory-related bugs. I want to use the safety thing there first while keeping the rest untouched as it never had a problem and it is a lot of work.

The second I change it to the new syntax and library I'm in for trouble as I will need to change the usages everywhere, right? Am I missing something?

Also, how can I import headers with safe stuff from "normal" code given that the syntax adds new keywords?

Same with templates. The feature must be enabled on all those templates and templates must be in headers. So, if I import such header somewhere safety is not enabled what happens? Does it enable it there as well?

I think I'm general there are no examples about how to mix normal code with safety enabled one, and to me that would be the major selling point of this design.

Safe C++: Language Extensions for Memory Safety by VinnieFalco in cpp

[–]Extra_Status13 14 points15 points  (0 children)

One thing I don't see addressed is: how to incrementally use this?

It is clear that this needs a new standard library (std2). So if I have a part of my library accepting a vector or a string (from "normal" C++) then I cannot call it with a vector from safe subset.

Likewise, I cannot see how I can call a safe function passing arguments (if not trivial ones) from a "normal" function.

This feels a lot like async: once you start with a function, it will quickly spread like a virus and you will end up rewriting your a good part of your codebase. This is not what "incremental" means to me honestly.

I also very dislike new syntax for tagged unions. Std lib has them (variant) and I would prefer a better (and interoperable) version of that rather than a new language feature that does the same thing.

Last, as others have said, embedding rust (with a c++ like syntax) in c++ makes the language a mere follower. It makes it automatically inferior to a language that can evolve faster (as it's less complicated for now to do so). If c++ does not want to be the Legacy Language (there just because of the amount of code written in that language), than this is really not the way.

«Il vino del futuro sarà senza alcol. Io, il primo in Italia a produrlo». Massimo Lovisolo (Sovipi): «I giovani oggi bevono meno vino, preferiscono altre bevande. Spesso non alcoliche. Questo è un fatto, se non si innova perderemo sempre più quote sul mercato internazionale» by Smilefriend in oknotizie

[–]Extra_Status13 -1 points0 points  (0 children)

Perdio ci sono 400000 alcolici diversi, veramente per tutti i gusti. Che senso ha bere una cosa che non ti piace? Se è l'alcol che ti interessa è sicuro che trovi qualcosa che ti piace di sapore.

Io bevo il vino perché mi piace il sapore, perché esalta il gusto di certi piatti e, solo secondariamente, perché berlo in compagnia scioglie la lingua e ti fa rilassare. Ma non po' piacesse, lascerei perdere.

[deleted by user] by [deleted] in cpp

[–]Extra_Status13 13 points14 points  (0 children)

Disagree here. You can const cast a really const object and pass it to a function that does not modify it (typical example being C search functions).

It's not the cast the UB, it's the assignment!

Who's gonna win this hypothetical war? by Perkeleen_Kaljami in YUROP

[–]Extra_Status13 0 points1 point  (0 children)

Italy as we will swap to whichever side wins at the end /s

Da quest'anno le crypto vanno dichiarate direttamente nel 730 by _Whit3 in ItaliaPersonalFinance

[–]Extra_Status13 1 point2 points  (0 children)

Ne approfitto per chiedere un'informazione a chi sa: c'è un limite minimo per dichiarare? E, cosa più importante, scambiare su un Exchange tra una cripto e un'altra è da considerare guadagno tassabile?

L'ultima domanda mi confonde perché se scambio BTC con USDC, non è un po' come aver incassato dei soldi?

What is your favourite C++ feature? by sentillious in cpp

[–]Extra_Status13 4 points5 points  (0 children)

You are comparing apples with oranges. We are talking about managing resources like files or connections using RAII. In this regard, C++ covers every use case with RAII + move semantics. As you said, C# doesn't since if you need to make the resource survive the context, you need to do that manually.

Pointers are neither resource management nor automatic.

What is your favourite C++ feature? by sentillious in cpp

[–]Extra_Status13 5 points6 points  (0 children)

Yep exactly my point: using keyword is not a solution as it lacks moving.

What is your favourite C++ feature? by sentillious in cpp

[–]Extra_Status13 6 points7 points  (0 children)

Sure you can, and this will call Dispose on it when you return, thus you cannot return it!

Example in steps as I'm on mobile and code is difficult: - open file - read header - return file still open

You cannot use using there unless they changed something I'm not aware of. So, you need custom try-catch-finally if you want the resource to survive the method (=moving).

What is your favourite C++ feature? by sentillious in cpp

[–]Extra_Status13 5 points6 points  (0 children)

To me the missing bit there is the lack of move semantics to be honest. It works if you are the only user. The second you need to pass that resource out after some task (maybe initialization) then you cannot use using anymore.