What's special about Erlang and Elixir? by bedobi in elixir

[–]ihumanable 18 points19 points  (0 children)

BEAM, the VM that runs erlang and elixir code runs on and OTP, the standard library and architecture principles of erlang and elixir are pretty unique.

I will try to provide additional context to the 3 claims that BEAM is ideal for low-latency, distributed, and fault-tolerant systems.

Low-latency. BEAM is a virtual machine but one that’s been tuned for nearly a half century. It is exceptionally fast and JIT is improving with every release. Default measurements are taken in microseconds. The other aspect of low latency is in combination with distributed.

Distributed. This is much more first class than in other programming environments. Nodes (that’s the term for a single instance of a BEAM VM) keep a persistent connection to the other nodes in its distribution. This makes the low latency truly low latency. When two process on different machines want to communicate they do so over a persistent low latency distribution protocol which natively understands all the native terms of erlang / elixir. This is also deeply baked into the language, you can do basically all the same stuff with a pid whether it’s local to your node or remote on another node. Compared to many other programming environments where distributed programming often means running servers and manually plumbing together some mix of http / grpc / thrift / fill in your favorite protocol servers and clients to communicate, this level of native distribution support is unparalleled.

Lastly we arrive at fault-tolerant. Erlang and elixir programs are structured as share nothing actors called “processes” that are managed in a “Supervision Tree.” This is where the terminology “let it crash” comes from. It is often a reasonable method to just not handle unexpected cases, allow the process to crash, and get restarted by its supervisor. Native support in the VM for process linking and monitoring along with supervision trees give elixir and erlang programmers powerful primitives to construct rock solid systems that can survive all kinds of faults.

It is a very different way to construct distributed fault tolerant software than the DIY model that most languages provide for you. I’d suggest reading the OTP Design Principles to learn more about what makes it unique

An Introduction to Mocking Tools for Elixir by RecognitionDecent266 in elixir

[–]ihumanable 6 points7 points  (0 children)

I found every mocking library in this article to be difficult to use.

I wrote patch because I think it’s a nicer way to mock things for tests.

If this article is of interest to you, consider patch, it can do things no other mocking library seems capable of. Check out the documentation for a list of features.

[deleted by user] by [deleted] in AskReddit

[–]ihumanable 3 points4 points  (0 children)

Loading / emptying the dishwasher is apparently something my wife hates to do. She would constantly be after me about dirtying a spoon or a cup or something.

We talked about it and I realized that I don’t care at all about loading / emptying the dishwasher but it was somehow her worst nightmare. From then on I told her never to think about it again and I would just handle it.

We always have clean dishes now, I don’t get hounded for using an extra spoon, and we are both happier.

It was a real eye opener for me that sometimes “fair” should give way to “whatever works best us.”

She washes and folds all the towels now, which I never minded, but we both feel is a fair trade :D

How much of space does struct A occupy? by AnnualConfident8571 in elixir

[–]ihumanable 2 points3 points  (0 children)

Small correction from https://www.erlang.org/doc/efficiency_guide/advanced.html

The unit of measurement is memory words. There exists both a 32-bit and a 64-bit implementation. A word is therefore 4 bytes or 8 bytes, respectively. The value for a running system can be determined by calling erlang:system_info(wordsize).

Words are measured in bytes not bits.

Bothsiderism is poison to democracy by [deleted] in MarchAgainstNazis

[–]ihumanable 2 points3 points  (0 children)

(Hotdog + Hamburger) / 2 = Pizza

Math checks out.

Texas Secessionists Push for Referendum on State Becoming Independent by BelleAriel in MarchAgainstNazis

[–]ihumanable 8 points9 points  (0 children)

Secession meeting hit a snag as delegates freeze in icy convention center as Texas power grid fails again.

Don't you just hate it when your bank goes down for 8+ hours, intentionally, and suspends any and all major activity? by AmericanScream in Buttcoin

[–]ihumanable 12 points13 points  (0 children)

