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
<%@ Page Language="C#" AutoEventWireup="true" Trace="true" TraceMode="SortByCategory" %> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title>ASP.NET Diagnostic Page</title> | |
</head> | |
<body> | |
<form id="form1" runat="server"> | |
<% | |
void DumpIdentityAsTable(object identity) |
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
A sample karel progrma! |
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
A sample karel progrma! |
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
class Program | |
{ | |
static void Main() | |
{ | |
string[] args = Environment.GetCommandLineArgs(); | |
if (args.Length == 1) | |
{ | |
//Do nothing | |
} | |
else if (string.Equals(args[1],"-process")) |
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
internal class ProcessStarter | |
{ | |
internal void StartExeToProcessMessage(string pathToExe, CustomQueueMessage customMsg) | |
{ | |
string serializedMsg = JsonConvert.SerializeObject(customMsg); | |
using (Process p = GetProcessAfterStarting(pathToExe)) | |
{ | |
p.StandardInput.WriteLine(serializedMsg); | |
p.OutputDataReceived += (sender, args) => Console.WriteLine("Data receied from child exe - {0}", args.Data); | |
p.EnableRaisingEvents = 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
public void Main() | |
{ | |
int currentCounterValue = Convert.ToInt32(Dts.Variables["counter"].Value); | |
int square = currentCounterValue * currentCounterValue; | |
Dts.Log(string.Format("Inside custom script block value of counter is {0} square is {1}", | |
currentCounterValue, | |
square), | |
0, | |
new byte[0]); | |
Dts.TaskResult = (int)ScriptResults.Success; |
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
internal void TestExecutionInstanceId() | |
{ | |
Package pkg = GetPackageFromConstantLocationWithParametersSet(); | |
DTSExecResult pkgResults = pkg.Execute(); | |
object executionIdAsObj = pkg.Variables["System::ExecutionInstanceGUID"].Value; | |
Guid executionId = Guid.Parse(executionIdAsObj.ToString()); | |
Console.WriteLine(pkgResults.ToString()); | |
} |
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
private async Task WriteFactorialAsyncUsingAwait(int facno) | |
{ | |
int result = await Task.Run(()=> FindFactorialWithSimulatedDelay(facno)); | |
Console.WriteLine("Factorial of {0} is {1}", facno, result); | |
} | |
public void Main() | |
{ | |
for (int counter = 1; counter < 5; counter++) | |
{ | |
if (counter % 3 == 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
public void Main() | |
{ | |
for (int counter = 1; counter < 5; counter++) | |
{ | |
if (counter % 3 == 0) | |
{ | |
WriteFactorialAsyncUsingTask(counter); | |
} | |
else | |
{ |
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
private void WriteFactorialAsyncUsingTask(int no) | |
{ | |
Task<int> task=Task.Run<int>(() => | |
{ | |
int result = FindFactorialWithSimulatedDelay(no); | |
return result; | |
}); | |
task.ContinueWith(new Action<Task<int>>((input) => | |
{ | |
Console.WriteLine("Factorial of {0} is {1}", no, input.Result); |