FirebaseAuth Implementation
Before you startThis article assumes you already have a firebase project with react-native-firebase/app installed. If you don’t know what it is, check the Getting Started section in their documents. [[React Native Firebase Documentation]](React Native Firebase | React Native Firebase (rnfirebase.io))
InstallationInstall the authentication module using yarn:
1yarn add @react-native-firebase/auth
or npm:
1npm install @react-native-firebase/auth
If you’re developing your app using iOS, rebuild th ...
React Native SVG
Using SVG (Scalable Vector Graphics) in React Native requires a bit of additional setup because React Native doesn’t support SVG out of the box. You can use SVGs in your React Native app by using a library like react-native-svg. This library provides SVG support for React Native and allows you to use SVG files or SVG code directly in your components.
InstallationNpm:
1npm install react-native-svg
Yarn:
1yarn add react-native-svg
Linking (for React Native versions < 0.60):
1react-native link ...
Firebase AdminSDK Setup
Before you start
Make sure you have installed Firebase CLI. You can do this by running npm install -g firebase-tools.
Firebase Project Initialized, if not, run firebase init and following the prompts to connect your local project to the Firebase project.
Get serviceAccountKey.jsonFind Service Account Tab
Go to the Firebase console:
Open your web and navigate to the Firebase Console.
Log in with your Google account if you’re not already logged in.
Navigate to the Service Account Tab:
Choose ...
Consensus Algorithm - Raft
All contents are modified and cite from the paper “In Search of an Understandable Consensus Algorithm (Extended Version)” by Diego Ongaro and John Ousterhout at Stanford University. It could be checked on the Raft consensus algorithm website. For a Chinese translate version, check 译 - In Search of an Understandable Consensus Algorithm (Extended Version) | 咕咕 (bugwz.com).
This only talk parts of the paper, for full version check paper directly!
IntroRaft is a consensus algorithm for managing a re ...
Leetcode 刷题前言
English?Click here
写在最前作为 Leetcode 刷题系列的前言,我想给大伙儿和我自己说明一下这个系列的目的和参考。大家如果点进这篇文章就说明大家其实都想通过 Leetcode 来提升自己的码字实力,我与大家一样也渴望通过刷题通过后面的面试,而记录在博客不单单是为了记录这过程中我的所做所想,同样还为了对未来的自己提供一个可以快速复习的资源。当然如果这些文章能给你们也带来帮助那更好,这也证明我的文笔没有想的那么烂哈哈哈哈😂
题组来自哪?很多人跟我一样在第一次接触 Leetcode 时对于该去刷哪道题完全没有头绪,在这里就要非常感谢这些将所有的题目进行过滤并进行排序组合的大佬们给后辈们铺好了路!资源有很多,但目前来说我将以 “代码随想录” 提供的刷题攻略进行练习,在这里再次感谢他们无私的奉献!!!
代码规范在刷题时,代码的规范性同样需要注意,这也是一个巩固自己代码规范的机会。很多人不屑于了解代码规范,将重心放在功能的实现上,这在未来大公司的小组里是非常致命的!不规范的代码会对后期的维护十分困难,也是公司招人的一个标准。
变量命名主流有三种:
小驼峰、大驼峰命名法
...
Algorithm Introduction
看不懂英文?点这里
AbstractThis series of posts are used to record how I learned and understand by algorithm practice on leetcode. Hopefully, these post would be a great review of what I learned, and might give you some advice on how to solve these questions.
Where they from? (Link at References)It is better to now what/which question should you take before we start doing them, or you will not know where to start, where to go next level. Thus, I found a GitHub repository about the leetcode que ...
CSE116的学习笔记-Lec3-6:Immutability
Just the Lecture Question!!!
Lecture QuestionRestriction:No state is allowed in this question. Specifically, the keyword “var” is banned
Question:In a package named “functions” write a class named VoteCounter with the following features:
Has a constructor that takes a List of Strings representing all votes that have been cast
A method named “castVote” that takes a String as a parameter representing a vote for a candidate and returns a new VoteCounter with this vote added to the List of votes
A ...
CSE116的学习笔记-Lec5-6:WebSocket_App
Chatting with Web SocketsThis is the last Lecture you need to take(without the expansion)
Clicker App
When the app starts
An actor system is created
A ClickerServer actor is added to the system
UpdateGames message is sent to the server at regular intervals
When a client connects and chooses a username
This username is sent to the server in a WebSocket message of type startGame
In response to receiving the gameStart message, the server:
Sends the client the game configuration in a ...
CSE116的学习笔记-Lec5-5:WebSocket_Clients
WebSocket ClientsTeach you how to write a clients:)
WebSocket Client - Scala
Another new library!
We’ll use the Scala / Java version of the socket.io client Library
Follows the same structure as the web client
Add to pom.xml and use maven to download
Included in examples repo
Import relavent code from the socket.io library
Use IO.socket to create a socket
Returns a reference to the created socket
Call connect() to connect to the server
1234567891011121314151617181920import io ...
CSE116的学习笔记-Lec5-4:WebSocket_Server
WebSocket ServerTeach you how to write a simple server:)
The Problem
In CSE115 you used HTTP request / responses to build web apps
If you wanted more data from the server after the page loads, you used AJAX
Server hosts JSON data at certain end points
Client makes an AJAX call to retrieve the most current data
But the server has to wait for a request before sending a response
What if the server wants to send time-sensitive data without waiting for a request?
In CSE115
Built a chat app ...