Results for “Sort-Object”
Small, practical examples. Search by task or narrow things down below.
Count repeated lines after sorting
Linux Commands: Group identical lines before uniq -c, then normalize its leading padding.
Linux Commands✓ Tested
Create an object with named properties
PowerShell: Create an object with named properties using PowerShell 7.
PowerShell✓ Tested
Deduplicate sorted values
Deduplicate sorted values using a complete Go program with explicit sample inputs.
Go✓ Tested
Describe an object with an interface
Require named fields on a reusable object shape.
interface✓ Tested
Deserialize a JSON object into a dictionary
C#: Specify the value type expected from a known JSON shape.
C#✓ Tested
Detect an invalid Date object
JavaScript: An invalid Date has a NaN time value.
JavaScript✓ Tested
Detect an invalid Date object
TypeScript: An invalid Date has a NaN time value.
TypeScript✓ Tested
Emit a typed object from a child
Emit a typed object from a child with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Find a median element without fully sorting
C++: nth_element partitions around the element that would occupy the chosen sorted position.
C++✓ Tested
Find lines common to two sorted files
Linux Commands: Use comm -12 to suppress the two columns of unmatched lines.
Linux Commands✓ Tested
Find lines unique to the first sorted file
Linux Commands: Use comm -23 to retain only records absent from the second input.
Linux Commands✓ Tested
Find sorted set members missing from another set
C++: set_difference writes elements present in the first sorted input but absent from the second.
C++✓ Tested