4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
That's not saying much. Ukraine isn't receiving military support from NATO countries. It only gets weapons, and western politicians (mostly US) keep making sure that they do not get the big guns (regarding e.g. airplanes). Initially Germany blocked Estonia from giving weapons to Ukraine, and English airplanes carrying weapons for Ukraine had to make a detour not to cross German airspace. If Ukraine was a NATO state, none of that could happen, even with some politicians being cozy with Russia, as was evident now.
comment 4y ago · link · parent
> Every compression of a file implies an assumption that the compressed file can be decompressed to reproduce the original. Great efforts in design, coding and testing have been made to ensure that this program works correctly.
> However, the complexity of the algorithms, and, in particular, the presence of various special cases in the code which occur with very low but non-zero probability make it impossible to rule out the possibility of bugs remaining in the program.
That got me thinking: I've always implicitly assumed that authors of lossless compression algorithms write mathematical proofs that D o C = id[1]. However, now that I've started looking, I can't seem to find that even for Deflate. What is the norm?
[1]: C being the compression function, D being the decompression function, and o being function composition.
comment 4y ago · link · parent
$ dd if=/dev/urandom of=test bs=1G count=1 iflag=fullblock
$ gzip -k test
$ zcat test.gz | pv -a >/dev/null
[ 228MiB/s]
$ sudo journalctl -r | pv -a >/dev/null
[13.1MiB/s]
UPDATE: Gzip with more real-world data[1]: $ gzip -k adventures-of-huckleberry-finn.txt
$ zcat adventures-of-huckleberry-finn.txt.gz | pv -a >/dev/null
[ 151MiB/s]
[1]: <https://gutenberg.org/files/76/76-0.txt>comment 4y ago · link · parent
comment 4y ago · link · parent
> If it was your code they were talking about, you may feel differently.
I'm not the commenter you replied to, but no, I'm not my code, so I'm not going to get offended by someone criticising it. If someone does, it's on them.
There were a number of times in my career when someone called something I wrote overcomplicated, and I've never been even close to feeling any emotion about that fact at all. That remark always prompted me to hear carefully what they have to say about improving it. That's not a brag, just a certain level of emotional maturity.
People shouldn't be held responsible for every emotional reaction people have to their actions/words, because part of the responsibility for that rests on the person experiencing those emotions. In that case I don't think Casey said anything offensive, so if that made someone angry, they have themselves to blame for that.
comment 4y ago · link · parent
The author of the blog post is the author of the second comment on GitHub. Also[1]:
> Afterward, the same dev also used a fake name to hang out on our discord and talk about Windows Terminal without telling anyone who he was. I figured it out and confronted them, and they failed to see anything wrong with that behavior. It's a really special team they have there.
[1]: <https://nitter.net/cmuratori/status/1522471966929653761>
comment 4y ago · link · parent
> There is no such thing as "intrinsic value". The value gets assigned by people and market participants.
I'll leave out the discussion of the value of a company and fundamental analysis as off-topic here. Let's focus on currencies instead. The value of a currency is not its exchange rate. Just because Bitcoin is worth 38910.69 USD, does not mean it's more valuable as a currency than a dollar. 1 GBP being worth 1.25 USD doesn't push people to use GBP in place of USD. The value of a currency stems from two factors: liquidity and stability. The reason for the dominance of USD in international trade is the stability people around the world expect from it, compared to other currencies, as well as its liquidity (almost everyone accepts dollars, sometimes even more eagerly than their local currency). Bitcoin fails on both fronts. There are still loads of things I can't buy with Bitcoin (admittedly this aspect is changing). Stability^W volatility of Bitcoin is a meme since its inception. A currency whose value changes so dynamically is a shitty currency. It is more similar to a gambling game than to a currency (and has similar psychological effects on the players). Notice that noone ever "invests in a currency" (other than as a shorthand for investing in something that's sold in that currency), that would be nonsensical, given that the whole point of a currency is so that its value changes as little as possible. So... I guess saying that "Bitcoin is a digital currency that has no intrinsic value" is wrong mainly due to the first part of this sentence. Instead I'd say: Bitcoin is not a currency, but a speculative financial asset.
comment 4y ago · link · parent
> Duchamp also said "Art is either plagiarism or revolution". So unless you are doing Greco-Roman statuary in a manner that shatters people's expectations of Greco-Roman statuary, your statues are a jejune copy of what has come before -- and therefore not art.
Here is a contradiction. First plagiarism is listed as an example of art, to then be described as "not art". Also, I think that art which sticks to established understanding of what art is isn't necessarily plagiarism. Just because there were plenty of standard 3-act structured plays/films, does not mean that subsequent attempts are plagiaristic. Otherwise art would be castrated to just form, when in fact it is a marriage of form and substance.
I think this fixation on "subverting expectations" comes from self-centredness of some artists. Maybe if you dedicate your whole life to just art, you don't have other experiences to draw from to create something about more than art itself. And so art becomes a simulacrum.
comment 4y ago · link · parent
Unfortunately the untestable stuff gets the most press. If you talk to experimental physicists in university, they'll tell you all that stuff isn't treated seriously by them, but reading the press you may get the impression that things like string theory are widely-respectable and that there is only some disagreement, usual science stuff. The press really distorts the picture of what most physicists think about these topics.
(Also, I wouldn't use the term "theoretical" for untestable stuff. I would use "speculative". "Theoretical physics" does not imply unfalsifiable speculation, it can actually be fruitful scientifically.)
comment 4y ago · link · parent
No. Inbox Zero means that almost nothing is in the inbox. I practice Inbox Zero, but I don't put everything into Archive. The main kind of mail that I put into Archive is personal messages (hard to categorize them). I put finance-related mails into a separate folder, newsletters into a separate folder, German classes-related mails into a separate folder, healthcare-related mails into a separate folder, job-hunt-related mails into a separate folder and mails related to searching for a flat to rent into a separate folder. Archive is the default, when a certain kind of mail is not expected to generate a lot of mails, or it's hard to categorize something in general. I do use search, but the folders help in searching too. I guess I use them more like tags than folders. I've considered setting up notmuch with notmuchsync, but haven't got around to it yet.
As for organizing files on the filesystem, I do have mildly-deep hierarchies. One nice thing about folders as tags, is that you can construct a hierarchy which means that tag A implies tag B. So e.g. you don't need to tag something as "finance", if you already tagged it as "taxes".
As for preference for navigation over search, it's understandable to me, because by successively going into deeper folders you don't need to remember each "tag". The contents of the folders you browse remind you about what tags are available. You don't need to know all the most-specific tags right off the bat and you're not presented with a zillion of them at any time. You gradually get more specific based on context, at any one time presenting you with only a handful of tags to choose which are relevant at a given time.
comment 4y ago · link · parent
First, let me preface that with a disclaimer that those opinions are reserved for general purpose languages. Domain-specific languages should be judged differently.
Built-in types like int don't bother me. Built-in string also doesn't bother me, because it is immutable. strings.Builder is part of the standard library on the other hand. I think this division is perfect, because I feel that anything that's denotable as a literal should be built-in. Algorithms on the other hand belong in the library.
When it comes to integer division, it's an operation which has a pair of inputs and one output. In other words, it behaves like a function. On the other hand, its most reasonable implementation is a single machine code instruction and compilers usually have a bunch of optimizations for it, which turn it into something else. In other words, I think the best option here is for it to be an intrinsic, a bit similar to how it is in Standard ML[1] or Scheme[2].
The reason for those opinions is that I think implementing things in the compiler instead of the library signal that an instance of a legitimate general problem occurred which lacked a solution in the language, and instead of changing the language to solve the problem for all users, only the specific problem with, in this case, map and dynamic array was solved, and only those specific implementations of those concepts.
As you obviously know, Go gained generics, so this is in large part irrelevant now.
Also let me state that overall I think Go is a pretty good language. I like it (with generics and without). My comment just comes from the disagreement with the quoted argument.
[1]: Tangentially, one thing I don't like in Standard ML is polymorphism of built-in operators. It's another example of a feature which language designers reserved for themselves, and did not give it to users.
[2]: I'm basing this on my understanding of the Chez Scheme implementation, which implements the division operator in the library, in Scheme itself, but this implementation relies on an intrinsic. (Assuming it's implemented the same way as other operators I've checked. I haven't checked this one specifically.)
comment 4y ago · link · parent
I'm all for large standard libraries. Implementing things in the language instead of stdlib on the other hand usually smells bad.
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
1. Analytical
0.9999... = \sum_{n=1} ^{\infty} (9 * 0.1^n) = 0.9/(1 - 0.1) = 0.9/0.9 = 1
The first equality is by definition of strings of the form "0.abcdef...". The second is the sum of geometric series.
2. Algebraical
x = 0.9999...
10x = 9.99999...
9x = 10x - x = 9.9999... - 0.9999... = 9
x = 1comment 4y ago · link · parent
Box deletes the owned object when it goes out of scope without being moved (like unique_ptr in C++). So if anything, you want to go the other way: https://doc.rust-lang.org/std/boxed/struct.Box.html#method.f...
However, you can delete a *T by using <https://doc.rust-lang.org/std/alloc/trait.Allocator.html#tym...> with the Global allocator (since this is the one you're most likely using).
> I wanted to transform a &mut T into &UnsafeCell<T> (note the &) and copy the reference, to allow shared mutation scoped within the lifetime of the source &mut T. How can this be accomplished?
If you want to have two instances of one &mut T, you don't go through &UnsafeCell<T>. Instead you may cast &mut T into *mut T and then use this: <https://doc.rust-lang.org/std/primitive.pointer.html#method....>. This however will cast into any lifetime, so if you want to bind the two lifetimes together, then you need to have the lifetime of the original &mut T explicitly specified, and then you assign the result of the method I linked to a variable with explicitly specified type where you specify the lifetime annotation. Alternatively, you may write a separate function which accepts both references as arguments and binds the two lifetimes together the usual way.
I admit it's a bit unergonomic. The best way currently would be to have the data stored as UnsafeCell in the first place and then call get_mut() on it to get all the references. However, if this reference comes from outside, you're left with the little mess I outlined above.
comment 4y ago · link · parent
UnsafeCell<T> also owns T, so transforming &mut T into UnsafeCell<T> also doesn't make sense. The unsafe equivalent of references is pointers.
comment 4y ago · link · parent