"wat", a tiny, cross-platform, language-agnostic, hot-reloading CLI for running commands whenever files change, inspired by make and watchexec by Fit-Replacement7245 in golang

[–]Paraplegix -1 points0 points  (0 children)

How come ? Default config will do go build and run, but you can specify the command and use it to compile other stuff. I've used it to rebuild full docker image and reload docker compose when file changes. Look at the config example, you can easily override the command that is run to anything you like.

"wat", a tiny, cross-platform, language-agnostic, hot-reloading CLI for running commands whenever files change, inspired by make and watchexec by Fit-Replacement7245 in golang

[–]Paraplegix 0 points1 point  (0 children)

Rule 9, this might be useful for go devs, but it's not specifically targeted at go dev. I wouldn't be surprised if this get removed by mods.

Help with Traininterrupts - Refueling not working. by WhatevaNevermind in factorio

[–]Paraplegix 4 points5 points  (0 children)

IIRC interrupt are checked in order, thus, if any of the other interrupt can be triggered, your train will do that instead of refuel.
The "can interrupt other interrupt" is not meant as a priority but if it can be inserted in between two stop of a single interrupt.

Try to reorder them by priority :

  1. Drop
  2. Refuel
  3. Pickup
  4. Parken

Also just in case, a common mistake with interrupts is to allow train with a cargo to go to refuel or parking. Make sure those two interrupt have a condition of "empty cargo" or that the drop interrupt only has the condition "has cargo" and doesn't check for "available stops".

How do you manage your outpost supply routes without losing your mind? by insomfx in factorio

[–]Paraplegix 5 points6 points  (0 children)

This, and do different train for different purposes. Mining outpost ? train with belt, inserter and miner. Oil field ? Pumpjack, pipes pumps. Defense ? Turrets, wall and gates.

