A nice way to avoid the options
parameter so often used
function frob(arg1, arg2, {foo = defFoo, bar = defBar, baz = defBaz}) {
// just use foo, bar, and baz instead of ops.foo, etc.
}
A nice way to avoid the options
parameter so often used
function frob(arg1, arg2, {foo = defFoo, bar = defBar, baz = defBaz}) {
// just use foo, bar, and baz instead of ops.foo, etc.
}
Sometimes npm will turn very slow out and not install anything.
It seems to have something to do with using npm on a docker VM.
The fix for me was
npm cache clean
followed by
use arrays or vectors
capable of being acted on
what, not how
a way of organizing data so that it can be used efficiently
A structure utilizing value, physical, and representational relationships to encode sematic relationships on a collection of objects / Sean Parent
John Carmack Oculus Connect 2 Keynote
"In the end, there are problems that compilers can't fix" (referring to communication between humans)
"The more you optimize something the less you can modify it"
Jose Aguinaga "How it feels to learn JavaScript in 2016"
"I need to display data on a page, not perform Sub Zero’s original MK fatality."
Kevlin Henney "Simplicity Before Generality , Use Before Reuse"
import * as React from 'react' | |
import { Redirect, RedirectProps } from 'react-router' | |
interface DelayedProps { | |
delay: number | |
} | |
interface DelayedState { | |
timeToRedirect: boolean | |
} |
Since you can only pass a pointer to an array - and not the array itself - as an argument to a function in C, the information regarding the length of the array is lost. While you can derrive the length with something like sizeof(arr) / sizeof(int)
, that is a run-time operation and quite ugly.
There are other data structures, such as std::vector, that solves this problem, but it comes with a lot of other aspects, such as dynamic memory allocation, that you might not be interested in.
This gist provides a super simple implementation of an array of a fixed size that is not dynamically allocated but has its length as a property. Just like a normal array, it allows indexed element read and write operations, but nothing more.