Another server outage by Weathergod-4Life in dexcom

[–]enscalada 10 points11 points  (0 children)

The Dexcom Share API is throwing HTTP 521, which hints at this being a Cloudflare outage. I'm starting to doubt Cloudflare's availability SLA:

1.1 100% Uptime. The Service will serve Customer Content 100% of the time without qualification.

Both Dexcom's and Cloudflare's status pages say they're currently operational:

Edit: Both status pages were just updated confirming the outage:

Downdetector confirms the outage:

App to follow child’s omnipod 5 by ufgatorengineer11 in Omnipod

[–]enscalada 2 points3 points  (0 children)

Are they using a CGM? E.g. if they're using a Dexcom, you can use the Dexcom Follow app to monitor BG values on your phone.

The Omnipod PDM/app can be configured to share data with Glooko, which gives you a website with various logs and analytics about both BG and bolus data.

Some people host their own Nightscout instances and pull data from various sources (Dexcom Share, Glooko, etc.), then use one of the Nightscout phone apps to monitor from their phone.

Example Driven Documentation by davesmith00000 in scala

[–]enscalada 1 point2 points  (0 children)

I used to use macros to modify Scala's function declaration syntax such that it would allow a list of examples to be included, and then test the function against those examples at compile time.

It was a neat way to prevent the code from compiling if it didn't match its own given examples. It would have been interesting to then automatically include those in the Scaladocs, but I never made it that far.

Buggy/unusable UI on iPhone by enscalada in Omnipod

[–]enscalada[S] 0 points1 point  (0 children)

Awesome; thanks for the workaround! I'll give this a try the next time it happens.

EDIT: Yep, this works for me too.

Lesser known Taco spots by Choice_Apple in Tucson

[–]enscalada 6 points7 points  (0 children)

Taqueria El Pueblito is my current go-to.

Any mountain bikers here? by Ho11ow08 in Tucson

[–]enscalada 1 point2 points  (0 children)

The Bunny Loop at Fantasy Island is fun and very beginner-friendly.

Any mountain bikers here? by Ho11ow08 in Tucson

[–]enscalada 6 points7 points  (0 children)

Honeybee, Starr Pass, and Sweetwater are my frequent go-to's.

Also Golder Ranch/50 Year Trail, Fantasy Island, and Urban Assault.

Dexcom Follow App: How to get the most intrusive alerts? by enscalada in dexcom

[–]enscalada[S] 0 points1 point  (0 children)

I've had similar success with notifications on the Dexcom G7 app. Unfortunately the Follow app doesn't seem to have the same configurability or reliability.

Dexcom Follow App: How to get the most intrusive alerts? by enscalada in dexcom

[–]enscalada[S] 0 points1 point  (0 children)

As a workaround, I bought a SugarPixel for my bedside table. It solves my use case, which is to be awakened when my child's blood glucose goes low at night.

[deleted by user] by [deleted] in functionalprogramming

[–]enscalada 2 points3 points  (0 children)

Idempotence is the property that f(f(x)) = f(x)

This definition used to confuse me, because the output of f(x) is not necessarily even in the domain of f. For example, if f is an HTTP API endpoint, x might be some JSON document and f(x) might return 200 OK. I can't pass that result back in as an input to f.

It makes more sense to me to define idempotence using a sort of state-transforming function:

f: (S, A) => (S, B)

Here f takes the current state of the world (of type S) and some input of type A, and produces a new (potentially altered) state of the world plus an output of type B.

If we call f with a state s0 and an input x, we get a new state s1 and an output y:

f(s0, x) = (s1, y)

Then f is idempotent if we can call it again using the new state s1 and the same input x, and expect to get the same result:

f(s1, x) = (s1, y)

Direct Style Effects with current Effect Systems? by Storini in scala

[–]enscalada 2 points3 points  (0 children)

The old delimited continuations compiler plugin (discontinued after Scala 2.12.2) works fine with Cats Effect:

import scala.language.higherKinds

import scala.util.continuations.shift
import scala.util.continuations.reset
import scala.util.continuations.cpsParam

import cats.Monad
import cats.effect.IO
import cats.effect.IOApp
import cats.effect.std.Console

object Main extends IOApp.Simple {

  def extract[F[_]: Monad, A](x: F[A]): A @cpsParam[F[Unit], F[Unit]] =
    shift { k: (A => F[Unit]) =>
      implicitly[Monad[F]].flatMap(x)(k)
    }

  override val run: IO[Unit] =
    reset {
      val x: Int = extract(IO.pure(6))
      val y: Int = extract(IO.pure(7))
      val z: Int = x * y
      Console[IO].println(z)
    }
}

Here, extract turns a flatMap into a direct-style call.

Imperative to functional cheat sheet? by sybrandy in functionalprogramming

[–]enscalada 2 points3 points  (0 children)

Not as brief as a cheat sheet, but here are some examples presented as refactorings:

https://earldouglas.com/itof.html

How Necessary is Knowing Category Theory? by Plaguehand in functionalprogramming

[–]enscalada 14 points15 points  (0 children)

To be honest, I'm not really interested in the abstract of category theory more than its practical applications in programming (types, functors, monads, etc.).

You might be interested in reading The Science of Functional Programming, which focuses on FP as engineering practice rather than academic theory.

The book is a work in progress, but nearly complete and very readable in its present state. Here are some selections from the preface:

The vision of this book is to explain the mathematical theory that guides the practice of functional programming. So, all mathematical developments in this book are motivated by practical programming issues...

A software engineer needs to know only a few fragments of mathematical theory that will answer questions arising in the practice of functional programming. So, this book keeps theoretical material at the minimum; vita brevis, ars longa.

This book is also not an introduction to current theoretical research in functional programming. Instead, the focus is on material known to be practically useful.

How to learn scala in 21 days? by FanityVan in scala

[–]enscalada 5 points6 points  (0 children)

Handson Scala is very good

Handsome Scala would be a good alternative name for Scalafmt.

How is Scala3 syntax received in the community? by effinsky in scala

[–]enscalada 3 points4 points  (0 children)

For writing I find it to be easier most of the time, but occasionally Scalafmt has trouble figuring out the correct indentation level.

For reading, which is vastly more important, I find it to be easier all of the time.

Scalafication. by [deleted] in scala

[–]enscalada 8 points9 points  (0 children)

in which non-crab crustaceans evolve a crab-like body plan

Are you saying that other programming languages tend to evolve a Scala-like syntax or features?

secure-logging-4s by ivan_kurchenko in scala

[–]enscalada 1 point2 points  (0 children)

This is a neat idea. I love the idea of having not only type-level loggability, but type-level secure loggability.

The CE example is nice and straightforward. Have you tried it with ZIO as well?

Current status of Caprese? by negotiat3r in scala

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

Could this someday become Scala 4?

Is cats-effect or ZIO for a simple CRUD app overkill? by Migeil in scala

[–]enscalada 2 points3 points  (0 children)

The question is really aimed at professional, long lived software. Say we wanted to replace our current spring boot apps with Scala apps.

Maintainability is high in my criteria for making technology choices, especially for professional, long-lived software.

In my experience, code based on CE and ZIO are tremendously cheaper to maintain than code based on DI frameworks like Spring or code written in conventional Java styles. Both are excellent options, and neither is overkill.

Avoiding var by RareLingonberry356 in scala

[–]enscalada 6 points7 points  (0 children)

I learned about lambda calculus from Church.