#TIL pencil writing is more permanent and waterproof than most ink. good news, I love pencils! #eco #notes
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
🌠 Visual Notetaking Guides & Demo Vaults for Managers
You can now push notes to Readwise’s Reader app for improved spaced repetition review. You can also comment on the Roundup! ⌘ 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
}
Command palette and commands for managing a graph of notes: https://merveilles.town/@akkartik/108766067153506592
Preview of a note-taking app I’ve been working on: https://archive.org/details/akkartik-pensieve-2022-07-27 (video; 5 mins)
UAE sells US$3 billion in high-quality debt amid recession fears
The oil-rich Persian Gulf nation on Thursday sold US$1.75 billion in 10-year bonds and US$1.25 billion in notes due in 2052. ⌘ Read more
Ukraine war: Japanese man arrested over Vladimir Putin straw doll nailed to shrine tree
Mitsunobu Hino, 72, is accused of trespassing and making holes in a sacred tree to put up a figure with a note wishing death to the Russian leader. ⌘ Read more
wait, is CIRL incorrigible for the same reason that utility-maximizers don’t wirehead? https://niplav.github.io/notes.html#A-Short-Example-For-Why-CIRL-Is-Incorrigible
NixOS 22.05 released
Hey everyone, I’m Janne Heß,
the release manager for 22.05. As promised, the latest stable
release is here: NixOS 22.05 “Quokka”.
- Release manual - Highlights
- [New\ Services]( … ⌘ Read more
https://goalkicker.com/ Programming notes for professionnals books
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
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
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
This isn’t a friendship, it’s a starship. Are you a star or not?” Patch 41 – Release Notes | Star Trek Fleet Command
Code: update to 1.18.1 of opinionated Ansible role for Go
Note: due to an issue no darwin build published for 1.18.1 at the time of writing 1 points posted by Sascha Andres ⌘ Read more
@prologic@twtxt.net yeah. For commercial use even. Just need to put an attribution note in the project README
Note: this seems to be for male chorus, and isn’t the arrangement that I hear in the sixteen recording.
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
Docker: Nine Years YOUNG
Nine years ago today, March 15, 2013, Solomon Hykes, the founder of Docker, first demoed Docker publicly to the world at PyCon. On stage Solomon noted that, for developers, “shipping to the server is hard,” and thus he and the early team designed Docker to help developers more easily build, share, and run any app, […]
The post Docker: Nine Years YOUNG appeared first on Docker Blog. ⌘ Read more
Nix 2.7.0 released
We’re pleased to announce the availability of Nix 2.7.0. It will be
available from
NixOS - Getting Nix / NixOS.
Here are the release notes:
Nix will now make some helpful suggestions when you mistype something
on the command line. For instance, if you type nix build
nixpkgs#thunderbrd, it will suggest
thunderbird.A number of “default” flake output attributes have been renamed.
These are:defaultPackage.<system></system>→packag ... ⌘ [Read more](https://nixos.org/blog/announcements.html#nix-2.7.0)
** 2022-02-24 feature/6.0 Android test plan **
OverviewWill test the upgrade path from a known state to new version to ensure that settings and app state are maintained during upgrade process.
V. 6.0 of libro.fm android app introduces an entirely new local database. This testing is focused on ensuring that local data remains intact between versions.
NotesThis evening I was mostly focused on setting up a successful build of feature/6.0 on my test device or the emulator. So far, no dice. My next … ⌘ Read more
GitHub Enterprise Server 3.4 improves developer productivity and adds reusable workflows to CI/CD
The GitHub Enterprise Server 3.4 release candidate delivers enhancements to make life easier and more productive, from keyboard shortcuts to auto-generated release notes! ⌘ Read more
** What is an addressing mode? **
In a recent post I referenced addressing modes. But what the heck are they!?
The instruction register holds the program instruction that is currently being run.
A fixed number of bits within the instruction register represent the operation, e.g. “op. code” — examples of these instructions include things like add, subtract, load, and store. We can imagine the instruction register like this:
[![ASCII diagram of … ⌘ Read more
Stream a USB webcam to HDMI on a Raspberry Pi
This post exists to collect my notes on displaying a USB webcam on the Raspberry Pi HDMI outputs. This is not the same as streaming the webcam (easy), and this is not for use with the Raspberry Pi camera module. This is specifically for USB UVC webcams. ⌘ Read more
** Notes on 6502 Assembly **
The NES runs a very slightly modified 6502 processor. What follows are some very introductory, and not at all exhaustive notes on 6502 Assembly, or ASM.
If you find this at all interesting, Easy 6502 is a really great introductory primer on 6502 Assembly that lets you get your hands dirty right from a web browser.
NumbersNumbers pre … ⌘ Read more
Nix 2.6.0 released
We’re pleased to announce the availability of
Nix 2.6.0.
Instructions how to install Nix on different platforms can be found on
the download page.
Here are the release notes:
New builtin function
builtins.zipAttrsWithwith the same
functionality aslib.zipAttrsWithfrom Nixpkgs, but
much more efficient.The Nix CLI now searches for a
flake.nixup until the
root of the current Git repository … ⌘ Read more
@prologic@twtxt.net, who calls me name when I am busy profiting? 😂 In a less serious note—because nothing is more serious than making profit, of course—yes, it seems your avatar issue has been fixed. I am kind of sad, I looked forward each day to see which random one was going to show. LOL.
GoCN 每日新闻 (2022-01-06)
- Golang profiler 笔记https://github.com/DataDog/go-profiler-notes/blob/main/README.md
- Bundling templates with embedhttps://osinet.fr/go/en/articles/bundling-templates-with-embed/
- Go 通过 Map/Filter/ForEach 等流式 API 高效处理数据https://gocn.vip/topics/20922
- 滴滴夜莺监控发布 v5 正式版,定位 Promet … ⌘ Read more
Go profiler notes
3 points posted by kenny ⌘ Read more
Peter Saint-Andre: Meditations on Bach #9: Musical Monadology
In meditation #7 of this series, I took note of some similarities between the aesthetics of Aristotle and the music of Bach. Another intriguing influence might be the monadology of Gottfried Wilhelm Leibniz (1646-1716), who directly influenced philosophers and musical theorists in the Bach’s orbit: for instance, Bach’s student Lorenz Mizler (1711-1778) was a follower of the Leibniz scholar Christian Wolff (1679-1754). In chapter 5 of his book Music in the Culture of th … ⌘ Read more
PEP 678: Enriching Exceptions with Notes
Exception objects are typically initialized with a message that describes the
error which has occurred. Because further information may be available when the
exception is caught and re-raised, this PEP proposes to add a .__note__
attribute and update the builtin traceback formatting code to include it in
the formatted traceback following the exception string. ⌘ Read more
5 automations every developer should be running
Looking to avoid security vulnerabilities, buttons that don’t work, slow site speeds, or manually writing release notes? This one’s for you. ⌘ Read more
a zero dependency shell script that makes it really simple to manage your text notes [[https://github.com/nickjj/notes]] #links
Notes on the Go translation of Reposurgeon
3 points posted by tomf ⌘ Read more
Thanks to @TANTlab@twitter.com and @birkbak@birkbak.neocities.org for havning me today at AAU CPH🙏 Presentation notes can be found at: http://darch.dk/aau-tool-talk/
NixOS 21.11 released
Hey everyone, we’re Timothy DeHerrera and Tom Bereknyei,
the release managers for 21.11. As promised, the latest stable
release is here: NixOS 21.11 “Porcupine”.
- Release manual - [Highlights](/manual/nixos/stabl … ⌘ Read more
Attention, attention! Please note: The fork lockdown will take effect in five minutes. Please keep calm, we will keep you posted.
@prologic Sorry I only just saw your note from almost a year ago: http://twtxt.xyz/update/21b5925b16b9a793
Important notes for LARBS users
Two notes for LARBS users:
- Xorg went through some updates last week that changed how it calculates dots-per-inch (DPI) on screens. There’s a chance that you might update and find your font extra large or small. If so, you can just manually add
xrandr --dpi 96to the beginning of yourxprofileto set the DPI to the typical 96 (or whatever number looks best).
- I have no switched new installs of LARBS from using Pulseaudio to Pipewire as an … ⌘ Read more
Important notes for LARBS users
Two notes for LARBS users:
- Xorg went through some updates last week that changed how it calculates dots-per-inch (DPI) on screens. There’s a chance that you might update and find your font extra large or small. If so, you can just manually add
xrandr --dpi 96to the beginning of yourxprofileto set the DPI to the typical 96 (or whatever number looks best).
- I have no switched new installs of LARBS from using Pulseaudio to Pipewire as an … ⌘ Read more
** Operators in C **
Following up my notes on Data Types and Variables in C here are notes on operators in C.
An operator is a symbol that represents a mathematical or logical operation. An operator effects operands.
C provides a number of operators.
Some arithmetic operators include,
”`hljs plaintext
+*
/
%
”`
% is the most exciting of the list, it is called modulo and it returns the remainder after division. Of note, modulo c … ⌘ Read more
I got a menu in the mail from a new Chinese food restaurant. Across the front of the menu, beneath the phone number is a note,
“Open Christmas!”
I feel seen. ⌘ Read more
dutifully taking notes for !novembeat_2021
preliminary notes for a workshop on qiudanz technique mode 1 | gemini://compudanzas.net/qiudanz_mode_1.gmi
Common Cold Viruses
⌘ Read more
Common Cold Viruses
⌘ Read more
Bookmarked : Fix Facebook by Making It More Like Google+ - The Atlantic
My colleague Adrienne LaFrance has named the fundamental assumption, and danger, of social media megascale: “not just a very large user base, but a tremendous one, unprecedented in size.” Technology platforms such as Facebook assume that they deserve a user base measured in the billions of people—and then excuse their misdeeds by noting that effectively controlling such an unthinkably la … ⌘ Read more