update inbox list

This commit is contained in:
manhlab
2021-04-07 19:25:18 -04:00
parent fda7245f7c
commit 436de2efd6
8576 changed files with 1013325 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
<span class="hljs-string">@' The wild cat jumped over the $height-tall fence.
He did so with grace.
'@</span>
This SHOULDNT be a part of the above strings span.
<span class="hljs-string">@' The wild cat jumped over the $height-tall fence.
He did so with grace.
break-end-of-string'@
This SHOULD be a part of the above strings span.</span>

View File

@@ -0,0 +1,11 @@
@' The wild cat jumped over the $height-tall fence.
He did so with grace.
'@
This SHOULDNT be a part of the above strings span.
@' The wild cat jumped over the $height-tall fence.
He did so with grace.
break-end-of-string'@
This SHOULD be a part of the above strings span.

View File

@@ -0,0 +1,57 @@
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Device</span></span> {
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$Brand</span>
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$Model</span>
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$VendorSku</span>
<span class="hljs-function">[<span class="hljs-built_in">string</span>]<span class="hljs-title">ToString</span></span>(){
<span class="hljs-keyword">return</span> (<span class="hljs-string">"{0}|{1}|{2}"</span> <span class="hljs-operator">-f</span> <span class="hljs-keyword">$this</span>.Brand, <span class="hljs-keyword">$this</span>.Model, <span class="hljs-keyword">$this</span>.VendorSku)
}
}
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Rack</span> : <span class="hljs-title">Device</span></span> {
<span class="hljs-keyword">hidden</span> [<span class="hljs-built_in">int</span>] <span class="hljs-variable">$Slots</span> = <span class="hljs-number">8</span>
<span class="hljs-keyword">static</span> [<span class="hljs-type">Rack</span>[]]<span class="hljs-variable">$InstalledRacks</span> = <span class="hljs-selector-tag">@</span>()
[<span class="hljs-built_in">int</span>]<span class="hljs-variable">$Slots</span> = <span class="hljs-number">8</span>
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$Brand</span>
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$Model</span>
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$VendorSku</span>
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$AssetId</span>
[<span class="hljs-type">Device</span>[]]<span class="hljs-variable">$Devices</span> = [<span class="hljs-type">Device</span>[]]::new(<span class="hljs-keyword">$this</span>.Slots)
Device(
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$b</span>,
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$m</span>,
[<span class="hljs-built_in">string</span>]<span class="hljs-variable">$vsk</span>
){
<span class="hljs-keyword">$this</span>.Brand = <span class="hljs-variable">$b</span>
<span class="hljs-keyword">$this</span>.Model = <span class="hljs-variable">$m</span>
<span class="hljs-keyword">$this</span>.VendorSku = <span class="hljs-variable">$vsk</span>
}
<span class="hljs-function">[<span class="hljs-built_in">void</span>] <span class="hljs-title">AddDevice</span></span>([<span class="hljs-type">Device</span>]<span class="hljs-variable">$dev</span>, [<span class="hljs-built_in">int</span>]<span class="hljs-variable">$slot</span>){
<span class="hljs-comment">## Add argument validation logic here</span>
<span class="hljs-keyword">$this</span>.Devices[<span class="hljs-variable">$slot</span>] = <span class="hljs-variable">$dev</span>
}
<span class="hljs-function">[<span class="hljs-built_in">void</span>]<span class="hljs-title">RemoveDevice</span></span>([<span class="hljs-built_in">int</span>]<span class="hljs-variable">$slot</span>){
<span class="hljs-comment">## Add argument validation logic here</span>
<span class="hljs-keyword">$this</span>.Devices[<span class="hljs-variable">$slot</span>] = <span class="hljs-variable">$null</span>
}
<span class="hljs-function">[<span class="hljs-built_in">int</span>[]] <span class="hljs-title">GetAvailableSlots</span></span>(){
[<span class="hljs-built_in">int</span>]<span class="hljs-variable">$i</span> = <span class="hljs-number">0</span>
<span class="hljs-keyword">return</span> <span class="hljs-selector-tag">@</span>(<span class="hljs-keyword">$this</span>.Devices.foreach{ <span class="hljs-keyword">if</span>(<span class="hljs-variable">$_</span> <span class="hljs-operator">-eq</span> <span class="hljs-variable">$null</span>){<span class="hljs-variable">$i</span>}; <span class="hljs-variable">$i</span>++})
}
}
<span class="hljs-variable">$rack</span> = [<span class="hljs-type">Rack</span>]::new()
<span class="hljs-variable">$surface</span> = [<span class="hljs-type">Device</span>]::new()
<span class="hljs-variable">$surface</span>.Brand = <span class="hljs-string">"Microsoft"</span>
<span class="hljs-variable">$surface</span>.Model = <span class="hljs-string">"Surface Pro 4"</span>
<span class="hljs-variable">$surface</span>.VendorSku = <span class="hljs-string">"5072641000"</span>
<span class="hljs-variable">$rack</span>.AddDevice(<span class="hljs-variable">$surface</span>, <span class="hljs-number">2</span>)
<span class="hljs-variable">$rack</span>
<span class="hljs-variable">$rack</span>.GetAvailableSlots()

View File