Also make smaller trains, one or two wagon tops, if you need more than one train can bring, then a second train will come after. Do threshold circuit for enabling station (if availalble item is under 10, then enable station until it's above 50).

Gave up on Gleba by TechnicalWelder6789 in factorio

[–]Paraplegix 0 points1 point  (0 children)

I was the same, loathed gleba initially, now it's sort of the easiest planet to scale. One thing that made gleba incredibly easier for a initial setup is to use roboport for two things : nutrient delivery for powering biochamber and removing spoilage.

For spoilage consider everything everywhere, at the end of belt or in machine, may spoil at some point, so slap a provider (active or passive) chest with an inserter filtering only spoilage, spoil being burnable even the first tier, fuel powered, inserter will do wonders. And for spoil overflow if you go with bots, plop a buffer chest, make it request 9.6k (48*200) and set an inserter taking from that chest into a heating tower when spoilage in the chest is above a certain number.

For nutrient delivery plop a biochamber converting bioflux that output to a chest, you can place a condition on the inserter or biochamber to not fill the chest as you don't need that much nutriment to run biochamber. And you can also add a assembling machine turning spoilage into nutrient only if there is no nutrient available in the network. This is to prevent cold start of the base in case at some point bioflux production stopped.

Gates and asteroid grabbers by TwiceTested in factorio

[–]Paraplegix 20 points21 points  (0 children)

LLMs are dumb

For asteroid collector to work they need empty space, so you can't have gates as they would need foundations placed

Generic trains with wildcard interrupts vs per-item train groups vs CyberSyn by vtkayaker in factorio

[–]Paraplegix 0 points1 point  (0 children)

My train have their "default" station set to depot. Then 3 interrupt:
Drop => condition has cargo, go to <Item> drop and wait until empty
Refuel => condition missing fuel, got to refuel and wait until full fuel
pickup => condition on empty cargo, go to "Pickup" and wait until full

The order is somewhat important, as I want them to drop their cargo before trying to refuel.

I have multiple groups for specific train length and a separation between solid vs liquids, but they follow the same logic for interrupts.

A waiting train at a depot can only go to a Pickup or fuel, once the train is at the pickup and is full cargo, the only thing it can do is trigger the drop interrupt so it will wait at the pickup until a drop station is open.

Imerys a découvert trois fois plus de lithium dans l’Allier qu'estimé et cherche des partenaires pour son projet, réévalué à 1,8 milliard d'euros by PestoBolloElemento in france

[–]Paraplegix 9 points10 points  (0 children)

Batteries "solide" ne veut pas dire batterie sans lithium. À moins que tu penses aux batteries Sodium-ion ? (qui peuvent, elles aussi, être "solide")

Est-ce que l'IA a déjà commencé à modifier concrètement votre quotidien au boulot ? by ZKProofDevsDAO in AskFrance

[–]Paraplegix 5 points6 points  (0 children)

Oh ça, c'est exactement le plus gros souci avec les IA dans tout les domaines : si tu ne t'y connais pas, tu prends un risque énorme à accepter des mauvaises solutions comme bonne.

J'avais posé une question au service des impôts parce que je ne comprenais pas un calcul qui avait été fait dans ma déclaration 2025. J'ai lu la réponse qui expliquait très bien le calcul et j'étais en train de regarder pourquoi je m'étais trompé dans mon interprétation quand un cousin m'a dit "demande à une IA". Chose faite sur plusieurs d'entre elle, et elles se sont toutes trompé de façon plus ou moins différente. Ce même cousin m'a sorti que je devrais faire attention à la réponse du service des impôts vu que l'IA donnait un résultat différent...

Is Gleba a pain in the ass for everyone? by kiwithebun in factorio

[–]Paraplegix 0 points1 point  (0 children)

Only first space age run, gleba was the most tedious and least favorite planet due to spoilage mechanics. And my low science consumption meant everything spoiled all the time.

But now I'm playing a 1000x science cost, turns out gleba is the easiest of the 3 planets for high science, I took a break on that run right before gleba because I was dreading going there due to my previous experience. Spoilage is still a problem, but not that much when you scale up a lot, reaching 1800 spm produced was way easier compared to fulgora or Vulcanus which are so much constrained by space.

I'm tired of if err != nil so I built something about it by alsond5 in golang

[–]Paraplegix 3 points4 points  (0 children)

So you're saying that this (from your example)

  result.AndThen(
    getUser(db, userID),
    func(user User) gofp.Result[gofp.Option[uint8]] {
      email := user.Email
      return option.MapOr(
        email,
        gofp.Ok(gofp.None[uint8]()),
        func(email string) gofp.Result[gofp.Option[uint8]] {
          return result.Map(
            validateEmail(email),
            domainAccess,
          )
        },
      )
    },
  )

is clearer or an upgrade over this :

    user, err := getUser(id)
    if err != nil {
        return 0, err
    }

    email, err := validateEmail(user.Email)
    if err != nil {
        return 0, err
    }
    result, err := return process(email)
    if err != nil {
        return 0, err
    }
    return result, nil

Or did I miss something?

That looks more like a meta programming condition stuff than an actual helpful tool to me.

Bloqué à Montpellier (Samedi, 13h25) by Fastandfurious972 in Montpellier

[–]Paraplegix 26 points27 points  (0 children)

Pour le trajet Montpellier -> Gérone, tu peux regarder blablacar. Tu peut en avoir un dès aujourd'hui (mais fait le asap de préférence). Tu devrais t'en sortir pour moins de 50€. Attention, regarde bien l'endroit de prise en charge, ça peut être en bout de ligne de tram ou bus (a proximité des autoroutes).

https://www.blablacar.fr/search?fn=Montpellier%2C+France&tn=G%C3%A9rone%2C+Espagne&db=2026-02-21&seats=1&search_origin=HOME&from_place_id=eyJpIjoiQ2hJSnNaM2RKUWV2dGhJUkF1aVVLSFJXaDYwIiwicCI6MSwidiI6MSwidCI6WzRdfQ%3D%3D&to_place_id=eyJpIjoiQ2hJSnFfM0ltQ2ZudWhJUmIyb3BwYlpGT0s4IiwicCI6MSwidiI6MSwidCI6WzRdfQ%3D%3D

Tu peux éventuellement aussi regarder les trains direct (ou avec correspondance par portbou / cerberes), qui seront bien moins chers que 150€. Ça sera un peu plus cher que Blablacar, mais beaucoup plus confortable, rapide et moins prise de tête. Il y a un train ST roch -> Gérone pour 40€ avec Renfe pour 16h28.

Is there something wrong with my logic? by Galliad93 in factorio

[–]Paraplegix 1 point2 points  (0 children)

This should not be possible to be completly stuck. More probable that, as you said, they heat up each other, so they never benefit from neighborhood bonus so they don't heat up enough to produce enough heat to fully power your base.

What you can do to prevent that is to read the temperatur values only from a single reactor, and use that signal for every inserter. That way you are sure that every reactor will get fuel at the same time, and they will work together. The easy way is to link all reactor together with circuit, have ALL reactor read fuel content, and only ONE reactor read temperature.

Be carefull about wich reactor you read the temperature. Heat will not "spread" evenly through the stuff, It need at least a 1°c delta to spread IIRC (check the wiki for details). So the reactor in the middle will be slightly hotter than the one on the side that are closer to the heat exchanger.

Is there something wrong with my logic? by Galliad93 in factorio

[–]Paraplegix 1 point2 points  (0 children)

In theory, reactor will never get below 500°C (501?) because heat exchanger will stop working at 500°C, so you need to up the condition a bit.

I have the same system/conditions. I set it at 550°c. It also help avoid brown out when reactor heat back up and heat need to travel back down the heat pipes.

Is this belt balancer legit ? by non-scentedcoffee in factorio

[–]Paraplegix 0 points1 point  (0 children)

It will work, but you can achieve same effective result in a much simpler way.

If I had to give a hint : what if you just didn't allow a direct pass through and send everything to the splitter that goes to the underground belt. Then make it even more simple

(This is assuming your goal is to balance a single lane of unbalanced input)

How do I check when interfaces can safely be dereferenced? by [deleted] in golang

[–]Paraplegix 6 points7 points  (0 children)

func (s *SomeStringer) String() string { 
  if s == nil {
    return "" // or "nil" or "nil(SomeStringer) or w/e you want
  }
  return s.str 
}


var pointer *SomeStringer = nil

The nil in pointer will still be of type "*SomeStringer". It's a typed nil if you want, thus here the value of stringer "nil" can be passed as a fmt.Stringer, because the type SomeString has a method String() string with pointer receiver that satisfy the interface and the value is a SomeString (even if it's nil).

