Spyke

Posts

concatenative·Concatenative ProgrammingbyTushta

Factor Cannot apply “call” to a run-time computed value

I wanted to map over a nested array in factor so I created a helper function:

: nested-map ( a quote -- a' ) swap [ over map ] map nip ;

which i then called with

{ { 1 2 } { 3 4 } } [ 1 + ] nested-map

But when I call it I get the error from the title.

If I just paste the body of the function it works as intended:

{ { 1 2 } { 3 4 } } [ 1 + ] swap [ over map ] map nip

So I guess I have two questions: is there a better way to achieve the original goal, but also how am I supposed to create higher order functions without getting this error?

View original on programming.dev
buildapc·BuildapcbyTushta

ITX build for photo editing / graphics design

I'm building a PC for my wife to do photo editing / retouching / other 2d/non moving stuff. I'm aware that this kind of software does benefit from GPU acceleration, but I'm also under impression that it's not critical. One additional constraint is that it should fit into teenage engineering's computer-1 case, because orange. I'm personally having a preference for AMD stuff, but I could be talked out of it. Two similarly priced options I had in mind were:

  • Ryzen 5600 / 16G ram / radeon 6600 GPU
  • Ryzen 8600G / 32G ram / no gpu

Thoughts / suggestions?

View original on programming.dev
linux·LinuxbyTushta

Did deep sleep broke for anyone else recently or is it just me?

I was running KDE Neon on ThinkBook 15 G2 and had deep sleep working after adding mem_sleep_default=deep to GRUB_CMDLINE. It worked for a while until it didn't. I didn't do anything other than running regulat updates. Since couple weeks back, when going to sleep, it shows BIOS Recovery progress bar or something and restarts.

I switched to Debian and the behavior is the same. S2 sleep is next to useless as it drains something like 10% battery / hour, and the lap top is warm to touch.

View original on programming.dev
programming·ProgrammingbyTushta

It turns out I really enjoy programming puzzles, is there something useful I can do with it?

There is a commonly shared view in the programming community that algorithm puzzles are something you do to prep for an interview and than you never use in the actual job. This certainly rings true as in 15 years of programming, i feel I can count on fingers the number of times I needed to stop and think about data structure / algorithm, rather than usual workload of thinking about what's even the problem being solved; how to structure code; what's the interface at the module/service/package boundary; how to make code testable/maintainable/flexible etc... Iterating though a list or a dict is all ds/algo you'll need 99% of the time.

FF to now when I'm on a burnout induced sabbatical, and after a while I got itchy to write some code again. Problem was that all the ideas for projects I'd like to do are, well... projects. I still don't feel like digging through manuals for libraries and frameworks and writing boilerplate and doing all the things that need to be done to push things through. Anyhow, I was sitting in a coffee shop with my illustrator friend, who, at some point, just pulled out a notebook, spent 20-ish minutes drawing something that caught his eye and was like: "that's it for today". That's it... 20 minutes, it's done, tomorrow something else, new blank page... So I got into puzzles. Now, the first thing I do in the morning is solving a daily puzzle on leet code. If I feel like it, I might also do problems from an old competition. And I'm having a blast!

Which brings us to the question from the title: is there a direction I can push this forward? I mean, I don't mind this just being fun, but I was curious, is there something out there in the "Real World" that I'm missing that is closer to this kind of problem solving from what i was doing so far?

View original on programming.dev

You reached the end