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
| WITH total_transaction_amount AS (SELECT DATE(transaction_time) AS transaction_date, SUM(transaction_amount) AS date_total FROM transactions | |
| WHERE transaction_time BETWEEN '2021-01-29' AND '2021-02-01' | |
| GROUP BY DATE(transaction_time)) | |
| SELECT rolling_3_day_transaction_average AS jan_31_rolling_3_day_avg FROM | |
| (SELECT transaction_date, date_total, AVG(date_total) OVER(ORDER BY transaction_date ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) | |
| AS rolling_3_day_transaction_average | |
| FROM total_transaction_amount) AS rolling_avg | |
| WHERE transaction_date = '2021-01-31'; |
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 concurrent.futures as cf | |
| import logging | |
| import math | |
| import numpy as np | |
| import time | |
| import threading | |
| logger_format = '%(asctime)s:%(threadName)s:%(message)s' | |
| logging.basicConfig(format=logger_format, level=logging.INFO, datefmt="%H:%M:%S") |
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 concurrent.futures as cf | |
| import logging | |
| import math | |
| import numpy as np | |
| import time | |
| import threading | |
| logger_format = '%(asctime)s:%(threadName)s:%(message)s' | |
| logging.basicConfig(format=logger_format, level=logging.INFO, datefmt="%H:%M:%S") |
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 concurrent.futures as cf | |
| import logging | |
| import time | |
| import threading | |
| LOCK = threading.Lock() | |
| logger_format = '%(asctime)s:%(threadName)s:%(message)s' | |
| logging.basicConfig(format=logger_format, level=logging.INFO, datefmt="%H:%M:%S") |
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 asyncio | |
| async def foo(): | |
| await boo() | |
| async def boo(): | |
| await foo() | |
| async def main(): | |
| await asyncio.gather(*[foo(), boo()]) |
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 asyncio | |
| import logging | |
| import time | |
| logger_format = '%(asctime)s:%(threadName)s:%(message)s' | |
| logging.basicConfig(format=logger_format, level=logging.INFO, datefmt="%H:%M:%S") | |
| class DbUpdate: | |
| def __init__(self): | |
| self.value = 0 |
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 concurrent.futures as cf | |
| import logging | |
| import time | |
| logger_format = '%(asctime)s:%(threadName)s:%(message)s' | |
| logging.basicConfig(format=logger_format, level=logging.INFO, datefmt="%H:%M:%S") | |
| class DbUpdate: | |
| def __init__(self): | |
| self.value = 0 |
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 asyncio | |
| import logging | |
| import time | |
| logger_format = '%(asctime)s:%(threadName)s:%(message)s' | |
| logging.basicConfig(format=logger_format, level=logging.INFO, datefmt="%H:%M:%S") | |
| num_word_mapping = {1: 'ONE', 2: 'TWO', 3: "THREE", 4: "FOUR", 5: "FIVE", 6: "SIX", 7: "SEVEN", 8: "EIGHT", | |
| 9: "NINE", 10: "TEN"} |
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 concurrent.futures as cf | |
| import logging | |
| import time | |
| logger_format = '%(asctime)s:%(threadName)s:%(message)s' | |
| logging.basicConfig(format=logger_format, level=logging.INFO, datefmt="%H:%M:%S") | |
| num_word_mapping = {1: 'ONE', 2: 'TWO', 3: "THREE", 4: "FOUR", 5: "FIVE", 6: "SIX", 7: "SEVEN", 8: "EIGHT", | |
| 9: "NINE", 10: "TEN"} |
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 asyncio | |
| import logging | |
| import time | |
| logger_format = '%(asctime)s:%(threadName)s:%(message)s' | |
| logging.basicConfig(format=logger_format, level=logging.INFO, datefmt="%H:%M:%S") | |
| num_word_mapping = {1: 'ONE', 2: 'TWO', 3: "THREE", 4: "FOUR", 5: "FIVE", 6: "SIX", 7: "SEVEN", 8: "EIGHT", | |
| 9: "NINE", 10: "TEN"} |
NewerOlder