9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions
comment 4y ago · link · parent
I think the core.autocrlf option in Git is more harmful than useful (for example, it can change file hashes and break something) and should be removed. An option to warn about unwanted \r characters on commit might be useful though.
comment 4y ago · link · parent
SAT solver is a tool that determines whether a given boolean formula can be True (it is called SAT) or not. If it can be True, a SAT solver provides values for variables so that you can check that they are correct.
For example, a Boolean formula
a & (b | c)
Can be True if a = True, b = True and c = False.SAT solver can be useful for resolving dependencies in a package manager. Imagine if a user wants to install package A with version >= 1.0, but package A depends on other packages and might conflicts with some packages as well. The package manager converts these requirements into a boolean formula like this: let's say that if variable A₁₀ is True, then package A version 1.0 is installed, if A₁₁ is True, then package A version 1.1 is installed and so on.
First, let's express user's desire to have any version of A installed. Here is the rule:
A₁₀ | A₁₁ must be True
Let's say A version 1.0 requires B version 1.0 or 1.1. We can then write a rule, that if A 1.0 is installed, then B 1.0 or 1.1 must be installed as well: !A₁₀ | (B₁₀ | B₁₁) must be True
Now, let' say that B 1.0 conflicts with C 1.0 and both cannot be installed at the same time. We can express that as a formula as well: !(B₁₀ & C₁₀) must be True
Finally, we cannot install two versions of the same package, so let's write that too: !(A₁₀ & A₁₁) & !(B₁₀ & B₁₁) must be True
Now we can combine all the rules into a single formula. All the rules must be true, so we join them using AND operator: (A₁₀ | A₁₁) & (!A₁₀ | (B₁₀ | B₁₁)) & !(B₁₀ & C₁₀) & !(A₁₀ & A₁₁) & !(B₁₀ & B₁₁)
Now we can give the formula to the SAT solver. If will solve it and give a set of versions that need to be installed in order to satisfy all requirements. Or it will prove that this is impossible.Another use of SAT solver is verification of programs: if you have two pieces of code without loops and you want to make sure that they are equivalent, you can convert them into boolean formulas and use SAT to prove that for any given input they produce the same output.
comment 4y ago · link · parent
Basically, you should not have several things changing in different places at the same time because human can only focus at one point. Maybe it would be better to add pauses in the sequence, animate one thing, wait a little, then animate other thing. Let the user stop and think a bit about what he/she have seen.
For example, in the image "Repeated addition of a point P" the points and lines are constantly moving, and I don't have time to look at the formula. I see that it is changing, but I cannot read it while looking at the animation. Maybe it would be better if the points stopped moving for a while, then the formula would change, then you give some time to read and comprehend it and then points continue moving.
Or maybe you could write all the formulas on the side, and have a box or selection moving over them. This way the viewer can see how the formulas are related to each other and doesn't have to remember previous ones.
Also, in the image "Point addition is associative and commutative" formulas seem to be random and do not illustrate anything. For example, I see 5P + P = 6P, then 2P + P = 3P, then 6P + P = 7P. So what it should mean?
Maybe a better way to illustrate these laws would be to have two images that produce the same result, for example P + 6P = 7P and 3P + 4P = 7P. It is easier to compare images side-by-side.
Instead of percent sign it might be better to use "mod" as percent sign is understood only by programmers but not by people familiar with mathematical notation.
To illustrate addition you might use a circle (or an ellipse, or even a square, why not) instead of a straight line. This way the wrapping behaviour would be more obvious. To illustrate multiplication, you could draw several sequential arcs (so that the multiplication is represented as several additions). And for negation, two arcs extending in the opposite direction from zero.
I don't understand how to illustrate inverse numbers though. Maybe several arcs that start at zero, end at 1 and number of them is the inverse value?
For the last illustration it definitely would help if it had some key points on the side, showing what we have done and what we are doing now.
comment 4y ago · link · parent
For example, let's take "Input format" switch. Our computers can do billions of calculations per second, cannot they determine file format automatically? And show a warning if the format doesn't match file extension?
Or let's look at checkboxes, determining which information should be displayed: "print serial number" and so on. Cannot a program just display all important information at once without toggling any checkboxes?
Of course, CLI interface is good for using in scripts. But not every CLI program matches that purpose: utilities intended for use in scripts should output data in machine-friendly format like CSV or JSON or TOML or even specially invented CLIML, but not in plain text. Otherwise scripts will break every time they stumble upon a filename with spaces. Sadly, despite decades of evolution, many CLI programs are not machine-friendly yet.
I use openssl maybe once a month or once a year and I cannot remember a single option. I would rather prefer to type "crypttool /some/file.pem" than spend time finding out which options I need to specify.
And obviously if I had to manage a company-wide PKI with its own CA I would definitely prefer a well designed GUI tool.
[1] Please note that I am not a designer. I just learn things by observing other people's work.
comment 4y ago · link · parent
This is a wrong assumption. There are lot of smartphones that do not get updates and have browsers that can be several years old.
Therefore transpiling and polyfills are not going away anywhere soon.
Of course, supporting different browsers can insignificantly increase development costs. It might be impractical to try to support Internet Explorer 7. A safe and reasonable choice would be to make sure that site looks and works perfectly in any browser released 5 years ago and is usable in a 10-year old browsers.
Obviously there are cases when this rule can be amended, for example, if you are making a game requiring a fast GPU and a mouse, then you can ignore smartphones and old browsers. But for a general website, like a corporate website, an online store, a social network, this seems like a sane default choice. You can extend support to 12-15 years old browsers if you feel confident in your skills.
comment 4y ago · link · parent
Cannot one convert their money to dollars or gold and start getting profit from inflation?
UPD: I forgot that in such cases governments usually impose large tax on currency conversion. Obviously you can't outsmart the government.
comment 4y ago · link · parent
3292.
Why Rust easily optimizes out smart pointers where C++ cannot?
28 points · by codedokode · 4y ago · 60 comments
comment 4y ago · link · parent
It is good only if it is "opt in". But in the wild we see that lot of software doesn't even provide an opt out and doesn't warn about telemetry when installing or starting a program.
If it is such a good thing, why developers prefer not to disclose its usage?
comment 4y ago · link · parent
Maybe ther should be a paid service that would manually review packages and provide a curated repository? I can't see other solutions. Either you review the code or you pay someone to do it or you isolate every library into a sandbox.
comment 4y ago · link · parent
I wonder, can Turing machine count as "Zero Insturction Set"? Technically there is no sequence of instructions.