Also, I’m struggling a bit with some basic stuff, for example variables, does not work the same way as I’m used to with c++ it seems, so it’s a bit confusing, re-using variables as input to several functions does not seem to be as straight forward as I’m used too - so I need to find some more info about stuff like that.
Also the callback stuff for buttons and such is really weird to me. But I’ll stick with it.
La catastrophe immobilière commence à prendre forme
Youpi, tralala, le gouvernement – buté comme un Ayatollah – continue dans sa démarche idéologique de transition énergétique vers un monde plus vert, décarboné (c’est-à-dire sans tous ces gueux couinant pour vivre décemment) et donc nettement moins peuplé : réjouissez-vous, la guerre contre l’énergie et donc contre vous, sous toutes ses formes, a été lancée. Et […] ⌘ Read more
Vers une Europe de la défense ?
Kiev serait-elle la nouvelle destination diplomatique à la mode ? En tout cas, les dignitaires occidentaux s’y relaient avec application et après Biden ou Von Der Leyen, c’est au tour du Premier ministre espagnol de s’y rendre. Apparemment, la capitale ukrainienne serait l’endroit indispensable où se montrer pour espérer avoir droit à une photo dans les […] ⌘ Read more
I will try and write a small cli example project in rust, that will let you post a message on yarn through a server url. Once I have that - I will then try and write a client with GUI and all that. I have not used rust much - but I really want to learn it more. I usually stick with c++. Not sure how much time it’ll take to get started, but I’ll give it a try.
So I looked up how to do it. It did not work. I Git cloned https://github.com/dgoulet/torsocks and followed the build instructions. I tried using it and got Looking up check.torproject.org1676676356 PERROR torsocks[16470]: socks5 libc connect: Connection refused (in socks5_connect() at socks5.c:202)
L’Etat macronien, en même temps, veut refaire du nucléaire avec votre argent
Rappelez-vous, c’était il y a quelques années : en tant que citoyen français, vous pouviez quasiment faire ce que vous vouliez de vos finances après les indispensables ponctions fiscales et sociales qui permettaient au pays de disposer d’un système social que le monde entier nous enviait (sans nous copier, pas fou). Mais ça, c’était il y […] ⌘ Read more
On the topic of Programming Languages and Telemetry. I’m kind of curious… Do any of these programming language and their toolchains collect telemetry on their usage and effectively “spy” on your development?
- Python
- C
- C++
- Java
- C#
- Visual Basic
- Javascript
- SQL
- Assembly Language
- PHP
RT by @mind_booster: One of the world’s biggest polluters, #Shell, just announced obscene annual profit of $40bn. Shell accounts for close to 1.6% of the global 1.5°C carbon budget. We must prioritize people and planet over profit and #ActInTime. https://www.theguardian.com/business/2023/feb/02/shell-profits-2022-surging-oil-prices-gas-ukraine
One of the world’s biggest polluters, #Shell, just announced obscene annual profit of $40bn. Shell accounts for close to 1. … ⌘ Read more
**This is how every news program should start, what political interviews first question should be about, the first impact assessment to every decision that is made.
The world knows how disastrous >1.5C is, pretends to be doing what is needed to avoid it, but we’re heading to 2°C.**
This is how every news program should start, what political interviews first question should be about, the first impact assessment to every decision that is made.
The world knows how disastrous >1.5C is, pretends to be doing what i … ⌘ Read more
Exploring the Edge of the Universe with Janna Levin | Podcast Highlights ⌘ Read more
2023 : fin de l’hégémonie du dollar américain ?
Si l’Histoire nous enseigne quelque chose, c’est qu’un empire ne peut tenir dans la durée que grâce à deux éléments clés : son armée et sa monnaie. Son armée, car l’empire doit être capable de protéger son territoire et de conquérir de nouvelles terres pour s’étendre ; et sa monnaie, car c’est avec celle-là qu’elle […] ⌘ Read more
**R to @mind_booster: “2045 não é bom?”
Não: tendo em conta o carbon budget de 2022, precisamos de atingir net-zero carbónico o mais tardar em 2040 para atingir mas não ultrapassar os 1.5°C.**
“2045 não é bom?”
Não: tendo em conta o carbon budget de 2022, precisamos de atingir net-zero carbónico o mais tardar em 2040 para atingir mas não ultrapassar os 1.5°C. ⌘ Read more
pass on my machine:
@abucci@anthony.buc.ci So.. The issue is that its showing the password by default? Would making an alias to always include the -c help? We can probably engage Jason with a PR to enable a more hardened approach when desired. I’ve spoken to him before and is generally a pretty open to ideas.
I found this app that was created by the gopass author that does copy by default and has a tui or GUI mode https://github.com/cortex/ripasso
pass on my machine:
@abucci@anthony.buc.ci So.. The issue is that its showing the password by default? Would making an alias to always include the -c help? We can probably engage Jason with a PR to enable a more hardened approach when desired. I’ve spoken to him before and is generally a pretty open to ideas.
I found this app that was created by the gopass author that does copy by default and has a tui or GUI mode https://github.com/cortex/ripasso
Salto, fini les galipettes : le contribuable français se fracasse sur Netflix
Ce vendredi, drame : le contribuable va devoir verser une petite larme car il ne pourra plus faire de petites cabrioles, devra faire une croix sur les galipettes et surtout, c’en est fini de Salto. Pour le rappel, Salto n’est pas ce mouvement gymnastique que le contribuable devrait effectuer pour récupérer son argent (tant le fisc […] ⌘ Read more
@kdx@kdx.re: I suggest you to try twtwt client, it’s also written in C: https://github.com/win0err/twtwt
RT by @mind_booster: The Dutch government was forced to release the source code of their DigiD digital authentication iOS app. It is written in C#.
https://github.com/MinBZK/woo-besluit-broncode-digid-app/
The Dutch government was forced to release the source code of their DigiD digital authentication iOS app. It is written in C#.
I’d start by dumping Donatello, the D.C. And get some youngsters on that D line that can keep up.
2024 devient 1984 : des médias de propagande et un corps médical sous surveillance
L’année 2023 vient à peine de commencer que, déjà, de multiples signes s’accumulent dans la presse de grand chemin qui montrent que jamais la liberté d’expression n’aura été autant attaquée. C’est, sans surprise, le deux-poids deux-mesures déjà évoqué dans un précédent article qui permet aux journalistes de s’époumoner en outrages courroucés lorsqu’un des leurs est […] ⌘ Read more
Une sobriété qui s’appelle famine
Pour paraphraser un petit poulet un peu trop gonflé de sa propre importance, “l’abondance, c’est fini”. Apparemment, il va falloir tenir compte d’une réalité de terrain quelque peu bousculée : lorsqu’on regarde certains indicateurs avancés, on se rend compte qu’effectivement, la sobriété va s’abattre sur le monde, plus ou moins mollement selon les régions. Bien évidemment, […] ⌘ Read more
Pourquoi ChatGPT n’est pas qu’une intéressante curiosité
Le 30 novembre 2022 est une date à garder en tête : c’est ce jour que ChatGPT est officiellement devenu accessible à tous. ChatGPT a été produit par OpenAI, une société créée en 2015 et qui s’est lancée dans l’intelligence artificielle. En janvier 2021, elle proposait déjà Dall-E, un modèle de traitement du langage entraîné sur […] ⌘ Read more
@abucci@anthony.buc.ci did you know about the chip inside USB-C cables?

https://connectorsupplier.com/usb-type-c-what-you-need-to-know/
some groups have created their own chips that have hidden keyloggers that can phone home over network connections.
@abucci@anthony.buc.ci did you know about the chip inside USB-C cables?

https://connectorsupplier.com/usb-type-c-what-you-need-to-know/
some groups have created their own chips that have hidden keyloggers that can phone home over network connections.
**RT by @mind_booster: Remember:
We’re at 1.25/1.75°C of global warming and rising fast.
Fossil fuel emissions should have peaked in 2022 to avoid 2.5°C, but they didn’t.
Forest degradation is getting worse.
Capitalism has put world-ending 2.25/2.75°C by 2045- 2090 in the pipelines. 🧵**
Remember:
1. We’re at 1.25/1.75°C of global warming and rising fast.
2. Fossil fuel emissions should have peaked in 2022 to avoid 2.5°C, but they didn’t.
3. Forest degradation is getting worse.
4. Capitalis … ⌘ Read more
C’est bon, détendez-vous, on passe l’hiver !
Si les températures ne sont pas très élevées, reconnaissons au moins à certains amateurs de ballon rond de savoir dégeler plus que l’ambiance dans les rues françaises. Pendant que l’homoncule en charge du ministère de l’Intérieur fait semblant de s’agiter à réduire un peu l’empreinte carbone de ces fêtards émotifs dans les rues de Paris, […] ⌘ Read more
I think it was a very wise decision to buy some long merino underwear, a new and warmer jacket and new winter shoes. It’s so cold! The whole week already under 0°C. ⌘ Read more
**RT by @mind_booster: 1.
‘equilibrium climate sensitivity is at least ~4°C with a likely range of 3.5-5.5°C.
global warming in the pipeline is greater than prior estimates.’
James Hansen and colleagues release new work for discussion.
This should be front page news.
https://arxiv.org/abs/2212.04474**
1.
‘equilibrium climate sensitivity is at least ~4°C with a likely range of 3.5-5.5°C.
global warming in the pipeline is greater than prior estimates.’
James Hansen and colleagues release new work for discus … ⌘ Read more
I made a thing. Its a multi password type checker. Using the PHC string format we can identify a password hashing format from the prefix $name$ and then dispatch the hashing or checking to its specific format.
I made a thing. Its a multi password type checker. Using the PHC string format we can identify a password hashing format from the prefix $name$ and then dispatch the hashing or checking to its specific format.
Une transition énergique vers le pas d’énergie du tout
Jadis, les fiers Gaulois (dont certains extrémistes chuchotent qu’ils seraient nos ancêtres) avaient peur que le ciel ne leur tombe malencontreusement sur la tête. Quelques millénaires plus tard, la Science™ aidant, ces superstitions évidemment ridicules se sont évaporées et ne reste plus que la douce réalité de la programmation gouvernementale rigoureuse. C’est d’ailleurs grâce à […] ⌘ Read more
Bientôt Paris sous tutelle ? Puis ensuite, la France ?
Le vendredi, c’est poisson et la morue en est un excellent qu’on peut par exemple déguster en brandade. Sans rapport aucun, signalons qu’Anne Hidalgo fait actuellement parler d’elle alors que la ville dont elle a la charge serait en très fâcheuse posture budgétaire. Il est vrai que la situation économique du pays et l’inflation galopante […] ⌘ Read more
Dérives sectaires : n’oubliez pas la plus grandes des sectes
La stupéfaction est totale : on apprenait il y a quelques jours que la France, pourtant pays du miel et du lait, serait le terreau fertile à l’apparition de certaines sectes et autres groupuscules louches à “caractère sectaire”. C’est en tout cas ce que s’est époumoné à dire la mission interministérielle dédiée, la Miviludes, dans un […] ⌘ Read more
I have found the issue with this very subtle bug.. the cache was returning a slice that would be mutated. The mutation involved appending an item and then sorting. because the returned slice is just a pointer+length the sort would modify the same memory.
CACHE Returned slice
original: [A B C D] [A B C D]
add: [A B C D] E [A B C D E]
sort: [E A B C] D [A B C D E]
fix found here:
https://git.mills.io/yarnsocial/yarn/pulls/1072
I have found the issue with this very subtle bug.. the cache was returning a slice that would be mutated. The mutation involved appending an item and then sorting. because the returned slice is just a pointer+length the sort would modify the same memory.
CACHE Returned slice
original: [A B C D] [A B C D]
add: [A B C D] E [A B C D E]
sort: [E A B C] D [A B C D E]
fix found here:
https://git.mills.io/yarnsocial/yarn/pulls/1072
How The War in Ukraine Will Shape The Future with Irwin Redlener ⌘ Read more
Le suicide par écologisme
Il faut que les choses soient claires : l’empreinte carbone qu’il s’agit de réduire, c’est vous ! Et c’est tellement vrai, tellement évident qu’une récente tribune du Monde revient sur ce qui est maintenant un but affiché de l’écologie de combat, à savoir la réduction active de l’Humanité. Peu importe que les dernières projections raisonnables montrent une […] ⌘ Read more
Panier-Runacher : Sobriété bien ordonnée commence par les autres
Le vendredi, c’est traditionnellement poisson. Ce jour-ci, ce sera du Ordralfabétix, c’est-à-dire pourri, et par la tête comme il se doit. La surprise est totale : on apprend par deux sources, Investigate et Disclose, que l’actuelle ministre de la transition énergétique, Agnès Pannier-Runacher, est directement liée par des intérêts financiers et familiaux avec la seconde compagnie […] ⌘ Read more
Comment continuer à voir Rumble en France ?
Encore une fois, l’État français sombre dans le ridicule et la tentative de censure la plus vile. On apprend que le site de vidéo en lignes Rumble n’affiche plus qu’un petit panneau laconique pour les visiteurs provenant de la France. C’était une étape sinon prévisible du moins logique après les derniers articles de la presse […] ⌘ Read more
RT by @mind_booster: Dear public bodies, business, & politicians: “incremental change is no longer an option: broad-based economy-wide transformations are required to avoid closing the window of opportunity to limit global warming to well below 2°C, pref. 1.5°C. Every fraction of a degree matters.”
Dear public bodies, business, & politicians: “incremental change is no longer an option: broad-based economy-wide transformations are required to avoid closing the window of opportunity to limit global warming to w … ⌘ Read more
@prologic@twtxt.net It’s called “cgod” and it isn’t written in C or Go? I want my money back…
I also like Gopher more than Gemini. The problem Gemini is trying to solve is better solved by just writing static HTML 4.01 pages.
I was just reminded of this interpreter for an APL/J-like language by Arthur Whitney, the absolute weirdest bit of C code I’ve actually gotten something out of, and thought I’d share: https://code.jsoftware.com/wiki/Essays/Incunabulum
Lunduke’s Normal Computing News - Oct 19, 2022
Listen now (40 min) | Microsoft kills “Office”, iPads get USB-C, and Firefox wants to know your feelings. ⌘ Read more
Au moins Sandrine Rousseau échappera au sentiment d’insécurité
Ce sont des tombereaux de menaces par internet qui s’abattent sur une élue de la République. « C’est hyper-violent, on ne sait pas comment elle tient » aurait déclaré l’entourage de l’inénarrable Sandrine Rousseau, dont le mandat de député EELV semble lui avoir donné une tribune permanente pour le militantisme écoféministe le plus débridé, ce qui aurait […] ⌘ Read more
Et un chargeur unique pour les gouverner tous
Vous ne l’avez probablement pas entendu (ou pas assez) mais tout un continent vient de pousser un « ouf » de soulagement : enfin, les chargeurs de smartphone vont être standardisés en Union Européenne ! C’est une véritable victoire que vient ici de signer le Parlement européen en imposant le chargeur unique pour smartphones d’ici l’automne 2024 : partant du […] ⌘ Read more
Électricité : « Chérie, je crois que ça va couper ! »
Les clowneries de nos ministres s’étaient largement déployées pendant la crise sanitaire, et n’avaient commencé à se calmer qu’avec l’agacement visible des foules devant la multiplication artificielle du nombre de vagues, de cas et maintenant de picouses magiques. Avec la crise énergétique, c’est le retour de la clownerie industrielle et planifiée, dont le côté grotesque […] ⌘ Read more
“Para Portugal, […] seria necessário garantir uma redução de emissões de pelo menos 61% até 2030 relativamente aos níveis de 2005, em vez dos atuais 55% na Lei de bases do Clima, para alinhar o país com a meta de 1,5°C”
“Para Portugal, […] seria necessário garantir uma redução de emissões de pelo menos 61% até 2030 relativamente aos níveis de 2005, em vez dos atuais 55% na Lei de bases do Clima, para alinhar o país com a meta de 1,5°C”
[nitter.net/ZEROasts/status/1575415098352586760#m](https://nitter.n … ⌘ Read more
Video: C Programming on System 6 - VCF Midwest, Wikipedia Reader, and Subterm
I attended the Vintage Computer Festival Midwest 17 and wrote two new programs. ⌘ Read more
Même squatté, entretenez votre bien et oubliez vos droits de propriétaire
La façon dont le droit de propriété est interprété par les différentes cours de justice de la République française ne cessent d’amuser la galerie et c’est sans surprise que des affaires défrayent régulièrement la chronique. Ainsi, dernièrement, on apprend que même occupé illégalement, votre logement doit être entretenu. Eh oui m’ame Ginette, même lorsque votre […] ⌘ Read more
Élisabeth Borne lance un nouveau (rantan)plan vélo !
Le temps passe vite mais pas assez pour tout oublier. C’est ainsi qu’on se souvient d’il y a un peu plus d’un an, une certaine Elisabeth Borne lançait avec brio un premier plan vélo qui permettait enfin à chaque Français d’entrer – en pédalant – dans le XXIème siècle. Pour parfaire les résultats déjà flamboyants […] ⌘ Read more
Réforme des retraites ou rafistolage de circonstances ?
Mais puisqu’on vous dit que Macron, c’est Le Grand Réformateur ! Puisqu’on vous dit qu’il n’a pas arrêté de réformer, d’affûter avec habileté la France pour la prochaine décennie ! Les petits dérapages budgétaires n’y changeront rien : les réformes sont sur des rails, elles passeront. Quoi qu’il en coûte. C’est sans doute dans cet esprit que l’actuel […] ⌘ Read more
working with c++, windows, cmake and wxwidgets reminded me on why I want to learn more rust. rust and crates makes it really easy to get up and running, crossplatform. scrapping what I did today, I’ll start over and force my self to learn rust.
Économisez, économisez, économisez, il en restera bien quelque chose !
Le gouvernement est un petit malin et comme d’habitude, il a tout prévu : alors même que les températures extérieures ne sont pas encore problématiques, il sent bien que les prochaines semaines pourraient poser quelques soucis. C’est pour cela qu’il a dépêché la plus affûtée de ses membres pour lancer une belle campagne de propag d’information […] ⌘ Read more
Le plan se déroule comme prévu, c’est-à-dire mal pour le peuple
Comme le disait régulièrement Hannibal Smith, il n’y a rien de tel qu’un plan qui se déroule sans accrocs et celui qui consiste à transformer à grands coups de pieds au derrière la riche société occidentale en société pauvre et désorganisée semble porter ses fruits : ça se transforme de plus en plus. Dans cette « grande […] ⌘ Read more
@carsten@yarn.zn80.net I have the same problem, at work I work with c÷÷, c#, java, python and qt. I want to learn more rust, but its a pain to get into.
L’absolue nécessité de la peur
Alors que l’automne n’est même pas encore entamé, tout le monde semble vouloir parler déjà d’hiver. À commencer bien sûr par nos élites qui nous rappellent, par leur incroyable talent prévisionniste, que gouverner c’est prévoir, vous allez voir ce que vous allez voir. D’ailleurs, on a vu : ayant su prévoir – avec un brio inégalé […] ⌘ Read more
Une presse française lâche et paresseuse
Ah, finalement, qu’il est doux d’être journaliste en France dans un journal de révérence ! Jadis, c’était un travail fatigant, voire stressant et parfois même risqué : il fallait aller chercher l’information directement sur le terrain et la corroborer le carnet de notes à la main. Certains événements pouvaient impliquer de mettre sa vie en danger ; et […] ⌘ Read more
C’est la rentrée, alors faites confiance au gouvernement !
Voilà, c’est dit ! Cet hiver sera rude : on va se cailler les miches mais finalement, cela permettra à tous de prendre de bonnes résolutions sur le chemin de la Sobriété Énergétique, de goûter au plaisir des douches froides, des repas crus et des longs trajets en vélo sous la pluie, la neige et les missiles […] ⌘ Read more
Linux, Alternative OS, & Retro Computing News - Aug 27, 2022
Linux’s birthday, Windows 95’s birthday, NetBSD, Zelda 3 in C++, & new Dell Linux laptop ⌘ Read more
(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
}
(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
}
Just testing my new fancy twtwt client written in C
Scratch? Python? C? Kernighan on Languages for Kids Coding - Computerphile ⌘ 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
Pour une poignée de semaines
Ah sapristi, c’était trop beau pour durer ! Mais c’était prévisible, cela arrive tous les ans à la même époque : des *£*#{] de vacances. Il est temps pour moi de mettre ce blog en pause pour quelques semaines, et laisser tomber l’actualité et son commentaire : compte-tenu du rythme d’enfer que les politiciens actuels nous font subir, […] ⌘ Read more
Mais que fait Obélix ?
Par Edmond Dantès Depuis plusieurs années, les discussions de fin de soirée ont pris des allures de débriefing médical dans un centre de soins palliatifs. On ne refait plus le monde, on regarde comment il meurt. Parfois, ça ressemble à une discussion entre experts analysant une malfaçon de charpente industrielle. L’un soutient que c’est telle […] ⌘ Read more
France : le délitement s’accélère
Chaque jour qui passe – et à plus forte raison lorsque c’est un jour de forte chaleur – est une ode, que dis-je, un poème raffiné à l’organisation minutée et cadencée de nos infrastructures de transport, notamment en Île-de-France et en particulier à Paris. Il ne se passe pas une journée sans qu’on doive louer […] ⌘ Read more
Cette si discrète colère batave
Décidément, la presse grand public choisit ses sujets et sans prendre beaucoup de risques, on peut déjà parier que les prochains jours verront se développer une titraille toute en finesse sur le thème du réchauffement climatique et de l’abomination que constituent de fortes chaleurs en plein mois de juillet. C’est pratique, cela permet d’éviter consciencieusement […] ⌘ Read more
GitHub enables the development of functional safety applications by adding support for coding standards AUTOSAR C++ and CERT C++
GitHub is excited to announce the release of CodeQL queries that implement the standards CERT C++ and AUTOSAR C++. These queries can aid developers looking to demonstrate ISO 26262 Part 6 process compliance. ⌘ Read more
Erlang Solutions: Modern Software Engineering Principles for Fintechs by Daniel Pilon at SumUp
Daniel Pilon is a Software Engineering Manager at SumUp. Since 2007 he has worked across several industries before arriving in the fintech space. He has experience in many programming languages, such as C#, Java and JavaScript but since discovering Elixir and the power of functional programming a few years ago, he hasn’t looked back.
Right now he is building SumUp Bank, a complete digital banking solution … ⌘ Read more
Labor Wins ⌘ Read more
Monerotopia Presentation and Website News
Just a note that within two hours (11AM NY time), my edited Monerotopia presentation with slides and all will be premiering here on the Monero Talk channel on YouTube.
I did already do an extended commentary and explanation of my talk here on my PeerTube channel, and I might put this an the edited talk onto my YouTube channel if I feel like it. You shou … ⌘ Read more
🙰 c
Nix 2.8.0 released
We’re pleased to announce the availability of Nix 2.8.0. It will be
available from NixOS -\
Getting Nix / NixOS.
Here are the release notes:
New experimental command:
nix fmt, which applies a
formatter defined by theformatter.<system></system>flake
output to the Nix expressions in a flake.Various Nix commands can now read expressions from standard input
using--file -.New experimental builtin function
builtins.fetchClosurethat c … ⌘ Read more
Richard Stallman - “The state of the Free Software movement” - April 13, 2022
Free Software founder has choice words for Ubuntu, Apple. Announces a manual for GNU C. ⌘ Read more
second, there’s predictions. a prediction is Done when it’s made. you could add comments, explanations, models &c, but the prediction can be Done and stand there on its own. (there is a slight problem with the fact that predictions need to be updated over time, though, so there is some Piling there as well).
Yesterday I ordered a blanket for an incredible amount of money, more precisely a weighted blanket. Now I hope that it will be delivered quickly and that it really has the positive effects that are being advertised. Although I can usually fall asleep quickly in the evening with a sleeping mask and earplugs, I never manage to sleep through the night, I am never woken up by the alarm clock because I wake up earlier. In the morning I feel tired almost every day, sometimes even the whole day, which then also limits my c … ⌘ Read more
Annotate PDFs on Linux
This post is about a GUI tool called pdfrankestein that
fills a gap on mostly Linux machines where a powerful and easy to use
PDF annotator does not exist.
Adobe Acrobat® on Windows and Mac allow you to add text, drawings and
signatures to PDF documents. This is useful when filling forms or
marking notes to send back to someone. Such a tool with similar
capabilities and easy of use does not exist on Linux. The reason that’s
often cited is that PDF is a c … ⌘ Read more
https://traditionsofconflict.com/blog/2019/10/4/sacred-metal, and now consider computer programming (especially the terminology of wizards/gurus, programming as magic, the SICP cover &c!)
B.C. premier John Horgan all insults toward Victoria protests
Video: C Programming on System 6 - Talking to the Modem
Starting work on adding a serial module to join the console and telnet inputs, to allow calls through a modem. I got stuck for a while trying to figure out why writes to the serial port would hang the machine. ⌘ Read more
Live Streaming a Macintosh Plus
Since recording a handful of C Programming on System 6 videos, I’ve occasionally wanted to live-stream the more casual daily programming being done on my Macintosh Plus. After getting all of the pieces together, I now have a working self-hosted broadcasting setup. ⌘ Read more
Livestream brought you by Starlink
I got Starlink/Soylink and I might, might be able to do a livestream from my house.
Come see if it works here:
Livestream brought you by Starlink
I got Starlink/Soylink and I might, might be able to do a livestream from my house.
Come see if it works here:
https://videos.lukesmith.xyz/w/6HaEr5NtP61H1fZC3FdXC9
I will start sometime soon once I get things set up. I should have a chat module open now on my PeerTube instance now. ⌘ Read more
Golang《基于 MIME 协议的邮件信息解析》部分实现
Golang 邮件 golang 中邮件相关的包net/mail
net/smtp
net/textproto
mime
mime/multipart
mime/quotedprintable
基于 smtp 包的邮件发送示例,基于官方文档:
<span class="c">// Set up authentication information.</span>
<span class="n">auth</span> <span class="o">:=</span> <span class="n">smtp</span><span class="o">.</span><span class="n">PlainAuth</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="s">"xxxx@qq.com"</span><span class="p">,</span> <span class="s">"xxxxx"</span><s ... ⌘ [Read more](https://gocn.vip/topics/20948)
GoCN 每日新闻 (2022-01-08)
- Go 1.17.6/1.16.13 版本发布https://groups.google.com/g/golang-announce/c/95ZD3rKn4DI/m/93cyN8F1BAAJ
- 高效的 Go 错误处理https://earthly.dev/blog/golang-errors/
- 从零实现一个 RedisClient 了解 Redis 协议https://mauricio.github.io/2022/01/07/redis-protocol.html
- Golang 简洁架构实战[https://zh … ⌘ Read more
Video: C Programming on System 6 - A New On-Disk Database Format
It’s a new year and my computer is still old. ⌘ Read more
Guest Blog: Deciding Between Docker Desktop and a DIY Solution
Guest author Ben Hall is the lead technical developer for C# .NET at gov.uk (a United Kingdom public sector information website) and a .NET Foundation foundation member. He worked for nine years as a school teacher, covering programming and computer science. Ben enjoys making complex topics accessible and practical for busy developers. Deciding Between Docker […]
The post [Guest Blog: Deciding Between Docke … ⌘ Read more
GoCN 每日新闻 (2022-01-07)
GoCN 每日新闻 (2022-01-07)
- 用 golang 在 tor 网络上安全的私有部署共享文件服务https://github.com/R4yGM/garlicshare
- 一个极速的 golang 全栈 web 开发包https://github.com/mikestefanello/pagoda
- ch 一个 clickhouse 客户端,比 rust 和 c++ 的都快https://github.com/go-faster/ch
- 用 gosec 扫描 go 源码的漏洞[https://jcdan3.medium. … ⌘ Read more
** Forth, a tool for cultivating community **
I watch most of the recordings of the Forth2020’s Zoom chats. A topic that comes up from time to time is how to get more folks interested in Forth — especially younger folks. In my weird little corner of the internet I can say that there are certainly young folks interested in Forth!
I wonder if the issue at play is less one of interest, and more one of cross c … ⌘ Read more
[深圳] 百度 BFE 项目招聘 Go 研发工程师
团队简介百度智能负载均衡团队负责维护 BFE 开源项目,并研发负载均衡商业产品。
BFE 是基于 Go 语言的七层负载均衡系统,已经在百度内经过多年的研发,每天转发万亿级的请求。BFE 于 2019 年 7 月开源,2020 年 6 月成为 CNCF 官方项目。
除百度以外,BFE 已经被 360、用友网络、招商银行、央视网等公司或机构使用。
BFE 开源项目地址:
Go 中这么多创建 error 的方式,你真的了解它们各自的应用场景吗
大家好,我是渔夫子。今天从应用场景的角度来聊聊我对 error 的理解。
原文链接: https://mp.weixin.qq.com/s/ncEemMJ0kQayVPJrnF9aew
01 什么是 Error在 Go 中,error 是一种内建的数据类型。在 Go 中被定义为一个接口,定义如下:
<span class="c">// The error built-in interface type is the conventional interface for< ... ⌘ [Read more](https://gocn.vip/topics/20911)
Video: C Programming on System 6 - Implementing Chat
Let’s have a chat. ⌘ Read more
蚂蚁 - 可信原生技术部 - 专用编程语言设计研发 (杭州 P7-8)
工作内容- 从事云原生配置策略语言的设计研发工作,服务云原生基础设施管理场景
- 从事区块链智能合约专用编程语言的设计及研发工作,服务区块链链智能合约场景
- 深度参与开源社区项目
- 熟练掌握 rust、golang、c/c++、java、python 中的一种或多种
- 熟悉现代编程语言设计理念、技术及研发体系,熟悉编译技术�� … ⌘ Read more
Isode: Successfully Managing HF Radio Networks
With the potential for new technologies to cause interference to traditional communications networks and even space itself at the risk of becoming weaponised, it is important to make sure that you always have a backup plan for your communications ready and waiting.
Should the worst happen and your primary network, typically SatCom, go down you need to ensure that you can still communicate with your forces wherever they are, and that c … ⌘ Read more
高性能中文分词库 gojieba
gojieba 是什么?gojieba 是 Python 知名分词库结巴 jieba 的 Go 语言实现版本,底层分词算法由 C++ 实现,具备很高的性能; gojieba 解决了在做文本分析,文本搜索相关业务功能时的分词需求。
gojieba 支持多种分词方式:
- 全模式:把文本中所有可能的� … ⌘ Read more
Video: C Programming on System 6 - User Authentication and Telnet Negotiation
I review some recent commits covering user authentication and telnet negotiation, then write some ANSI output code and a broken function for returning a number’s ordinal string. ⌘ Read more
『新闻快讯』网上带回血都是假的么《手机搜狐网 8》
网上带回血都是假的么【老师 Q-6306172】【诚信誷√zh58 典 vip√】〔复.制.到·U·C·浏·览·器·才·能·打·开〕〔大·发·官·方·直·属·平·台) 『信.誉.平.台』『实.力.雄.厚』『大.额.无.忧』『顶.尖.计.划』【8 年无黑史】【千万人推荐】【金 - 牌-导 - 师-单 - 带,推 - 荐-顶 - 级-信 - 誉-】
假设你刚刚玩,我来教教你 假设现已玩很久了,却不稳,我来拉� … ⌘ Read more
『9 新闻资讯』真正正确的倍投 6 种方法《手机搜狐网 0》
真正正确的倍投 6 种方法【老师 Q-6306172】【诚信誷√zh58 典 vip√】〔复.制.到·U·C·浏·览·器·才·能·打·开〕〔大·发·官·方·直·属·平·台) 『信.誉.平.台』『实.力.雄.厚』『大.额.无.忧』『顶.尖.计.划』【8 年无黑史】【千万人推荐】【金 - 牌-导 - 师-单 - 带,推 - 荐-顶 - 级-信 - 誉-】
假设你刚刚玩,我来教教你 假设现已玩很久了,却不稳,�� … ⌘ Read more
『1 新闻快讯』五分快 3 输了很多钱怎么办《手机搜狐网 8》
五分快 3 输了很多钱怎么办【老师 Q-4081525】【诚信誷√zh58 典 vip√】〔复.制.到·U·C·浏·览·器·才·能·打·开〕〔大·发·官·方·直·属·平·台) 『信.誉.平.台』『实.力.雄.厚』『大.额.无.忧』『顶.尖.计.划』【8 年无黑史】【千万人推荐】【金 - 牌-导 - 师-单 - 带,推 - 荐-顶 - 级-信 - 誉-】
快 3 怎么玩?你知道吗?
快 3 中奖概率是 … ⌘ Read more
『5 新闻快讯』5000 本金回血 10 万的技术《手机搜狐网 5》
5000 本金回血 10 万的技术【老师 Q-6306172】【诚信誷√zh58 典 vip√】〔复.制.到·U·C·浏·览·器·才·能·打·开〕〔大·发·官·方·直·属·平·台) 『信.誉.平.台』『实.力.雄.厚』『大.额.无.忧』『顶.尖.计.划』【8 年无黑史】【千万人推荐】【金 - 牌-导 - 师-单 - 带,推 - 荐-顶 - 级-信 - 誉-】
假设你刚刚玩,我来教教你 假设现已玩很久了,却不稳,�� … ⌘ Read more