-
Internationaler Katzentag 😺
My cat reminded me today of the International 😺 Day!
Do not forget the extra treats today!
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈
-
Katzentreppe 😺
My cat asked me for a staircase. After a long design discussion he finally said: "meow"! Project is on!
All parts except the round material were cut from those boards.
The boards were cut in length.
And to thinner size.
The staircase has an angle of 30°
With a fixed vise all the holes in the treads were drilled.
One of the wooden rounds broke and I had to cut one manually. Took longer than expected.
The railing holes are cut with a 30° alignment using one of the cut offs as a guide.
Two parts assembly.
Construction finished. Painting!
Customer is happy!
It is his staircase.
-
Cafe Roussillon, Paris, France
Typical french cafe in this neighborhood: Cafe Roussillon. Right in the center of Paris between the Eiffel tower and the Louvre.
Interaktives Panorama Cafe Roussillon
-
Scan text with regex in PowerShell
The named group capture (?
exp) in a regex is an easy way to scan content. In this example, to get the text enclosed in quotes in a string. This is how it is done in PowerShell: # Get the text enclosed in quotes. [string]$text = 'This is an "example text".' [string]$textRegex = '\"(?<Text>.*?)\"' if ($text -match $textRegex) { $matches['Text'] }This outputs
example text
Or split a formatted string into parts. For example the assignment structure 'id=value':# Parse the id and value of the text. [string]$text = ' id123 = abc ' [string]$idValueRegex = "^\s*(?<id>\w+?)\s*=\s*`"?(?<value>.+?)`"?\s*$" if ($text -match $idValueRegex) { "id=$($matches['id']), value=$($matches['value'])" }This outputs
id=id123, value=abc
Or parse a pattern, for example the content of each bracket in " abc { 123 } { def } 456 {xyz}"[string]$text = " abc { 123 } { def } 456 {xyz}" [string]$bracketRegex = "[{]\s*(?<Text>.*?)\s*[}]" ([regex]$bracketRegex).Matches($text) | % { [System.Text.RegularExpressions.Group]$match = $_ [string]$value = $match.Groups["Text"].Value $value }This outputs
123
def
xyz -
Using List in PowerShell
PowerShell has lots of array and lists support, but changing or creating a list with dynamic data recreate the list on each change which is inefficient for large lists.
The most simple solution is to use the .NET List class:[System.Collections.Generic.List[string]]$content = [System.Collections.Generic.List[string]]::new() $content.Add("line1") $content.Add("line2")