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
#!/usr/bin/env python | |
# coding: utf-8 | |
# In[1]: | |
import cv2 | |
import numpy as np | |
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: | |
vector<bool> ap; | |
int maxReq = 0; | |
int maximumRequests(int n, vector<vector<int>>& requests) { | |
int res = 0; | |
for (auto it = requests.begin(); it != requests.end();) { | |
if ((*it)[0] == (*it)[1]) { | |
it = requests.erase(it); | |
res++; |
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
# coroutine | |
import asyncio | |
import aiohttp | |
import aiofile | |
# set up coroutine | |
loop = asyncio.new_event_loop() | |
asyncio.set_event_loop(loop) | |
# get tasks | |
tasks = [] | |
for index, img_url in enumerate(img_url_list): |
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
# Install a conda package in the current Jupyter kernel | |
import sys | |
!conda install --yes --prefix {sys.prefix} numpy | |
# url: https://jakevdp.github.io/blog/2017/12/05/installing-python-packages-from-jupyter/#How-to-use-Conda-from-the-Jupyter-Notebook |