- Hawks vs. Falcons
- Observability vs. Metrics (Cindy Sridharan)
- Events vs. Structured Logs (Ben Hartshorne, Honeycomb.io)
pragma solidity >=0.4.21 <0.6.0; | |
contract Prime { | |
address public owner = msg.sender; | |
constructor() public { | |
} |
Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".
Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).
Let's dig in:
class AnyEquatableBase { | |
func isEqual(to other: AnyEquatableBase) -> Bool { | |
fatalError("overrideMe") | |
} | |
} | |
class AnyEquatableBox<T: Equatable> : AnyEquatableBase { | |
let value: T | |
init(_ value: T) { self.value = value } |
Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.
My 3 developers team has just developed React.js application with 7668
lines of CSS (and just 2 !important
).
During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.
Here are main principles we use to write CSS for modern (IE11+) browsers:
/** | |
1. Install the Stylish(https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en) extension for Chrome. | |
2. Open up extension options and paste the whole CSS mentioned below. | |
3. Specify the domain name to be `github.com`. | |
4. Add a title and save. | |
*/ | |
.header { | |
padding-top: 10px; | |
padding-bottom: 10px; |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
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,
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');