WIP
How to understand radix: A tutorial for students of systems engineering
Note the binary number 0010
. Binary is read RTL or right-to-left.
WIP
The maybe/optional data types in functional languages such as Haskell and Scala have ways to handle null/undefined that are often superior to using validation, conditionals and operators to infer whether or not a value is nullish.
That's what optional chaining and null coalescing remind me of. They're also a replacement for usage of Lodash .get() method which allows for default values to be set in the last parameter, hence handling nullish value use cases.
Rather than using something.property.anotherproperty
, which can error (and hence crash your program/web page) if it encounters a nullish value for one of the properties, we use something?.property?.anotherproperty
instead, which only returns undefined
(instead of an error) if a nullish value is encountered in one of the properties.
This workflow is outside of the "git pull -r origin branchName" workflow we use for rebases without merge commmits. This workflow is just to squash commits on a local/unshared branch. Keep in mind that "rewriting history can make teammates sad, angry or worse" standard warnings about rebasing.
git rebase -i hash123-everything-after-this-commit
You may have seen a couple of different ways to handle React PropTypes.
/* To upgrade a repo from using only thunks, to using sagas and thunks, | |
1. Create a dummy saga | |
2. Add in Saga middleware to store configuration, and start/run sagas from store config | |
3. Test sagas (generators with generator.next() { value: someValue, done: false } until { ... done: true } | |
4. Since thunks and sagas can live together in the same repo, you can now move forward with handling async side effects | |
with new code by using sagas (and being able to test them), and slowly migrate your legacy thunks over to sagas over time. | |
*/ | |
// 1. rootSaga.js |
The majority of blogs and documentation about git are one of two things:
OR
/* JavaScript Iterators | |
Strings as data source; for of and spread operator as data consumers | |
Strings can be consumed as iterables using the spread operator. | |
Note that strings will be parsed according to code points, not by character, | |
and so num characters parsed will be somewhat nondeterministic. | |
Sources: | |
1 - Axel Rauschmeyer: http://exploringjs.com/es6/ch_iteration.html | |
2 - http://www.zsoltnagy.eu/es6-iterators-and-generators-in-practice/ |
/* JavaScript Iterators | |
Sets and Maps | |
Sets and Maps can be made Iterable/Iterator by using the methods .entries(), .keys(), | |
values(), and/or via for of construct. | |
A Set is a unique (non repeated) version of a Bag data structure. Characteristic equation | |
is contains() or has(). | |
A Map (in JS) is a key-value pair data structure, unordered (in order of insertion). |
/* JavaScript Iterators | |
An Iterator Object is a data structure that has a .next() method that can be called repeatedly. | |
Iterators use the Well Known Symbol called Symbol.iterator. | |
(The Iterable Object has an Iterator pointer for indexing.) | |
The Iterator object has two properties, value and done (boolean). Iteration will continue so | |
long as done is falsey. Once done is truthy, iteration stops. | |
Just like C++ iterators for C++ data structures, JavaScript iterators iterate through an entire |
/* Well Known Symbols : Symbol.hasinstance | |
sources: | |
1 - https://www.keithcirkel.co.uk/metaprogramming-in-es6-symbols/ | |
2 - http://exploringjs.com/es6/ch_symbols.html | |
3 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof | |
4 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance | |
Well Known Symbols are Reflection via implementation in ES6. | |
Reflection in Metaprogramming: observing low level internals of a programming language/program. |