Topic: "talking to the bomb"
https://www.youtube.com/watch?v=h73PsFKtIck (warning this is considered to spoil the movie).
556 karma · joined January 12, 2017
ParisTech engineer (École Polytechnique), Ph.D. in robotics, 15+ years industrial experience (including transportation and premises receiving general public). Missions for demanding contexts: consultancy, interim CTO, all missions dealing with software source code, with a strong bias towards very high quality. Freelanced for 10 years, now doing something else.
* Longer summary on https://www.linkedin.com/in/gourichon/ * Long list of experiences and technologies on https://fidergo.fr/expertise (French) * CV https://gourichon.org/stephane/cv (French) * Languages: English/French * Contact https://fidergo.fr/contact
Topic: "talking to the bomb"
https://www.youtube.com/watch?v=h73PsFKtIck (warning this is considered to spoil the movie).
``` #!/bin/sh N=20 msg_len=$(git log -1 --pretty=%B | wc -c) if [ "$msg_len" -lt "$N" ]; then exit 125 fi # Here you would run your actual test and report 0 (good), 1 (bad) as needed exit 0 ```
I encourage you to continue working on your projects.
Is it really possible to reconcile "no bloat" with "fully standard compliant"?
Maybe have a look at https://github.com/eyalroz/printf, if only for the test suite, which looks pretty comprehensive and still fails.
Maybe "key features" does not mean the same in all projects, making every project appear "unnecessarily bloated while missing key features" in every other context?
I had a bug:
u_printf( my_output_cb, NULL, "%d" NL, -42 );
prints:--42
I may have found an explanation. In u_parse_format(), case 'i': calls u_itoa( value, buffer, 10, false ); which outputs minus sign.
Then if ( number ) does if ( sign ) { output_cb( '-', ctx ); chars_written++; } which outputs another minus sign.
25 years ago when I read that Microsoft has a software development environment named "Visual Studio" I imagined, well, something with graphs and nodes and flow and... Well something visual, right? Now it's 2024 and VS is still not visual.
Of course things are not as simple. Flyde (along with many alternatives mentioned) is visual IMHO. Keep up the good work!
Well, you impressed me (and others) with your simple bet that "hey, what if I simply choose the two most popular colors" and just code that in simple BASIC. The same could be done with the shading. It would probably pick a good compromise when bright yellow meets dark red: by choosing to have the few should-be-red pixels become yellow, you avoid a bigger obviously-square-grid-based clash of colors.
Next step: error diffusion dithering would IMHO be a good bet. But maybe that becomes really to much for Basic.
I've been considering doing Raytracing on the Amstrad CPC, but in C. Perhaps using integers only, for speed.
Done that instead: https://cpcitor.itch.io/just-get-9
Hey, found this https://bbcmic.ro/?t=9ctpk via "BBC BASIC raytracer in 432 characters (mastodon.me.uk)" https://news.ycombinator.com/item?id=39023056#39023768
* colored spheres (like you did)
* (one) checkerboard surface
* self-shadowing (like you did)
* cast shadows (like you did)
* partial or total specular reflection!
See https://www.cpc-power.com/index.php?page=detail&num=19283
The webpage displays the color (left) and green (right) versions on hovering your pointer over the ribbon (above). Image 1 and 2 are okay in both cases, image 3 is clearly tuned for color screen, image 4 for green screen.
Or direct links to the relevant variants:
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
Also, not exactly the same type or rendering, but basically word for word what you wrote: the full-screen fully animated parts appear to be "a set of frames rendered out and stitched together to make an animated sequence"
I've had the opportunity to use a variety of noise cancelling headphones over the years, from various brands, both in-ear and over-ear, and they all had this effect.
The good news is that you can become completely accustomed to it: after a while, the brain understands that there's no pressure imbalance, and it becomes a non-issue. Not hearing low frequencies is exactly what we expect from the product.
The article goes further to discuss some slope in a graph around 500Hz, which might be true, but I don't subscribe to that. It seems unnecessary to explain the observed facts and adds nothing.
What is not addressed at all is why all models seem to emit a subtle continuous shhhhhhh across a broad range of high frequencies. It's so subtle that you can only notice it when the outside environment is already quiet. I've never been certain whether it's just noise from the signal processing. My intuition is that it's artificially added to prevent inducing tinnitus in some users.
Yes, it's funny but that's not the point. The important thing is that the name clearly conveys the message that you really shouldn't be calling it, as explained in the comments above the function definition.
The "funny but there's a real reason behind" aspect is a bit like https://xkcd.com/radiation/ : "It's for general education only. If you're basing radiation safety procedures on an internet PNG image and things go wrong, you have no one to blame but yourself." The sentence is funny but has a real purpose: protect readers and author.
Constructs fully determined at compile time have some benefits. But const in C is weaker than constexpr that C++ has.
As prog-fh summarizes on https://stackoverflow.com/questions/66144082/why-does-gcc-cl...
> "The const means « I swear that I won't change the value of this variable » (or the compiler will remind me!). But it does not mean that it could not change by another mean I don't see in this compilation unit; thus this is not exactly a constant."
One example of invalid C:
const int mysize = 2; const int myarray[mysize];
gcc: error: variably modified ‘myarray’ at file scope
clang: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant] const int myarray[mysize];
* Good news: C can do compile time constant structs and array with deep self-references.
Yes, in C you can define and fully declare complex data structures that are accepted as compile-time constants, including pointers to parts of itself.
See "self-contained, statically allocated, totally const data structure with backward and forward references (pointers)?" for a previous example at https://stackoverflow.com/questions/47037701/can-c-syntax-de...
-----------------
I used this for a game on a retro machine where such a data structure avoids code which would have been several times (perhaps 10 times) bigger: https://github.com/cpcitor/color-flood-for-amstrad-cpc/blob/...
Here's another take showing two variants: where overall construct is an array then a struct: https://gist.github.com/fidergo-stephane-gourichon/792c194e1...
Many interesting quirks in type systems, surprising interference between separately innocuous type system features, but don't expect too many explosions.
Indeed, many of the tricks are years old (e.g., 2006) and are fixed in current versions of the language (or even are research paper involving experimental systems that were never released, e.g. Privacy violation in C# doesn't even use a syntax that released C# compilers use).
Mutable matching in Ocaml can be reproduced with ocaml 4.13, still, and cause a segfault.
> it is possible to shadow the BASIC ROM on the Amstrad CPC 464 (1984).
The ROM and RAM run at the same speed on that machine, so speed gain is not a motivation.
> You could copy the ROM to the RAM and permanently switch in the RAM.
Permanently? In principle you might be able to do that, but it's certainly not easy. The firmware switches ROMs/RAM all the time (lower ROM 300 times per second, higher ROM often when BASIC runs). You would need to patch the routines that perform ROM switching to make them switch only lower ROM. Fortunately those routines are already copied in central RAM because they need to operate whatever the ROM configuration, so it is possible to patch them. Still, the patched version would probably be more complex, so you'd need to borrow some more bytes elsewhere. Also make sure that no change is needed to the first 64 bytes (address range 0x0000-0x003F) because when ROM is enabled there they don't have your RAM-based changes.
> That ROM is normally located at C000h, shared with bank-switched RAM storing the display at the same address.
Beware, the optional external disk drive on the CPC464 adds another ROM at the sames address. So, if you want to keep compatibility, do patch the routine right, so that they do bank-switch that ROM, but when targeting BASIC ROM they actually re-enable RAM (not the same hardware registers as explained on the reference you posted).
> Which allowed you to do stuff like modifying the error messages in BASIC to say rude words,
After all that hard work is done, yeah you could replace some strings with other strings of the same length, keeping the most significant bit set as separator, why not. But most strings aren't even stored as is, they are encoded in various ways to save bytes (Basic instruction names, for example), typically only portions of words are in plain 7-bit ASCII.
> You had to do another trick to move the display RAM elsewhere too
More than one trick as shown above.
The welcome message is in lower ROM, so hey, let's go crazy like "I don't need a reason, let's shadow all the ROM". The simplest bet would be to start with a CPC464 without a disk drive, copy both ROMs to RAM, tell firmware to use screen at 0x4000 instead of 0xC000 (easy compared to the rest), patch all areas that define low addresses to shift these by 0x8000 more (much less easy). Then you'd have a system running, with your free RAM for Basic programs around 10k instead of 42k. But hey, the welcome message on system "reset" would be yours.
> not that we would have ever done that.
Definitely. Thanks for the ride.
It explains pitfalls in accessing these through low level C definitions, proposes a C++ encapsulation class and summarizes pros and cons.
(Not saying if any of those is viable, just mentioning in case it makes the conversation more interesting.)
I guess the average HN user has Javascript enabled by default, yet I expected a longer and more informative page than that. ;-)
Source: my father owned several cars of the 2CV family and we rode in them for years.
Did he actually build it in the desert? Without tools it seems rather difficult.
Here's the central point of https://sahara-overland.com/tag/emile-leray/
> I believe the 2CV bike was indeed built in the desert, much as Leray claims, but he set out from France with the explicit intention of performing this task. Otherwise he’d have walked out like any normal person in a similar situation.
> His claimed unease about leaving his stricken car doesn’t ring true, let alone the spontaneous idea of making it into a two-wheeler. Tellingly, in 2006 Leray went on to build a ‘2CV boat’ in Mali. He clearly likes mucking about with 2CVs. Fair play to him!
The point of selecting a higher definition video stream can be to circumvent bandwidth limitation, if the platform happens to compress too much what it sends by default.
> Warning: this page has about 72MB of Gifs! Medium also has a tendency to not load them properly, so if there’s a large gap or overly blurry image, try reloading the page. Ad blockers may cause problems, no script may make it better. It’s also broken in the official Medium app. Sorry, Medium is just weird.
There may be a fix: vote with your choice, stop publishing on Medium, publish elsewhere?
This content is worth it.
> Platform architecture: 32-bit/64-bit/arm64 > Supported OS: 7 SP1, 8, 8.1, 10, 11
while Portmaster https://safing.io/portmaster/ is open-source, offers precompiled packages for Windows 10/11, Debian/Ubuntu and Fedora and is reported to work (sometimes not perfectly) on many kernel/desktop environment combinations, see https://docs.safing.io/portmaster/install/linux .
Still, bees with their hard-coded set of neurons have surprising cognitive abilities: explore, memorize position of food source (angle and distance from the hive) and communicate the information to their peers.
Also, keep knowledge of absolute direction based on the sun or polarization pattern of even a small patch of blue sky, and use that information even many hours later, compensating for the change of the sun position in the sky.
https://en.m.wikipedia.org/wiki/Waggle_dance https://en.m.wikipedia.org/wiki/Bee#Navigation,_communicatio...
Related: I did a Ph.D. in mobile robotics inspired from short range navigation in bees, based on biologists' reports of systematic experiments on what elements bees uses to find their way.