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 NUnit.Framework; | |
| using System; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace EventTest2; | |
| public static class Extensions | |
| { | |
| private const int DEFAULT_HANDLE_POLLING_INTERVAL = 50; // ms |
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.Net.Sockets; | |
| string host = "192.168.1.45"; | |
| int port = 5678; | |
| byte[] getPowerCommand = { 0x81, 0x09, 0x04, 0x00, 0xff }; | |
| // Create two clients - these will connect immediately | |
| var client1 = new TcpClient(host, port); | |
| client1.NoDelay = true; |
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; | |
| var foo = new Foo(); | |
| Console.WriteLine(foo.ToString()); | |
| public interface IFoo : IFormattable | |
| { | |
| } | |
| public class Foo : IFoo |
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 Google.Cloud.BigQuery.V2; | |
| if (args.Length != 4) | |
| { | |
| Console.WriteLine("Expected arguments: <project-id> <dataset-id> <table-id> <csv-storage-url>"); | |
| return; | |
| } | |
| string projectId = args[0]; | |
| string datasetId = args[1]; |
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 Xunit; | |
| namespace AssertThrows; | |
| public class UnitTest1 | |
| { | |
| [Fact] | |
| public void Test1() | |
| { |
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.Generic; | |
| using System.Linq; | |
| public class Test | |
| { | |
| static void Main() | |
| { | |
| List<string> names = new List<string> | |
| { |
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; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| class Foo | |
| { | |
| } | |
| class 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
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class Test { | |
| public static void main(String[] args) throws Exception { | |
| List<Superclass> supers = new ArrayList<>(); | |
| supers.add(new Superclass()); | |
| showElementTypes(supers); | |
| } |
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
| import java.text.*; | |
| import java.util.*; | |
| public class Test { | |
| public static void main(String[] args) throws Exception { | |
| String text = "Mon Oct 11 19:00 2021"; | |
| String format = "EE MMM dd HH:mm yyyy"; | |
| SimpleDateFormat simpleDateFormat =new SimpleDateFormat(format, new Locale("en", "EN")); | |
| Date date = simpleDateFormat.parse(text); |
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; | |
| class Test | |
| { | |
| static void Main() | |
| { | |
| var initialTicks = 621356256000000000L; | |
| var dt1 = new DateTime(621356256000000000L); | |
| long ticksToAdd = 2083980640; | |
| dt1 = dt1.AddTicks(ticksToAdd); |