668 karma · joined October 9, 2021
Did they _ever_ had root access in the last, I don't know, ten years?
Are they, though? Consider I have a linked list (or a map/dictionary, or any data structure that allows removal of arbitrary elements). I add elements with indices 1, 2, 3, 4, 5. I remove elements with indices 2 and 4. I'd like to make memory consumed by these elements available again. At the same time I don't want to change indexing scheme of the whole data structure. So I have to keep "holes" with indices 2 and 4 at the very least. After few million operations that may become very inefficient.
In a typical language, that would be resolved by having a global allocator that allows indices 2 and 4 to be reused in neighboring data structures. If I don't implement a global allocator that shares indices between objects (as that kills the whole point), I consume more memory than needed and rely on my own clunky implementation of garbage collection/defragmentation, don't I?
I cannot efficiently mutate or even store references in structs anymore. That seems to be a show-stopper if you want to have any non-trivial or non-standard data structures in the program. Granted, they are hard to get right, so maybe it's a feature.
The following phrases got my eye: "It is reasonable to ask, then, how we can use mutable value types to represent self-referential data structures, such as doubly linked lists and directed graphs. In fact, any arbitrary graph can be represented as an adjacency list. For example, a vertex set might be represented as an array, each element of which contains an array of outgoing edge destination indices.". I don't see how one can reasonably implement doubly-linked list without re-inventing memory heap and some kind of garbage collection in the implementation.
UPD: found some discussion at https://github.com/orgs/val-lang/discussions/736 , seems that there will be some escape hatches akin to Rust's `unsafe`. That resolves all issues, and "whether the safe subset of Val is enough for reasonable application" question is open to long years of debate.
Not sure about FPC, but Delphi 7 was on par with C++ ten years ago in competitive programming, that is about 2-3 times faster than Java. By competitive programming I mean very short (1-3 seconds per execution max, so any JIT is at disadvantage), CPU-bound single-threaded heavily algorithmic computation on mostly default compiler/runtime settings with no external libraries or ability to tweak. The common knowledge was: you either use C++/Pascal, or use Java and occasionally rewrite your 200-300 line solution to C++ if you get "time limit exceeded" error, and it passes with flying colors.
See https://ansuz.sooke.bc.ca/entry/23 and discussion at https://news.ycombinator.com/item?id=24917679 and older
If you've got time, check out the full 62-page solution, it's a really nice read even if you're not a lawyer: https://www.supremecourt.gov/opinions/20pdf/18-956_d18f.pdf . Of course, it does not mean you (or me) understands it correctly. But it does contain everything you want, starting from background and some facts.
The main opinion and relevant facts are on pages 5-40. Dissenting opinion is on pages 44+. An interesting quote from there:
> Oracle spent years developing a programming library that successfully attracted software developers, thus enhancing the value of Oracle’s products[1]. Google sought a license to use the library in Android, the operating system it was developing for mobile phones. But when the companies could not agree on terms, Google simply copied verbatim 11,500 lines of code from the library. As a result, it erased 97.5% of the value of Oracle’s partnership with Amazon, made tens of billions of dollars, and established its position as the owner of the largest mobile operating system in the world. > ... > Oracle gave developers free access to these methods to encourage them to write programs for the Java platform. In return, developers were required to make their programs compatible with the Java platform on any device. Developers were encouraged to make improvements to the platform, but they were required to release beneficial modifications to the public. If a company wanted to customize the platform and keep those customizations secret for business purposes, it had to pay for a separate license.
I've taught to freshmen students who have personally encountered dozens of different false positives and false negatives not only with sanitizers, but with compiler warnings as well. Nothing extraordinary, just `-Wall -Wextra -Werror` with the latest available GCC/Clang on the latest available Ubuntu LTS.
Some examples (some library bugs are also included):
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98677
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105729
https://github.com/llvm/llvm-project/issues/59432
https://github.com/boostorg/dll/issues/30
https://github.com/boostorg/asio/commit/71964b22c7fade69cc4c...
https://github.com/chriskohlhoff/asio/issues/997
I've also seen fun examples of a program working with all sanitizers in 14 modes across 3 OSes (GCC and Clang on Ubuntu, Apple Clang on macOS, Visual Studio on Windows), and _only_ failing with Visual Studio Release mode. It was an array overflow. Just was not caught by sanitizers.
Mind you: no weird C++ magic, just standard coding exercises.
I guess they're different for different interviewers.
The one I would use is something about undefined behavior. I mean, the fact that it exists and consequences. For example: "this program works, but if I add this line of code at the very end, the program crashes. Can be I sure that it crashed because of that line or some incorrect inputs to that line?"
In (almost) all other languages the answer is "Yes". Not in C++ or C. You may have a faulty program in the first place that just happen to not crash.
All other quirks and syntax can be picked up when needed. You can play around and investigate. But undefined behavior requires one to think and debug in a very different mindset. One cannot assume that a program that does not crash and gives a correct answer will do that if extended.
It is already done, as I've heard. The previous iteration was to pay your lookalike to pass the interview for you. Or just pay anyone and blame lack of camera on "technical difficulties".
The ability to determine the origin of content is indeed a complex issue. However, it's important to note that researchers and developers are actively working on developing methods to identify AI-generated content. There are ongoing efforts in the field of AI ethics and responsible AI development to address this problem.
Some approaches to tackling this issue include developing AI algorithms that can generate AI-generated content, also known as "adversarial AI." These algorithms aim to create AI models that can detect and identify AI-generated text by analyzing patterns, linguistic cues, or statistical properties specific to AI-generated content.
Additionally, researchers are exploring the use of metadata, watermarking, or digital signatures to provide additional information about the origin or authenticity of content. These methods could potentially help in distinguishing between AI-generated and human-generated content.
While it may be a complex problem to solve entirely, the development of techniques and tools to identify AI-generated content is an ongoing area of research. The aim is to create a balance between the benefits of AI-generated content and the need for transparency and trust in online information.
Of course, all paragraphs above are ChatGPT-generated. I did not even read them before commenting. That's the bar to clear. Otherwise, see https://xkcd.com/810/
Degrees vary. For example, some kind of Germany's border control with Austria started as early as 2015 and is still active to this day. I've seen it in a train from Salzburg to Munich in 2019, but it was like a routine ticket inspection. Just the German police checking passports and visas instead of DB officers checking tickets.
Here is an example MIT course from 2011, it introduces C-style arrays and C-style strings in lecture 4, pointers in lecture 5, and classes in lecture 6: https://ocw.mit.edu/courses/6-096-introduction-to-c-january-... (although memory management is postponed)
Another MIT course from 2014 explicitly starts with C, but it has "C and C++" in its name: https://ocw.mit.edu/courses/6-s096-effective-programming-in-...
P.S. Glad to hear it all worked out in the end!
Some comments may refer to that discussion post instead of the original blog (e.g. ones talking about downvotes) because it was a separate submission to HN whose comments were moved to this page.
Yes, StackOverflow is not for beginners at all. It's for fairly narrow technical questions.
Maybe AI may assist in asking a good question or breaking down a big question into narrow on-topics ones.
Sorry.
I'm really missing support for remotes. There are lots of tools for local-only development (like https://gitexercises.fracz.com/), but very few allow to demonstrate stuff like "Syncing a GitHub fork with the original repository" which involves two remotes and three copies of the same branch at the very least.