View errorhandler.R
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
library("httr") | |
httr::set_config(config(http_version = 2)) # set the HTTP version to 1.1 (none, 1.0, 1.1, 2) | |
sendMail <- function(e){ | |
body <- list(secret = 'sfsdf£$4500dfdd__$$', body=e["message"]) # create a list that will be serialized to JSON | |
result <- POST(url = "https://prod-10.westeurope.logic.azure.com/workflows/8934jadajada999" | |
, body = body , encode = "json", handle = NULL) |
View gist:0879b3dd0df737054ae95f264f3b5e0f
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
test |
View gist:3e7b39f3282d0e38d082
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
//Prepare test data. Could be a set returned | |
//from a database query | |
var list = new List<int>(); | |
for (int i = 0; i < 1000000; i++) | |
{ | |
list.Add(i); | |
} | |
//Prepare a list to hold the results | |
//E.g list of all users born a certain year | |
var listOfInts = new List<IEnumerable<int>>(); |
View gist:2b3a49f98d8c3a56e118
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
//Prepare test data. Could be a set returned | |
//from a database query | |
var list = new List<int>(); | |
for (int i = 0; i < 1000000; i++) | |
{ | |
list.Add(i); | |
} | |
//Filter out a small subset of the data [zip code, annual income] | |
var listSmall = list.Where(i => i > 100000 && i < 150000); |
View gist:5999561
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
private void Dispose(object sender, EventArgs e) | |
{ | |
if (ev_Click == null) | |
return; | |
foreach (var w in ev_Click.GetInvocationList()) | |
{ | |
using (var x = w.Target as IDisposable) | |
{ | |
x.Dispose(); | |
} |
View gist:5999508
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
private void TriggerChildObjects(object sender, EventArgs e) | |
{ | |
countLabel.Text = "InvocationList contains " + | |
(ev_Click == null?0:ev_Click.GetInvocationList().Length) + " objects"; | |
} |
View gist:5999454
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
private readonly byte[] bLoad = new byte[99999]; | |
HostWindow _host; | |
public Worker(HostWindow host) | |
{ | |
_host = host; | |
host.ev_Click += HostEventTriggered; | |
} |
View gist:5999416
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
for (int a = 0; a < 10000; a++) | |
{ | |
new Worker(this); | |
} | |
memoryLabel.Text = "Memory consumption:" + GC.GetTotalMemory(true)/1024; |
View gist:5993946
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
[DataContract] | |
class Order | |
{ | |
public DateTime CreatedOn { get; set; } | |
public List<OrderRow> Orderrows { get; set; } | |
} | |
[CollectionDataContract] | |
class OrderRow | |
{ | |
[DataMember] |
View gist:5993927
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 (true) | |
{ | |
BrokeredMessage message = Client.Receive(); | |
if (message != null) | |
{ | |
try | |
{ | |
var msgStream = message.GetBody<Stream>(); | |
StreamReader sr = new StreamReader(msgStream); | |
NewerOlder