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); |
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
| 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
| import React, { useState } from "react"; | |
| import { StyleSheet, TouchableOpacity, Text, ImageBackground } 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
| --Os seguintes esquemas serão utilizados como base para a resolução desta prova. Chaves primárias estão | |
| --sublinhadas e chaves estrangeiras estão em itálico. | |
| --Customers (CustomerID, CompanyName, ContactName, Address, City, Region, Country, Phone, Fax) | |
| --Employees (EmployeeID, LastName, FirstName, BirthDate, HireDate, Address, City, Region, Country) | |
| --Orders (OrderID, CustomerID, EmployeeID, OrderDate, ShippedDate) | |
| --Order Details (OrderID, ProductID, UnitPrice, Quantity, Discount) | |
| --Products (ProductID, ProductName, SupplierID, CategoryID, UnitPrice, UnitsInStock, ReorderLevel, | |
| --Discontinued) | |
| --Suppliers (SupplierID, CompanyName, ContactName, Address, City, Region, Country, Phone, Fax, | |
| --HomePage) |
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
| --Customers (CustomerID, CompanyName, ContactName, Address, City, Region, Country, Phone, Fax) | |
| --Employees (EmployeeID, LastName, FirstName, BirthDate, HireDate, Address, City, Region, Country) | |
| --Orders (OrderID, CustomerID, EmployeeID, OrderDate, ShippedDate) | |
| --Order Details (OrderID, ProductID, UnitPrice, Quantity, Discount) | |
| --Products (ProductID, ProductName, SupplierID, CategoryID, UnitPrice, UnitsInStock, ReorderLevel, | |
| --Discontinued) | |
| --Suppliers (SupplierID, CompanyName, ContactName, Address, City, Region, Country, Phone, Fax, | |
| --HomePage) | |
| --Categories (CategoryID, CategoryName, Description, Picture) |
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
| exports.get = async() => { | |
| return await User.find({}, 'name email'); | |
| } | |
| exports.getById = async(id) => { | |
| return await User.findById(id, 'name email'); | |
| } | |
| exports.create = async(data) => { | |
| const user = new User(data); |
NewerOlder