Show newer

Looks like a fucking safety hazard if thats what it is for..

Based on the fact that it has a cross bar on the top my guess would be that it ensures oversized vehicles do not drive on the road. By the looks of it the slow cars just barely make the limit which is why they go so slow, the fast ones are much smaller.

I think im going to order some squid and mackerel for my next round of cooking.

For any ruby :ruby: devs out there, wanted to share a neat little open-source :opensource: module I wrote to solve a common problem. Keep in mind ruby is not my main language so if there is a batter approach here I'm all ears.

Basically right now I have a game (text based mud) and in normal and expected fashion objects in the game are created when their objects get initialized, such as a new player being created. The system then periodically saves the universe by marshalling all the object into some serialized format and saves it to a file from time to time. As tends to be the case with serialization, however, when an object is restored, such as a previous player logging out and back in, then the class is created directly without the initialize method getting called , its class and instance variables are simply populated directly.

This is where problems can arise if you change the system and add new features (such as a new variable to an object). New objects that are created will populate the new variable correctly through the initialize method however already existing players will not have that variable set at all (it won't be nil, it simply wont be set, which is a distinctly different state). This is the problem I solved.

What I did was created a mix-in module that lets you set default values for variables, once a class is reinstated from storage it checked if any variables that have defaults are unset (nil variables are considered set) and then applies the default value to them. In this way legacy objects will be able to update to new code changes automatically when it loads. To prevent duplicating code you can even intentionally leave it out of the initialize method and rely on the defaults when it is appropriate to do so.

Moreover the defaults do not have to be static values but can be determined based on the existing state of the object, which makes them dynamic and flexible... a class that uses the mixin could look like this:

require 'defaults'

class Foo
include Defaults

# @bar defaults to @baz*2
default(:bar) { |this| this.baz * 2 }
# @faaboo defaults to 178
default(:faaboo) { 178 }

def initialize
@baz = 13

line can be ommited
@bar = 26
# if you add this line instead
load_defaults
work fine
end
end

Here is a link to the module:

git.qoto.org/aethyr/Aethyr/-/b

You can see a class that utilizes this new feature here:

git.qoto.org/aethyr/Aethyr/-/b

@Science

@Science

Hey everyone, a supernova just went off in Cassiopeia!!!! Right now it is in the early stage so only visible by telescope but after a few days it is likely to be visible to the naked eye. Supernovas are fairly rare so might want to make some time to see this one!

@Science

Hey everyone, a supernova just went off in Cassiopeia!!!! Right now it is in the early stage so only visible by telescope but after a few days it is likely to be visible to the naked eye. Supernovas are fairly rare so might want to make some time to see this one!

Threw together a second meal today, bitter-ginger farro and shrimp... Basically has farro and barly as the carb, shrimp , rainbow trout, Eel, and a little anchovy as the fish, has fresh lime, lemon rind, finely diced brussel sprouts, snow peas, ground sesame, soy, ginger, sesame oil, and sone almond oil. On top of that i threw in some jalapenos and long hots

I intended for this to have way more veggies and got my perportions a bit mixed up, but turned out amazing. Its conch and rice with a sesame, soy, ginger sauce, has 3 kinds of hot peppers, and 8 different veggies. The sauce was more of a blended sesame paste so had a nice nutty kick to it.

I buy all my spices freshly ground and in bulk bags which i transfer to jars.. just reupped today and it smells SOOOOO good... looking forward to my next meal

Why is it red meats are always sold in shacks, especially ribs.. "the meat shack", "the rib shack"... but you never hear of a salad shack, or a sushi shack.. is sushi just too high class to be sold out of a shack, is a shack low class food and all meat by default low class... what is the proper shack-food relationship here!

Not to brag, but we definitely have the coolest voting locations. 🎉🇳🇱 #TheNetherlands #Amsterdam

Tusky: Censoring people

Me: Please don’t do this, censorship harms marginalized people the most

Tusky: Yeah right, Nazi

Google: Censors Tusky

Tusky: NOOOO I DON’T UNDERSTAND WHY IS THIS HAPPENING???

I decided to cook more healthy stuff to try to improve my diet a bit. So I planned some healthy easy meals, in partciular basically poke bowls which is little more than some rice, a bunch of mixed asian flavors, some protein, and you go. They are often eaten cold so easy to prep it before hand. I wanted to make some sauce and one of the ingredients in umagi sauce is sake..... 3 hours later of food shopping I have now ordered 3 bottles of various types of sake and nothing else :)

Lord @freemo just proved here that he is an Electrical Engineer :blobfoxcomfysmirk: @stux

This is what some of you sound like, you know who you are...

It always felt wrong to start a programming language design already having a type system in mind. I couldn't put my finger on it before, but now I think I understand why.

There is well known tradeoff between exploration and exploitation when it comes to solution search.

During *exploration* you try to open undiscovered areas. Something that might not be very viable at the beginning but in the long run could lead to outstanding results. During *exploitation* you try to find best solutions in selected area, relying on already accumulated assets.

Eventually exploration and exploitation would be in conflict, since resources are limited. You can resolve this conflict differently depending on the task you're trying to accomplish.

If you want to design a PL that is more convenient for humans, starting with a type system in mind would pull you away from exploration too early. There might be a brilliant solution that is incompatible with that type system.

You can always think how to limit flexibility and reduce space for errors later.

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.