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 random | |
| from time import time | |
| def binary_search(int_list: range, number: int) -> tuple[str | None, int]: | |
| """ | |
| Return index and number of iterations of a number in range | |
| RANDOM NUMBER 940_695_391 | |
| Time to complete: 0.0069141387939453125ms | |
| INDEX OF RANDOM NUMBER, ('940_695_391', 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
| """ | |
| Ensures only one instance runs migrations when multiple instances are spun up concurrently. | |
| This prevents a deadlock scenario. | |
| """ | |
| from django.core.management.base import CommandError | |
| from django.db import connection | |
| from django.core.management.commands.migrate import Command as MigrateCommand | |
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
| const validateDomain = (domain) => { | |
| const domainRegex = /^[A-Za-z0-9-]{1,63}(\.[A-Za-z0-9-]{1,63})*\.[A-Za-z]{2,6}$/mig; | |
| return domainRegex.test(domain) | |
| } |
OlderNewer