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
from typing import Iterable, TypeVar | |
T = TypeVar("T") | |
def first(items: Iterable[T], pred: callable) -> T | None: | |
return next((i for i in items if pred(i)), 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
IF OBJECT_ID (N'[ts_round_base]', N'FN') IS NOT NULL | |
DROP FUNCTION ts_round_base; | |
GO | |
CREATE FUNCTION [dbo].[ts_round_base](@ts datetime, @secs_delta int) | |
RETURNS DATETIME | |
AS | |
-- ============================================= | |
-- Author: Arthur Harduim | |
-- Description: DATETIME rounding function | |
-- |
OlderNewer