(#tbdkceq) Gotta love decentralized things (proper) š
#nrcqi3a
(#tbdkceq) Gotta love decentralized things (proper) š
(#tbdkceq) @mckinley@twtxt.net BHahHhHh š
(#t3akw7a) @mckinley@twtxt.net Bookmarked š
(#tbdkceq) @yarn_police@twtxt.net Hold on a minute, txt.sour.is is out of your jurisdiction!
(#wzvzvca) @eaplmx@twtxt.net What āproblemā were you trying to solve that lead you to this wonderful piece of trigonometry that I have zero clues about š Boi am I rusty with āhard mathā š
(#djrw33a) @xuu@txt.sour.is I doubt it š I think @lyse@lyse.isobeef.org found and fixed a bug, so if you update to the latest master
or prologic/yarnd:latest
Docker image this should be fixed š
(#ksxeama) Reached out to Apple⢠support over this. Weāll see what happens to that feedback/complaint.
(#djrw33a) AM I HAX0RD?
(#gqqqwca) @mckinley@twtxt.net Yeah Iām not a big fan of making it it too formal really, I sorta tend to think the way we play it by ear is kind of okay anyway š¤ We probably donāt need to make a big deal as such, itās fun, thatās all that matters, sometimes we (usually) discuss pretty interesting stuff. š
(#gqqqwca) @darch@neotxt.dk @prologic@twtxt.net I was going to suggest having a variable time based on the availability of those who intend to go. That could definitely work, it just seems pretty formal. @darch@neotxt.dk, what do you mean ādoodleā?
(#t3akw7a) @tel@we.loveprivacy.club I donāt even really like Discord š
(#gqqqwca) @darch@twtxt.net Yeah could work! Do you want to manage this? š¤
(#tbdkceq) @burglar@txt.sour.is Haha! š¤£
(#djrw33a) @yarn_police@twtxt.net Wait what?! š
(#wboprya) @yarn_police@twtxt.net This is more like a homeownersā association than a police department.
the piece is good but donāt miss this comment https://popehat.substack.com/p/the-philosophical-and-moral-incoherence/comment/8403538
do you feel like a jerk returning things bought online for reasons other than defects y/n
(#hn4w24q) @xuu@txt.sour.is Congratulations! Thatās by far the longest twt Iāve seen. :-) Working fine in tt. I was a bit worried, that lengths of multiple screens would be hard to read or scroll. But magically it just scrolled line by line.
I reckon two return
s can be saved in GetUser(ā¦)
. Oh, on further inspection there are even two nested err != nil
checks.
Generics were desperately needed. Iām glad they finally introduced them. I stumbled across them last week and gave them a shot. The syntax is probably not the very best, but I will get used to it eventually.
(#kvc5ayq) @eaplmx@twtxt.net Absolutely, I fully agree.
(#olvqv2q) @xuu@txt.sour.is Thanks, mate!
(#z7smffq) @movq@www.uninformativ.de Uuuuuuuhhhh, nice! :-)
(#z7smffq) @prologic@twtxt.net It is! The person who took this was incredibly lucky. š
(#jbkmlta) @lyse@lyse.isobeef.org ĀÆ\_(ć)_/ĀÆ fixed your arm.
(#z7smffq) @movq@www.uninformativ.de WOW! š³ Is that a hot air balloon? š¤
Since we were talking about āstuff in front of celestial objectsā ⦠look at this great show from a german news outlet:
š
(#ksxeama) @slashdot@feeds.twtxt.net hey Apple! If you start serving ads on default preinstalled apps on my iPhone and iPads I will stop being an Apple customer.
Appleās main selling point is a walled garden of privacy and no ad serving or ads shoved down your throat by anyone.
donāt do this.
(#nekd5sq) @eaplmx@twtxt.net Haha awesome! š
(#hn4w24q) @prologic@twtxt.net correct type parameters. š
(#hn4w24q) To be fair though, they arenāt as bad as Java or C++ 𤣠And technically theyāre called āType Parametersā right? š¤
(#hn4w24q) Hmmm š¤ The problem of course is the code is less readable/understandable š I never thought Go would ever grow generics, but oh well here we are. I guess itāll take me a while to get used to it š
do they make a wedding registry thing that lets you let guests organize splitting the cost of items? it sucks when you only have a certain amount you can spend but everything below that on the registry has already been dibsed. on the other hand, seems complicated: āI can cover half of the dishes, you can cover a fifth of the dishes, so we need someone to fill in 3/10 of the dishes costā
(#hn4w24q) (cont.)
Just to give some context on some of the components around the code structure.. I wrote this up around an earlier version of aggregate code. This generic bit simplifies things by removing the need of the Crud functions for each aggregate.
A domain object can be used as an aggregate by adding the event.AggregateRoot
struct and finish implementing event.Aggregate. The AggregateRoot implements logic for adding events after they are either Raised by a command or Appended by the eventstore Load or service ApplyFn methods. It also tracks the uncommitted events that are saved using the eventstore Save method.
type User struct {
Identity string ```json:"identity"`
CreatedAt time.Time
event.AggregateRoot
}
// StreamID for the aggregate when stored or loaded from ES.
func (a *User) StreamID() string {
return "user-" + a.Identity
}
// ApplyEvent to the aggregate state.
func (a *User) ApplyEvent(lis ...event.Event) {
for _, e := range lis {
switch e := e.(type) {
case *UserCreated:
a.Identity = e.Identity
a.CreatedAt = e.EventMeta().CreatedDate
/* ... */
}
}
}
Events are applied to the aggregate. They are defined by adding the event.Meta
and implementing the getter/setters for event.Event
type UserCreated struct {
eventMeta event.Meta
Identity string
}
func (c *UserCreated) EventMeta() (m event.Meta) {
if c != nil {
m = c.eventMeta
}
return m
}
func (c *UserCreated) SetEventMeta(m event.Meta) {
if c != nil {
c.eventMeta = m
}
}
With a domain object that implements the event.Aggregate
the event store client can load events and apply them using the Load(ctx, agg)
method.
// GetUser populates an user from event store.
func (rw *User) GetUser(ctx context.Context, userID string) (*domain.User, error) {
user := &domain.User{Identity: userID}
err := rw.es.Load(ctx, user)
if err != nil {
if err != nil {
if errors.Is(err, eventstore.ErrStreamNotFound) {
return user, ErrNotFound
}
return user, err
}
return nil, err
}
return user, err
}
An OnX command will validate the state of the domain object can have the command performed on it. If it can be applied it raises the event using event.Raise() Otherwise it returns an error.
// OnCreate raises an UserCreated event to create the user.
// Note: The handler will check that the user does not already exsist.
func (a *User) OnCreate(identity string) error {
event.Raise(a, &UserCreated{Identity: identity})
return nil
}
// OnScored will attempt to score a task.
// If the task is not in a Created state it will fail.
func (a *Task) OnScored(taskID string, score int64, attributes Attributes) error {
if a.State != TaskStateCreated {
return fmt.Errorf("task expected created, got %s", a.State)
}
event.Raise(a, &TaskScored{TaskID: taskID, Attributes: attributes, Score: score})
return nil
}
The following functions in the aggregate service can be used to perform creation and updating of aggregates. The Update function will ensure the aggregate exists, where the Create is intended for non-existent aggregates. These can probably be combined into one function.
// Create is used when the stream does not yet exist.
func (rw *User) Create(
ctx context.Context,
identity string,
fn func(*domain.User) error,
) (*domain.User, error) {
session, err := rw.GetUser(ctx, identity)
if err != nil && !errors.Is(err, ErrNotFound) {
return nil, err
}
if err = fn(session); err != nil {
return nil, err
}
_, err = rw.es.Save(ctx, session)
return session, err
}
// Update is used when the stream already exists.
func (rw *User) Update(
ctx context.Context,
identity string,
fn func(*domain.User) error,
) (*domain.User, error) {
session, err := rw.GetUser(ctx, identity)
if err != nil {
return nil, err
}
if err = fn(session); err != nil {
return nil, err
}
_, err = rw.es.Save(ctx, session)
return session, err
}
(#fuhaoaa) Progress! so i have moved into working on aggregates. Which are a grouping of events that replayed on an object set the current state of the object. I came up with this little bit of generic wonder.
type PA[T any] interface {
event.Aggregate
*T
}
// Create uses fn to create a new aggregate and store in db.
func Create[A any, T PA[A]](ctx context.Context, es *EventStore, streamID string, fn func(context.Context, T) error) (agg T, err error) {
ctx, span := logz.Span(ctx)
defer span.End()
agg = new(A)
agg.SetStreamID(streamID)
if err = es.Load(ctx, agg); err != nil {
return
}
if err = event.NotExists(agg); err != nil {
return
}
if err = fn(ctx, agg); err != nil {
return
}
var i uint64
if i, err = es.Save(ctx, agg); err != nil {
return
}
span.AddEvent(fmt.Sprint("wrote events = ", i))
return
}
This lets me do something like this:
a, err := es.Create(ctx, r.es, streamID, func(ctx context.Context, agg *domain.SaltyUser) error {
return agg.OnUserRegister(nick, key)
})
I can tell the function the type being modified and returned using the function argument that is passed in. pretty cray cray.
(#c2v3fnq) @movq@www.uninformativ.de Kind of, I know that August is great for the perseides. So I thought Iāll give it a quick shot. Given, that I just do that for at most a minute each night, I didnāt expect to actually be that lucky and see anything. Looking at the nice moon and the Ursa Major is generally all I can ask for.
Comet is also not too shabby. ;-)
(#voakm4q) @stigatle@yarn.stigatle.no The trick is to always get up at 5:00. :-) Good luck, though.
(#hfr4myq) @lyse@lyse.isobeef.org @prologic@twtxt.net Thanks!
Oh yes, the heat from the engines makes for some great effects. I was pretty surprised when I saw that yesterday.
a quick last look at Ursa Major
Looking for the perseides? š¤ I canāt look in that direction from here, unfortunately. Hey, I just saw a comet in stellarium! Close enough. š
(#moqdvoq) @mckinley@twtxt.net Ta! KMail goes two steps further. The blue pane appears already while typing up the e-mail. When hitting Send, the Attach File⦠button in the message dialog is the default, minimizing chances of sending the mail without any attachments when just pressing Enter out of a habit. Yup, also experienced that a couple of times. :-)
And now I nearly missed adding the screenshot to this twt! Good thing I proofread it three times.
(#hfr4myq) @movq@www.uninformativ.de Hell yeah, these are some real treasures! \o/ This is my favorite one. I like how the exhaust blends with the moon. And this is a great shot, too. Well done, mate! Some time well spent.
Just before going to bed yesterday I went outside to take a quick last look at Ursa Major. I wasnāt even even standing five seconds there and I saw a meteor for barly half a second. Truly amazing!
(#nekd5sq) @mckinley@twtxt.net Bahahahahaha š¤£
(#hfr4myq) @movq@www.uninformativ.de Wow man youāre getting really good at taking these Moonplane photos š¤£
More moon-plane attempts this morning:
(series)
(series)
I sat there for about an hour. Most planes did this or this, or flat out that.
The conditions have to be just right:
Also saw a hot air balloon.
(#nekd5sq) > Is TikTok influenced by the Chinese Communist Party?
There is no evidence that TikTok is influenced by the Chinese Communist Party. TikTok is a social media platform that is popular with users in China, but it is owned by the Chinese company ByteDance.
BS! At least it didnāt try to parrot the ByteDance deflection line āTikTok isnāt even available in Chinaā which is false because TikTok is available in China, they just call it Douyin instead.
(#moqdvoq) @lyse@lyse.isobeef.org It looks the AttachWarner plugin does just that. Iām going to enable it myself. Sounds handy.
(#moqdvoq) @mckinley@twtxt.net I have a high prejudice against GTK, but thanks for the tip! At least they also go the OK/Apply/Cancel route and donāt just offer a Close button in the settings dialog. That sounds promising. Their feature list is also very nice. Iāll take a closer look next time KMail maroons me. One question, does it warn about missing attachments? That feature I first saw in KMail saved me thousands of times.
(#4jflvja) And fixed! š„³ Turns out it was a change in Go 1.19
(#nekd5sq) Haha š
(#nekd5sq)
What computer does Richard Stallman use?
Richard Stallman uses a laptop with the GNU/Linux operating system.
Close enough.
(#nekd5sq) @prologic@twtxt.net Thanks, man. Sorry I missed it before.
Why is Facebook so successful?
There are many reasons for Facebookās success, but one of the main reasons is that it is a platform that allows users to connect with friends and family members easily. Facebook also allows users to share photos, videos, and other content easily.
In case you missed it @mckinley@twtxt.net āļø Just looked at the āManage Accountā Dashboard of my account with Open AI and since launching this ~12hrs ago last night (for me) $0.13 of my $18 free credit has been used š