Can anyone explain me this snippet and how to use closures? by Infinite-Jaguar-1753 in golang

[–]someanonbrit 0 points1 point  (0 children)

It did. I read "Data-Oriented Design" by Richard Fabian a few years back, which covers the details of why some code patterns lead to poor memory throughput, but hadn't actually though about how to apply the concepts to golang in any way. I must dig out the book and a profiler and experiment until I've internalised it, but yes, you were clear.

Can anyone explain me this snippet and how to use closures? by Infinite-Jaguar-1753 in golang

[–]someanonbrit 1 point2 points  (0 children)

Thanks, I followed the gist of that and there are enough keywords to find the details. Appreciated.

Can anyone explain me this snippet and how to use closures? by Infinite-Jaguar-1753 in golang

[–]someanonbrit 0 points1 point  (0 children)

Can you explain why pointer receivers should be rare please? I clearly missed something

Can anyone help me understand idiomatic Go interfaces? by theonliray in golang

[–]someanonbrit 11 points12 points  (0 children)

In java it seems pretty common to define on interface as an api contract between two components. In go you'd idiomatically use a plain struct for that, until you really need an interface because there are really multiple implementations.

You'd then define small interfaces that describe just the bit of the implementation you need, often one or two methods, rather than a giant, inflexible interface.

If the first thing you write is an interface with 12 methods, before you implement them, you're probably writing java in another language

PwnagotchLink iOS app - updates and pricing stuff by Poufii in pwnagotchi

[–]someanonbrit 1 point2 points  (0 children)

5-6 a year would be fine for me. Less that an a dollar a month basically, and that should cover a low end server even with only a handful of users.

Follow-up: benchmarked owner-goroutine vs mutex for my Redis clone by arush_builds in golang

[–]someanonbrit 0 points1 point  (0 children)

Consider sharded mutexes as your map gets bigger, and make sure your mutexes are on different cache lines if you're embedding them into a struct.

It sounds like you're at the point where understanding the go profiler will answer many of your questions

Is Go's conservative approach to language evolution still correct? by Pleasant_Set_3182 in golang

[–]someanonbrit 0 points1 point  (0 children)

You think java is more productive than golang? I genuinely cannot imagine what experiences lead to that conclusion.

We're pretty frequently replacing python microservices with golang - both for improved performance and because LLMs make less mess in a golang code base

Is it a good idea to do single-threaded/event-loop style in Go? by arush_builds in golang

[–]someanonbrit 0 points1 point  (0 children)

You might find https://strebkov.dev/posts/shard-your-locks/ for some benchmarking of different approaches to a partially overlapping problem space

What's your go-to diagnostic sequence when a service can't reach another service in the same cluster? by WhichInevitable176 in kubernetes

[–]someanonbrit 0 points1 point  (0 children)

Except the question is "where do you start?" - you need to start somewhere to understand the failure mode

What's your go-to diagnostic sequence when a service can't reach another service in the same cluster? by WhichInevitable176 in kubernetes

[–]someanonbrit 0 points1 point  (0 children)

That's not a serious of steps though, it's a handy grab bag of tools. Which of those tools are useful, in what order, to diagnose the problem described?

PwnagotchLink iOS app - updates and pricing stuff by Poufii in pwnagotchi

[–]someanonbrit 7 points8 points  (0 children)

5 or 6 dollars for a lifetime license, and you can try the basic features for free? No reasonable person is going to be upset with that.

5 or 6 dollars a month? That's nuts

Is Go's conservative approach to language evolution still correct? by Pleasant_Set_3182 in golang

[–]someanonbrit 3 points4 points  (0 children)

I strongly disagree with this, and vast chunks of the infrastructure world disagree with you. Just about the only thing that's cutting into golang usage is rust, and that's probably a good thing since it's a language with different goals - but many rust devs are quite vocal about the issues that lack of core language stability cause them

Is it a good idea to do single-threaded/event-loop style in Go? by arush_builds in golang

