Show newer

@hans_w Good question, havent decided. I wish i had a smoker, mackerel is amazing smoked. I'm thinking I might do the mackerel in a fesh stew or soup.. also going to get some sardines, i think ill do sesame crusted and baked on those. The squid im thinking just grilled with some lemon, nothing fancy.

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

@stux Good, I really didnt want to integrate the knowledge that you could be this stupid... so im glad to hear that :)

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

@abhimanyuaryan This is the first time im hearing anyone have that problem from QOTO itself... are you using a client maybe, there is a bug in tusky and husky that sometimes cause that, but its unrelated to qoto.

@hector

FYI me personally I dont give a shit what people call them. I call them illegal immigrants because it is the more well known term and it is the one that came first, and i havent heard any better terms.. undocumented is about as descriptive but its a newer term so i see no reason to change. That said if someone calsl them undocumented I wont correct them, and really dont care, i know what they mean.

@icedquinn @denza252 @Moon

@hector

by that logic you are now deunking your statements about "undocumented" and showing why it is actually a perfectly fine term. You cant have it both ways.

@icedquinn @denza252 @Moon

@hector

Your ogic was that "undocumented" didnt make sense because while they lacked some documents (greencard/citizenship) they had other documents (license, census etc).

By your own logic calling them "illegal" therefore is equally inappropriate since there are many ways in which they are legal (for example if they have a license they can legally drive) and are illegal in other ways.

so by your own logic "illegal" makes just as little sense.

@icedquinn @denza252 @Moon

@icedquinn

the definition doesnt make that distinction usually, but in general usage that can often be true. Strictly by the definition anyone not living in their native country is an expatriot

@hector @denza252 @Moon

@slh C 50%.. I would rule out B right away leaving only 25% and 50% as potential answers, to satisfy the question and pick at random I would now randomly pick one of those. Since there are only two choices, 25% or 50% i know that only 50% must be correct of these two, and thus 50% is the answer.

We can likewise know that is the only answer because I as far as I can tell there is no other scenario, no matter how convoluted (and that was pretty damn convoluted) that would give an answer :)

Show older
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.