#Paradoxes and Contemporary #Logic: https://plato.stanford.edu/entries/paradoxes-contemporary-logic/
@bender@twtxt.net Hehe good sleuthing 𤣠I swear it was an edit āļø Haha š yarnd
now āseesā both every single time, where-as before it would just obliterate the old Twt, but remain in archive. Now you get to see both š
Not sure if thatās a good thing or not, but it certainly makes it much clearer how to write ācode logicā for detecting edits and doing something more UX(y) about āem š¤
š Logic and Science: https://philpapers.org/go.pl?aid=FERLAS-7
Today is the day where everything is falling apart. Suddenly, I get: SQL logic error: cannot start a transaction within a transaction
Why is there a āsmall houseā in IBMās Code Page 437?
Thereās a small house ( ā ) in the middle of IBMās infamous character set Code Page 437. āSmall houseāāthatās the official IBM name given to the glyph at code position 0x7F, where a control character for āDeleteā (DEL) should logically exist. Itās cute, but a little strange. I wonder, how did it get there? Why did IBM represent DEL as a house, of all things? ā« Heikki Lotvonen Donāt waste any time here, and go read the article. Itā ⦠ā Read more
@bmallred@staystrong.run I forgot one more effect of edits. If clients remember the read status of massages by hash, an edit will mark the updated message as unread again. To some degree that is even the right behavior, because the message was updated, so the user might want to have a look at the updated version. On the other hand, if itās just a small typo fix, itās maybe not worth to tell the user about. But the client doesnāt know, at least not with additional logic.
Having said that, it appears that this only affects me personally, noone else. I donāt know of any other client that saves read statuses. But donāt worry about me, all good. Just keep doing what youāve done so far. I wanted to mention that only for the sake of completeness. :-)
What is clean architecture? Thatās a good question.
You think of a pattern for ordering code with good decisions isolating technologies (you can change the web framework or database without break the business logic), easy to test (you only test interfaces and use cases), sharing code between frameworks (entities and use cases), scalability, modulations and standardizing names. Clean architecture is not perfect, it has a learning curve and some abstraction in each technology. You can even find rejection with yours colleagues.
I have a good article on this topic.
https://programadorwebvalencia.com/implementando-arquitectura-limpia-en-python/
#python
After I stripped off my clothes and turned around, I came to the conclusion that the plan to shower was cancelled at this moment. The faucet had broken right off and was laying in the tub. I noticed that the diameters of the hot and cold water pipes were surprisingly small, didnāt expect that. Since the pipes were broken flush with the wall, I couldnāt even determine if I had to remove the inner our outer threads, well, remains thereof, in order to attempt to repair this mess. Luckily, I was going to see a plumber mate at the christmas tree collection later anyway.
The first thing that came to mind when I woke up was that I didnāt catch the logical flaw in my dream: absolutely no water was coming out of the burst pipes. The whole scenario took place in summer, so the water couldnāt be frozen either.
Need to summary all of these logic. So:\u2028 1. If file named twtxt.txt then grab parent directory name or hostname if file in root (and maybe delete ~?) \u2028 2. If file named nick.txt then grab filename
twtxt.txt
, following your recommendation, there could be many "twtxt" nicks. š
@doesnm@doesnm.p.psf.lt the logic that keeps on growing! :-D
Simplified twtxt - I want to suggest some dogmas or commandments for twtxt, from where we can work our way back to how to implement different feature like replies/treads:
Itās a text file, so you must be able to write it by hand (ie. no app logic) and read by eye. If you edit a post you change the content not the timestamp. Otherwise it will be considered a new post.
The order of lines in a twtxt.txt must not hold any significant. The file is a container and each line an atomic piece of information. You should be able to run
sort
on a twtxt.txt and it should still work.Transport protocol should not matter, as long as the file served is the same. Http and https are preferred, so it is suggested that feed served via Gopher or Gemini also provide http(s).
Do we need more commandments?
If some of you budding fathers want to know how I created a computer nerd to one day work for Facebook in the big USA, well you purchase a $1000 Xmas present, an enormous thick book with C++ programming, and say, you can play as many games as you like kids, but James has to create them using computer software.
SO James created once a 3D chess program with sound, took 6 months or so, really hard to beat, not based on logic moves point by point like other chess programs, this one was based on the depth of looking for patterns, set it to 5 moves ahead and you were toast every time. Nice program too, sadly gone over the years, computers suffer from bit rot. We used to try and mark rotten hard drive discs once as bad sectors, not sure how UBuntu does this these days, I see a dozen errors on the screen every time I load.
Today I would purchase for my kids AI CAD simulation software with metal 3D printer and get your child to build fancy 3D models and engines from scratch. This will make them an expert in the CAD AI industry by the time they are 14 years old. Sadly AI is here to stay and will spoil the Internet.
Itās a very dangerous time. The coalition for reason is extremely weak. Thatās why I really appreciate C.H. Danhauserās entertaining and informative Logical Thinking series. (https://www.youtube.com/watch?v=BUqMNVnELzE&list=PLMpofmkxKHBJfta_JzekLbWGHUSLUJoLt)
@sorenpeter@darch.dk a poem about me giving Odo a free bucket:
A glint in his eye, a sly, Ferengi grin,
Quark crossed the promenade, a curious thing within.
No jeweled trinket, no weapon so grand,
But a simple pail held tight in his hand.Odo, the Constable, with a brow raised high,
āA bucket, Quark? What trickery do you try?ā
The Ferengi huckster, with a salesmanās flair,
āA gift, my friend, a constableās rare!āāFor those late-night spills, a morphing mishap,
This bucket, dear Odo, will catch every scrap.
And should a suspect turn to goop and flee,
This pailās the answer, a guarantor, you see!āOdoās lips twitched, a hint of a smile,
At Quarkās twisted logic, his mercantile style.
āPerhaps,ā he conceded, the bucket held tight,
āA useful addition, in the pursuit of right.āSo Quark made his sale, with a wink and a nod,
A bucket for Odo, a Ferengi oddity, odd.
But on Deep Space Nine, where chaos takes hold,
Even a pail can be worth more than gold.
About the account, thanks, but I already have way too many. :-D
Ol Ben sets himself up as an intellectual for the right. He got promoted up with his connections with PragerU. Talks like he is the smartest one in the room. Though his arguments are full of logical fallacies. He is up there with Joe Rogan and the ilk destroying rational though in America.
@xuu@txt.sour.is LOL omfg.
This is the absurd logical endpoint of free market fundamentalism. āThe market will fix everything!ā Including, apparently, encroaching floodwater.
I do have to say though, after spending awhile looking at houses, that there are a crapton of homes for sale for very high prices (>$1 million) in coastal areas NASA is more or less telling us will be underwater in the next few decades. I donāt get how a house thatās going to be underwater soon is worth $1 million, but then Iām never been a free market fundamentalist either so 𤷠Maybe theyāre all watertight.
(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.
Domain ObjectsA 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
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
}
}
Reading Events from EventStore
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
}
OnX Commands
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
}
Crud Operations for OnX Commands
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
}
@mckinley@twtxt.net
I really would like to know the logic behind that reasoning.
@prologic@twtxt.net What if the reply does what fork does, for any replies to the top post, but not the top post itself? You know, like email does. Other than to reply to the top post (for which I use reply), I donāt use reply but fork, to reply to posts underneath because it is the logical thing to do.