[-] Redkey@programming.dev 20 points 1 month ago

Let me know if you find one that uses AI to find groupings of my search terms in its catalogues instead of using AI to reduce my search to the nearest common searches made by others, over some arbitrary popularity threshold.

Theoretical search: "slip banana peel 1980s comedy movie"
Expected results in 2010: Pages about people slipping on banana peels, mostly in comedy movies, mostly from the 80s.
Expected results in 2024: More than I ever wanted to know about buying bananas online, the health impacts of eating too many or not enough bananas, and whatever "celebrities" have recently said something about them. Nothing about movies from the 80s.

[-] Redkey@programming.dev 16 points 3 months ago

As a half-joking response to this half-joking admission, I got started with the Usborne programming books as a kid, and they laid some excellent foundations for my later study. They're all available online for free these days, so grab an emulator and user manual for your 80s 8-bit home computer of choice, and dive in!

[-] Redkey@programming.dev 26 points 3 months ago

Thr34dN3cr0 wrote (14:12 5/17/2019):

Does anyone have a way to fix this in the latest version? I've been looking all day but none of the answers I've found work.

Thr34dN3cr0 wrote (14:48 5/17/2019):

nvm figured it out.

[-] Redkey@programming.dev 38 points 3 months ago

"If you wish to be a writer, write."

Epictetus delivered this burn over 1900 years ago.

[-] Redkey@programming.dev 25 points 4 months ago

Re: the Acceptance stage.

Years ago I worked at a family-run business with a good working environment. The staff were once told a story of how, earlier in the company's history, a manager made a mistake that caused the company a substantial monetary loss.

The manager immediately offered their resignation, but the owner said to them, "Why would I let you go now? I've just spent all this money so you could learn a valuable lesson!"

So yeah, generally, most managers' reaction to accidentally deleting vital data from production is going to be to fire the developer as a knee-jerk "retaliation", but if you think about it, the best response is to keep that developer; your data isn't coming back either way, but this developer has just learned to be a lot more careful in the future. Why would you send them to a potential competitor?

[-] Redkey@programming.dev 30 points 4 months ago

It's a persistent dynamic memory allocation that's accessed by multiple processes! :)

[-] Redkey@programming.dev 16 points 5 months ago

Whatever it may have become in later years, Alan Kay, who is often called "The Father of Object-oriented Programming", outlined the message-passing idea as the main concept he was driving at, originally.

He also says that he probably misnamed it.

Here's a discussion in which the man himself makes a (small) appearance: https://softwareengineering.stackexchange.com/questions/46592/so-what-did-alan-kay-really-mean-by-the-term-object-oriented

[-] Redkey@programming.dev 12 points 6 months ago* (last edited 6 months ago)

I love low-level stuff and this still took me a little while to break down, so I'd like to share some notes on the author's code snippet that might help someone else.

The function morse_decode is meant to be called iteratively by another routine, once per morse "character" c (dot, dash, or null) in a stream, while feeding its own output back into it as state. As long as the function returns a negative value, that value represents the next state of the machine, and the morse stream hasn't yet been resolved into an output symbol. When the return value is positive, that represents the decoded letter, and the next call to morse_decode should use a state of 0. If the return value is 0, something has gone wrong with the decoding.

state is just a negated index into the array t, which is actually two arrays squeezed into one. The first 64 bytes are a binary heap of bytes in the format nnnnnnlr, each corresponding to one node in the morse code trie. l and r are single bits that represent the existence of a left or right child of the current node (i.e. reading a dot or dash in the current state leading to another valid state). nnnnnn is a 6-bit value that, when shifted appropriately and added to 63, becomes an index into the second part of the array, which is a list of UTF-8/ASCII codes for letters and numbers for the final output.

[-] Redkey@programming.dev 12 points 7 months ago

Assuming C/C++, dare we even ask what this teacher uses instead of switch statements? Or are her switch statements unreadable rat's nests of extra conditions?

This is a good life lesson. We're all idiots about certain things. Your teacher, me, and even you. It's even possible to be a recognized expert in a field yet still be an idiot about some particular thing in that field.

Just because some people use a screwdriver as a hammer and risk injuring themselves and damaging their work, that's not a good reason to insist that no-one should ever use a screwdriver under any circumstances, is it?

Use break statements when they're appropriate. Don't use them when they're not. Learn the difference from code that many other people recommend, like popular open-source libraries and tutorials. If there's a preponderance of break statements in your code, you may be using a suboptimal approach.

But unfortunately, for this course, your best bet is to nod, smile, and not use any break statements. Look at it as a personal learning experience; by forcing yourself sit down and reason out how you can do something without using break statements, you might find some situations where they weren't actually the best solution. And when you can honestly look back and say that the solution with break statements is objectively better, you'll be able to use that approach with greater confidence in the future.

[-] Redkey@programming.dev 14 points 7 months ago

Some of the things you mentioned seem to belong more properly in the development environment (e.g. code editor), and there are plenty of those that offer all kinds of customization and extensibilty. Some other things are kind of core to the language, and you'd really be better off switching languages than trying to shoehorn something in where it doesn't fit.

As for the rest, GCC (and most C/C++ compilers) generates intermediate files at each of the steps that you mentioned. You can also have it perform those steps atomically. So, if you wanted to perform some extra processing at any point, you could create your own program to do so by working with those intermediate files, and automate the whole thing with a makefile.

You could be on to something here, but few people seem to take advantage of the possibilities that already exist, and combining that with the fact that most newer languages/compilers deliberately remove these intermediate steps, this suggests to me that whatever problems this situation causes may have other, existing solutions.

I don't know much about them myself, but have you read about the LLVM toolchain or compiler-compilers like yacc? If you haven't, it might answer some questions.

[-] Redkey@programming.dev 13 points 8 months ago

It really depends on your expectations. Once you clarified that you meant parity with current consoles, I understood why you wrote what you did.

I'm almost the exact opposite of the PC princesses who can say with a straight face that running a new AAA release at anything less than high settings at 4K/120fps is "unplayable". I stopped watching/reading a lot of PC gaming content online because it kept making me feel bad about my system even though I'm very happy with its performance.

Like a lot of patient gamers, I'm also an older gamer, and I grew up with NES, C64, and ancient DOS games. I'm satisfied with medium settings at 1080/60fps, and anything more is gravy to me. I don't even own a 4K display. I'm happy to play on low settings at 720/30fps if the actual game is good. The parts in my system range from 13 to 5 years old, much of it bought secondhand.

The advantage of this compared to a console is that I can still try to run any PC game on my system, and I might be satisfied with the result; no-one can play a PS5 game on a PS3.

Starfield is the first game to be released that (looking at online performance videos) I consider probably not being worth trying to play on my setup. It'll run, but the performance will be miserable. If I was really keen to play it I might try to put up with it, but fortunately I'm not.

You could build a similar system to mine from secondhand parts for dirt cheap (under US$300, possibly even under US$200) although these days the price/performance sweet spot would be a few years newer.

[-] Redkey@programming.dev 18 points 9 months ago

This isn't a slight against you, OP, or this game, but I'm just suddenly struck by the way that, "aside from the first few hours," or more commonly, "it gets better a couple of hours in," has become a fairly common and even somewhat acceptable thing to say in support of a game, as part of a recommendation.

As I get older I'm finding that I actually want my games to have a length more akin to a movie or miniseries. If a game hasn't shown me something worthwhile within an hour or so, I'm probably quitting it and never coming back.

view more: ‹ prev next ›

Redkey

joined 1 year ago