4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions
comment 5y ago · link · parent
> This is undefined by the spec.
> There are 2 obvious ways.
> 1. Scan from the front, when you see an id for a record do the appropriate thing.
> 2. Scan from the back, find the end-of-central-directory-record and then use it to read through the central directory, only looking at things the central directory references.
I was recently bitten by this at work. I got a zip from someone and couldn't find inside the files that were supposed to be there. I asked a colleague, and they sent me a screenshot showing that the files were there, and that they didn't see the set of files that I saw. I listed the content of the zip using the "unzip -l" command. They used the engrampa GUI. At that point I looked at the hexdump of the file. What caught my eye was that I saw the zip magic number near the end of the zip, which was odd. The magic number was also present at the beginning of the file. At this point I suspected that someone used cat(1) to concatenate two zips together. I checked it with dd(1), extracting the sequence of bytes before the second occurrence of the zip magic number and the remainder into two separate files. And sure enough at that point both "unzip -l" and "engrampa" showed the same set of files, and both could show both zips correctly. Turns out engrampa was reading the file forwards, whereas unzip was reading the file backwards.
comment 5y ago · link · parent
I thought it was FAT32. Do Macs support NTFS?
EDIT: It seems they don't out of the box: <https://www.howtogeek.com/236055/HOW-TO-WRITE-TO-NTFS-DRIVES...>
EDIT 2: Since many comments replied with the same thing, I'll reply here: I wouldn't consider read-only support as support for portable data storage, since that allows you only to send data in one direction. When you want to copy a file from a Mac to a Windows computer, NTFS is not a solution now (out of the box at least), therefore falls pretty short wrt "portable".
comment 5y ago · link · parent
[1]: That's the frequency of this paranoia creeping in that I observed, not of detected memory corruption, but that too I think would be counted in an integer number of percents IME.
comment 5y ago · link · parent
I don't think most dinosaurs are seen as monsters. When it comes to public relations "monsters", I think it's mostly T-Rex, and usually it isn't portrayed as skeletal. Depictions of most dinosaurs make them look cute.
comment 5y ago · link · parent
Or bullshit jobs.
comment 5y ago · link · parent
Basically my ISP router would receive data at full speed, while internally I would have a lot of dropped packets.
Additionally, I usually use the web browser to view Jira or copy files over NFS during calls, and I'm sure there are some background apps contributing to the traffic as well.
The one thing that fixed all my problems was reconfiguring the network driver to set 1G bandwidth on my NIC instead of the 100M that it set automatically. Yeah, Linux Desktop problems...
comment 5y ago · link · parent
You jest, but I turn off my router for the night and each time I leave home for more than a day. Not just router to be exact, everything that's connected to a power strip goes down, as I turn off all the power strips. (Not OP.)
comment 5y ago · link · parent
comment 5y ago · link · parent
Afaik Cargo does it out of the box, based on Cargo.lock.
UPDATE: This doc page seems to confirm that: <https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lo...>
comment 5y ago · link · parent
With Rust, procedural macros add a lot of overhead when compiling, so I try to avoid them.
At work, we have a C++ project which, without using distributed builds with distributed ccache, running on powerful cloud computers, takes 3h+. Code quality is adequate. Debugging anything is a nightmare in such a codebase.
comment 5y ago · link · parent
That's not what we see happen in life. Just look at how dearly we hold on to coal plants. My country's energy is 90+% coal-based and there is an insurmountable opposition to atom, and great suspicion against solar (government recently started financially deterring against mounting solar panels).
comment 5y ago · link · parent
Also, compilers often can't optimize stuff which is obvious to humans. E.g. here is an example of GCC not being able to delete useless code: <https://godbolt.org/z/655KeM33Y> (it's fixed in later versions of GCC, but this version of GCC also isn't that old). Another example is Clang emitting useless code out of nowhere: <https://youtu.be/R5tBY9Zyw6o?t=1620>. So, it's not out of the ordinary for compilers to be really stupid about the assembly they generate.