(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Please petition Github to support HTTPS on github pages: https://github.com/contact
Here's what I wrote:
Obviously, a lot of people want HTTPS for github pages:
Until recently, that would be difficult to implement but, as it turns out, the implementation is pretty much complete:
PS: If you liked this talk or like this concept, let's chat about iOS development at Stitch Fix! #shamelessplug
Speaker: David Abrahams. (Tech lead for Swift standard library)
"Crusty" is an old-school programmer who doesn't trust IDE's, debuggers, programming fads. He's cynical, grumpy.
OOP has been around since the 1970's. It's not actually new.
Classes are Awesome
import java.util.Random; | |
/* | |
If Alice tosses a coin until she sees a head followed by a tail, and Bob tosses a coin until he | |
sees two heads in a row, then on average, Alice will require four tosses while Bob will require | |
six tosses (try this at home!), even though head-tail and head-head have an equal chance of | |
appearing after two coin tosses. | |
https://www.quantamagazine.org/20160313-mathematicians-discover-prime-conspiracy/ | |
*/ |
State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?
There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.
Here I present a composable pattern for pure state machiness with effects,
#!/usr/bin/env bash | |
# Find all added *.kt files from last commit and mv to *.java | |
for f in $(git diff --name-status --diff-filter='A' HEAD~ "*.kt" | cut -f 2); | |
do mv -- "$f" "${f%.kt}.java"; | |
done | |
# Commit the kt to java changes | |
git add . | |
git commit -m"kt to java" |
/* Copyright 2022 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
@Composable | |
fun BouncyRopes() { | |
val startCoOrdinate by remember { | |
mutableStateOf(Offset(0f, 0f)) | |
} | |
var endCoOrdinate by remember { | |
mutableStateOf(Offset(100f, 0f)) | |
} |