@@ -0,0 +1,57 @@
class Device {
[string]$Brand
[string]$Model
[string]$VendorSku
[string]ToString(){
return ("{0}|{1}|{2}" -f $this.Brand, $this.Model, $this.VendorSku)
}
}
class Rack : Device {
hidden [int] $Slots = 8
static [Rack[]]$InstalledRacks = @()
[int]$Slots = 8
[string]$Brand
[string]$Model
[string]$VendorSku
[string]$AssetId
[Device[]]$Devices = [Device[]]::new($this.Slots)
Device(
[string]$b,
[string]$m,
[string]$vsk
){
$this.Brand = $b
$this.Model = $m
$this.VendorSku = $vsk
}
[void] AddDevice([Device]$dev, [int]$slot){
## Add argument validation logic here
$this.Devices[$slot] = $dev
}
[void]RemoveDevice([int]$slot){
## Add argument validation logic here
$this.Devices[$slot] = $null
}
[int[]] GetAvailableSlots(){
[int]$i = 0
return @($this.Devices.foreach{ if($_ -eq $null){$i}; $i++})
}
}
$rack = [Rack]::new()
$surface = [Device]::new()
$surface.Brand = "Microsoft"
$surface.Model = "Surface Pro 4"
$surface.VendorSku = "5072641000"
$rack.AddDevice($surface, 2)
$rack
$rack.GetAvailableSlots()

View File

@@ -0,0 +1,35 @@
<span class="hljs-keyword">using</span> <span class="hljs-keyword">namespace</span> System.Text
<span class="hljs-keyword">using</span> <span class="hljs-keyword">module</span> CardGames
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Get-PowerShellProcess</span></span> { <span class="hljs-built_in">Get-Process</span> PowerShell }
<span class="hljs-function"><span class="hljs-keyword">Function</span> <span class="hljs-title">Add-Numbers</span><span class="hljs-params">(<span class="hljs-variable">$one</span>, <span class="hljs-variable">$two</span>)</span></span> {
<span class="hljs-variable">$one</span> + <span class="hljs-variable">$two</span>
}
<span class="hljs-class"><span class="hljs-keyword">enum</span> <span class="hljs-title">MediaTypes</span></span> {
unknown
music = <span class="hljs-number">10</span>
mp3
aac
ogg = <span class="hljs-number">15</span>
}
<span class="hljs-string">"def"</span> <span class="hljs-operator">-notin</span> <span class="hljs-string">"abc"</span>, <span class="hljs-string">"def"</span>
<span class="hljs-string">"Sunday"</span> <span class="hljs-operator">-notmatch</span> <span class="hljs-string">"rain"</span>
<span class="hljs-string">"Good Dog"</span> <span class="hljs-operator">-match</span> <span class="hljs-string">"Dog"</span>
<span class="hljs-number">2</span> <span class="hljs-operator">-eq</span> <span class="hljs-number">2</span>
<span class="hljs-string">"abc"</span> <span class="hljs-operator">-ne</span> <span class="hljs-string">"def"</span>
<span class="hljs-variable">$hash</span> = <span class="hljs-selector-tag">@</span>{
SomeKey = <span class="hljs-string">'SomeValue'</span>
SomeKey2 = <span class="hljs-string">'SomeValue2'</span>
SomeKey3 = <span class="hljs-string">'SomeValue3'</span>
}
<span class="hljs-variable">$client</span> = <span class="hljs-built_in">New-Object</span> System.Net.WebClient
[<span class="hljs-type">System.Environment</span>]::Commandline
<span class="hljs-variable">$notepad</span> = <span class="hljs-built_in">Get-Process</span> notepad
<span class="hljs-variable">$notepad</span>.Kill()
<span class="hljs-string">'this is rocket science'</span>.Replace(<span class="hljs-string">'rocket'</span>, <span class="hljs-string">'rock'</span>)

View File

@@ -0,0 +1,35 @@
using namespace System.Text
using module CardGames
function Get-PowerShellProcess { Get-Process PowerShell }
Function Add-Numbers($one, $two) {
$one + $two
}
enum MediaTypes {
unknown
music = 10
mp3
aac
ogg = 15
}
"def" -notin "abc", "def"
"Sunday" -notmatch "rain"
"Good Dog" -match "Dog"
2 -eq 2
"abc" -ne "def"
$hash = @{
SomeKey = 'SomeValue'
SomeKey2 = 'SomeValue2'
SomeKey3 = 'SomeValue3'
}
$client = New-Object System.Net.WebClient
[System.Environment]::Commandline
$notepad = Get-Process notepad
$notepad.Kill()
'this is rocket science'.Replace('rocket', 'rock')

View File

@@ -0,0 +1,11 @@
<span class="hljs-string">@" The wild cat jumped over the <span class="hljs-variable">$height</span>-tall fence.
He did so with grace.
"@</span>
This SHOULDNT be a part of the above strings span.
<span class="hljs-string">@" The wild cat jumped over the <span class="hljs-variable">$height</span>-tall fence.
He did so with grace.
break-end-of-string"@
This SHOULD be a part of the above strings span.</span>

View File

@@ -0,0 +1,11 @@
@" The wild cat jumped over the $height-tall fence.
He did so with grace.
"@
This SHOULDNT be a part of the above strings span.
@" The wild cat jumped over the $height-tall fence.
He did so with grace.
break-end-of-string"@
This SHOULD be a part of the above strings span.