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
def get_youtube_url(artist, song): | |
r = requests.get('https://www.youtube.com/results', params={'search_query': '{} {} official music video'.format(artist, song)}) | |
soup = BeautifulSoup(r.text) | |
videos = soup.findAll('a', {'class': 'yt-uix-tile-link'}) | |
while not videos[0]['href'].startswith('/'): | |
videos = videos[1:] | |
return 'https://www.youtube.com/' + videos[0]['href'] |
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
#include <iostream> | |
int main() { | |
int a = 0; | |
int b = 7; | |
int& aRef = a; | |
int& bRef = b; | |
aRef = bRef; | |
std::cout << a << " " << b << std::endl; |
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
class MessageIterator: | |
''' | |
Async iterator for messages received. | |
Only necessary as a separate class since async generators won't be introduced until 3.6 | |
''' | |
def __init__(self, redis_conn, channel_name): | |
self.redis_conn = redis_conn # redis_conn can also be a pool, they have the same api | |
self.channel_name = channel_name | |
self.subscriber = None |
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
Aggregate (cost=40095.76..40095.77 rows=1 width=0) | |
-> Hash Join (cost=16470.62..40095.40 rows=145 width=0) | |
Hash Cond: ((c.tract_id)::text = (((g.state)::text || (g.county)::text) || (g.tract)::text)) | |
-> Hash Join (cost=47.98..23660.40 rows=10 width=52) | |
Hash Cond: ((t.geoid)::text = (c.tract_id)::text) | |
-> Seq Scan on tract t (cost=0.00..23334.33 rows=74133 width=12) | |
-> Hash (cost=47.85..47.85 rows=10 width=40) | |
-> Seq Scan on tractcache c (cost=0.00..47.85 rows=10 width=40) | |
Filter: ((metro_id)::text = '348'::text) | |
-> Hash (cost=16386.46..16386.46 rows=2895 width=56) |