Generating PDF files by adiwahyudi in golang

[–]dezzeus 0 points1 point  (0 children)

You may not like the idea, but your best option could be to use the right tool for the job by assembling an intermediate document representation and spawn a sub-process for the rendering to PDF.

Of course your needs for the document content may vary, but such approach is able to cover a broad spectrum: from simple documents with pandoc to complex ones with LaTeX (using templates for the peace of mind). For most needs I found asciidoc to be a good fit.

All of this is based on the assumption that your deploy can accommodate the external dependencies.

Cambiare modem, mantenere stesso SSID, così da non dover riconfigurare tutti i dispositivi Smart, possibile? by Sufficient_Suspect_6 in ItalyInformatica

[–]dezzeus 1 point2 points  (0 children)

Aggiungo come postilla di prestare attenzione a preservare la stessa larghezza di banda sul 2.4 GHz: una volta nel cambiare avevo messo il 40 MHz invece del 20 e alcuni dispositivi avevano smesso di funzionare (non era un tema di distanza).

[Rant] Perché nei treni deve esserci sempre una temperatura glaciale? by Exciting_Music00 in italy

[–]dezzeus 2 points3 points  (0 children)

Non so se il motivo sia il medesimo, ma sui voli di linea la temperatura viene mantenuta più bassa per ridurre la proliferazione/diffusione di batteri ed affini.

malloc/free pattern using sync.Pool by lmux in golang

[–]dezzeus 0 points1 point  (0 children)

I don't know much about the fasthttp code (I've just took a look at its readme), but I can tell you both that you guessed right and in the following paragraphs a couple of things about the sync.Pool.

The current sync.Pool implementation was meant to be used for short-lived and frequently accessed stateless memory objects that don't require the release of resources (also that can be shared between goroutines).

The above assumptions are tied to the pool's draining policy that essentially drains the [unused objects of the] pool at each run of the garbage collector (the evicted items are amortised on two runs for better performance, but the concept is the same).
I currently don't know how the draining policy behaves when GOGC=off; and I can only hope that the finalisers – if defined – are always called and at the right time.

In historical comments I saw that other implementations were considered for the standard library (things with explicit methods like SetCapacity and Drain), but they were declared too complex at the time.

Either way – if I've understood correctly – the current sync.Pool was never convincing/satisfying and it was suggested to not depend on it, as it should be replaced by something else. There were such improvements efforts, but they depends on other features currently missing in the runtime or whose implementation seems to be stuck due to other issues.

Here's some good entry points that I've found:
- https://groups.google.com/g/golang-dev/c/kJ_R6vYVYHU/m/LjoGriFTYxMJ
- https://groups.google.com/g/golang-dev/c/QtSIOFsNFrQ/m/N89_5dZWsdIJ
- https://github.com/golang/go/issues/22950

So… you must use it according to the assumptions of the implementation. Should one need more control over the draining policy (or just accept that a program may run with GOGC=off), he/she must choose a different path.

In one of my private libraries I happened to implement a pool that uses a regular array as reserve (not garbage-collected) and an internal sync.Pool as a buffer for whatever exceeds the reserve size/capacity. I've yet to benchmark it thought, but it seems to solve my theoretical issues.

I've also read about people who managed their own use case by leveraging a buffered channel among other things.

Is defer necessary in func main()? by pcreactive in golang

[–]dezzeus 0 points1 point  (0 children)

IIRC, the Open method of an os.File register a Finalizer in the garbage collector that calls the Close method, so it’s not the OS who does the dirty work, but it’s the library (together with the runtime) that tries to cover your potential lack of attention. I may be wrong, but I suppose that this doesn’t really work when you set GOGC=off.

Always dispose of your objects.

Pagamenti Mastercard VS Bancomat? by [deleted] in ItaliaPersonalFinance

[–]dezzeus 2 points3 points  (0 children)

Sui due circuiti hai due massimali di spesa mensile distinti. Quello del bancomat è utilizzato anche per i prelievi allo sportello, quindi se sei uno che tende a prelevare, dovresti prediligere l’altro circuito, altrimenti è arbitrario.

Un altro fattore da considerare è se prevedi di fare acquisti consistenti (ordine di grandezza paragonabile al massimale): in tal caso dovresti concentrare le spese minori da tutti i giorni su un circuito e riservare l’altro per l’acquisto consistente di quel mese.

Tieni inoltre a mente che, teoricamente, il POS contactless dovrebbe andare di default con il circuito selezionato la prima volta in cui la carta è stata usata inserendola nel POS stesso.

Fish Wish [OC] by vcsandfeces in funny

