Searching We.Love.Privacy.Club

Twts matching #time
Sort by: Newest, Oldest, Most Relevant

How to Build and Run Next.js Applications with Docker, Compose, & NGINX
At DockerCon 2022, Kathleen Juell, a Full Stack Engineer at Sourcegraph, shared some tips for combining Next.js, Docker, and NGINX to serve static content. With nearly 400 million active websites today, efficient content delivery is key to attracting new web application users. In some cases, using Next.js can boost deployment efficiency, accelerate time to market, […] ⌘ Read more

⤋ Read More

**In 2011, @MightySieben in Leiria’s castle for #Entremuralhas .

Today he returns to the castle (this time in Pena’s church) for the kick off concert of #Extramuralhas .

Concert in less than two hours, and I can’t wait!**
In 2011, @MightySieben in Leiria’s castle for #Entremuralhas .

Today he returns to the castle (this time in Pena’s church) for the kick off concert of [#Extramuralhas](https://nitter.net/search? … ⌘ Read more

⤋ Read More

** Miscellaneous this and that **
Since my brain injury (which I’ve since learned can be called anā€œABIā€ orā€œacquired brain injuryā€) I’ve noticed that I have trouble focusing on programming tasks; I’m able to do what I need to do for work and family but, when it comes time for hobby projects I’m just gloop. Totally oozy.

Because of that I’ve been drawn to do more reading and game playing, but also still wanna code…I’ve found that it is easier to use moreā€œbatteries includedā€ kinda languages, namely scheme, over what I’d … ⌘ Read more

⤋ Read More
In-reply-to » 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.

(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 Objects

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

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
}

⤋ Read More

The XMPP Standards Foundation: Mid Term Evaluation Updates
It’s been a month since I wrote my last blog. For those of you who have been following my blogs, thanks a lot for taking the time to read them. In this blog, I will give the updates post mid-term evaluation and the challenges that I have been facing and how I overcame some of them.

The Mid-Term Evaluation

For those of you who don’t know much about GSoC, a mid-term evaluat … ⌘ Read more

⤋ Read More

meet lol, my new website generator!

meet lol, my new website generator!

2022-08-08

I’ve been pretty busy lately, so I haven’t had a lot of time to explore
computers, which is what I love doing. In the last few months, I’ve been trying
to fight back against busyness by writing a new website generator after everyone
goes to bed. I can’t recommend doing this, because it gets exhausting after a
while, but it gives me my kicks and makes me happy.

My old website generator, [wg](https://git.m455.casa/w … ⌘ Read more

⤋ Read More

Release Radar Ā· July 2022 Edition
While some of us have been wrapping up the financial year, and enjoying vacation time, others have been hard at work shipping open source projects and releases. These projects include everything from world-changing technology to developer tooling, and weekend hobbies. Here are some of the open source projects that released major version updates this July. […] ⌘ Read more

⤋ Read More
In-reply-to » Now brace yourself, the tech world stands still for a while: "Stack Overflow is currently offline for maintenance"

@prologic@twtxt.net Well, I have to confess that whenever a Stack Overflow post pops up in the search results of my least mistrusted search engine the answer(s) there are spot on and exactly what I’m looking for most of the time. Of course there are the occasional exception, but I’m actually very happy with what I dig up there. Sometimes I need to scroll through a few answes to get what I need, but in general the first answer appearing below the question is fairly good. There are super bad answers, no doubt. But you can tell them apart immediately and just skip them right away.

⤋ Read More

@movq@www.uninformativ.de From my limited experiences in two companies I can anedoctic tell you, that what we developers told our support work mates after analyzing things and what they replied back to the enquirers was not always the same. That also happend when we gave them answers in written form. Always super nice support folks, no a single doubt, but their basic technical knowledge was pretty much non-existent. And plenty of them didn’t even really know the softwares they’re supposed to support. Granted, those were not easy programs, one was indeed super complex. But if they use them on a daily basis for years one would expect that they know them quite well. At least the main features and workflows. We also often had to tell them basic stuff several times, which was quite a bit frustrating for both sides.

But, I was super glad, that we had them in the front row. You wouldn’t believe what crap queries they had to deal with and what utter bullshit they kept off our shoulders. Sometimes people wrote really offensive e-mails for no reason. Holy moly. I wouldn’t want to trade with them, not in a hundred years. Lots of my developer work mates, however, didn’t value our first level support at all. I mean, I totally understand, that after telling the same things over and over and over and over again it pisses you off, but treating them in a way they feel like shit, doesn’t help either. It only makes things worse. I had the impression that there was a slight war between development and support.

One thing that was totally stupid, is that the POs didn’t listen to improvements and suggestions on how to make things easier for the support team and also all our users. I mean, support has to deal with this software all day long and also get the same questions about workflows and stuff that’s too complicated or unintuitive. So a lot of things were really low hanging fruit to improve everybody’s live. But when they suggested anything, the POs always declined it, nah, it’s the support’s job. Period. A few times I teamed up with the support work mates and told the POs the same, the support team was suggesting and then it was accepted without hesitation. So that clearly shows there really was a two-tier society.

In my current project we don’t have a support team, so we need to handle all the support queries ourselves. In that regard I miss the old project. But luckily, it’s basically just other developers who are needing our help, so that’s fairly okay.

⤋ Read More

@movq@www.uninformativ.de @prologic@twtxt.net I tried to think about it once more today, but still no luck yet. However, I reckon that when I try to grasp something in a very focused way, then I imagine how I would loudly read it (but actually don’t) and hear myself. I’m quite certain about that. In more extreme cases I even noticed my lips slightly moving, but not creating any sound. But most of the time I don’t think there’s a voice. The tricky thing is, if I don’t think about how it works in general, I don’t know. And if I try to think about it, it feels like introducing tons of measuring errors. I just found Schrƶdinger’s cat in my brain.

⤋ Read More

**We still didn’t have a (much needed) conversation about how to prepare for the next pandemic, so that next time we won’t end up with such ill-designed contact tracing apps.

But it seems that first we have other conversation we can no longer postpone:

https://www.wired.com/story/covid-19-data-switch/**
We still didn’t have a (much needed) conversation about how to prepare for the next pandemic, so that next time we won’t end up with such ill-designed contact tracing apps.

But it seems that first we have oth … ⌘ Read more

⤋ Read More

@prologic@twtxt.net Hahahaha, great typo, I had to laugh! Shot probably doesn’t feel too much different in your situation right now. :-D Jokes aside, get well mate!

Maybe call in sick and have a good rest. Sleeping most of the day and drinking a whole lot of tea and/or water sometimes makes a big difference for me when I’m knocked out. I’m convinced that reporting sick a day even speeds up the recovery and is a clear win in the end. Considering the reduced productivity when being ill and all the additional errors one is going to make for several days and the time spent afterwards to fix them or rework stuff, one’s better off to don’t to anything for one or two days and then take that time to really rest and give the body the time to get things sorted. At least in my limited and biased experience. Your mileage may vary, of course might be different for other folks.

⤋ Read More
In-reply-to » Went on a hike this evening and brought my camera along. The 26°C felt much nicer than yesterday's 33°C. I perfectly met a mate who also wanted to go for a quick walk, just like we planned it. The first half hour we went together and then I parted for the longer route to the local mountain. The sunset was absolutely brilliant, but the aftermath turned out to be very boring.

@prologic@twtxt.net Thanks mate! Hahaha, I can assure you, I’ve shown these places a hundred times already. :-D But I’m glad that my selection seems alright and it’s not getting boring over time. Well, to be fair, the lion is a fairly recent addition when they replaced the old benches and fenced off a steep trail over a meadow, so mountain bikers don’t ride down this path anymore. The tree stump is a knot in a bench timber. :-) The carriage bolt fastens the seat to the frame.

⤋ Read More

Went on a hike this evening and brought my camera along. The 26°C felt much nicer than yesterday’s 33°C. I perfectly met a mate who also wanted to go for a quick walk, just like we planned it. The first half hour we went together and then I parted for the longer route to the local mountain. The sunset was absolutely brilliant, but the aftermath turned out to be very boring.

Sunset

Photo 9 shows the entrance to a wasp nest next to the bench in the previous take. The greenery blocks most the view, though. Several individuals took off and returned. But it wasn’t too crowded. Nothing like at a typical honey bee hive at this point in time

What I found quite strange, there was quite a lot of smell of dead meat and butyric acid in the air. Hello hot summer. Both in the forest as well as in the village. I think I noticed those nasty odors at six or seven different places. Never experienced that before. Not to thaaat extent.

⤋ Read More

@movq@www.uninformativ.de @mckinley@twtxt.net Yup, some people do. I tried several times to figure out whether I also have some imaginary voice in my head or not. And I can’t really tell. My best bet is that it depends. Generally there is no voice or just a very faint one. For very complex stuff I think my brain plays some audio. But it’s very hard to tell. If I try to think about it, it feels super weird in my head.

⤋ Read More
In-reply-to » (#ay7e6ka) @eaplmx That reminds me, I should start doing some exercises, too. Years ago, I wrote a web application to track those and two other mates used it as well. This way we motivated us to do our daily pushups and situps. I even extended it to upload GPX trajectories from our bike rides and hikes to show the route on an OSM map. Finally, you could enter your weights and get a nice graph with all the ups and downs. I should revibe this project. And maybe even rewrite it.

@prologic@twtxt.net Haha, of course, no worries! :-) Yup, I thought to try Go for this web application this time. REST API and web UI would be both needed in my opinion. I have at least two mates who would need a UI instead of a programmer-friendly interface. :-D

It’s far from complete, but I started writing something down: https://git.isobeef.org/lyse/kraftwerk2

⤋ Read More

In reply to: A simple mess

This is also something people keep getting wrong about Markdown as originally presented. Markdown isn’t a format. It’s a convenience tool that helps you write some of the boringest and commonest parts of HTML easier, and you can easily drop into more wonky HTML at any time.

Yes yes yes yes yes yes! ⌘ Read more

⤋ Read More

My connecting train was cancelled, so I decided to go for a night walk with a bit of a detour. It was absolutely worth it, saw a rabbit in front of me crossing the road and the clear sky in the forest made the stars pop nicely. Also super quiet once I left the city and the overgrown paths in the woods were incredibly dark. It was very, very hard to even make out the way. Luckily, I’ve walked it many, many times, so anticipating turns was doneable. Quite an adventure! Took me about 1:15 hours to reach home about 15 minutes ago. So I won’t make it to today’s call, sorry mates. I’ll hopefully sleep like a rock in a few minutes.

⤋ Read More

All the scripts on my Gemini capsule (except chess) have now been rewritten using Python and storing data in a SQLite database. This is the first time I’ve ever worked with database in a ā€œproductionā€ environment, and I’m inordinately excited.

⤋ Read More
In-reply-to » My mate and I spontaneously decided to go for a longer tour today in 29°C heat. We ended up hiking 23 km in 4:30 hours. I had two liters of mineral water in my backpack and we bought a bottle of cherry limonade each on the way in. In the end we opted for pear limo at the same self-service fridge. What a great invention these small vending machines and self-service huts are! In Germany shops are closed on Sundays, so we would have needed to find an open restaurant (plenty didn't survive Corona) with some detours.

Don’t worry, @prologic@twtxt.net. :-) Except for one other I couldn’t do that with all my other hiking mates. Not even close. To complicate things even further, there were some rougher spots and all the inclines would slow down progress substantially. At least one hour on top, probably even two.

To be fair, when I started all the hiking a few years back, my endurance was really low, too. I couldn’t have done that back then in this time. I went out for half an hour to an hour, then I was whacked. Nothing comes from nothing.

⤋ Read More

My mate and I spontaneously decided to go for a longer tour today in 29°C heat. We ended up hiking 23 km in 4:30 hours. I had two liters of mineral water in my backpack and we bought a bottle of cherry limonade each on the way in. In the end we opted for pear limo at the same self-service fridge. What a great invention these small vending machines and self-service huts are! In Germany shops are closed on Sundays, so we would have needed to find an open restaurant (plenty didn’t survive Corona) with some detours.

It was my first time on that particular terrain. We went through some beautiful and quaint forest paths with scenic views. I forgot to put my SD card back into my camera, so no photos until my mate will send me his.

Now my feet a cooling off in a bucket of cold water. Superb.

⤋ Read More

Yesterday, we had a heavy thunderstorm in the evening. At first it wasn’t too bad, just thunder in the distance and then a few drops of rain for at most five minutes. That was it. Alright, I thought, it’s over, let me call a mate and walk to the dairy farm. The heavy clouds looked awesome, a bit threatening but mostly harmless and just beautiful. We decided on a small detour to the home made ice cream vending machine and got ourselves some expensive, but very yummy pineapple/mint, yoghurt and raspberry/basil tubs. Mint was super strong, had to eat three spoons of some other flavors to actually taste it. A few spoons in and then the thunder rolled in from nowhere. So we quickly headed for the dairy farm while eating our ice creams. Half way there the sky floodgates opened and we took cover under a tree at the local playground. A minute later we decided to climb up the slide tower, because it had a proper roof. A tiny bit of hail cam down, but nothing serious.

About 15-20 minutes the rain stopped and the thunder and lighning rolled past. So we continued our journey and I finally filled my two one liter bottles successfully. Every now and then it drizzled a little bit through the forest. We reached our homes and a couple minutes later rain hit again. Thunder and lighning went crazy. The sky lit up every few seconds and this continued through half of the night.

Right after I hung up to meet my mate, another mate called and reported a few villages north of us they experienced hail sized a bit under golf balls. But he luckily managed to get the car in the underground carpark in time.

Today, it rained the whole morning. This was great since the temperatures stayed below 20°C, so my walk was a real joy. It’s going to get close to 30°C tomorrow, though, gnarf, ƶrks, bwƤh. :-(

Sunset, once again

⤋ Read More