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
| """Run a Monte Carlo simulation to validate the lottery example.""" | |
| import random | |
| from lottery import winner, PEOPLE | |
| def simulate(runs, f=winner, arg=PEOPLE): | |
| """Simulate function f with argument arg with number of given runs.""" | |
| # Store the number of results in a dict. | |
| result_counts = {} # this is a dict |
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
| model-service: | |
| image: x86_64/cassava-model-service:0.8.1 | |
| container_name: model-service | |
| environment: | |
| MODEL_NAME: saved_model | |
| networks: | |
| - pred-network |
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
| %%writefile app.py | |
| import pickle | |
| import streamlit as st | |
| # loading the trained model | |
| pickle_in = open('classifier.pkl', 'rb') | |
| classifier = pickle.load(pickle_in) | |
| @st.cache() |
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
| # Scanner i2c en MicroPython | MicroPython i2c scanner | |
| # Renvoi l'adresse en decimal et hexa de chaque device connecte sur le bus i2c | |
| # Return decimal and hexa adress of each i2c device | |
| # https://projetsdiy.fr - https://diyprojects.io (dec. 2017) | |
| import machine | |
| i2c = machine.I2C(scl=machine.Pin(5), sda=machine.Pin(4)) | |
| print('Scan i2c bus...') | |
| devices = i2c.scan() |
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
| /* Sample data */ | |
| insert into emp (EMPID, NAME, JOB, SALARY) | |
| values | |
| (201, 'ANIRUDDHA', 'ANALYST', 2100), | |
| (212, 'LAKSHAY', 'DATA ENGINEER', 2700), | |
| (209, 'SIDDHARTH', 'DATA ENGINEER', 3000), | |
| (232, 'ABHIRAJ', 'DATA SCIENTIST', 2500), | |
| (205, 'RAM', 'ANALYST', 2500), | |
| (222, 'PRANAV', 'MANAGER', 4500), | |
| (202, 'SUNIL', 'MANAGER', 4800), |
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 createRTCPeerConnection(){ | |
| connection = new RTCPeerConnection(configuration); | |
| // Add both video and audio tracks to the connection | |
| for (const track of localStream.getTracks()) { | |
| log("Sending Stream.") | |
| existingTracks.push(connection.addTrack(track, localStream)); | |
| } | |
| // This event handles displaying remote video and audio feed from the other peer |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>WebRTC Video Chat</title> | |
| <style> | |
| #videoContainer { |
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 createAndSendOffer(){ | |
| if(channel){ | |
| channel.close(); | |
| } | |
| // Create Data channel | |
| channel = connection.createDataChannel('channel', {}); | |
| setChannelEvents(channel); | |
| // Create Offer |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| ...... | |
| @override | |
| Widget build(BuildContext context) { | |
| String bgImage = now.hour > 6 && now.hour < 19 ? "assets/day.png" : "assets/night.jpg"; | |
| return Scaffold( | |
| body: Container( | |
| decoration: BoxDecoration( | |
| image: DecorationImage( |
NewerOlder