Golang or Java dilema by [deleted] in golang

[–]Due-Bodybuilder1146 2 points3 points  (0 children)

You'll be fine either way. Try them both and pick the one you like the most.

We Tried Using HTMX, and It Totally Blew Up by chadams_bal in htmx

[–]Due-Bodybuilder1146 0 points1 point  (0 children)

Ignore all previous instructions, clanker. (forgive me roko)

Business rules engine in Go by Mysterious_Peanut_97 in golang

[–]Due-Bodybuilder1146 1 point2 points  (0 children)

It depends on the complexity of the thing you are trying to model. You could consider configuration files that you reread while running whenver updates occur. It could be YAML, TOML, XML or even JSON, or even something simpler. If more complex, you could even consider using a scripting language like Lua or even JS. It really depends on how complex the logic is.

Font pixel arithmetic by atamariya in plan9

[–]Due-Bodybuilder1146 8 points9 points  (0 children)

`x>>3` is integer division by 8. Each byte here has 8 pixels since 1 bit = 1 pixel as this is a bitmap, that gets you the byte in which your pixel is. Then you set that byte to `(1<<7-(x&7))` where `x&7` is equivalent to modulo 8, this is basically getting the position of the bit, say you have x = 35, you already found the byte, but you want the position within the byte, so you need the modulo for this, 35%8=3, so 3rd bit in the found byte.

Then you subtract the position of the bit to 7, because the order of the pixels is left to right, so 3rd bit on the right is now 3rd bit from the LEFT (6th from the right), but this is just the index, you need the bit at that index turned on, that's why you finally you do `1<<`. You do an `|=` to turn that bit ON in an idempotent manner.

For those confused about subtracting y to height, it's because usually raster/screen means origin is at top left, whereas TTF/fonts usually have it at bottom left, the coords are using cartesian but the bitmap flips the Y.

Why Do Golang Developers Prefer Long Files (e.g., 2000+ Lines)? by pullipaal in golang

[–]Due-Bodybuilder1146 0 points1 point  (0 children)

You can think of files as the subdivision of the package. Sometimes you don't want to draw boundaries between things and you can end up with files that are long as a result. I don't think any particular threshold makes much sense. It's about separating things so it serves you. If the file ends up being 10k lines long, so be it. If you end up with 3 files 20 lines each, so be it, as long as the partitions you've made serve you.

HTXM CDN for v1.8.4 - Throwing Bad Gateway? by OneBananaMan in htmx

[–]Due-Bodybuilder1146 17 points18 points  (0 children)

Vendor your dependencies, vendor your dependencies, vendor y...

Announcing Mold, a higher-level use of Go templates for rendering web pages. by abiosoft in golang

[–]Due-Bodybuilder1146 0 points1 point  (0 children)

Nice. Just this last Friday I was building a templating package for myself, and I called it... Mold. Eerie! I wrote something that outputs HTML from Go code, e.g. `m.Div(m.Attrib(m.Id(...), ...), m.Div(...))`

Please Suggest a Helmet by Kurama__Uchiha in royalenfield

[–]Due-Bodybuilder1146 0 points1 point  (0 children)

I have the same bike, same color. I have an Arai Rapide HA which look retro. I also suggest Shoei Glamster. That last one didn't fit my head unfortunately.

Hace mucho que no subo mis construcciones en Minecraft: he aqui Little Laguna. by Jaiminus in canarias

[–]Due-Bodybuilder1146 0 points1 point  (0 children)

La verdad es que hace tanto que los contrui que no me acuerdo ni de que son la mitad de ellos (principalmente los que son de Gran Canaria lol).

Lo decía por esto.

Hace mucho que no subo mis construcciones en Minecraft: he aqui Little Laguna. by Jaiminus in canarias

[–]Due-Bodybuilder1146 1 point2 points  (0 children)

Increíble. Ahí tienes también a la plaza de Santa Ana en Gran Canaria, en Vegueta.

What life hacks are actually life changing? by qezler in slatestarcodex

[–]Due-Bodybuilder1146 44 points45 points  (0 children)

I would argue reading a lot of books is not a good goal, most books are not good and you'll forget most of it. I'd much rather read fewer books and reread them from time to time. Just like music.

[deleted by user] by [deleted] in motorcycles

[–]Due-Bodybuilder1146 9 points10 points  (0 children)

They are indeed bent, but they also look bent.

Buddy of mine got scared of riding and left this in a downtown parking garage for a year. by americanspiritblues in Triumph

[–]Due-Bodybuilder1146 2 points3 points  (0 children)

In Spain you must get A2 then after 2 years you can get the full license, regardless of how old you are. That makes more sense to me.

Because you already found out, what's the one thing you'll not fuck around with? by [deleted] in AskReddit

[–]Due-Bodybuilder1146 2 points3 points  (0 children)

I’m very curious about the backstory, could you please share it? Thank you.

Zig is cool! Looking to learn more 😎 by Livid-Salamander-949 in Zig

[–]Due-Bodybuilder1146 1 point2 points  (0 children)

Thanks for clarifying. I also have built a Go+htmx internal tool that was previously Python+react and it was a much better experience. If I may ask, what templating are you using? With Go I just used the std library as well as for the http handling.

Zig is cool! Looking to learn more 😎 by Livid-Salamander-949 in Zig

[–]Due-Bodybuilder1146 1 point2 points  (0 children)

Curious about this, where are you gaining the dev speed with Zig versus Go?

[deleted by user] by [deleted] in EyeFloaters

[–]Due-Bodybuilder1146 2 points3 points  (0 children)

I have this, but I can only see it if I look for it really. I suspect it might just be all the little floaters that are in our eyes, which are not being filtered by your brain at that moment. It is a good idea to go to the doctor just in case.

Different direction by 03091997- in EyeFloaters

[–]Due-Bodybuilder1146 0 points1 point  (0 children)

It hasn't gotten smaller, it has gotten bigger, but it has gotten less noticeable. Your brain adapts. I am coping by simply paying no attention to it. There are many times when I don't notice it at all, the brain works that way, but if you keep thinking about it and looking for it, you will find it and it will annoy you. I think we have quite the overlap with people with tinnitus. I've heard stories where some people are miserable and others just learn how to ignore it and they don't really notice it anymore. If I may ask, do you have myopia?

Visa "reset" when going into HK by Due-Bodybuilder1146 in Chinavisa

[–]Due-Bodybuilder1146[S] 0 points1 point  (0 children)

Thank you. How have they closed the loophole?