- Background
- What is replication and why we need it
- Replication definition
- How it helps
- Master slave architecture
- Overview
- Why we use it? -> HA, scale read performance, simpler than multi read multi write
- What is replication and why we need it
- Master slave replication
- A simplistic approach
- List steps:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.tuhuynh.tradebot; | |
| import java.util.Arrays; | |
| import java.util.HashMap; | |
| import java.util.HashSet; | |
| import java.util.Map; | |
| import java.util.regex.Pattern; | |
| public class Main { | |
| private static final Map<String, Boolean> testMap = new HashMap<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"debt":-0.004999999999881766,"logs":[{"date":"11/04/2021 11:46:55","num":-3.6,"reason":"cơm trưa","reporter":"Tú"},{"date":"11/02/2021 12:19:00","num":-4.8,"reason":"cơm trưa dbrr","reporter":"Tú"},{"date":"11/01/2021 22:35:10","num":6.5,"reason":"cơm trưa + vim","reporter":"Lâm"},{"date":"11/01/2021 20:54:40","num":1257.45,"reason":"tiền nhà","reporter":"Lâm"},{"date":"11/01/2021 20:51:51","num":-1278.5,"reason":"tiền nhà tháng 11","reporter":"Tú"},{"date":"10/31/2021 16:28:00","num":7.1,"reason":"cơm chiên","reporter":"Lâm"},{"date":"10/29/2021 19:56:42","num":-8.5,"reason":"cơm tối ấn đụ","reporter":"Tú"},{"date":"10/29/2021 17:58:38","num":7.1,"reason":"cơm sườn","reporter":"Lâm"},{"date":"10/29/2021 12:58:16","num":4.5,"reason":"cơm trưa hqua","reporter":"Lâm"},{"date":"10/26/2021 20:59:51","num":-12,"reason":"cơm tối","reporter":"Tú"},{"date":"10/26/2021 12:12:41","num":-4.8,"reason":"cơm trưa dbrr","reporter":"Tú"},{"date":"10/25/2021 11:30:20","num":8.1,"reason":"cơm trưa","reporter":"Lâm"},{"date":" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const operators = ['=', '+', '-', '*', '/', '>', '<', '>=', '<=', '==', '!='] | |
| function isOp(v: string) { | |
| for (let i = 0; i < operators.length; i++) { | |
| if (operators[i] == v) return true | |
| } | |
| return false | |
| } | |
| function isNum(v: any) { |
Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)
Bài viết cung cấp chi tiết về cách mà React render hoạt động, và việc sử dụng Context và Redux ảnh hưởng thế nào tới quá trình render của React.
Rendering is the process of React asking your components to describe what they want their section of the UI to look like, now, based on the current combination of props and state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tap "graalvm/tap" | |
| tap "homebrew/bundle" | |
| tap "homebrew/cask" | |
| tap "homebrew/cask-fonts" | |
| tap "homebrew/cask-versions" | |
| tap "homebrew/core" | |
| cask "adoptopenjdk8" | |
| brew "autojump" | |
| brew "cloc" | |
| brew "deno" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const axios = require('axios'); | |
| const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Imh1eW5obWluaHR1ZnVAZ21haWwuY29tIiwibmlja25hbWUiOiJEYXJrbG9yZCIsImlhdCI6MTU4NDAwMTcxMCwiZXhwIjoxNTg0MDg4MTEwfQ.9FOV-LJMDuFfwFpQV3Kw1vXvK4alJnuzw9MLmA23HCg'; | |
| async function calAvgProcess(numberOfPosts, token) { | |
| const { data } = await axios.get('https://api.fuhcm.com/api/v1/confessions?load=' + numberOfPosts, { | |
| headers: { | |
| 'authorization': 'Bearer ' + token, | |
| }, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "container/list" | |
| "encoding/json" | |
| "errors" | |
| "log" | |
| "math/rand" | |
| "net/http" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| call plug#begin('~/.config/nvim/bundle') | |
| Plug 'rking/ag.vim' | |
| Plug 'ryanoasis/vim-devicons' | |
| Plug 'herringtondarkholme/yats.vim' | |
| Plug 'styled-components/vim-styled-components', { 'branch': 'main' } | |
| Plug 'Yggdroot/indentLine' | |
| "Plug 'yuttie/comfortable-motion.vim' | |
| Plug 'scrooloose/nerdtree' | |
| Plug 'alvan/vim-closetag' | |
| Plug 'honza/vim-snippets' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { db } from "@models"; | |
| async function pair() { | |
| try { | |
| const matchingCollection = db.collection("matchings"); | |
| const notMatchedArr = await matchingCollection | |
| .find({ | |
| matched: false | |
| }) |