1,209 karma · joined Feb 10, 2016 (10y ago) · 426 submissions
comment 5y ago · link · parent
As I remember it, SQLite enforces serializability by default (and maybe as its only option), but with a hard price: when a transaction is writing, the whole database is exclusively locked by that transaction; the other transactions cannot even read.
PostgreSQL allows serializability, though not by default (I think). It's more advanced than SQLite, as it can have more reading and writing transactions at the same time, but any of them might fail if at some point the database engine is not able any more to keep the illusion of serialization. So the application must be ready to retry the transaction from the beginning, if required.
Serializability is very desirable for the application, because it has the following property: "If each transaction transforms the database in a consistent way, the database will always remain consistent". But that's difficult to do with concurrent transactions (unless you're able to predict future), so you should be aware of the associated compromises.
PostgreSQL has some interesting documentation on this problem: https://www.postgresql.org/docs/9.5/transaction-iso.html.
comment 5y ago · link · parent
Though you're not writing C/C++ in that case. You're writing "C/C++ for that particular architecture, ABI, OS and compiler".
In general C/C++, if your code is correct every present and future, known and unknown compiler is supposed to generate a correct executable. If they don't, they have a bug. You can pretend to be smarter and go UB, but then the responsibility shifts on you, you have (in principle) to validate each compiler and environment and you can claim no bug on anybody other than you.
comment 5y ago · link · parent
For the same reason, say, in an HTTP server I could store a request as a char* or std::string, but I would definitely create a class that ensures, upon construction, that the request is valid and legitimate. Code that processes the request would accept HTTPRequest, but not char*, so that unverified requests cannot even risk to cross the trust boundary.
189.
Raphaël Hertzog on how to pay Debian contributors(raphaelhertzog.com ↗)
1 points · by giomasce · 5y ago · discuss
comment 5y ago · link · parent
comment 5y ago · link · parent
The thing I really can't understand is why you would compare a boolean condition to `true` instead of checking the condition itself (in other words, writing `false` instead of `true == false`). Also, let me suggest to use `&&`, not `||`. And while we're at that, I would actually write:
if (false && my_var == 'some value') { ... }
just in case operator `==` can have side effects or relevant computational cost in your language.comment 5y ago · link · parent
In other words, let's say a non-sampled (black and white, for simplicity) image is a function [0,1]^2 -> [0,1]. You have to choose function space, like C^0, L^1, L^2, L^\infty, there are many. Whatever function space you choose, it will probably be infinite-dimensional, do you want to sample it to reduce it to a finite dimension and be able to represent it in a computer. Usually you do that by convolving it with a kernel. Using a delta kernel (i.e., taking the value of the function at the location of a pixel) is choice, but not the only one, and certainly not the one that models physical processes like a camera or a scanner (as the essay itself discusses).
Once you have chosen your sampling filter, you can process to choose your reconstruction filter, and again you have a lot of freedom. One property that you will reasonably want to retain is that the reconstruction filter is a right inverse of the sampling filter, i.e., if you take a sampled image, reconstruct the non-sampled image and then sample it again, you will probably want to get the same image you started with. But being the sampling filter a map from an infinite-dimensional space to a finite-dimensional one, it has a lot of right inverses, and you can choose.
Depending on these choices you get different aliasing and interpolation results. My point is that there is no hardcoded predefined choice: depending on your models you will have different outcomes, and you have to choose wisely depending on what you want. This is probably not far from what that essay says, but then I don't see why its conclusion is that a pixel is a sizeless point: it can be whatever you want.
comment 5y ago · link · parent
comment 5y ago · link · parent
comment 5y ago · link · parent
What I really would like to see is hardware manufacturers (Apple and anybody else) releasing the specs, so that people are free to do whatever they want with the metal they buy. I might event consider appropriate a legislative intervention in this field.
comment 5y ago · link · parent
I don't mean to say that you have to accept it as it is. If you don't like it, just go somewhere else. If you are motivated to help fixing stuff, that's wonderful. Just don't pretend we like to make stuff difficult for the sake of it.
Disclaimer: volunteer Debian Developer, always on short time to contribute.
comment 5y ago · link · parent
Amazon's choice to exploit workers might very well be an industry standard, but this doesn't make it a choice any less: Amazon boasts about leading on important social issues, but that's the real bullshit. They just do as the others, no virtue at all. Being in the strong position, they might have the opportunity to make the industry fairer, but they willingly decided not even to try.
I like how in your world megacorp automatically get the benefit of doubt, while people pissing in their pants because they cannot go to the bathroom are "relatively" fine.
comment 5y ago · link · parent
Sure, nothing is black or white, but that doesn't mean that some shades are way darker than others.
comment 5y ago · link · parent
Well, if you're speaking about non-negative integers, you don't have the problem of the primality of negative numbers.
If you're considering relative integers, still you don't really have a unique factorization property, because negative integers do not have a factorization altogether (in terms of positive primes). So you have to stipulate that a prime factorization is not just a "product of primes", but a "product of primes, perhaps times -1", which is still not the way you usually define it. So I am not totally convinced.
In the end, everybody just pick the definition they like.