Wednesday, August 21, 2024

OneNote history of changes (view/rollback)

To view history of changes/and or restore to a previous verion, please follow below 1. OneNote, left side, click "Show Recent Notes"
2. Recent Notes should show. Pick the notebook, change you made, and right click 3. Select "Page Versions"
4. Select the change and click "Make current Page"
Tested on OneNote for Windows 10 Version 16001.14326.22008.0

Monday, May 20, 2024

C# Get JSON property name


using System.Text.Json.Serialization;
class TestClass {

[JsonPropertyName("test-id")]
public string TestId { get; set; }

public static string GetName(string name) => typeof(CompanyInfo).GetProperty(name)?.GetCustomAttribute<JsonPropertyAttribute>()?.Name ?? name;

}

using Newtonsoft.Json;
class TestClass {

[JsonPropertyName("test-id")]
public string TestId { get; set; }

public static string GetName(string name) => typeof(CompanyInfo).GetProperty(name)?.GetCustomAttribute<JsonPropertyAttribute>()?.PropertyName ?? name;

}

Use as:
TestClass.GetName(nameof(TestClass.GetName))

Thursday, February 8, 2024

UE5, Elements like PlayerStart are greyed out

In Unreal Engine 5, I was trying landscapes, and while hitting Play, my player character will just fall through the ground. I just couldn't figure out how to edit/update PlayerStart so it can start in a different location. In fact, everything, like lightning was also not editable. Only the landscape object was showing as editable!

Turns out I am in Landscape Editing mode and its not allowed here. Just need to toggle to Selection (Shift + 1), and I was able to edit

 

Turn on Windows 11 Fast Boot

If windows starting is slow, to enable windows 11 fast startup/boot,  Press Windows + R, type powercfg.cpl, and hit Enter.  This will direct...