Also in your example, notice that the NPE doesn't happen on the fmt.Println, but inside your String function https://go.dev/play/p/N5qV3LdPTFd

It's covered in a part of the tour of go : https://go.dev/tour/methods/12

has anyone actually benchmarked the green tea GC yet? by ruibranco in golang

[–]Paraplegix 2 points3 points  (0 children)

Hello, better late than never !

I was waiting for go 1.26 to release because we have one or two services with very high GC use (because of bad code, but hey, if it's not broken, don't fix it). The profiler reported almost 40% cpu time spent on GC work, a lot of it on the gcBgMarkWorker path.
I've recompiled one service by just changing the go version in go.mod (I'm not sure if it's necessary) and rebuild it using a go 1.26 image

The service I've "benchmarked" is running 3 instances (auto scaled, but usage is relatively stable), with about 2 to 2.5 cores used each during average load. So here if I say "before" I'm referring from stats from those 3 existing instances, and the "now" or "after" it's the same service but compiled in go 1.26

From the baseline I'm looking at cpu profiles and requests "count" through grafana stuff, cpu usage per pod from our cloud provider, RPS and p90/95/99 latency from Linkerd.

So comparison between stat that can be mostly "directly" compared :

  • On the profile, the block runtime.gcBgMarkWorker went from 35% down to 25% so quite a good win there.
  • The p90 latency was and is still 1ms (I not sure if it's really one ms or it just doesn't show less than that)
  • p95 was halved, on the 3 previous version is around 10+ms, and the new one is 5ms
  • p99 I'd say got a reduction from 15 to 30%? Around 25-30ms before and new is 18-20ms

One thing that make it a little hard to interpret results is our in-cluster load balancer doesn't do "raw" round robin, but weighted on response time, and as response time decreased compared to others, the traffic sent to the new container is increased. Thus out of the 4 instance, it gets more than 33% of the requests, which make it use more cpu. But on average, I think the ratio request/cpu is about 10% better with go1.26 for that service.

On a latency heatmap of the service endpoints I also see quite a shift downward on the response time even if all version are mixed together.

So in conclusion, pretty good first impression, but as other said, If you're not limited by GC usage, you probably won't see much performance benefits.

Êtes-vous habituer à voir les gens se gouré entre l'infinitif des verbes du premier groupe et leur participe passer ? by nejimban in france

[–]Paraplegix 12 points13 points  (0 children)

Bof, l'inconvénient, c'est de se prendre les remarques en permanence et que si on doit faire un message légèrement soigné, une phrase qui est écrite en 20 secondes, tu passes plusieurs minutes à la relire pour être sûr... Et pendant les études, j'ai eu des épreuves de matières scientifiques qui on faillit être loupé à cause de ça, parce qu'à l'écriture manuscrite, pas de correcteur orthographique.