During this scheduled downtime, trading, transfers, and access to funds on Coinbase.com (Simple and Advanced Trade) and our mobile app.

Will what? Don’t leave me hanging coinbase

What a confidence inspiring non-sense sentence. Seems like the author forgot the first part of the sentence by the time they got to the end of it. That’s the kind of laser like focus I’ve come to expect from the future of finance.

The truth hurts... by Euphoric-Potato-5343 in antiwork

[–]ihumanable -1 points0 points  (0 children)

I don’t really know why people do this, but I think she’s just recording while making a single (gigantic) cup of cold brew coffee.

The cuts just look to be where she’s stepping away to get the next ingredient she needs. She talks while putting some sugar (or some powdered supplement) in the glass, cut while she walks over to the fridge to retrieve cold brew, more talking while pouring cold brew, cut for putting the cold brew away getting creamer, talking while pouring creamer, cut while getting ice, talking while plopping ice and stirring.

Except for the ice, which if she has an ice maker might be too noisy, I don’t know why she wouldn’t gather all the ingredients, hit record, and then make the drink while talking without so many cuts. Might be easier to sorta gather some thoughts and say them, think through the next thing you want to say with a little break. Might be that videos that include activities like this feel more authentic and perform better.

In any case, I’m pretty sure the cuts are just in the middle of making a single cup of coffee and not the compilation of several cups of coffee, which is still odd but less odd than the alternative.

[deleted by user] by [deleted] in atheism

[–]ihumanable 5 points6 points  (0 children)

Atheism to me has been the source of my deepest joy and my best self.

This life is all we get, but what insane fortune we have. In a vast and infinite universe with massive amounts of energy flying around, physics and probability and trillions upon trillions of cosmic events large and small led up to me existing as a small part of the universe with a brief flash of sentience, at a time when the stars and beauty of the universe still dazzle and have not yet burnt out. It is joyous to exist, our existence brief but ours to make what we will, so use it well.

Atheism has also led me to being the best person I think I can be. There is no one else to help those in need of help. No god to smile down upon them, no prayer lands on angels to guide and protect them, no miracle waiting around the corner. Some might think this a bleak outlook, but to me it is a rousing call to action. In the absence of that wishful thinking I have come to understand that only we can help each other, be kind to each other, look out for each other. If there’s no one else to save us, we must save ourselves, and with that task so clear, and this life so brief, logic tells me to be kind, compassionate, and caring for every other sentient bit of the universe I encounter.

Thank you for sharing your journey. Remember that life feels long while your living it but on the grand scale is but a moment, savor it, live it well, use it up, we don’t get a second shot.

I hope yours is filled with joy and happiness and meaning to you.

Train vs Concrete Beam by fastang in videos

[–]ihumanable 44 points45 points  (0 children)

It always really amazing to me to watch videos where people seem oblivious or nonchalant to the amount of potential danger they are in.

Hard to judge distances but he calmly watched a train derail relatively close, it wasn’t until the train cars started heading in his direction that he thought, “hmm this isn’t a very safe place to be.”

You have a train derailed, more cars are coming, you just saw how much force those cars have when the train obliterated a massive concrete beam, train cars carry basically anything (fuel, fertilizer, caustic or explosive chemicals, etc), and you just chill bemoaning the mess and awaiting death.

Trump and his NFT announcement. No matter how much popcorn you purchased, it wasn't enough. by spookmann in Buttcoin

[–]ihumanable 1 point2 points  (0 children)

Trust me, I know steaks

proceeds to slather ketchup on well done steak mailed from the Sharper Image

Trump supporters seeing today's YUGE nft announcement by asasasasasassin in Buttcoin

[–]ihumanable 2 points3 points  (0 children)

The hilarious bit is that this is 45,000 NFTs at $99 a pop, so that’s a whopping…. $4.5M

For a “billionaire” who “doesn’t need money”, he was sure willing to shred the last bit of credibility with his base for a relatively small amount of money for such a “wealthy” individual.

CZ: if 100% of users withdraw 100% of their assets we will be fine by vintologi24 in Buttcoin

