This file contains 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
# https://stackoverflow.com/a/75174377 | |
Get-PnpDevice -FriendlyName "*WH-1000XM4*" | ForEach-Object { | |
$local:test = $_ | | |
Get-PnpDeviceProperty -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' | | |
Where Type -ne Empty; | |
if ($test) { | |
"To query battery for $($_.FriendlyName), run the following:" | |
" Get-PnpDeviceProperty -InstanceId '$($test.InstanceId)' -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' | % Data" | |
"" |
This file contains 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
// NuGet package `System.Diagnostics.PerformanceCounter` have to be installed | |
// .NET 6 | |
#nullable disable | |
using System.Globalization; | |
using System.Diagnostics; | |
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; | |
using var writer = new StreamWriter( Console.OpenStandardOutput() ); |
This file contains 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
while (!Console.KeyAvailable) { | |
var result = await client.ReadValueAsync<ushort>( "MAIN.pState^", CancellationToken.None ); | |
ushort state = result.Succeeded | |
? result.Value | |
: (ushort) 0; | |
Console.Write( $"{(state == 100 ? "*" : "+")}" ); | |
await Task.Delay( 50 ); | |
} |
This file contains 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
<TcTargetDesc> | |
<TargetType>TC/BSD-OS</TargetType> | |
<TargetVersion> | |
<Version>3</Version> | |
<Revision>1</Revision> | |
<Build>4024</Build> | |
</TargetVersion> | |
<TargetFeatures> | |
<NetId>39.159.94.42.1.1</NetId> | |
</TargetFeatures> |
This file contains 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
<TcTargetDesc> | |
<TargetType>CX9020-M510-CE</TargetType> | |
<TargetVersion> | |
<Version>3</Version> | |
<Revision>1</Revision> | |
<Build>4024</Build> | |
</TargetVersion> | |
<TargetFeatures> | |
<NetId>5.59.222.141.1.1</NetId> | |
</TargetFeatures> |
This file contains 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; | |
using System.Linq; | |
using System.Text; | |
using System.Xml.Linq; | |
using TwinCAT.Ads; // v4.4.0.0 | |
namespace AdsReadSystemConfig | |
{ | |
class Program | |
{ |
This file contains 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
__kernel void halton( | |
uint base1, | |
uint base2, | |
const int bufferSize, | |
__global float2* rngBuffer) | |
{ | |
uint mBase2 = base1; | |
uint mBase3 = base2; | |
float mX; | |
float mY; |
This file contains 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
__kernel void xorshift( | |
uint s1, // seed(base) 1 | |
uint s2, // seed(base) 2 | |
const int bufferSize, | |
__global float2* rngBuffer) | |
{ | |
uint st; | |
for(int i = 0; i < bufferSize; i++) { | |
st = s1 ^ (s1 << 11); |
This file contains 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 MQTTnet; | |
using MQTTnet.Client; | |
using MQTTnet.Client.Options; | |
using System; | |
using System.Threading.Tasks; | |
namespace Tc3_DataAgentConsole | |
{ | |
class Program | |
{ |
This file contains 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
PROGRAM MAIN | |
VAR | |
PAYLOAD: UINT := 100; | |
usage, usageMax: UDINT; | |
latencyMax, latencyAct: UDINT; | |
cycleExecTime, cycleTimeSti, cycleExecSti: REAL; | |
cycleLoad, cycleLoadUser: REAL; | |
TcSysLatency: TC_SysLatency; |
NewerOlder