-
Install Flask
pip install flask -
Install firebase-admin
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 os | |
| import json | |
| import base64 | |
| import asyncio | |
| import websockets | |
| from fastapi import FastAPI, WebSocket, Request | |
| from fastapi.responses import HTMLResponse | |
| from fastapi.websockets import WebSocketDisconnect | |
| from twilio.twiml.voice_response import VoiceResponse, Connect, Say, Stream | |
| import boto3 |
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
| class Solution { | |
| public boolean isValidBST(TreeNode root) { | |
| return isValidBST(root, null, null); | |
| } | |
| /** | |
| The key to solving this problem is that, we use low and high values and not | |
| just depend on making sure that a particular node is greater than or less than its parent. | |
| */ | |
| public boolean isValidBST(TreeNode root, Integer low, Integer high) { |
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
| { | |
| "name": "Raghav", | |
| "gender": "", | |
| "email":"", | |
| "imageUrls":[ | |
| "", "", "" | |
| ], | |
| "tagsApplicable":["A", "B", "C"], | |
| "socialFootprint":{ | |
| "twitter":[ |
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
| interface Vehicle | |
| - double calculateCo2Emission(Trip t) | |
| class Car implements Vehicle | |
| - double calculateCo2Emission(Trip t) | |
| * valueFromHashMap * t.distanceInKm | |
| class Train implements Vehicle | |
| - double calculateCo2Emission(Trip t) | |
| * valueFromHashMap * t.distanceInKm | |
| class Bus implements Vehicle |
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 java.util.Scanner; | |
| import java.util.*; | |
| public class Main{ | |
| public static boolean checkPallindrome(int num){ | |
| int actualNum = num; | |
| int reverseNum = 0; |
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
| public String generateOrderId(OrderDetails orderDetails){ | |
| StringBuilder sb = new StringBuilder(); | |
| if(orderDetails.getIsOneDayDelivery().equals("Y") || orderDetails.getIsOneDayDelivery().equals("Yes")){ | |
| sb.append("#Y"); | |
| sb.append(String.valueOf((int)(orderDetails.getOrderedItemType().charAt(0)))); | |
| sb.append(String.valueOf((int)(orderDetails.getOrderedItem().charAt(0)))); | |
| } | |
| else{ |
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 requests | |
| def maskDataUpdate(): | |
| url = "localhost:5000/realtimeMask" | |
| payload = { | |
| "people_with_mask":20, | |
| "people_without_mask":14 | |
| } |
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 getFiles(){ | |
| return new Promise((resolve,reject)=> { | |
| exec("ls -la", (error, stdout, stderr) => { | |
| let fileNameArr = [] | |
| if(error){ | |
| console.log(`error : ${error.message}`); | |
| return; | |
| } | |
| if(stderr){ |
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 logo from './logo.svg'; | |
| import './App.css'; | |
| import React, { useState } from 'react'; | |
| function App() { | |
| const [tweets,setData] = useState([""]) | |
| const onclick = (e) => { | |
| const newData = [...tweets,""] |
NewerOlder