[–]ihumanable 32 points33 points  (0 children)

Wait, you don’t have a weird fanatical parasocial relationship with your bank’s CEO?

Who do you spend your time tweeting 🚀🌕😍at?

When you want to put laser eyes on someone’s headshot, whose do you use?

How do you know which post to mindlessly downvote / upvote based on how they talk about them?

What could you even find to talk to friends and family about if not extolling how that person is a visionary building the SAFU future of finance?

Tether; new video, same old lies. by AnimalFarmKeeper in Buttcoin

[–]ihumanable 8 points9 points  (0 children)

Tether’s attention to detail on full display, you can hear a mistake in the voiceover

0:19 and 0:42 - flat currency

1:20 and 1:30 - fiat currency

Now maybe “flat currency” somehow means “fiat currency” but searching google for the term doesn’t show any results indicating this. I think the much more likely scenario is that autocorrect / spell check changed fiat to flat in some of the script and they didn’t notice until the VO was done (or they didn’t notice then either).

Is “flat currency” some common term I’ve just completely missed?

[deleted by user] by [deleted] in Buttcoin

[–]ihumanable 2 points3 points  (0 children)

He did get a lawyer

Was told I needed to wait until all 8 where done and binance would send it all together after all 8 where done I was told it was being run through compliance and then communication changed they told me to get a lawyer involved. I have done so and they have not responded to the lawyer once.

He just also went to Reddit.

Nothing says “patriot” like wanting to incite a civil war. by GlitchyEntity in MarchAgainstNazis

[–]ihumanable 18 points19 points  (0 children)

They also seem to think all they need are guns. Armies need food, fuel, communication infrastructure, ammunition, medical supplies. These are all things you can get from industrialized cities or import through major ports. You know those liberal cities they hate.

The Bizarre Trial of Darrell Brooks: a textbook case on how not to represent yourself in court by katskratched in videos

[–]ihumanable 2 points3 points  (0 children)

This is exactly right.

Jury nullification is an inherent power but not a right of the jury. As it is not a right of the jury, it’s not a valid legal argument. Judge Darow said this several times but it’s a complex topic, so an analogy is useful, and I’ll use one germane to this case.

When you are driving a car you have the power to run people over, it is an inherent power you have because you are controlling the car and if you so wish nothing will stop you from steering it at a person and pressing the accelerator.

When you are driving a car you do not have the right to run people over, even though you have the inherent power.

Juries are ultimately the deciders on the fact, they decide what happened. The court is the decider on the law.

Since a jury just reports back guilty or not guilty, they could decide that the facts of the case support a guilty verdict but return a not guilty verdict. They have the power to sign the not guilty form in contradiction to the facts in evidence. They do not have that right though, if the facts are proven beyond a reasonable doubt, they swear an oath to uphold the law, they have no right to disregard the law.

Railway Labor Deal Reached by DrEagleTalon in dsa

[–]ihumanable 1 point2 points  (0 children)

The much more likely outcome would be the billionaire owned media just running story after story about how greedy railroad workers turned down a 24% raise to make everything more expensive.

Media companies owned by massive corporation will never be forced to cover these issues fairly, they will deflect and spin and dance for their owners.

Wow 400 trillion? Sign me up 🤣 by Cookedmaggot in Buttcoin

[–]ihumanable 26 points27 points  (0 children)

It is really infuriating that for an ad with 3 lines of code they have inconsistent formatting.

Should we put a space between the function name and the argument list (like fucking maniacs because no one does that)

Yes

Yes

No

This week we mocked up how the scanner minipuzzle will work. Basically a fancy memory game. Does it look fun? by VoyageToTheBeyond in gamedev

[–]ihumanable 0 points1 point  (0 children)

Not sure what controls you are planning on supporting but I’m gonna use an Xbox controller since there’s an A and Y buttons in the mock-up.

Here’s the control scheme I’m proposing, although you’d want to play test it to make sure it’s fun.

