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
""" | |
Given an array of objects representing ingredients (each with a name and amount per serving), and a target number of servings, write a function to calculate the required amount of each ingredient for the target servings. Return the results as an array of objects with name and amount. Can you do this in less than 5 lines? In one? | |
Example: | |
const ingredients = [ | |
{ name: "flour", amount: 200 }, // 200g per | |
{ name: "sugar", amount: 100 }, // 100g per | |
{ name: "eggs", amount: 2 } // 2 eggs per | |
]; | |
const targetServings = 3; |
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
NATO_DICTIONARY = { | |
"A": "Alpha", | |
"B": "Bravo", | |
"C": "Charlie", | |
"D": "Delta", | |
"E": "Echo", | |
"F": "Foxtrot", | |
"G": "Golf", | |
"H": "Hotel", | |
"I": "India", |
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
1 | |
00:00:00,000 --> 00:00:24,000 | |
It's a simple game. You have 15 players. Give one of them the ball. Get it into the net. | |
2 | |
00:00:24,000 --> 00:00:26,000 | |
Very simple. Isn't it? | |
3 | |
00:00:26,000 --> 00:00:31,000 |
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
""" | |
Datastructures | |
1. Tuple | |
2. List | |
3. Set | |
4. Dictionary | |
5. Class | |
""" | |
import datetime |
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
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, | |
especially safe concurrency. | |
Rust is syntactically similar to C++, but can guarantee memory safety by using a borrow checker to validate references. | |
Rust achieves memory safety without garbage collection, and reference counting is optional. | |
Rust has been called a systems programming language and in addition to high-level features | |
such as functional programming it also offers mechanisms for low-level memory management. | |
First appearing in 2010, Rust was designed by Graydon Hoare at Mozilla Research, with contributions from | |
Dave Herman, Brendan Eich, and others. | |
The designers refined the language while writing the Servo experimental browser engine |
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
Python is an interpreted high-level general-purpose programming language. | |
Its design philosophy emphasizes code readability with its use of significant indentation. | |
Its language constructs as well as its object-oriented approach aim to help programmers write clear, | |
logical code for small and large-scale projects. | |
Python is dynamically-typed and garbage-collected. | |
It supports multiple programming paradigms, including structured (particularly, procedural), | |
object-oriented and functional programming. It is often described as a "batteries included" language | |
due to its comprehensive standard library. |
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
[tool.poetry] | |
name = "flask-sqlalchemy" | |
version = "0.0.1" | |
description = "" | |
authors = ["kracekumar <>"] | |
license = "MIT" | |
readme = "" | |
repository = "" | |
[tool.poetry.dependencies] |
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 tweepy | |
import json | |
from sqlite_utils import Database | |
def authenticate(): | |
# twitter API credentials | |
cred = json.load(open('.cred.json', 'r')) | |
auth = tweepy.OAuthHandler(consumer_key=cred['api_key'], consumer_secret=cred['api_secret_key']) | |
auth.set_access_token(key=cred['access_token'], secret=cred['access_token_secret']) | |
api = tweepy.API(auth) |
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
{ | |
"cropHintsAnnotation": { | |
"cropHints": [ | |
{ | |
"boundingPoly": { | |
"vertices": [ | |
{ | |
"x": 89 | |
}, | |
{ |
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 torch | |
import torch.nn.functional as F | |
import torchvision | |
import torchvision.models as models | |
import mlflow | |
import mlflow.pytorch | |
import numpy as np | |
class Model(mlflow.pyfunc.PythonModel): |
NewerOlder