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
| # Put one of these blocks in front of your ps1 script | |
| # Credits to http://vegetarianprogrammer.blogspot.com/2013/03/running-64-bit-powershell-from-32-bit.html | |
| if ($env:PROCESSOR_ARCHITEW6432 -eq "AMD64") { | |
| Write-Warning "Switching from 32bit to 64bit PowerShell" | |
| $powershell = Join-Path $PSHOME.ToLower().Replace("syswow64","sysnative").Replace("system32","sysnative") powershell.exe | |
| if ($myInvocation.Line) { | |
| &"$powershell" -NonInteractive -NoProfile -ExecutionPolicy Bypass $myInvocation.Line | |
| } else { | |
| &"$powershell" -NonInteractive -NoProfile -ExecutionPolicy Bypass -file "$($myInvocation.InvocationName)" $args |
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
| string[] tests = { | |
| "AutomaticTrackingSystem", | |
| "XMLEditor", | |
| "AnXMLAndXSLT2.0Tool", | |
| }; | |
| Regex r = new Regex(@"(?<=[A-Z])(?=[A-Z][a-z])|(?<=[^A-Z])(?=[A-Z])|(?<=[A-Za-z])(?=[^A-Za-z])"); | |
| foreach (string test in tests) | |
| { | |
| Console.WriteLine(r.Replace(test, " ")); |
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
| public static class EnumExtensions | |
| { | |
| private static void CheckIsEnum<T>(bool withFlags) | |
| { | |
| if (!typeof(T).IsEnum) | |
| throw new ArgumentException(string.Format("Type '{0}' is not an enum", typeof(T).FullName)); | |
| if (withFlags && !Attribute.IsDefined(typeof(T), typeof(FlagsAttribute))) | |
| throw new ArgumentException(string.Format("Type '{0}' doesn't have the 'Flags' attribute", typeof(T).FullName)); | |
| } |
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; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace Kongsberg.KSim.Extensions.Gmdss.Domain | |
| { | |
| /// <summary> | |
| /// Helper class to run async methods within a sync process. | |
| /// </summary> | |
| public static class AsyncUtil |
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; | |
| using System.Collections.Concurrent; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace Blablabla | |
| { | |
| public static class Logger |
OlderNewer