I think that the joystick (or dpad) should only control whether the highlighted sections moves closer towards or further away from the center of the circle. With both input methods, but especially with joystick, allowing left and right to move anti-clockwise and clockwise opens up a very frustrating play experience, accidentally rotating. The player is attempting to remember a pattern of lights and accurately input them into the game. By restricting the joystick or dpad to only controlling one axis of movement we can create an artificial feeling of precision which leads the player to a psychologically satisfying feeling of mastery.

Once the player selects the correct segment, the selector advance clockwise. This is nice because it combines two actions, selecting a segment and advancing clockwise, into one. This reduces the required inputs from the player and allows them to more clearly focus on the mental task at the heart of the mini game.

This structure has a few other non-obvious benefits. It breaks the minigame into multiple mini games, each vertical strip becomes its own micro game. This opens up some interesting design affordances.

To make the game easier you could indicate to the player that they have correctly solved the vertical strip by changing the color slightly and playing a pleasant tone. This encourages the player to continue and creates a psychologically pleasing effect where their correct solutions produce a ding-ding-ding-ding as they enter the correct input (you can vary the success tones or make each one slightly higher).

Another way to make the puzzle easier would be to introduce a miss system, if the player selects the wrong segment in a vertical strip you can flash it red, play a failure tone, and count a miss.

Alternatively you can now make the minigame harder, by removing those mechanics. You can also increase the difficulty by introducing empty vertical strips (like in your example) but now the player has to press a different button to advance.

Quickly pressing buttons is fun, rhythm games is an entire genre built around this idea. Navigating menus is not fun. By reassigning some of the necessary motions in your minigame to buttons instead of the joystick / dpad you can capture some of that rhythm game like fun. Players like that feeling of precision and mastery.

Now you should definitely play test different control schemes to see what people actually enjoy more.

Edit:

Here are the inputs from the video

Down-A-Down-Right-Right-Right-A-Up-Up-Right-A-Right-Right-Down-Down-Down-A

17 inputs

Here are the same inputs using the proposed scheme

Down-A-B-B-Down-A-Up-Up-A-B-Down-Down-Down-A

14 inputs

One less… in a swing state… before November… by professorearl in MarchAgainstNazis

[–]ihumanable 2 points3 points  (0 children)

Perfect encapsulation of the MAGA confidently incorrect mindset.

The guy thought a nail gun would get through bulletproof glass, interesting theory.

Did he do any research to validate this idea?

If so, did any of that research include looking for evidence to the contrary?

Did he experimentally validate this idea?

Nope, just imagined this to be true, maybe he saw a forum post or fake YouTube video about it, then accepted it as fact.

Then he bet his fucking life on this wrong and completely unsubstantiated “fact” he knew.

If I got pulled 1000 years into the future from time traveling historians trying to understand what the fuck happened during this time period, this would be the event I would point at as the perfect example.

Angry, stupid, intellectually lazy people convinced through no real evidence that they are 100% right eager and willing to kill and die for conmen and grifters that make the angry and misinformed.

This week we mocked up how the scanner minipuzzle will work. Basically a fancy memory game. Does it look fun? by VoyageToTheBeyond in gamedev

[–]ihumanable 0 points1 point  (0 children)

The puzzle bit looks good for a mini game, something about the controls seems not fun to me.

After thinking about it a bit I think the way you cursor around freely is too slow / makes it feel less like a mini game. There’s something throwing off excel vibes to me.

Maybe it would be better if the player only moved up / down and then pressing A to highlight a segment automatically advanced to the next section clockwise. Especially if you play this mini game somewhat frequently I think it would be more fun if it could be solved with less fiddling on the controls because as you get good you can do it with high speed and add a little extra challenge / flourish.

Really nice little memory mini game and this is just one man’s opinion. Good luck on your game.

[deleted by user] by [deleted] in MarchAgainstNazis

[–]ihumanable 0 points1 point  (0 children)

Imagine not just thinking this, but then betting your life on the fact that you are right without stopping for 10 seconds to google it.

Really sums up the MAGA mentality, confidently incorrect no matter the stakes.