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 React, { useState } from "react"; | |
| import { StyleSheet, TouchableOpacity, Text } from "react-native"; | |
| import { RNCamera } from "react-native-camera"; | |
| export default Camera = () => { | |
| const [imageUri, setImageUri] = useState(null); | |
| takePicture = async () => { | |
| try { | |
| if (this.camera) { | |
| const options = { |
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 grpc = require("grpc"); | |
| const protoLoader = require("@grpc/proto-loader"); | |
| const PROTO_PATH = __dirname + "/proto/user.proto"; | |
| const packageDefinition = protoLoader.loadSync(PROTO_PATH, { | |
| keepCase: true, | |
| defaults: true, | |
| oneofs: true | |
| }); |
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
| syntax = "proto3"; | |
| service UserService { | |
| rpc createUser (User) returns (User) {} | |
| rpc getUserById (UserId) returns (User) {} | |
| } | |
| message User { | |
| int32 id = 1; | |
| string email = 2; |
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 grpc = require("grpc"); | |
| const protoLoader = require("@grpc/proto-loader"); | |
| const PROTO_PATH = __dirname + "/proto/user.proto"; | |
| const packageDefinition = protoLoader.loadSync(PROTO_PATH, { | |
| keepCase: true, | |
| defaults: true, | |
| oneofs: true, | |
| }); |
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
| function twoSum(nums: number[], target: number): number[] { | |
| let map = new Map(); | |
| for (let i = 0; i < nums.length; i++) { | |
| let complement = target - nums[i]; | |
| if (map.has(complement)) { | |
| return [map.get(complement), i]; | |
| } else { | |
| map.set(nums[i], i); |
OlderNewer