How I keep myself alive using Golang
bytesizego.com
bytesizego.com
Tieni duro. Non ti disunire
Incidentally, I work in pentesting, and one of my colleagues has Type 1 Diabetes; your overview of it and its resultant complexities really made me empathize with what challenges he has to surmount daily while still being one of the nicest, most approachable people in our team.
I even read recently about the case of a worker who wasn't promoted despite everyone else expected him to be promoted. His sin ? He told briefly one of his colleagues that his car got stuck and he was tired of fixing it every now and then.
The promotion involves commuting for a certain distance. His manager told him he would have promoted him but he heard his car was not fit.
and then there is penetration testing as in trying to break into things. is that what you do?
sigh
On the other hand, it seems quite heinous that users don't have access to data that is rightfully theirs that they can action on it.
Perhaps if your bic pen fed your scratches into a system that ignored aberrant marks, cleaned up your letters, ran a spell check, and printed the result in the font of your choice?
This glucose device is a sensor. Sensors generally produce noise, sometimes a lot of noise, and require post processing in order to get the signal you wanted. The raw data is interesting but often not reliable as input.
That kind of processing is usually complex and companies often seek IP protection and close their source or use DRM. Whether that’s good or bad is a matter of opinion but the motivation is clear.
As a T1 myself, I use a Dexcom as my CGM and have it working around that specifically, but I'd love to open it up to other devices too, and offer more. Feel free to check it out! https://github.com/Cian911/tmux-xdrip
I'm a T1 diabetic and while the Freestyle Libre is an _amazing_ device, truly life changing, the software is pretty bad. I reported a bug more than a year ago and Abbott still haven't acknowledged it as being a bug, despite there being loads of reports online and in their app reviews on Google Play.
For anyone interested, or who might be able to add weight to my case for them to acknowledge it, the bug is that adding LibreLink to the list of apps that can override DND has no effect; entering DND mode instantly shows a warning that 'alarms are not available'. It's a pain in work settings where I can't enable DND without disabling my glucose alarms too.
While reading this I wondered if someone has geeked something for similar for OSA, maybe for monitoring purposes or more severe cases.
I already know (and am incredible grateful for) OSCAR[1], but I'm really curious to see what else is out there.
During my sleep study I logged about at the worst 48 incidents per minute of stopping to breath (kind of difficult to do that when you tongue rolls back into your airway)
Check for leaks. Make sure your mask is actually comfortable, I'd recommend trying multiple if you haven't already.
First you need a mask that fits the profile of your face and the severity of your condition. There are a lot of different shapes and designs. Having tried a few, some were completely useless for me. Only one actually worked.
Facial hair also affects the performance of the mask too. I don’t know if this is something you need to be concerned about or not, but if you have a beard and wear a full mouth and nose mask, then you might want to consider a change of appearance.
Then you have the configuration of the CPAP machine itself:
+ how much pressure to apply?
+ what, if any, ramp up period to use before deep sleep pressure is applied?
Those two metrics took a bit of tuning before I found something I was comfortable with.
I was lucky that I had (and still have) an excellent doctor to guide me through all of this. Free from the UK NHS too. I can’t imagine having to navigate all of these caveats on my own.
Good luck with the CPAP machine. Not getting enough quality sleep can be debilitating. I’ve been in the same situation as you so understand how horrible life was before my CPAP machine.
I use a nasal mask (not the pillows) since I am not a mouth breather - for me the Fisher & Paykel Eson 2 (L) was just the right fit - took about two different masks before I settled on it.
As I see it, the big advantage of Nightscout is that it is a de facto standard interface, with many integrations already existing. And it's easy to build add-on apps on top of its API. I've built about four myself [0], [1] and there is a big community of users and developers building other things such as [2], [3], [4]...
Even though Nightscout is a little bit messy and requires MongoDB, it's surprisingly easy to self-host. I'm using the stock docker-compose file from the main repo with only minor modifications. I run it on a $6/mo VPS. As an alternative, there are two or three hosted Nightscout services costing little more than that.
I highly recommend you to consider going this "standard" Nightscout route because it can save you work (and worries) in the future, and you get to connect with the community around it. In my experience, going all alone from the start was not worth it.
[0] https://github.com/vitawasalreadytaken/koboscout [1] https://github.com/vitawasalreadytaken/glucoscape [2] https://github.com/kashamalasha/nightscout-widget-electron [3] https://github.com/mlukasek/M5_NightscoutMon [4] https://customtypeone.com/products/sugarpixel
> [...]
> After playing around it seemed that the main app didn’t like sending data that it felt was anomalous due to a sudden change in blood glucose level.
That sounds like a life-threatening bug.
Strictly speaking, you're not supposed to make treatment decisions based on the CGM data.
For dexcom sensors, certain apps can pull the raw values and bypass this. For libre- at least the libre3- I've seen it backfill the data in certain cases where it seems to realize that it's not a bad reading, your BG is just going through a fast swing.
I have recently be learning about tremendous success with well trained dogs alerting their owners as a complement to the technology based monitoring and alerting systems.
I have dived into this a bit, and the thing that I grokked is the challenge of proving that the algorithm/device loops really work and are really safe. There has been a lot of painstaking work to develop and certify a thing like Camdiab. Unfortunately it also means that it's important to buy the right smartphone to make sure that the right libraries are available and being used by the app... Has been a bit expensive.
They have also walked the road of testing and proving the devices/algorithm for use in small children and teenagers. Bear in mind that this is all very complicated and there are a lot of differences in the behaviour of different hormone systems in different cohorts.
The other piece of the puzzle is Nighscout[2] that stores data in Mongodb (last time I looked at it). You can also enter a custom script to your Nightscout installation that can be your own endpoint to accepting JSON data about BG.
1) https://xdrip4ios.readthedocs.io/ 2) http://www.nightscout.info/
CGM devices seems like the gold standard in terms of what they're natively capable of (and you don't need something separate on top of a flash sensor) and I think they're free on the NHS. Lots of them have companion smartphone apps, so you'd assume that it's possible to reverse engineer whatever API that these apps are using in order to get at the raw data. Dexcom seemingly does have an API, but it only works if you're located in the US.
It's a patched app that broadcasts values it receives to any app that's listening, e.g. xdrip.
Libre 2 has also got patches floating around on the internet.
I haven't had time to work on it recently, but it uses ntfy and Retool to send alerts and visualizations. Originally I did everything over Discord, but found the UI to be not great especially on mobile.
I was thinking of eventually incorporating some kind of automatic remedial solution eventually to help keep my glucose in range, but haven't had any time to look into it yet.
Please don't give up! It's absolutely possible to break through this mental block and improve your results and mindset step by step. It is a tough journey, but it can be empowering.
I don't know where you're at now, but for me the change started with honestly tracking my data and looking the truth in the eye. I learnt to review the data regularly and think about my results, and the possible interventions I could do. And, well... it's been like that ever since :) Endless incremental improvements and occasional setbacks, but with a clear trend towards higher TIR and lower BG variance.
On the practical side of things, if you're tech-savvy I can recommend the Diabetech podcast: https://www.diabetechpodcast.com/
I'm curious about your thoughts on insulin pumps. I'm not very familiar but I know a few people with T1 that use them and seem happy with them. My understanding is that the idea is that they both monitor glucose levels and supply insulin to keep things stable. Have you considered them? Is there a limitation/downside to them that isn't obvious to a non diabetic? Thanks!
Unfortunatley I’m not eligible for an insulin pump on the NHS so for now I’m sticking with injections. I do a good job of managing them this way so it works for me for now.
While the Dexcom is "better" (than Freestyle Libre) in my opinion because the recent revision can talk directly to your phone continuously (the Libre only sends alerts, getting data requires you tapping phone to arm)... your insurance may cover only one or other. Either is way way better than nothing, but both are still a long way from automation.
It has a side benefit of allowing them to show it on their Apple Watch using Google Calendar only.
I used to use Libre + MiaoMiao + Nightscout, but these days I much prefer Dexcom G6 + xDrip + Nightscout.
Pros for the G6:
- No 3rd party transmitter (e.g. the MiaoMiao)
- It's smaller and can go on the stomach so it's less likely to get ripped off
- 1 less app involved -- xDrip integrates directly to Nightscout and there is no need for the Dexcom app
- Supposedly the glucose readings are a bit more accurate than the Libre
Cons:
- Sensors are more expensive than the Libre
- The transmitter is not rechargeable so you need to keep buying them every 90 days
Lots of different implementations and hosts: https://duckduckgo.com/?q=requestbin
On the diet side, I'm living with almost no carbs for 2 years and over time my ability to turn fat into energy changed significantly, to the point I can do any activity I was doing before as long as I keep in check my sodium and potassium intake.
You can find people doing well with Type 1 and carnivore and you can find people telling you your insulin resistance will worsen.
I'd experiment regardless of what you find on the internet or the doctor tells you.
I spent two years of hell (not diabetes though, frequent diarrhea, stomach ulcers, blood in stool) following doctors indications and ended up with non sensical prescriptions and a low fat diet as a recommendation, when a high fat diet fixed all the symptoms in a week.
Monitoring glucose:
Sensor libre 2 and xdrip mobile app using the bluetooth option where xdrip + oop2 reads values in 1min intervals. ( no miaomiao needed ) Values are pushed to nightscout
I got 2 nightscout instances: one for my self one for my son deployed to heroku.
Alarms are pushed to my phone for my sons low and high bloodsugar using pushover.
Heroku alarms are configured if service goes down.
Database: mongo atlas highly available.
We both use omnipod dash with android aps app.
A) helps with carb to insulin calc and carb counting, insuline on board.
B) closed loop, that auto corrects high glucose and stops insulin when too low
C) different profiles for things like "recently done sports" vs "didnt do much excerise in the last days"
D) aps app allows to track extra insuline injected by pen
>Typically, a standard cheeseburger with a bun, beef patty, cheese, lettuce, and tomato can contain around 30 to 40 grams of carbohydrates, primarily from the bun. A standard serving of fries could add an additional 30 to 50 grams, depending on the serving size. Hence, the meal in the image could contain somewhere between 60 to 90 grams of carbohydrates in total.
That is pretty good! Good luck with your T1D, my got his diagnosis 5 years ago and it's pretty amazing technology we have for it now.
Despite this, it is nice whilst my daughter is at school, since some automated corrections (even if overly conservative) are certainly better than none — teachers generally won't administer corrections (but will bolus for food).
I do imagine it's different for everyone though, and would also depend on what your alternatives are. In our circumstances, it's a huge improvement over manual injections. But by no means the closed loop silver bullet we're all hoping for.
We ran the TSlim on BasalIQ (precursor to ControlIQ) for a couple of years. Haven't done her HbA1C since we swapped, so I don't have any hard data. Well, and with the constant changing lifestyle of kids, all data needs to be taken with a grain of salt. I think we're being woken by high alarms less often, but she just seems to be fairly high (just under 10 mmol/L) much more often. There are of course still run away highs much worse than that (don't want to misrepresent the situation!) and I guess they're somewhat mitigated by ControlIQ, but it definitely doesn't stop them outright, and manual corrections are still required if you want the high resolved in under 2 hours.
I kind of do have the option for a omnipod dash with a diy loop using something like nightscout, but my nurses have advised against it (I suppose significantly because it's not something they can directly monitor or have knowledge of). I'm highly tempted to just use the TSlim because if my projects are anything to go by it'll be years before I actually set it up haha
Long story short, I'm planning to buy a few boxes of Omnipod Dash pods, in a country where I can do so, out of my own pocket – so that I can try iAPS. #WeAreNotWaiting and all that :)
BTW Nightscout should not be required for Loop nor iAPS.
I also have T1D and its a natural source for cool software engineering projects like this.
You might like these two posts: Using machine learning to predict when I excercised: https://dddiaz.com/post/glucose-datascience/
Using Genomic Software to explore my auto-immune genes: https://dddiaz.com/post/hla/
Neat idea.
Edit: I'm curious if the people disagreeing with my musings have some studies investigating the topic, or some other interesting point.
Type 1 is when your immune system erroneously kills the cells producing insulin in your pancreas. Treatable by injecting insulin manually - but as any substitute, there are caveats, it's not perfect. Type 1 is pretty binary, you either have it or you don't, it appears rather rapidly, usually at young age, up to around 20. There's no way to avoid injections through diet.
Type 2 is when the cells that are _reacting_ to insulin are no longer doing so very well. Lots of reasons: genetics, body weight, physical activity. It's much less binary, with gradual onset over years. Can initially be managed by change of diet, activity, pills - later it also requires injections like type 1.
I use a drug called Metformin daily which slows down my digestive tract (you feel fuller after a meal longer like Ozempic), lowers the uptake of glucose in your gut and lowers glucose production in your liver.
That and a low carb diet is essential.
Not essential. There are people who manage it or even get into remission with high carb diets (high carb low fat) too. One common thread across all these diets is avoiding processed foods.
- slow down stomach emptying (which was noted)
- improving glucose disposal
- reduce appetite by affecting brain chemistry
GLP1 RAs are really really interesting compounds (I'm a bit biased of course)
I’m grateful of the free health care that our country has.
He is now on Dexcom+Omnipod+AAPS and doing well.
Being familiar with PagerDuty and Datadog/ELK stack, all I want is a similar set of services that can scale (cheaply) to manage all people with T1D. Nightscout is a start but won't scale.
Awesome work and best of luck, T1D is shite.
There are so many ways that software can make T1D more tolerable, I am glad you have found some solutions for yourself too :)
Now I am debating between Rust and Go for backend development (for a web service). Which one between these two would be recommended for my needs? My priorities are to be able to learn quickly and develop/iterate as fast as possible.
If that was the case, wouldn’t people who love Go have created one after more than a decade in existence?
The reason why Go developers don’t like “frameworks” a-là Ruby on Rails in the Ruby ecosystem is because the Go community generally prefers libraries over frameworks because Go’s simplicity and flexibility allow developers to compose their solutions using small, composable packages rather than being constrained by a rigid framework.
This approach often results in more efficient and maintainable code. The Go philosophy emphasizes minimalism and encourages developers to avoid unnecessary abstractions.
https://github.com/mingrammer/go-web-framework-stars?tab=rea...
But you won't find anything that's anywhere near as comprehensive and batteries-included as Rails or Django.
For a web service with fast iteration times, I'd probably pick Go of those two. While I'm not personally a giant fan, I think it is a much simpler stack that lets developers be pretty productive especially in the domain of web services.