If we make a change, like add a property to the domain model, we have to make the same change for every use case of that model, and there could be n more use cases. We would also add m validations for that property - so one change could result in n x m changes.
- Mutexes communicate by shared memory, channels share memory by communication
- sources:
The choice between unbuffered and buffered channels, and the choice of a buffered channel's capacity, may both affect the correctness of a program.
What is MutableRefObject
in TypeScript?
A MutableRefObject
is the type of a ref that is returned from useRef
in React.
- Soft inset:
box-shadow: inset 0 2px 4px 0 hsla(0,0%,0%,.2)
- Transparent:
box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.1)
- Soft shadow 1:
box-shadow: 0 1px 3px hsla(0, 0%, 0%, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08);
- Soft shadow 2:
box-shadow: 0 5px 15px 0 hsla(0,0%,0%,0.15)
- By default, all elements are
position:static
. This means the element will be positioned according to the order in the HTML structure.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
- Inventor of Piece Table == J Strother Moore, the inventor of the boyer-moore string search algorithm
Big Idea: Piece Table encoded as a Splay tree for large file edits
A splay tree is useful because it provides efficient lookup for workloads with high locality.
Demonstrates the tradeoffs of representing edits as a list v. as a splay tree
Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.
All files were downloaded from https://cdnjs.com and named accordingly.
Output from ls
command is stripped out (irrelevant stuff)
$ ls -lhS
566K Jan 4 22:03 angular2.min.js
- a Content Delivery Network (CDN). A CDN delivers content through nodes (data centers) that are globally distributed
- When a user requests content that we're serving from CloudFront (our application), the user is routed to the edge location that provides the lowest latency
- User requests content and is routed to the nearest CDN -> low latency, best performance
- If the content is not at the edge location (content DNE at node) CloudFront retrieves the content from the origin we define (our S3 bucket)
- For headers
Redis is Database whereas RabbitMQ was designed as a message router or message-orientated-middleware (mom), so I'm sure if you look for benchmarks, you'll find that RabbitMQ will outperform Redis when it comes to message routing.
RabbitMQ is written in Erlang which was specifically designed by the telecom industry to route messages, you get clustering out of the box due to it being written in Erlang which means in a clustered environment, RabbitMQ will outperform Redis even further.
Furthermore, you get guaranteed delivery of messages due to the AMQP protocol, in other words, if the network drops while consuming the message, the consumer won't be able to say thanks for the message, so the consumer will drop the message and Rabbit will requeue the message, if you publish a message and the queue didn't say thanks to the publisher due to network problems or timeouts, Rabbit will drop the message and the publisher will keep on trying to publish the message. You can have publish retries with backoff policies, so