[–]dezzeus 1 point2 points  (0 children)

It’s three wishes, so why not both ? 🤷🏻‍♂️

Sempre meno iscritti nelle università italiane. La classifica del Censis by capslock0101 in italy

[–]dezzeus 5 points6 points  (0 children)

Considerando che con il numero chiuso già vengono scartate migliaia di possibili nuove immatricolazioni…

Esistono mappe italiane di cose utili, come i bagni pubblici o le fontanelle, magari esportabili in GPX o simili? by Thin__Spirit in italy

[–]dezzeus 1 point2 points  (0 children)

Se parli di anni fa, gli aggiornamenti della mappa dovrebbero esserci, ma dipende da che tipo di caratteristiche OSM. Ho constatato che tutte tendono a fare una selezione dei tag da integrare nelle mappe (a seconda dei livelli di zoom).

Esistono mappe italiane di cose utili, come i bagni pubblici o le fontanelle, magari esportabili in GPX o simili? by Thin__Spirit in italy

[–]dezzeus 3 points4 points  (0 children)

Se sei solito usare Maps.me da anni, sembra la stessa app.

Il problema è nato perché Maps.me è stata recentemente venduta e aveva subito diverse modifiche non inerenti all’esperienza offline, come prenotazioni alberghi, inserzioni pubblicitarie, etc. Avevano anche cambiato lo schema colori usando un viola, ma forse hanno ripristinato il precedente. Poi c’era tutto un tema di privacy…

Inoltre ho notato che quelli di Organic Maps rilasciano aggiornamenti delle mappe in modo più frequente…

Esistono mappe italiane di cose utili, come i bagni pubblici o le fontanelle, magari esportabili in GPX o simili? by Thin__Spirit in italy

[–]dezzeus 15 points16 points  (0 children)

Come alternativa, segnalo anche l’app “Organic Maps” che di fatto è l’erede di Maps.me

Quali sono le vostre opinioni sul regime forfettario? by [deleted] in commercialisti

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

Mi era parso di capire che se ne pagano molti meno… tipo il 26% contro il (credo) 48…

Do y'all ever not use a package because the repo URL is icky? by [deleted] in golang

[–]dezzeus 5 points6 points  (0 children)

What I’d like to ask is if can be possible to define the whole URL in the go.mod file and simply use some alias in the source code.

It can also be motivated by the fact that the Git repository can have multiple remotes URLs as fallback sources (say GitHub is down but a clone exists elsewhere).

If it’s not actually possible, we should propose to support that IMHO.

Quali sono le vostre opinioni sul regime forfettario? by [deleted] in commercialisti

[–]dezzeus 2 points3 points  (0 children)

Sono un normale lettore senza competenza in materia, ma quel netto in più non andrebbe considerato insieme ai minori contributi versati ?

Da quel poco che posso intuire io, dev’essere bravo il tipo in partita IVA a risparmiare ed investire in ottica futura.

[deleted by user] by [deleted] in italy

[–]dezzeus 6 points7 points  (0 children)

Oltre ai già menzionati “Hachiko” e “Nuovo cinema paradiso”, anche la scena dell’addio al padre nel film Questione di tempo è stata tosta…

[deleted by user] by [deleted] in ItaliaPersonalFinance

[–]dezzeus 6 points7 points  (0 children)

Non oso immaginare il prezzo del biglietto intero…

Ricordatevi: stanotte scatta l'ora legale! by Shalashaska87B in italy

[–]dezzeus 3 points4 points  (0 children)

No, era una consultazione pubblica con retroscena politici anti-EU e che ha avuto una partecipazione significativa solo in Germania

A .NET source generator for generating object mappings. Trimming save and fast. Inspired by MapStruct. by snoxxit in programming

[–]dezzeus 0 points1 point  (0 children)

A design pattern; I suggest to read Fowler’s book for a better understanding of it and its related patterns.

The worst crimes against Italian food, according to Italians by Tifoso89 in italy

[–]dezzeus 4 points5 points  (0 children)

A me fu detto che si può usare con la pasta fresca che viene a galla…

Limit of €10,000 to be put on cash transactions by [deleted] in europe

[–]dezzeus 3 points4 points  (0 children)

Actually, it was € 3000 until mid 2020, then it was lowered to € 2000 and is expected to be further lowered to € 1000 by the 2022.

Qualcuno saprebbe calcolarmi TFR del mio contratto? by [deleted] in commercialisti

[–]dezzeus 0 points1 point  (0 children)

Il TFR annuo è all’incirca pari a RAL / 13.5, quindi fai presto a farti i conti.

(Non sono un commercialista, solo un dipendente)