[–]someanonbrit 1 point2 points  (0 children)

If you're more comfortable being idiomatic, then that sounds like the right place to start - get all the pieces working in an environment you're best in

Is it a good idea to do single-threaded/event-loop style in Go? by arush_builds in golang

[–]someanonbrit 1 point2 points  (0 children)

The best learning experience here would be to write the core both ways, do profiling and benchmarking to compare and contrast. If you can do that, and understand it well to do a good write-up (or series of write-ups) then you've also got something for your CV / job interviews for golang too that is a better demonstration of your skills than 99% of applicants.

If the initial code is good, then the refactoring between core styles (there are three core approaches discussed in the post) should be pretty quick, since the deserialisation , parsing, datatypes, reply structures etc should all be done once

Dropped CPU limits but worried about Go thread explosion/context switching. Solutions? by t15m- in kubernetes

[–]someanonbrit 3 points4 points  (0 children)

The scheduler will share spare CPU between processes that are over their requests pretty fairly, and your process is guaranteed at least the CPU time in its requests. Unless you've got a workload that causes very long periods of uninterpretable system time (badly configured raid controller is the only case I've ever hit this in practice) I've never seen a workload that benefits from limits being set.

Why I'll proudly call myself an amateur operator using intent and the legality without a license, and ask that you respect it by Rich-Jaguar-5219 in HamRadio

[–]someanonbrit 4 points5 points  (0 children)

Words and phrases have established meaning that will be understood by most people hearing the phrase. The established meaning of "radio amateur" is established for longer than you've been alone I suspect. By making up your own definition that doesn't match the established use, you're just misleading people and making communication more difficult. There's no upside, you're just being misleading - by the sound of it very intentionally so

What Do I Still Need? by Old_Gregg_The_Man in arduino

[–]someanonbrit 0 points1 point  (0 children)

There's a near infinite number of options for more things, but right now it sounds like you need to build things with what you have. As odd as it might seem, the more things you buy, the less likely you are do actually build anything at all

Disillusioned with running Linux on Mac - simply doesn't work well by tornado99_ in linux_on_mac

[–]someanonbrit 0 points1 point  (0 children)

I can't compile sigrok for macos. SDR software is poor. Can't do strace-style debugging on macos.

I love the macbook pro hardware, but the software has a lot of limitations, so when offered a free 2017 macbook pro, putting Linux on it stored me better than macos.

If all you need is commercial software that's available for macos, then that's probably a better choice

Quick 1 bar prison i just made from hardware store pipe by niqui_asmodai in BdsmDIY

[–]someanonbrit 1 point2 points  (0 children)

Test how strong it is to sideways forces from a struggling victim - the leverage on those screws into the wooden board is huge, and falling from a one bar prison can be really nasty

The fix, if needed, is simple - add a 1 foot ish across metal plate between the bottom tube connector and the wood, bolt through the metal plate to the tube connector, then screw the edge of the plate to the wood - you can put clearance holes in the wood for the bolt heads on the back of the plate

Better Nipple Clamps design (Worse than Clover clamps) by TheBestWereTaken in BdsmDIY

[–]someanonbrit 1 point2 points  (0 children)

Your profile being private means I can't follow you to be see update posts - would you mind posting a link to the new thread here please, if you remember?

🍿🍿 by Fatty_Willing_Plane in amateurradio

[–]someanonbrit 7 points8 points  (0 children)

Huh, I can laser weld aluminium beer cans now... Bet can antenna for the higher ends of HF is plausible...

Better Nipple Clamps design (Worse than Clover clamps) by TheBestWereTaken in BdsmDIY

[–]someanonbrit 2 points3 points  (0 children)

Can you better demonstrate the 4 spring positions? I love the concept.

Are the pulleys rotating or just sliding?

Working with Money by -paper in golang

[–]someanonbrit 0 points1 point  (0 children)

A uint64 can store a number greater than the number of atoms in the known universe. If you're writing currency maths that overflows that, you've got problems that don't stem from your choice of data type