The code both applies your Prime membership and links your preferred payment method.
50 karma · joined May 31, 2022
The code both applies your Prime membership and links your preferred payment method.
https://github.com/whatyouhide/short_maps https://andrealeopardi.com/posts/a-story-of-regret-and-retir...
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.
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.
The codebase is open-source! https://github.com/mbta/screens
* (Massachusetts Bay Transportation Authority)
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.