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
| using System.Collections.Generic; | |
| using System.Linq; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Jobs; | |
| namespace DanielDoesBenchmarks | |
| { | |
| [SimpleJob(RuntimeMoniker.Net472, baseline: true)] | |
| public class ListBenchmarks | |
| { |
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
| git log --shortstat --pretty="%cE" | sed 's/\(.*\)@.*/\1/' | grep -v "^$" | awk 'BEGIN { line=""; } !/^ / { if (line=="" || !match(line, $0)) {line = $0 "," line }} /^ / { print line " # " $0; line=""}' | sort | sed -E 's/# //;s/ files? changed,//;s/([0-9]+) ([0-9]+ deletion)/\1 0 insertions\(+\), \2/;s/\(\+\)$/\(\+\), 0 deletions\(-\)/;s/insertions?\(\+\), //;s/ deletions?\(-\)//' | awk 'BEGIN {name=""; files=0; insertions=0; deletions=0;} {if ($1 != name && name != "") { print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net"; files=0; insertions=0; deletions=0; name=$1; } name=$1; files+=$2; insertions+=$3; deletions+=$4} END {print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net";}' |
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 importlib | |
| import logging | |
| import os | |
| import shutil | |
| from bentoml.exceptions import InvalidArgument, MissingDependencyException | |
| from bentoml.service.artifacts import BentoServiceArtifact | |
| from bentoml.service.env import BentoServiceEnv | |
| logger = logging.getLogger(__name__) |
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
| from typing import List, Tuple | |
| from azure.cli.core import get_default_cli # requires `pip install azure-cli-core` | |
| from tqdm import trange # requires `pip install tqdm`, can be removed | |
| DEFAULT_RG = "resource_group" | |
| NAME_FORMAT = "app0storage{0}" | |
| SA_PREFIX_ARGS = ["storage", "account"] | |
| GENERATE_SAS_DEFAULT_ARGS = ["--expiry", "2023-01-01", "--services", "ftqb", "--resource-types", "sco" ,"--permissions" ,"cdlruwap"] | |
| class StorageAccountCreator: |
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
| from typing import Tuple, List | |
| # pip install sqlparse | |
| import sqlparse | |
| # https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/ | |
| SQL_TYPE_TO_KQL_TYPE = { | |
| 'int': 'int', | |
| 'varchar': 'string', | |
| 'datetime': 'datetime', | |
| 'bool': 'bool' |
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
| from typing import List | |
| import requests | |
| import json | |
| import time | |
| from azure.kusto.data import KustoClient, KustoConnectionStringBuilder | |
| from datetime import datetime, timedelta | |
| def main(): | |
| def read_kusto_data(q): | |
| results = kc.execute_query(KUSTO_DB ,q) |
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
| .create-or-alter function with (folder = "formatting", docstring = "Table to Markdown", skipvalidation = "true") TableToMarkdown(t:(*)) { | |
| let schema = t | getschema; | |
| let headers = schema | project ColumnName | summarize make_list(ColumnName) | extend String = strcat('| ', strcat_array(list_ColumnName, ' | '), ' |') | project String, Order=1; | |
| let upperDivider = schema | project ColumnName, Sep = '---' | summarize Cols=make_list(Sep) | extend String = strcat('| ', strcat_array(Cols, ' | '), ' |') | project String, Order=2; | |
| let data = t | extend Cols=pack_array(*) | extend String = strcat('| ', strcat_array(Cols, ' | '), ' |') | project String, Order=3; | |
| headers | |
| | union upperDivider | |
| | union data | |
| | order by Order asc | |
| | summarize Rows=make_list(String) |
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
| using System.Collections.Concurrent; | |
| using System.Threading.Tasks; | |
| namespace ProperLockingTester | |
| { | |
| public class WellLockedResource | |
| { | |
| private readonly object m_lock; | |
| private bool lockedState = false; | |
| private TaskCompletionSource<bool> m_taskCompletionSource; |
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
| using System.Diagnostics; | |
| namespace TestinManuelResetEventHandler | |
| { | |
| internal class Program | |
| { | |
| private enum RunMode | |
| { | |
| cluster, | |
| listen, |
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
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <OutputType>Exe</OutputType> | |
| <TargetFrameworks>net6.0;net48</TargetFrameworks> | |
| <AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects> | |
| </PropertyGroup> | |
| <ItemGroup> | |
| <PackageReference Include="BenchmarkDotNet" Version="0.13.3" /> |