Skip to content

Commit a6daa45

Browse files
authored
Batch updates & (#345)
♻️ (ClassificationHelpers.ps1): adjust watermark limits and improve key handling 🔧 (HugoHelpers.ps1): remove null values from string lists for cleaner data ✨ (Update-ClassisificationFrontMatter.ps1): add content generation prompt for blog posts 🔧 (Update-ReourcesFrontMatter.ps1): update output directory path and interim save ⚡️Update The watermark score and count limits are adjusted to refine classification accuracy. Handling of cached data keys is improved for better performance. Null values are removed from string lists to ensure data integrity. A new content generation prompt is added to guide the creation of concise blog posts, enhancing content quality. The output directory path is updated for consistency, and an interim save is introduced to prevent data loss during longer operations.
2 parents afc9340 + c4ff83b commit a6daa45

File tree

2,668 files changed

+185579
-120273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,668 files changed

+185579
-120273
lines changed

.powershell/_includes/ClassificationHelpers.ps1

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
$batchesInProgress = $null;
55
$batchesInProgressMax = 40;
6-
$watermarkAgeLimit = (New-TimeSpan -Start (Get-Date "2025-02-18T09:00:00") -End (Get-Date)).Days
7-
$watermarkScoreLimit = 30
8-
$watermarkCount = 1
6+
$watermarkAgeLimit = (New-TimeSpan -Start (Get-Date "2025-02-18T09:00:00") -End (Get-Date)).Days # Wattermark for calculation algorythem Change.
7+
$watermarkScoreLimit = 10
8+
$watermarkCount = 0
99

1010
function Get-CatalogHashtable {
1111
param (
@@ -103,7 +103,8 @@ function Get-ClassificationsForType {
103103
}
104104
# Check if the cache uses the latest calculations
105105
$recalculatedCount = 0
106-
foreach ($key in $cachedData.keys) {
106+
$keysToCheck = $cachedData.keys | ForEach-Object { $_ }
107+
foreach ($key in $keysToCheck ) {
107108
$entry = $cachedData[$key]
108109
$finalScore = Get-ComputedConfidence -aiConfidence $entry.ai_confidence -nonAiConfidence $entry.non_ai_confidence
109110
$level = Get-ComputedLevel -confidence $finalScore
@@ -306,6 +307,7 @@ function Get-ClassificationsForType {
306307
else {
307308
$DaysAgo = -1 # Or a default value like 0, depending on your needs
308309
}
310+
309311
Write-InformationLog "Updating {category} confidence {diff}! The old confidence of {old} was calculated {daysago} days ago. The new confidence is {confidence}!" -PropertyValues $result.category, $confidenceDiff, $oldConfidence, $DaysAgo, $result.ai_confidence
310312
$CatalogFromCache[$result.category] = $result
311313
$cachedData[$result.category] = $result
@@ -353,8 +355,8 @@ function Get-Classification {
353355
function Get-ClassificationOrderedList {
354356
param (
355357
[array]$Classifications,
356-
[int] $minScore = 30,
357-
[string[]]$levels = @("Primary", "Secondary", "Tertiary", "Quaternary", "Quinary"),
358+
[int] $minScore = 40,
359+
[string[]]$levels = @("Primary", "Secondary", "Tertiary"),
358360
[switch]$byLevel
359361
)
360362

@@ -390,8 +392,6 @@ function Get-ComputedLevel {
390392
{ $_ -gt 80 } { return "Primary" }
391393
{ $_ -gt 60 } { return "Secondary" }
392394
{ $_ -gt 40 } { return "Tertiary" }
393-
{ $_ -gt 20 } { return "Quaternary" }
394-
{ $_ -gt 10 } { return "Quinary" }
395395
default { return "Ignored" }
396396
}
397397
}

.powershell/_includes/HugoHelpers.ps1

+88
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,94 @@ function Update-Field {
115115
return
116116
}
117117

118+
function Update-HashtableList {
119+
param (
120+
[Parameter(Mandatory = $true)]
121+
[System.Collections.Specialized.OrderedDictionary]$frontMatter,
122+
[Parameter(Mandatory = $true)]
123+
[string]$fieldName,
124+
[Parameter(Mandatory = $true)]
125+
[AllowEmptyCollection()]
126+
[hashtable[]]$values, # Accepts only an array of hashtables
127+
[string]$addAfter = $null,
128+
[string]$addBefore = $null,
129+
[switch]$Overwrite
130+
)
131+
132+
# Ensure values are always an array and remove any null values
133+
$values = @($values | Where-Object { $_ -ne $null })
134+
135+
# Convert all input hashtables to ordered hashtables while keeping their order intact
136+
$values = $values | ForEach-Object {
137+
if ($_ -is [System.Collections.Specialized.OrderedDictionary]) { $_ }
138+
else {
139+
$orderedHash = [ordered]@{}
140+
$_.GetEnumerator() | ForEach-Object { $orderedHash[$_.Key] = $_.Value }
141+
$orderedHash
142+
}
143+
}
144+
145+
# If the field doesn't exist, create it with position handling
146+
if (-not $frontMatter.Contains($fieldName)) {
147+
$index = $null
148+
if ($addAfter -and $frontMatter.Contains($addAfter)) {
149+
$index = $frontMatter.Keys.IndexOf($addAfter) + 1
150+
}
151+
elseif ($addBefore -and $frontMatter.Contains($addBefore)) {
152+
$index = $frontMatter.Keys.IndexOf($addBefore)
153+
}
154+
155+
if ($index -ne $null) {
156+
$frontMatter.Insert($index, $fieldName, $values)
157+
}
158+
else {
159+
$frontMatter[$fieldName] = $values
160+
}
161+
162+
Write-Debug "$fieldName added"
163+
}
164+
else {
165+
# Ensure the field is always an array
166+
if (-not ($frontMatter[$fieldName] -is [System.Collections.IEnumerable])) {
167+
$frontMatter[$fieldName] = @($frontMatter[$fieldName])
168+
}
169+
170+
if ($Overwrite) {
171+
$frontMatter[$fieldName] = $values
172+
}
173+
else {
174+
# Preserve the existing values as an ordered array
175+
$existingValues = @($frontMatter[$fieldName])
176+
177+
# Create a lookup table of existing hashtables for deduplication
178+
$existingHashtablesJson = @{}
179+
foreach ($hash in $existingValues) {
180+
$existingHashtablesJson[(ConvertTo-Json $hash -Compress)] = $true
181+
}
182+
183+
# Append only unique hashtables in original order
184+
foreach ($hash in $values) {
185+
$hashJson = ConvertTo-Json $hash -Compress
186+
if (-not $existingHashtablesJson.ContainsKey($hashJson)) {
187+
$existingHashtablesJson[$hashJson] = $true
188+
$existingValues += $hash
189+
}
190+
}
191+
192+
# Maintain the original order exactly
193+
$frontMatter[$fieldName] = $existingValues
194+
Write-Debug "$fieldName updated with new unique values"
195+
}
196+
}
197+
198+
# Ensure the field remains an array even if it has only one value
199+
if ($frontMatter[$fieldName] -isnot [array]) {
200+
$frontMatter[$fieldName] = @($frontMatter[$fieldName])
201+
}
202+
}
203+
204+
205+
118206
# Update-List function to have the same signature as Update-Field
119207
# Update-List -frontMatter $frontMatter -fieldName 'tags' -values @('DevOps', 'Agile', 'Scrum')
120208
function Update-StringList {

.powershell/_includes/Utilities.ps1

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
3+
function ConvertTo-CamelCase {
4+
param (
5+
[string]$Text
6+
)
7+
8+
# Split words by spaces or non-alphanumeric characters
9+
$words = $Text -split '\W+' | Where-Object { $_ -match '\w' } # Remove empty values
10+
11+
if ($words.Count -eq 0) { return '' } # Handle empty input
12+
13+
# Ensure first word is lowercase, and capitalize subsequent words properly
14+
$camelCase = $words[0].ToLower() + ($words[1..($words.Count - 1)] | ForEach-Object {
15+
if ($_.Length -gt 0) {
16+
$_.Substring(0, 1).ToUpper() + $_.Substring(1).ToLower()
17+
}
18+
}) -join ''
19+
20+
return $camelCase
21+
}
22+
23+
Write-Debug "Utilities.ps1 loaded"

.powershell/single-use/resources/Update-ReourcesFrontMatter.ps1

+16-5
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,23 @@ $Counter = 1
2121
$categoriesCatalog = Get-CatalogHashtable -Classification "categories"
2222
$tagsCatalog = Get-CatalogHashtable -Classification "tags"
2323

24+
Write-InformationLog "Loading ({count}) markdown files...." -PropertyValues $resources.Count
25+
$resourceCount = $resources.Count
26+
$progressStep = [math]::Ceiling($resourceCount / 10) # Calculate step for 10% progress
2427
$hugoMarkdownObjects = @()
25-
$TotalFiles = $resources.Count
26-
Write-InformationLog "Loading ({count}) markdown files...." -PropertyValues $TotalFiles
27-
$resources | ForEach-Object {
28-
if ((Test-Path $_)) {
28+
29+
$resources | ForEach-Object -Begin { $index = 0 } -Process {
30+
if (Test-Path $_) {
2931
$hugoMarkdown = Get-HugoMarkdown -Path $_
3032
$hugoMarkdownObjects += $hugoMarkdown
3133
}
34+
35+
$index++
36+
if ($index % $progressStep -eq 0 -or $index -eq $resourceCount) {
37+
Write-InformationLog "Progress: $([math]::Round(($index / $resourceCount) * 100))% complete"
38+
}
3239
}
40+
3341
$TotalItems = $hugoMarkdownObjects.Count
3442
Write-InformationLog "Loaded ({count}) HugoMarkdown Objects." -PropertyValues $TotalItems
3543
### FILTER hugoMarkdownObjects
@@ -213,13 +221,16 @@ while ($hugoMarkdownQueue.Count -gt 0 -or $hugoMarkdownBatchQueue.Count -gt 0) {
213221
$categoryClassification = Get-ClassificationsForType -updateMissing -ClassificationType "categories" -hugoMarkdown $hugoMarkdown
214222
$categoryClassificationOrdered = Get-ClassificationOrderedList -minScore 50 -byLevel -classifications $categoryClassification | Select-Object -First 3
215223
$categories = $categoryClassificationOrdered | ForEach-Object { $_.category }
216-
217224
Update-StringList -frontMatter $hugoMarkdown.FrontMatter -fieldName 'categories' -values @($categories) -Overwrite
225+
#$categoriesMeta = $categoryClassificationOrdered | ForEach-Object { [ordered]@{ category = $_.category; final_score = $_.final_score } }
226+
#Update-HashtableList -frontMatter $hugoMarkdown.FrontMatter -fieldName 'categoriesMeta' -addAfter "categories" -values $categoriesMeta -Overwrite
218227
#-----------------Tags-------------------
219228
$tagClassification = Get-ClassificationsForType -updateMissing -ClassificationType "tags" -hugoMarkdown $hugoMarkdown
220229
$tagClassificationOrdered = Get-ClassificationOrderedList -minScore 70 -classifications $tagClassification | Select-Object -First 10
221230
$tags = $tagClassificationOrdered | ForEach-Object { $_.category }
222231
Update-StringList -frontMatter $hugoMarkdown.FrontMatter -fieldName 'tags' -values @($tags) -Overwrite
232+
#$tagsMeta = $tagClassificationOrdered | ForEach-Object { [ordered]@{ category = $_.category; final_score = $_.final_score } }
233+
#Update-HashtableList -frontMatter $hugoMarkdown.FrontMatter -fieldName 'tagsMeta' -addAfter "tags" -values $tagsMeta -Overwrite
223234
# =================COMPLETE===================
224235
$eeResult = Get-Classification -CacheFolder $hugoMarkdown.FolderPath -ClassificationName "Engineering Excellence"
225236
$tlResult = Get-Classification -CacheFolder $hugoMarkdown.FolderPath -ClassificationName "Technical Leadership"

site/content/resources/blog/2006/2006-06-22-ahaaaa/data.index.classifications.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1012,15 +1012,15 @@
10121012
},
10131013
"Troubleshooting": {
10141014
"category": "Troubleshooting",
1015-
"calculated_at": "2025-03-10T13:28:35",
1015+
"calculated_at": "2025-03-15T07:52:25",
10161016
"ai_confidence": 25.0,
10171017
"ai_mentions": 10.0,
10181018
"ai_alignment": 20.0,
10191019
"ai_depth": 10.0,
10201020
"non_ai_confidence": 0,
10211021
"final_score": 22.0,
10221022
"reasoning": "The content briefly mentions a problem related to posting code, which aligns with troubleshooting. However, it lacks detailed discussion on diagnosing or resolving the issue, and does not provide methodologies or insights typical of the troubleshooting category.",
1023-
"level": "Quaternary"
1023+
"level": "Ignored"
10241024
},
10251025
"Azure Boards": {
10261026
"category": "Azure Boards",

site/content/resources/blog/2006/2006-06-22-custom-ui-colour-scheme-for-windows-forms-net/data.index.classifications.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@
8282
},
8383
"Install and Configuration": {
8484
"category": "Install and Configuration",
85-
"calculated_at": "2025-03-10T13:28:40",
85+
"calculated_at": "2025-03-15T07:52:25",
8686
"ai_confidence": 32.0,
8787
"ai_mentions": 10,
8888
"ai_alignment": 25,
8989
"ai_depth": 15,
9090
"non_ai_confidence": 10,
9191
"final_score": 30.0,
9292
"reasoning": "The content provides a code snippet for customising the UI colour scheme in Windows Forms .NET, which relates to configuration aspects. However, it lacks a comprehensive discussion on installation procedures or broader configuration best practices. The focus is primarily on a specific implementation detail rather than a step-by-step guide or troubleshooting advice, leading to a lower confidence score.",
93-
"level": "Quaternary"
93+
"level": "Ignored"
9494
},
9595
"Market Adaptability": {
9696
"category": "Market Adaptability",
@@ -865,15 +865,15 @@
865865
},
866866
"Technical Mastery": {
867867
"category": "Technical Mastery",
868-
"calculated_at": "2025-03-10T15:23:21",
868+
"calculated_at": "2025-03-15T07:52:25",
869869
"ai_confidence": 42.0,
870870
"ai_mentions": 15.0,
871871
"ai_alignment": 35.0,
872872
"ai_depth": 30.0,
873873
"non_ai_confidence": 0,
874874
"final_score": 38.0,
875875
"reasoning": "The content provides a practical example of customising UI elements in Windows Forms using .NET, which touches on software craftsmanship and design principles. However, it lacks a broader discussion on best practices, principles of clean code, or methodologies that contribute to high-quality software development. The focus is primarily on implementation rather than a comprehensive exploration of technical mastery.",
876-
"level": "Quaternary"
876+
"level": "Ignored"
877877
},
878878
"Working Agreements": {
879879
"category": "Working Agreements",
@@ -1021,15 +1021,15 @@
10211021
},
10221022
"Troubleshooting": {
10231023
"category": "Troubleshooting",
1024-
"calculated_at": "2025-03-11T12:19:26",
1024+
"calculated_at": "2025-03-15T07:52:25",
10251025
"ai_confidence": 32.0,
10261026
"ai_mentions": 15.0,
10271027
"ai_alignment": 25.0,
10281028
"ai_depth": 20.0,
10291029
"non_ai_confidence": 0,
10301030
"final_score": 29.0,
10311031
"reasoning": "The content primarily focuses on customising UI elements in Windows Forms .NET, with a brief mention of troubleshooting by suggesting that if problems arise, one can inherit from the ToolStrip control and change the renderer. However, the main focus is on implementation rather than diagnosing or resolving technical issues, which limits its alignment with the troubleshooting category.",
1032-
"level": "Quaternary"
1032+
"level": "Ignored"
10331033
},
10341034
"Azure Boards": {
10351035
"category": "Azure Boards",
@@ -1126,15 +1126,15 @@
11261126
},
11271127
"System Configuration": {
11281128
"category": "System Configuration",
1129-
"calculated_at": "2025-03-11T10:54:44",
1129+
"calculated_at": "2025-03-15T07:52:25",
11301130
"ai_confidence": 32.0,
11311131
"ai_mentions": 5,
11321132
"ai_alignment": 15,
11331133
"ai_depth": 12,
11341134
"non_ai_confidence": 0,
11351135
"final_score": 29.0,
11361136
"reasoning": "The content primarily focuses on customising the UI colour scheme for Windows Forms in .NET, which is more related to software development and UI design rather than system configuration. While it does touch on aspects of configuration (like setting a custom renderer), it lacks depth in discussing broader system configuration practices, methodologies, or optimisation strategies. The technical details provided are specific to UI customisation rather than the overall system setup or performance enhancement.",
1137-
"level": "Quaternary"
1137+
"level": "Ignored"
11381138
},
11391139
"Lean Thinking": {
11401140
"category": "Lean Thinking",

site/content/resources/blog/2006/2006-06-22-custom-ui-colour-scheme-for-windows-forms-net/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ aliasesArchive:
2828
- /resources/blog/custom-ui-colour-scheme-for-windows-forms-net
2929
tags:
3030
- Windows
31-
- Software Development
3231
categories: []
3332
preview: metro-binary-vb-128-link-1-1.png
3433

site/content/resources/blog/2006/2006-06-22-hinshelm-on-composite-ui-application-block/data.index.classifications.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@
6464
},
6565
"Code and Complexity": {
6666
"category": "Code and Complexity",
67-
"calculated_at": "2025-03-10T13:28:29",
67+
"calculated_at": "2025-03-15T07:52:25",
6868
"ai_confidence": 32.0,
6969
"ai_mentions": 10,
7070
"ai_alignment": 25,
7171
"ai_depth": 15,
7272
"non_ai_confidence": 20,
7373
"final_score": 31.0,
7474
"reasoning": "The content primarily focuses on implementing a specific feature in a software framework, detailing code examples and implementation strategies. While it touches on aspects of code quality and maintainability through the discussion of factory patterns and inheritance, it lacks a broader exploration of complexity theory or its implications on software architecture. The discussion is more technical and practical rather than theoretical, which limits its alignment with the core themes of the 'Code and Complexity' category.",
75-
"level": "Quaternary"
75+
"level": "Ignored"
7676
},
7777
"DevOps": {
7878
"category": "DevOps",
@@ -850,15 +850,15 @@
850850
},
851851
"Pragmatic Thinking": {
852852
"category": "Pragmatic Thinking",
853-
"calculated_at": "2025-03-11T10:54:41",
853+
"calculated_at": "2025-03-15T07:52:25",
854854
"ai_confidence": 32.0,
855855
"ai_mentions": 15.0,
856856
"ai_alignment": 25.0,
857857
"ai_depth": 40.0,
858858
"non_ai_confidence": 0,
859859
"final_score": 29.0,
860860
"reasoning": "The content primarily focuses on a technical implementation of a UI adapter within the Composite UI Application Block (CAB). While it does touch on practical problem-solving by discussing two approaches to extend functionality, it lacks a broader discussion on Agile, Scrum, or DevOps principles. The depth of the technical details is significant, but the overall alignment with the core themes of pragmatic thinking is limited, as it does not address adaptability or real-world applications in a project management context.",
861-
"level": "Quaternary"
861+
"level": "Ignored"
862862
},
863863
"MVP": {
864864
"category": "MVP",
@@ -973,15 +973,15 @@
973973
},
974974
"Engineering Excellence": {
975975
"category": "Engineering Excellence",
976-
"calculated_at": "2025-03-10T15:23:15",
976+
"calculated_at": "2025-03-15T07:52:25",
977977
"ai_confidence": 32.0,
978978
"ai_mentions": 15.0,
979979
"ai_alignment": 25.0,
980980
"ai_depth": 25.0,
981981
"non_ai_confidence": 0,
982982
"final_score": 29.0,
983983
"reasoning": "The content primarily focuses on implementing a specific feature in a software framework, detailing code and technical solutions. While it touches on aspects of software craftsmanship, such as extending functionality and code reuse, it lacks a broader discussion on engineering excellence principles, best practices, or continuous improvement processes. The depth of discussion is limited to a specific implementation without addressing overarching themes of quality assurance or team collaboration.",
984-
"level": "Quaternary"
984+
"level": "Ignored"
985985
},
986986
"Coaching": {
987987
"category": "Coaching",

site/content/resources/blog/2006/2006-06-22-hinshelm-on-composite-ui-application-block/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ aliasesArchive:
2929
tags:
3030
- Software Development
3131
- Practical Techniques and Tooling
32-
- Technical Mastery
3332
categories: []
3433
preview: metro-binary-vb-128-link-1-1.png
3534

site/content/resources/blog/2006/2006-08-01-cafemsn-prize/index.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ aliasesArchive:
2222
- /blog/cafemsn-prize
2323
- /cafemsn-prize
2424
- /resources/blog/cafemsn-prize
25-
tags:
26-
- Miscellaneous
25+
tags: []
2726
preview: nakedalm-logo-128-link-1-1.png
2827
categories: []
2928

0 commit comments

Comments
 (0)