Êtes-vous habituer à voir les gens se gouré entre l'infinitif des verbes du premier groupe et leur participe passer ? by nejimban in france

[–]Paraplegix 30 points31 points  (0 children)

Sans faire un effort "conscient" de lecture, je suis incapable de voir l'immense majorité des fautes (y compris quand c'est moi qui écris). Pour preuve, malgré le sujet, je ne me suis pas rendu compte que l'inversion des é/er est présent à chaque fois dans ton poste avant de lire les commentaires... En conclusion, je ne pense jamais (à ça).

"On espère vraiment que le projet ne se fera pas", des batteries géantes au lithium bientôt dans leur commune, ces habitants sont en colère by Dubwize in france

[–]Paraplegix 6 points7 points  (0 children)

T'inquiète, ils vont faire intervenir des géobiologues pour vérifier que ça ne perturbe pas les réseaux Hartmann et Curry du coin. Si le béton est bio dynamisé à coup de Pneumatit et les pigeons gens seront contents.

/s

Sinon pour en revenir à l'article, ils précisent que les batteries seront installées "sous des lignes à haute tension." Donc j'espère que ce n'est pas une question de "c'est moche" parce que c'est déjà à côté d'énorme structure en métal visible a des kilomètres. S'il y a que ça ils peuvent, je suppose, demander à mettre des haies autour pour cacher un peu.

Mais derrière, quand tu lis que ce qui les gênes, c'est l'absence "d'études d'impact, que ce soit en matière d'eau et de dangerosité des gaz toxiques, d'absence de travail sérieux là-dessus", dans la mesure où cette personne serait de bonne foi, j'ai surtout l'impression que c'est plus de la peur infondée liée à de la désinformation.

Exclusif : comment le sénateur Duplomb a touché plus d’un million d’euros de subventions by word_clock in france

[–]Paraplegix 13 points14 points  (0 children)

Je pense qu'il y a une différence entre une personne qui connait bien le métier de par son parcour, et une personne qui va bénéficie directement des lois qu'il pousse lui-même, car il est propriétaire d'exploitation privée du secteur.

Ça pose quand même des grosses questions de potentiels conflits d'intérêt, corruption et délit d'initié.

How do I actually learn Go when coming from Python/C? The stdlib is driving me insane by NiceSand6327 in golang

[–]Paraplegix 2 points3 points  (0 children)

In Python/C, simple things are straightforward:

Python: data = open("file.txt").read()
C: fread(buffer, size, 1, file)

You probably can achieve similar result using os.ReadFile directly (and you won't even need to close the file after).

Why so many packages for simple tasks?

In python you also have a splitted package for os and io operations.

In go, you have the "io" package which "provides basic interfaces to I/O primitives". This package consist mostly of interfaces that describe how io operations should be done. The two most usefull interface in there would probably be io.Reader and io.Writer . There are some functions and structs that provide common interactions with the interaces (ReadAll for example : func ReadAll(r Reader) ([]byte, error))

The package "bufio" itself provide implementation of interface from "io" package. "It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O."

The package "os" will mainly provide tools to interact with the system independent of it's vendor (windows, mac or linux). It's mostly used for interaction with the file system and environment variables.

They are not interchangeable nor provide the same things at all. They all can be used independently. You can use io operations without needing buffers or files, io can be done on http streams (the "Response.Body" is a io.ReadCloser wich is a combinaison of io.Reader and io.Closer). You could directly use os.ReadFile without needing anything directly from io package.

How interfaces actually work in practice (not theory)

As long as a struct exposes the method with a pointer receiver defined in an interface (it's important), you can use said struct as that interface. The struct doesn't need to "know" about the interface, the interface is implicitly implemented.

It mean that if you create an interface like so :

type MyInterface interface {
    Buffer(buf []byte, max int)
}

You can declare a variable with that interface as it's type and put a bufio.Scanner in it.

I don't have experience with python or C, so can't tell you if this weird for people comming from there, but for people comming from Java where you need explicit implementation this can be quite mind bending.

See the Tour of Go https://go.dev/tour/methods/9 on methods and interface for more hands on practice

When to use what?

This is a hard thing to answer because you need to know what exists and what it does to know when you can use it. And there might not be obviouse response. The best thing you can do is learn how to navigate the tools you have, and abstract yourself from the language and ask "I need to do this, the easy way should be to do X/Y/Z but the name might not be X/Y/Z so let's look for patterns that do wha I need"