This file contains 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
1. https://ops.tips/blog/sending-files-via-grpc/ | |
2. https://bbengfort.github.io/programmer/2017/03/03/secure-grpc.html | |
3. https://grpc.io/docs/tutorials/basic/node/ |
This file contains 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
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
type Promise struct { | |
successChannel chan interface{} | |
failureChannel chan error |
This file contains 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
package main | |
import ( | |
"crypto/rand" | |
"encoding/binary" | |
"log" | |
"net/http" | |
) | |
// GenerateUint64 - generate a random uint64 |
This file contains 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
#!/usr/bin/env python3 | |
import asyncio | |
import time | |
async def count(): | |
print("One") | |
await asyncio.sleep(1) | |
print("Two") |
This file contains 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 asyncio | |
from aiohttp import web | |
from asyncnsq import create_reader | |
from asyncnsq.utils import get_logger | |
# Handle request | |
async def handle_echo(reader, writer): | |
data = await reader.read(100) | |
message = data.decode() | |
addr = writer.get_extra_info('peername') |
This file contains 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
'use strict'; | |
/** | |
For full repo go to: | |
https://github.com/doron2402/simple-upload-files | |
**/ | |
const http = require('http'); | |
const uploaderRoute = require('./routes/uploader'); | |
const formRoute = require('./routes/form'); | |
const notFoundRoute = require('./routes/notFound'); |
This file contains 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
package main | |
import "fmt" | |
type person struct { | |
firstName string | |
lastName string | |
age float32 | |
id int | |
} |
This file contains 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
# Polynomial Regression | |
# Number Of Vodka Shots Vs Tip | |
dataset = read.csv('./shots_tip.csv') | |
# Let's fit the data to a Linear Regression Model | |
linear_regressor = lm(formula = Tip ~ NumberOfShots, | |
data = dataset) | |
This file contains 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
NumberOfShots | Tip | |
---|---|---|
1 | 2 | |
2 | 3 | |
4 | 5 | |
5 | 9 | |
6 | 14 | |
7 | 18 | |
8 | 25 | |
9 | 42 | |
10 | 100 |
This file contains 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
# Multiple Linear Regression | |
# Importing the dataset | |
dataset = read.csv('tip.csv') | |
# Encoding categorical data, in this case country | |
dataset$Country = factor(dataset$Country, | |
levels = c('USA', 'England', 'France', 'Israel', 'Italy'), | |
labels = c(1, 2, 3, 4, 5)) |