Streamlit is lit

Briefly describing this Streamlit fronted python app that queries against menus pulled from a kaggle uber eats dataset found here. A Streamlit menu search Mini screencast First query something random It is off topic, so no results Continuing from an earlier post, this is taking advantage of Facebook’s BART model. A hugging face pipeline is used to hit against six food and restaurant related topics are averaged and compared against a threshold of 0.60 to determine if the query is food related. We see the topics are displayed with their level of entailment. ...

July 20, 2024 · (updated August 2, 2024) · 5 min · 908 words · Michal Piekarczyk

withings wireless scale infinite loop

holding pattern Kind of out of the blue, my Withings Body+ screen is on but theres nothing there. After some reseting, also cannot connect by phone. Removed it from the Withings app on my phone, trying to reconnect the scale as a new scale, but searching for the device, I see the Body+ c0 pop up, I select it, but then I am right back to the search for device screen. ...

June 29, 2024 · (updated June 30, 2024) · 2 min · 245 words · Michal Piekarczyk

Let's try BART zero shot on restaurant related queries

Let’s look at what bart-large-mnli has to say on restaurant related labels for food and non food queries The queries here are just arbitrary statements I came up with off the top of my head. You can skip to the final scoring, but in summary, using a super simplistic evaluation here, I think that the super accessible bart-large-mnli model does pretty well here. One observation I am seeing casually, which I believe Jake Tae https://jaketae.github.io/study/zero-shot-classification/ refers too also, is that bart-large-mnli is more or less by design, not as helpful w.r.t. single-word hypothesis entailment. And that’s why, inspired by Jake and the underlying work being discussed here, below, I’m also using mostly multi-word (multi-token) hypotheses as topics. ...

June 16, 2024 · 7 min · 1453 words · Michal Piekarczyk

Recycling xero shoe diy huarache rubber

What to do with the left over rubber from your Xero DIY haraches? I originally got this Vibram rubber sheet from this xeroshoes.com link, a few years ago. I have made two pairs for myself and I made a few pairs for some family members too. They are great, however, I had stowed away the left over rubber for, well, a long time now haha. I didn’t know what to use the left over material for, until now 😀. ...

June 9, 2024 · 1 min · 90 words · Michal Piekarczyk

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 ! Impressed. ...

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. This is on on typewise ...

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 ./prog.go:17:3: found declared and not used ./prog.go:20:3: found declared and not used ./prog.go:22:27: undefined: found Instead just need to define found outside the package main import ( "fmt" "slices" ) func main() { var stuff = []string{ "foo", "bar", "hmm", } found := false 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) } And get ...

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’m 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

Minimizing Golang struct types while observing tyep safety

Asked chat gpt the following conundrum, if I’m using Go struct types to model a data type, matching a table in my postgresql database say, type Merchant struct { id int, created_at time.Time, name string, phone string, email string, } I have the following question, does it make sense that I ended up creating different types also for the HTTP request to create this merchant, type CreateMerchantRequest struct { name string, phone string, email string, } since the id and created_at timestamps are populated automatically, and also another to update the merchant, ...

February 4, 2024 · 2 min · 368 words · Michal Piekarczyk