This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| SQL code for SQL Server from | |
| https://stackoverflow.com/questions/66496778/sql-statement-including-makevalid-crushing-the-server | |
| */ | |
| /* | |
| C# version using SqlGeography instead of SqlGeometry | |
| Requires the Microsoft.SqlServer.Types assembly | |
| Install-Package Microsoft.SqlServer.Types -Version 14.0.1016.290 | |
| */ | |
| void MakeValidCall() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # One parameter, to set the Num Lock state to On or Off, with | |
| # On as the default | |
| Param( | |
| [Parameter(Mandatory=$false)] | |
| [ValidateSet("On", "Off")] | |
| [String[]] $onoff='On' | |
| ) | |
| # Get the current state of the Num Lock key | |
| $CurrentState = [console]::NumberLock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [system.console] | Get-Member -Static -MemberType property | Format-Table name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace Os.Properties | |
| { | |
| // Get access to the hidden SDK class SystemProperties. The SystemProperties | |
| // class provides access to the System Properties store. This store contains | |
| // a list of key-value pairs | |
| // See https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/os/SystemProperties.java | |
| public static class SysProp | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (new FilterGraph() is IFilterGraph2 graphBuilder) | |
| { | |
| // Create a video capture filter for the device | |
| graphBuilder.AddSourceFilterForMoniker(dev.Mon, null, dev.Name, out IBaseFilter capFilter); | |
| // Cast that filter to IAMCameraControl from the DirectShowLib | |
| IAMCameraControl _camera = capFilter as IAMCameraControl; | |
| // Get the current focus settings from the webcam | |
| _camera.Get(CameraControlProperty.Focus, out int v, out CameraControlFlags f); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Get the list of connected video cameras | |
| DsDevice[] devs = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); | |
| // Filter that list down to the one with hyper-aggressive focus | |
| var dev = devs.Where(d => d.Name.Equals("Microsoft® LifeCam HD-5000")).FirstOrDefault(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Smoke() | |
| { | |
| int v = 50; | |
| int duration = 500; | |
| Beep(v, 2940, duration, 10); | |
| Beep(v, 3490, duration, 10); | |
| Beep(v, 3920, duration * 1.5, 150); | |
| Beep(v, 2940, duration, 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void FinalCountDown(void) | |
| { | |
| int v = 100; | |
| int duration = 125; | |
| Beep(v, CS5, duration, 10); | |
| Beep(v, B4, duration, 10); | |
| Beep(v, CS5, duration*4, 10); | |
| Beep(v, FS3, duration*5, duration*5); | |
| Beep(v, D5, duration, 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define A3 110 | |
| #define B3 123 | |
| #define C3 131 | |
| #define D3 147 | |
| #define E3 165 | |
| #define F3 175 | |
| #define FS3 185 | |
| #define G3 392 | |
| #define A4 220 | |
| #define B4 247 |