In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and
returning the cached result when the same
inputs occur again.
— wikipedia
| export const getRawWord = (type) => | |
| ({ | |
| undefined: "`${[![]][!![] + ![]]}`", | |
| true: "([] + !![])", | |
| false: "([] + ![])", | |
| object: "`${{}}`", | |
| }[type]); | |
| export const getCharacter = (char) => | |
| ({ |
| import firebase from 'firebase/app'; | |
| import 'firebase/messaging'; | |
| import { useEffect, useRef } from 'react'; | |
| import config from '../config'; | |
| import firebaseConfig from './firebaseConfig'; | |
| import { PushTokenAddMutation } from './__generated__/PushTokenAddMutation.graphql'; | |
| import { PushTokenAdd, USER_PUSHENDPOINT_TYPE } from './PushTokenAddMutation'; |
1 - Se está difícil, provavelmente tem algo errado, o código deveria ser mais fácil de codificado e lido.
2 - Você é seu melhor termômetro, se algo não te agrada é provável que precise refatorar, tal qual o item 1.
3 - Se o erro não faz sentido, provavelmente é algum typo, refaça todos os passos com bastante atenção.
4 - Tenha preferência em fazer funcionar com um código com a maior qualidade possível dentro do prazo dado, tendo feito um código que funcione, refatore (siga o TDD e o Make it works, Make it Beauty).
5 - É tudo sobre responsabilidades, clareza e objetividade, isso é orientação a objetos, isso é SOLID.
6 - Testes foram feitos para quebrar, isso é que te dá segurança sobre o que você está desenvolvendo. Se o teste não falha com a sua alteração no código, pode ser que o teste não esteja testando o que deve.
7 - O código é apenas um sintoma, um reflexo de você e ou ambiente em que
| import { addMiddleware } from 'graphql-add-middleware'; | |
| addMiddleware(schema, traceResolveMiddleware); |
- Básico: Complexidade: (https://en.wikipedia.org/wiki/Time_complexity)
- How Quantum Computers Break Encryption | Shor's Algorithm Explained (https://www.youtube.com/watch?v=lvTqbM5Dq4Q)
- How to Make Sense of Google’s Quantum Supremacy Claim (https://www.extremetech.com/extreme/300987-googles-quantum-supremacy-paper-tldr-edition)
- The Extreme Physics Pushing Moore’s Law to the Next Level (https://www.youtube.com/watch?v=f0gMdGrVteI)
- Graphene Processors and Quantum Gates (https://www.youtube.com/watch?v=VLPpDoMBVK0)
- How Quantum Computers Break Encryption | Shor's Algorithm Explained (https://www.youtube.com/watch?v=lvTqbM5Dq4Q)
- How Shor's Algorithm Factors 314191 (https://www.youtube.com/watch?v=FRZQ-efABeQ)
- How Does a Quantum Computer Work? (https://www.youtube.com/watch?v=g_IaVepNDT4)
- What is Quantum Mechanical Spin? (https://www.youtube.com/watch?v=v1_-LsQLwkA)
- Secret Key Exchange (Diffie-Hellman) - Computerphile (https://www.youtube.com/watch?v=NmM9HA2MQGI)
| //component | |
| <Dropzone | |
| onDrop={async acceptedFiles => { | |
| if (acceptedFiles.length > 1) { | |
| toaster.warning("Limite 1 imagem"); | |
| return; | |
| } | |
| const files = []; | |
| for (const file of acceptedFiles) { |
| { | |
| "env": { | |
| "browser": true, | |
| "es6": true, | |
| "jest": true | |
| }, | |
| "settings": { | |
| "react": { | |
| "version": "detect" | |
| } |
| import { useContext } from 'react'; | |
| import { __RouterContext, RouteComponentProps } from 'react-router-dom'; | |
| export const useRouter = <TParams = {}>() => { | |
| return useContext(__RouterContext) as RouteComponentProps<TParams>; | |
| }; |
| import { useRouter } from 'react-router-dom'; | |
| export const useSafeGoBack = (alternativePath: string) => { | |
| const { history } = useRouter(); | |
| const goBack = () => { | |
| if (history.length > 2) { | |
| history.goBack(); | |
| return; | |
| } |