Better HN
topnewbestaskshowjobs
Log inSign up

giomasce

1,209 karma · joined Feb 10, 2016 (10y ago) · 426 submissions

Mathematician, computer scientist, programmer. Currently Wine hacker @CodeWeavers and developer @Debian.
Submissions

comment 5y ago · link · parent

The "isolation" part is a bit sloppy: that's what happens if you are using the "serializable" isolation level in SQL speak. But that's often not the default, because guaranteeing a serializability is hard for the database engine.

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

Just save the label. Then you use generative techniques when they want to retrieve the image.

comment 5y ago · link · parent

I once thought about doing something similar too, but in the end I never tried. I guess it's not difficul, you just have to write a good deal of code to support all the operations.

comment 5y ago · link · parent

Yes, they could.

But, somewhat surprisingly, they don't. They prefer to introduce features that violate users' privacy.

comment 5y ago · link · parent

Well, isn't DRM basically the enforcement of a license?

comment 5y ago · link · parent

That is classical slavery. GP mentioned modern slavery, which is somewhat different.

comment 5y ago · link · parent

> There are edge-cases even there. Calling a function generated by a JIT compiler is undefined behaviour, but there's a gentleman's agreement that the compiler won't screw it up for you.

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

To me it could totally make sense. It depends on the context, but I can very well see contexts where such a choice could make sense. For example, in line of principle it would make sense, for an RSA implementation, to accept to construct a type PublicKey only computing the product of two Prime's, and not two arbitrary numbers. And the Prime type would only be constructible by procedures that provably (perhaps with high probability) generate an actual prime number. It would be a totally sensible form of defensive programming. You don't want to screw up your key generation algorithm, so it makes sense to have your compiler help you to not construct keys from anything.

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

And political fragmentation.

comment 5y ago · link · parent

That's true for any language. Computers are finite state machines, though with a lot of states, therefore no actual computer can really run a Turing complete language. As many mathematical things, Turing completeness is an abstraction that doesn't really map on reality without caveats.

comment 5y ago · link · parent

Because if you comment out the code you don't benefit any more from the compiler checking that the inner block is still legal, or from your IDE to do the refactoring operations you want. The code would bit rot much faster in a comment (or removed from the code base altogether).

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

Maybe we're just using different words. To me the "shape" of a pixel is the "shape" of the sampling filter you're using, and assuming that I stay by my first comment: you can choose whatever distribution you want (provided that you can couple it with the function space you're choosing for the non-sampled images, but let's avoid technicalities). Unless I am mistaken, this aspect is not discussed in that essay, only lightly touched. They speak more about reconstruction.

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

The thing I am concerned about with SciHub is its centralized nature. So far it has resisted everything, but supposed that eventually Elsevier manages to land Elbakyan in jail, or hack back SciHub and delete its content, what would happen? I'd be much much happier to see the material kept in a more resilient configuration (IPFS, database dumps, ...) so that other entities can back it up. And I'd also be happy if the paper collection segment was free software, so that other entities could cooperate in case the original SciHub went down.

comment 5y ago · link · parent

Well, you can model pixels as you wish and you can translate coordinates as you wish, as long as you are consistent with your assumptions. Modelling pixels as points (i.e., delta distributions) instead of squares or other continuous distributions makes everything more prone to aliasing artifacts and is arguably less physically justified, but can sometimes be the right thing.

comment 5y ago · link · parent

And that's great, but there is more in a laptop than Intel components. And you're not always lucky on that side.

comment 5y ago · link · parent

Most laptops are more or less in the same situation as M1. Maybe they different quantitatively, but not qualitatively: devices do not have (sufficient) specs available and people need to reverse engineer them if you want to run any free OS on them. Yet people want to do that and often manage. Why is M1 different?

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 think it is "by design". Many Debian contributors are frustrated as well by the packaging processes and tools, but it turns out that it is not that easy to coordinate the work of thousands of people, most of whose contribute voluntarily in their free time. Debian was founded in the early 90's, developed by thousands and used by millions. It has tens of thousands of packages. You don't just migrate them to the newest packaging technology every day. Once upon a time the next big thing was Subversion. Now it is Git. What will it be next decade? It is difficult to keep up on volunteer work.

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

I suppose that's not just incompetence. I mean, it happens to be incompetent when incompetence lets you pay your workers less...

comment 5y ago · link · parent

To me the best access way is the Telegram bot. Fast, keeps your files easily accessible and is shared with other devices.

comment 5y ago · link · parent

After all, computer science is basically a branch of mathematics.

comment 5y ago · link · parent

Just reached this HN entry via my self hosted tiny tiny RSS. Long live RSS! Fortunately RSS took off enough before social networks, so that many website still more or less support it.

comment 5y ago · link · parent

Quite agree that Amazon is a cheap target: they do very bad things and they are able to do them at scale; one might argue even in a monopoly situation. Doesn't make stuff fairer. Rest assured it's not my only target, if that's what troubles you.

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

"As Amazon became large, we decided to use our scale and scope to lead on important social issues".

A bold claim for a company widely known to exploit and underpay workers in distribution warehouses.

comment 5y ago · link · parent

Though giving quite a show, Trump ended up leaving his place and Boden or his collaborators never were arrested for not showing up at the police station while in a coma. Putin just showed the world he is of a different advice.

Sure, nothing is black or white, but that doesn't mean that some shades are way darker than others.

comment 5y ago · link · parent

Someone has begun digging the GPU.

https://rosenzweig.io/blog/asahi-gpu-part-1.html

comment 5y ago · link · parent

Hey, didn't notice the nick! Hi!

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.

comment 5y ago · link · parent

Unique factorization is always meant up to unities. You haven't really lost anything.
1
678
15