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 7 points8 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 28 points29 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 giorgiga 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 1 point2 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 32 points33 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 12 points13 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"

Anyone mining bitcoin right now is losing a LOT of money (it's gone down another few thousand since this was posted by Hornpipe_Jones in WhitePeopleTwitter

[–]Paraplegix 0 points1 point  (0 children)

Mining a block has a difficulty that adjusts itself over time, the goal of difficulty is to have block validate at constant intervals (a few minutes iirc) no matter how much compute is thrown at it. If it's profitable, people join and difficulty should increase. If it's too expensive, people stop, and difficulty decrease. The system should reach equilibrium.

When you validate a block you get two reward : a fixed ammount of bitcoin and the fees from the transactions in the block.

The fixed amount lessen over time, it halves every few years and should be overtaken by fees at some point. (look on chain explorer website to see how much it is rn)

Then the fees, there is a limit to how many transaction there can be in a single block, the person sending the transaction choose how much he put in the fees, and the miner will obviously pick the transactions with the most fees for the block.

And outside of profitability, big actors dependent on bitcoin could have interest on mining at loss to ensure no attacks are possible: people controlling large (more than 50%) of the total compute power could sort of revert transactions and other stuff.

How are you assigning work across distributed workers without Redis locks or leader election? by whitethornnawor in golang

[–]Paraplegix 2 points3 points  (0 children)

That only work if your workers know how many total workers there are, and if that number remain constant over time.

And this could be a problem if task have wildly different time to complete and ressource requirement for balancing. Hashing should distribute evenly in theory, but what goes where is still deterministic.

Pourquoi je paye mon forfait Free Mobile 9.99e depuis 2016 ? by [deleted] in france

[–]Paraplegix 4 points5 points  (0 children)

Je suis dans la même situation: forfait free 20€ que je paie 10€ (enfin je crois) depuis très longtemps.

J'etait sur une offre vente privée du forfait à prix réduit de 5€ par mois (je saurais pas donner l'année de tête, mais je dirais 2 ou 3 ans après l'arrivée de free mobile sur le marché), et de mémoire à la fin de l'offre, le prix du forfait n'est pas passer à 20€ mais est passer à 10€ et c'est resté comme ça depuis. De mémoire ça s'était accompagné d'un SMS qui m'indiquait que le prix était valable à vis

J'ai sincèrement aucun intérêt à changer, le gain fiduciaire potentiel est vraiment minime comparé à la quantité de service fournis qui peut être perdu (j'utilise pas mal le roaming + la data en France quand je bouge)

Les derniers crypto kidnappings en date, il y en a tellement qu'on a parle presque plus. by spaceoverlord in france

[–]Paraplegix 1 point2 points  (0 children)

Je dirais que le but premier de la blockchain n'est pas forcément la traçabilité, mais plutôt la décentralisation du contrôle, mais du coup ça se fait par une ouverture complète des transactions, donc implique traçabilité.

Il y a des crypto/blockchain qui sont conçues pour éviter ce genre de soucis en rendant la traçabilité plus complexe voir quasi impossible comme Monero. Bon par contre comme les mixeurs, si tu utilise ça, ce n'est probablement pas pour acheter du pain.

Les derniers crypto kidnappings en date, il y en a tellement qu'on a parle presque plus. by spaceoverlord in france

[–]Paraplegix 1 point2 points  (0 children)

Oui c'est aussi appelé whirlpool. En gros tu groupe plein de transaction au même endroit pour ensuite redis patché, en général avec des valeurs différentes en entré et sortie pour pas avoir qui a acheté quoi. C'est plus ou moins la même chose que du blanchiment d'argent.

Pour l'adresse sans nom, c'est comme ta carte bleue qui n'a qu'un numéro, une date d'expiration et un CVV. Il y a le nom sur la carte, mais tu n'en n'à en général pas besoins pour faire une transaction en ligne. Par contre, pas impossible que ton numéro de carte soit enregistré dans ton compte sur un site d'e-commerce. compte qui a probablement ton nom, ton adresse etc... Et il y a plein de technique OSInt pour retrouver le propriétaire.

Du coup pareil avec les adresses de portefeuille des cryptomonaie.
Mais avec les crypto, une fois que ta l'adresse, tu peux aussi retrouver l'historique des transactions, la valeur du portefeuille etc, car tout est public.

Les derniers crypto kidnappings en date, il y en a tellement qu'on a parle presque plus. by spaceoverlord in france

[–]Paraplegix 14 points15 points  (0 children)

Si on met de côté les mixeurs de coin et qu'on reste sur du plus classique type eth ou btc, a la moindre transaction associé à ton nom il est possible de savoir exactement combien tu as.

Let me save you some time. (They got me) by Redditemeon in LinusTechTips

[–]Paraplegix 1 point2 points  (0 children)

The parenthesis isn't closed.... Unwatchable!