What is easier to understand two months from now? Note that they are exactly equal in this example.
$regex = '(?n)(?<destination>(\d{1,3}\.){3}\d{1,3}).*time=(?<ms>\d+)ms'
verses
""" | |
The Premedicant Dose for animal type is the weight of animal multipled by drug dose rate, divided | |
by drugconcertration. | |
""" | |
from __future__ import division | |
drug_concentrations = {"meloxicam": 5.0, "amoxicillin clavulanic acid": 32.5, "ketamine": 100, | |
"enrofloxacin 2.5 percent solution": 25, "enrofloxacin 5.0 percent solution": 50} |
from xml.etree import ElementTree | |
import json | |
import os | |
import shutil | |
import requests | |
""" | |
todo: | |
A better solution that manually togglign `FORCE_CACHED` |
// PingLog - returns valid table otherwise entire query errors | |
// Output looks like: https://i.imgur.com/60oUF0C.png | |
let | |
Source = Sql.Databases("sandbox"), | |
nin = Source{[Name="nin"]}[Data], | |
PingLog = nin{[Schema="dbo",Item="PingLog"]}[Data], | |
#"Renamed Columns" = Table.RenameColumns( | |
PingLog, | |
{ | |
{"Latency", "Ping"}, |
{ | |
"Metadata": { | |
"Encoding": "utf8", | |
"Description": "appears to be query names and GUIDs", | |
"Path": "Metadata", | |
"ContentType": "text serialized text with null terminated chars?" | |
}, | |
"ReportLayout": { | |
"Encoding": "utf_16le", | |
"description": "layout, slicer settings, etc and contains escaped JSON", |
let | |
// basic json ( non-authenticated get request ) | |
Source_Json = Json.Document(Web.Contents("https://api.publicapis.org/random")), | |
Source_Table = Record.ToTable(Source_Json), | |
Entries = Source_Table{ [Name="entries"] }[Value], | |
result=Entries | |
in | |
result |
function Prompt() { | |
$ProfileName = nin_guess_terminal | |
# ... switch | |
} | |
function nin_guess_terminal() { | |
<# | |
detect whether you're running from | |
vscode addon, windows terminal or other | |
#> |
/// if conditions fail, don't allow the query | |
// to silently complete as "successful" | |
let | |
Source = Sql.Databases("server"), | |
nin = Source{ [Name="instance"] }[Data], | |
PingLog = nin{ [Schema="dbo",Item="PingLog"] }[Data], | |
// optional function: prints list values as a `csv` without having to drill down | |
list_to_string = (text_list as list) as text => | |
let |
@' | |
Usage: | |
> cd c:\github\powershell | |
> git clone https://github.com/MicrosoftDocs/PowerShell-Docs.git | |
set $doc_path | |
$doc_path = 'c:\github\powershell\PowerShell-Docs\reference' |