Skip to main content

Activity for sanqui.net

Active on:

Loading activity...

The "art of programming" might feel like it's crumbling, yet I'm still trying to keep up with software engineering developments. I'm now almost a year into learning event sourcing. It's satisfying to be able to write clean code even for legacy codebases. Sample con raffle feature—real world Python!

Screenshot of Python source code:

```
from datetime import datetime

from sqlalchemy import ForeignKey
from sqlalchemy.orm import Mapped, mapped_column, relationship

from database import Model
from reg.models import Event, Registration, db
from reg.villa_raffle.query import is_registration_entered_for_villa_raffle
from reg.villa_raffle.end import VillaRaffleEnded
from reg.villa_raffle.start import VillaRaffleStarted
from user.models import User
from furryest.utils import Failure

class VillaRaffleEntered(Model):
    event_id: Mapped[int] = mapped_column(ForeignKey(Event.id), nullable=False)
    registration_id: Mapped[int] = mapped_column(ForeignKey(Registration.id), nullable=False)
    entered_at: Mapped[datetime] = mapped_column(nullable=False, defalt=datetime.now)

    event: Mapped[Event] = relationship()
    registration: Mapped[Registration] = relationship()


def enter_villa_raffle(user: User, registration: Registration, event: Event) -> VillaRaffleEntered | Failure:
    if not db.session.query(VillaRaffleStarted).filter_by(event_id=event.id).first():
        return Failure("Villa raffle has not been started for this event.")
    elif db.session.query(VillaRaffleEnded).filter_by(event_id=event.id).first():
        return Failure("Villa raffle has already ended for this event.")
    elif registration.event_id != event.id:
        return Failure("Registration does not belong to the given event.")
    elif registration.user_id != user.id:
        return Failure("Registration does not belong to the given user.")
    elif is_registration_entered_for_villa_raffle(registration=registration, event=event):
        return Failure("This registration has already entered the villa raffle.")
    
    villa_raffle_entered = VillaRaffleEntered(
        event_id=event.id,
        registration_id=registration.id
    )
    villa_raffle_entered.save()
    return villa_raffle_entered

```
Bluesky network2d ago
Reply

That's right! But they were familiar with other Unix systems. The Pokémon Center PC may have been modeled after a particular experience of using a different machine.

Bluesky network7d ago
Reply

Technology is incredible! Credit to SatoMew for matching the label with the Unix variant. Photo from Wikipedia/Wikimedia (licensed with Creative Commons: commons.wikimedia.org/wiki/File:HP...)

Bluesky network7d ago

The PC in every Pokémon Center allows you to connect to Bill's and Prof. Oak's computers over the network, just like a workstation connected to the Internet in the early days. The source code to Pokémon Red (1996) implies we are using System V UNIX.

A composition of three images: a screenshot of the source code to Pokémon Red, highlighting a label called VunixMachine; a screenshot of Pokémon Red with the player using a PC in a Pokémon Center, saying "RED turned on the PC.", and an infobox from Wikipedia featuring a photo of a HP 9000 workstation running System V.
Bluesky network7d ago
Reply

Similarly, it's rather common to distribute ROM hacks as patches, but my unpopular take is that it still clearly constitutes a derivative work and is not permitted by strict interpretation of copyright law...

Bluesky network15d ago
Reply

It even crossed cultural borders back then. The Czech website where I got my Pokémon ROMs had it, and I recently saw it on a Chinese ROM site from 2000: web.archive.org/web/20000516...

Chinese warning saying:
WARNING!!!請大家注意,本網重要聲明!!!
本網頁只是為大家提供給從世界上搜集各網頁既DEMO GAMES,EMULATOR,使大家能夠試驗各遊戲機既不同之處,目的是希望各讀者能夠因那隻GAMES DEMO好玩而去購買正版遊戲和遊戲機!所以請大家在下載後24小時之內自動DELETE個GAMES ,這也是本網頁既法則.如有任何法律問題,本網頁絕不負責!
Bluesky network15d ago
Reply

Thanks for sharing these! For anybody studying these, ROM sites would be difficult to identify even in archives if you "weren't there" so this is a good starting point for research.

Bluesky network15d ago
Reply

All that for me to listen to it and still say meh, PSG is better.

Bluesky network17d ago

With age verification, we talk more about privacy and surveillance concerns, and some of us don't remember what it's like to be a minor, but that quote summarizes the other side of the coin. Personally I'm concerned about how sheltering children will make bad childhoods even worse.

Bluesky network23d ago
Reply

History needs to be a team effort. Formal and polite corrections on each other's work should be normalized for the benefit of us all ^v^

Bluesky network23d ago
Reply

Then make sure to watch Jeremy Parish cover the NES game: youtube.com/watch?v=P1b7...

Trash times in Toontown: Who Framed Roger Rabbit | NES Works 156
Bluesky network23d ago
Reply

The vibes (animations, music, sfx) remind me of Clubhouse Games (DS, also known as 42 All Time Classics). Same developer possibly?

Bluesky network27d ago
Reply

In Keitai Denjuu Telefang, the currency in the Denjuu world is called chiru. We always thought it's because of how it scatters from the grass when you run through it. Guess there isn't much more to it still.

Bluesky network1mo ago
Reply

This is an awesome feature!

Bluesky network1mo ago
Reply

That's what I did in 2048-gb to seed the PRNG

Bluesky network1mo ago
Reply

I think they're buying and selling characters, not sonas xD seems some people just enjoy having a ton of them and coming up with different personalities and stories for them, though I lack the imagination. I also think buying adoptables is often more a proxy for supporting the artist than anything

Bluesky network1mo ago
Reply

My username is sanqui.97 Makes me sound younger ovo

Bluesky network1mo ago
Reply

Think I'm gonna go wash some of my clothes today (laundratory)

Bluesky network2mo ago