Some quick analysis of prior fasting data

Ok fasting hours, but how about eating hours? The data dump from my Zero fasting app highlights the fasting hours. I had used Zero from 2019 to late 2023, and I wanted to look at briefly, well what about the eating hours, other than the fasted hours? In an effort to save time, I used ChatGPT to come up with the calculation around the eating hours. Actually the first try was interesting since the outcome was showing daily eating hours that were beyond 40 hours 馃槄, but coercing ChatGPT to try to correct so this falls within the expected under 10 hours, ChatGPT was able to actually course correct nicely !...

June 2, 2024 路 (updated June 8, 2024) 路 3 min 路 623 words 路 Michal Piekarczyk

issue experienced in typewise logseq interaction

UPDATE: 2025-02-04 wow, i dont know if this is new or if I stumbled upon something thats been sitting in plain site all along, but today, when after entering a part of a logseq node , with either the # or [[]] notation, if subsequently I type q comma and a space, , then no typesense autocorrection occurs! The issue An example that is around undo-ing auto-corrections, when using the Logseq app....

May 24, 2024 路 (updated February 4, 2025) 路 1 min 路 184 words 路 Michal Piekarczyk

Nice pretty printing go slices

package main import ( "encoding/json" "fmt" ) type Foo struct { Blah int Flarg string } func main() { var stuff []Foo = []Foo{ Foo{Blah: 8, Flarg: "sure"}, Foo{Blah: 7, Flarg: "mhm"}, } stuffBytes, err := json.MarshalIndent(stuff, "", " ") if err != nil { fmt.Println("Marshaling errors", err) return } fmt.Println("harder to read\n", stuff) fmt.Println("\nbetter\n", string(stuffBytes)) } outupt is easy on the eyes harder to read [{8 sure} {7 mhm}] better [ { "Blah": 8, "Flarg": "sure" }, { "Blah": 7, "Flarg": "mhm" } ]

March 30, 2024 路 (updated May 26, 2024) 路 1 min 路 85 words 路 Michal Piekarczyk

Scope trickiness in Go

Go scope is different for for loops and if blocks than in Python For example, with some code, package main import ( "fmt" "slices" ) func main() { var stuff = []string{ "foo", "bar", "hmm", } if idx := slices.IndexFunc(stuff, func(x string) bool { return x == "foo" }); idx == -1 { fmt.Println("yes") found := true } else { fmt.Println("no") found := false } fmt.Printf("found %v\n", found) } But the error is...

March 30, 2024 路 1 min 路 155 words 路 Michal Piekarczyk

Go Sprinkle reflection on domain driven development

Ok cool, realizing, following on from earlier post, that to nicely test the case when I have a Merchant and I am only making updates to it with UpdateMerchantRequest, I would need a nice generic way to obtain a subset struct instance from the other. Getting ChatGPT to help, here is what I asked, Okay I have a strategy I鈥檓 using, where I have a go struct for a merchant that mirrors a postgresql database table and also another struct for updates to it which is a subset,...

February 24, 2024 路 2 min 路 326 words 路 Michal Piekarczyk