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
# install docker in Debian 11/WSL2 | |
# uses systemd-genie since docker requires systemd but it's not available for WSL | |
# this is an alternative to Docker Desktop | |
# prerequisites | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get install ca-certificates curl wget gnupg lsb-release apt-transport-https | |
# systemd-genie requires dotnet runtime, add Microsoft repo |
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 class PackageBinaryInspector : MarshalByRefObject | |
{ | |
/// <summary> | |
/// Entry point to call from your code | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="dllPath"></param> | |
/// <param name="errorReport"></param> | |
/// <returns></returns> | |
/// <remarks> |
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.Runtime.CompilerServices; | |
using System.Threading.Tasks; | |
namespace StateMachineConceptual | |
{ | |
class Program | |
{ | |
static async Task Main() | |
{ |
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.Runtime.CompilerServices; | |
using System.Runtime.ExceptionServices; | |
using System.Threading; | |
namespace Fibers | |
{ | |
public struct AsyncFiberMethodBuilder<T> | |
{ | |
private Fiber<T>? fiber; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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
async def main(): | |
coroutine1 = do_some_work(1) | |
coroutine2 = do_some_work(2) | |
coroutine3 = do_some_work(4) | |
tasks = [ | |
asyncio.ensure_future(coroutine1), | |
asyncio.ensure_future(coroutine2), | |
asyncio.ensure_future(coroutine3) | |
] |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from ctypes import * | |
from ctypes.wintypes import * | |
INVALID_HANDLE_VALUE = -1 | |
CREATE_UNICODE_ENVIRONMENT = 0x00000400 |
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.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
[TestClass] | |
public class StartNewCancellationTokenUnitTests | |
{ | |
[TestMethod] | |
public void CancellationTokenPassedToStartNew_CancelsTaskWithTaskCanceledException() |
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
// Copyright (c) 2012 Daniel Grunwald | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
// software and associated documentation files (the "Software"), to deal in the Software | |
// without restriction, including without limitation the rights to use, copy, modify, merge, | |
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons | |
// to whom the Software is furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in all copies or | |
// substantial portions of the Software. |
NewerOlder