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.Drawing; | |
using System.Windows.Forms; | |
public class Test | |
{ | |
static void Main() | |
{ | |
Button button = new Button | |
{ |
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.Tasks; | |
class Test | |
{ | |
static void Main() | |
{ | |
Foo().GetAwaiter().GetResult(); | |
} | |
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.*; | |
import java.util.stream.*; | |
public class Test { | |
public static void main(String[] args) { | |
Stream<String> stream = Arrays.stream( | |
new String[]{"short", "quite long", "very long indeed"}) | |
.filter(x -> { System.out.println("Checking " + x); return x.length() < 12; }); | |
Iterator<String> iterator = stream.iterator(); |
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; | |
public enum Product | |
{ | |
Work = 33, | |
Travel = 34 | |
} | |
public 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
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
public class Test | |
{ | |
static void Main() | |
{ | |
Task task = DelayAndPrintAsync(); | |
Console.WriteLine("Task returned to Main. Sleeping for 10s"); |
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.IO; | |
using System.Text; | |
using NodaTime; | |
class Test | |
{ | |
static void Main() | |
{ | |
var start = Instant.FromUtc(2013, 1, 1, 0, 0); |
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 Newtonsoft.Json; | |
public class MainModel | |
{ | |
[JsonProperty(PropertyName = "pageTitle")] | |
public string PageTitle { get; set; } | |
[JsonProperty(PropertyName = "helpBtnText")] | |
public string HelpButtonText { get; set; } |
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 type = "test"; | |
string data = @"{""fields"":{""project"":{""key"": ""MD""},""summary"": | |
""Support EXAMPLE"",""description"": ""Testing Support"",""issuetype"": | |
{""name"": "+ type +" }}}"; | |
string postUrl = "https://aconline.atlassian.net/rest/api/2/issue"; | |
byte[] cred = UTF8Encoding.UTF8.GetBytes("username:password"); | |
HttpClient client = new HttpClient | |
{ |
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.Net.Http; | |
using System.Threading.Tasks; | |
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
HttpClient client = new HttpClient(); | |
Task<string> request = client.GetStringAsync("http://google.pl"); |
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 class Test { | |
public static void main(String... args) { | |
String x = "abc"; | |
String y = "def"; | |
String xy = x + y; | |
String xyInterned = xy.intern(); | |
System.out.println(xyInterned == xy); | |
// With this line here, the output is true, true |