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
How to create an asynchronous task | |
var t = Task.Run(() => | |
{ | |
//Long Running Task | |
}); | |
var t1 = t.ContinueWith(tt => | |
{ | |
Console.WriteLine("Ran to Completion successfully. i.e. no cancellation or faulting happened"); |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Cryptor | |
{ |
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
Steps: | |
1. Create a new WPF App in VS2012 | |
2. Add NuGet packages IronPython, and IronPython Stdlib | |
3. Setup ScriptEngine (see code) | |
4. Create the Controller (MVC) for data binding. (see code) | |
5. Run app, put some python code to TextBox hit Run Script | |
XAML: | |
------ |
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
int i3; | |
std::stringstream(record[i]) >> i3; |
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
public partial class MainWindow : Window | |
{ | |
public MainWindow() | |
{ | |
InitializeComponent(); | |
Mouse.OverrideCursor = CreateCursor(50,50, Brushes.Gold, null); | |
} | |
Cursor CreateCursor(double rx, double ry, SolidColorBrush brush, Pen pen) |