If you have an iOS phone you can create a shortcut on your home screen that jumps directly to the code in the Amazon app. Whole Foods app may have the Shortcuts integration too, but I use the Amazon app.
The code both applies your Prime membership and links your preferred payment method.
I believe it’s even quicker to ask Siri to open the Whole Foods app. You don’t need to touch anything and Face ID will unlock the phone while you’re talking.
But you all realize that the OP did not even have to reach for his phone. He just waved his hand to get his Prime discounts, pay and get his rewards.
I get that it is fairly easy to use the app on the phone (although my WF has terrible reception, which is frustrating enough when I come to pick up packages), but waving your hand would still be faster.
This was done previously with the `short_maps` library, which the author—a member of the Elixir core team—eventually retired and archived due to regrets from the undesirable impacts on clarity.
There was also a relatively popular fork shorter_maps [0], mentioned in the blog post above. My motivation for implementing es6_maps instead of using/updating shorter_maps was (I'm copying from my post in the Elixir forums [1]):
1. I do firmly believe this is a good language feature and a very natural extension of map literals syntax;
2. at the same time, being a language feature it should be simple - es6_maps works only with atom keys and has no extra features over the key expansion.
Point 1 is additionally reinforced by how easy it was to introduce to the compiler - I’m injecting just 9 lines of simple code, while parser and lexer already accept short-form maps without modifications.
That's quite surprising to me. As someone who writes a lot of Javascript, I usually find it easiest to read with this syntax than without it, and I generally recommend to my team that they use the shorthand where they can. This is because the meaning is clear and well-known, and being concise (while still being clear) is very valuable.
I wonder what specifically the original author found made it more difficult to read. Was it unfamiliarity? They allude to some confusion between sigils and strings, so I wonder if the issue was partly an Elixir-specific one.
The map '%{username, age, first_name, last_name}' would be 1 character away from the tuple '{username, age, first_name, last_name}'. It is easy to miss the '%' character and you'll waste some time figuring out why your code is throwing match and/or function clause errors at runtime.
Using this logic [username, age first_name, last_name] is only 2 characters away.
This example is easy to catch because tuple and map work completly different-it's not python.
I really don’t understand why some people are so against this as a language feature. I get that the community tries to stay away from “magic” but where is the line between magic and convenient syntactic sugar.
For example keyword lists as the last argument to a function don’t need brackets, and keyword lists are really lists of tuples where the first item is an atom. I feel like those two things are in some ways less obvious and more magical than this map shorthand.
Magic == “I don’t like it, but I want to sound more objective or rational than I really am”.
You’re definitely correct that there’s as good an argument that these implicit features you mention are “too magical” as there is the the “ES6” syntax is too magical.
Feral honey bees (European honey bees living in a non-beekeeper-managed colony) are different from North American native bees: https://bugguide.net/node/view/475348
Elixir puts some guardrails on its numbered-argument anonymous function syntax, which I think do a good job of restricting its use to defining extremely simple functions.
1. The function has to use all of its arguments at least once. You can’t do `&(&2)`, because it skips the first argument.
2. Single-expression. You can’t do something like `&(x = &1; x + 1)`.
3. No nesting. You can’t define an additional anonymous function inside of a & expression, or even use a `&SomeModule.some_fn/arity` capture. For anonymous functions with nesting, you have to use the `fn arg1, arg2, ... -> body end` syntax.
I work on a team building an application that displays real-time predictions/service alerts and other stuff on various types of strictly non-interactive screens posted around the MBTA’s* bus and rapid transit network.
Like others in the comments, we use a pretty straightforward architecture—our backend is written in Elixir and the frontend is rendered as a webpage with HTML/TypeScript/SCSS. We also use AWS Polly for on-demand readouts of the same content. The client periodically requests new data from the server—no web sockets involved for now.
The kiosk part is pretty basic; most of the interesting problems we face are related to the fact that we support a large variety of screen types/formats and need to strictly adhere to ADA guidelines (for both type size and audio equivalence). Screen types include solar-powered e-ink, portrait mode 1080p LCD, twin side-by-side portrait LCDs, and a set of screens owned by an ad vendor, on which our content appears in a rotation alongside ads.
That's basically what I did for some screens around the office (before covid sent us to remote work) - elixir backend with a raspberry pi on the back of each TV, then Drab[0] to update the screen over websockets (liveview wasn't a thing then IIRC)
Here’s the algorithm of the game’s letter marking system, based on my experience reproducing its logic for a script I wrote that computes remaining words from your guesses and their corresponding marks.
Suppose the target word is “polar” and you guess “banal”.
A submitted word is marked in 3 passes.
0. Initial state: (“banal”, “polar”)
1. Zip together the letters of the guess and target words, and loop through the zipped list. When both letters at a position are the same, replace the guess letter with the symbol for “correct” (green) and remove the target letter from the target word. State: (“banGl”, “polr”)
2. Loop through the target word’s letters, replacing the first occurrence (if any) of each one in the guess word with the symbol for “present” (yellow). State: (“banGY”, “polr”)
3. Replace any remaining letters in the guess word with the symbol for “not present” (black). State: (“BBBGY”, “polr”)
Return the marked guess word.
---
Other examples:
0. (“mamma”, “amaze”)
1. (“mamma”, “amaze”)
2. (“YYmmY”, “amaze”)
3. (“YYBBY”, “amaze”)
---
0. (“nieto”, “otoño”)
1. (“nietG”, “otoñ”)
2. (“nieYG”, “otoñ”)
3. (“BBBYG”, “otoñ”)
edit: fixing formatting issues. Sorry, first time posting a comment on here.
The code both applies your Prime membership and links your preferred payment method.
reply