WOOT! Our GitLab instance just got approval for another year of free ultimate license (normally costs 100$ per person, per month).

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

so I have been working a little bit each day in my spare time on a rather absurd refactor job... it was too much work to do by hand so I wrote a script that refactored my code for me... since it was throw away code i didnt put any effort of any kind into quality control and well, it shows.

Its so horrific I just had to share the refactoring script witht he world just so other can marvel at the horror.

dpaste.com/2N6W9C0

Whats your favorite rapid diagramming tool for UML type diagrams? Mine is Umlet.

What static site generator should I try out next?

I just did my first release as the new project owner for Goblin! It's an open-source :opensource: OGM for Graph Databases that sits on top of Tinkerpop.

Check it out here:
git.qoto.org/goblin-ogm/goblin

So now that I took over the Goblin open-source :opensource: project I started cleaning up the README and other repo documentation. Its amazing how just a little bit of time and attention can make a project look significantly more professional. Logo only cost me 7 bucks too!

git.qoto.org/goblin-ogm/aiogre

github.com/goblin-ogm/aiogreml

I'm really happy to see the trend in FOSS :opensource: licenses is moving towards MIT and Apache like licenses and we are seeing GPL like licenses being abolished slowly.

Free means Free!

What number most closely matched your preferred line width when enforcing style rules on source code?

What is your favorite Text editor for programming (IDE):

So I'm trying to consider what framework to use for documentation at CleverThis (first document ill need to convert is the Spec for the concurrency I'm designing). These are the options I'm playing with and considering. Which do you like most, leave comments with suggestions and opinions.

Which program language would most excite you to want to contribute to an open-source project, all else being equal?

So far on we have brought the following services up, I want to know what you want to see next. All of these services are free and open to the public for open-source and collaborative non-commercial ventures.

Here is what we have up so far:

Modified server - qoto.org

server - cloud.qoto.org

GitLab server - git.qoto.org

Servers we intend to bring up:

Let me know which of the above you'd like to see next. Also if you have a suggestion of a service we didnt list let me know and we might just host it for you if it would be useful for others.

We now have two more Federated services up on Qoto. They are still in beta so use at your own risk.

NextCloud: cloud.qoto.org
Gitlab: git.qoto.org

Feel free to sign up for an account and use the services. Let me know if you have any trouble using it.

Big things happening at I wanted to update everyone on.

So as most of you know I had a year long back injury that put a lot of QOTO plans on hold. But I've been healed and working on bringing much of that vision to reality.

As of a few weeks ago a few close friends and fellow engineers wanted to join the team. I am currently sitting with 3 other new engineers and we are working on bringing up several instances including peertube, nextcloud, gitlab, discourse, and of course a newer version of QOTO. A full collaboration suite for others in STEM and the open-source community. All for free to its users.

This launch will coincide with several of my other projects many of you follow including protowaffle, ROES, Graphactor, Aparapi, Ferma and many others. We will host all the source on QOTO as well as make it the source for future software announcements related to those products.

Stay tuned for me.

GPL is a hostage negotiation, or at best barter. I'll give you my code if you give me yours. There is nothing "free" about it in my mind.

MIT/BSD/Apache is true freedom "You can have my code, no strings attached, do what you want with it, just promise you will tell people it is open-source and who wrote it!"

Qoto Mastodon

QOTO: Question Others to Teach Ourselves. A STEM-oriented instance.

An inclusive free speech instance.
All cultures and opinions welcome.
Explicit hate speech and harassment strictly forbidden.
We federate with all servers: we don't block any servers.