Searching We.Love.Privacy.Club

Twts matching #2
Sort by: Newest, Oldest, Most Relevant
In-reply-to » Hi, I am playing with making an event sourcing database. Its super alpha but I thought I would share since others are talking about databases and such.

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
}

fig. 1

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)
})

fig. 2

I can tell the function the type being modified and returned using the function argument that is passed in. pretty cray cray.

⤋ Read More

R to @mind_booster: “O Governo está a fazer com a avaliação ambiental, aquilo que fez com a conservação da natureza e a proteção da biodiversidade.” 2/7
“O Governo está a fazer com a avaliação ambiental, aquilo que fez com a conservação da natureza e a proteção da biodiversidade.” 2/7 ⌘ Read more

⤋ Read More

Still two unresolved issues with WeeChat:

  1. How can I mark the current buffer as read? There is /input set_unread to mark it as unread (although I can’t tell that it does actually anything in the TUI) but there’s no set_read command that would put my read marker below the last message. Sure I can switch buffers and then the read marker is at the bottom, but this sounds like a silly workaround. There must be something better.
  2. I want the beep trigger to also fire when a regular message is sent. But the adjusted condition ${tg_displayed} && ${tg_tags} !!- ,notify_none, with the && (${tg_highlight} || ${tg_msg_pv}) removed then also includes joins and parts, which I don’t want to be alerted by. Now fiddling around with ${tg_message_nocolor} !~ ^(-->|<--), let’s see.

How do you folks do that?

⤋ Read More

“we looked at how damaging the journey of overshooting the 2°C temperature target would be,
[…]
The results suggest that a temporary overshoot would cause waves of irreversible extinctions and lasting damage to tens of thousands of species”
https://theconversation.com/climate-crisis-even-temporarily-overshooting-2-c-would-cause-permanent-damage-to-earths-species-185929?utm_source=twitter&utm_medium=bylinetwitterbutton

“we looked at how damaging the journey of overshooting the 2°C temperature target would … ⌘ Read more

⤋ Read More

I’m trying to switch from Konversation to irssi. Let’s see how that goes. Any irssiers out there who can recommend specific settings or scripts? I already got myself trackbar.pl and nickcolor.pl as super-essentials. Also trying window_switcher.pl. Somehow my custom binds for Ctrl+1/2/3/etc. to switch to window 1/2/3/etc. doesn’t do anything: { key = "^1"; id = "change_window"; data = "1"; } (I cannot use the default with Alt as this is handled by my window manager). Currently, I’m just cycling with Ctrl+N/P. Other things to solve in the near future:

  • better, more colorful and compact theme (just removed clock from statusbar so far)
  • getting bell/urgency hints working on arriving messages
  • nicer tabs in status bar, maybe even just channel names and no indexes
  • decluster status bar with user and channel modes (I never cared about those in the last decade)

⤋ Read More

Research: How GitHub Copilot helps improve developer productivity
We surveyed more than 2,000 developers about whether GitHub Copilot helped them be more productive and improved their coding. Then, we matched this qualitative feedback and subjective perception with quantitative data around objective usage measurements and productivity. ⌘ Read more

⤋ Read More

Ignite Realtime Blog: Openfire 4.7.2 released
The Ignite Realtime Community is pleased to announce the release of Openfire version 4.7.2. This version fixes a number of bugs and signifies our efforts to produce a stable 4.7 series of Openfire whilst work continues on the next feature release 4.8.0.

A major highlight of this release is fixing of BOSH bugs found under load testing.

You can find [download artifacts](https://ign … ⌘ Read more

⤋ Read More

Summing the first n odd positive integers yields n^2. For twisty puzzle enthusiasts, an interesting consequence of this is that a Pyraminx has the same number of stickers per face as a Rubik’s Cube, a Master Pyraminx has the same number of stickers per face as a Rubik’s Master Cube, and so on.

⤋ Read More

Sam Whited: Sirius
NameSiriusDesignationα CMaMake/modelHonda CB1100StyleNaked bikeEngine1140cc air-cooled inline fourTiresMetzeler Roadtec Z8 Interact Tires 110/80-18; 140/70-18

With gas prices as high as they are I recently decided to sell my Honda S2000,
Vela.
Though I normally say that there is never a reason to buy a new vehicle when a
used one can be had that’s just as good, depreciates less, and is cheaper, I’ve
decided to brake my own rule and ordere … ⌘ Read more

⤋ Read More

China’s easing of zero-Covid restraints set to release stocks into bull-market territory for first time in three years
A change in quarantine rules comes as the CSI 300 Index is within about 2 per cent of bull-market status, but opinions differ over how heavily Beijing’s zero-Covid policy still weighs on the market ⌘ Read more

⤋ Read More

‘We have nothing’ say survivors of deadly earthquake now facing disease outbreak
There is a desperate need for clean water – cholera outbreaks in the aftermath are of particular and serious concern – after at least 1,000 people were killed, 2,000 injured and 10,000 homes destroyed in the devastating earthquake. ⌘ Read more

⤋ Read More

How’s the China-India economic relationship changed 2 years on from the deadly Galwan Valley border clash?
China’s exports to India grew to US$27.1 billion in the first quarter of 2022, but India is concerned by its ballooning trade deficit with its neighbour amid strained ties two years after the deadly Galwan Valley clash. ⌘ Read more

⤋ Read More

Opening of Hong Kong Palace Museum a milestone in the Jockey Club’s support for the HKSAR in the past 25 years
[Sponsored Article]

The construction of the Hong Kong Palace Museum (HKPM) was funded by a HK$3.5 billion donation from The Hong Kong Jockey Club Charities Trust – the Club’s largest single charity donation to date. The museum will open to the public on 2 July as a highlight of the 25th anniversary of the establishmen … ⌘ Read more

⤋ Read More