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 AsyncObjectWait<T1, TriggerType> | |
{ | |
private Queue<TaskCompletionSource<TriggerType>> _waits; | |
T1 _value; | |
public AsyncObjectWait(T1 triggerValue) | |
{ | |
_value = triggerValue; | |
_waits = new Queue<TaskCompletionSource<TriggerType>>(); | |
} |
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
void setup() | |
{ | |
size(400,400); | |
background(255); | |
} | |
void drawBlob(int x,int y) | |
{ | |
noStroke(); | |
float val=0f; | |
for(int i=0;i<10;i++) |
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 Boolean TryOpen(){ | |
. | |
. | |
. | |
_hDrive = FileIO.Methods.CreateFile( | |
Info.PhysicalPath, | |
FileIO.FileAccess.GenericRead | FileIO.FileAccess.GenericWrite, | |
FileIO.FileShare.Read | FileIO.FileShare.Write, | |
IntPtr.Zero, |
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
* text=lf | |
*.js text | |
*.sh text | |
*.py text | |
*.md text | |
*.css text | |
*.html text | |
*.txt text |
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 RJCP.IO.Ports; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reactive.Disposables; | |
using System.Reactive.Linq; | |
using System.Reactive.Subjects; | |
using System.Text; | |
using System.Threading; |
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 static Task WaitOneAsync(this WaitHandle waitHandle) | |
{ | |
if (waitHandle == null) | |
throw new ArgumentNullException("waitHandle"); | |
var tcs = new TaskCompletionSource<bool>(); | |
var t = tcs.Task; | |
RegisteredWaitHandle rwh = null; | |
t=t.ContinueWith((antecedent) => rwh.Unregister(null)); | |
rwh = ThreadPool.RegisterWaitForSingleObject(waitHandle, |
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
#include <functional> | |
#include <iostream> | |
#include <string> | |
#include <mutex> | |
#include <thread> | |
#include <unordered_map> | |
#include <unordered_set> | |
#include <tuple> | |
using namespace std; |
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 static class NumericConverter | |
{ | |
public enum PadMode | |
{ | |
Zeros, | |
Ones, | |
Sign | |
} | |
private const int positiveExt = 0x00; | |
private const int negativeExt = 0xFF; |
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
let input: [boolean] = [ | |
true, true, true, | |
false, false, | |
true, true, | |
false, | |
true, | |
false, | |
true, | |
false, false] |
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.Buffers; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using PInvoke; | |
namespace PInvoke |
OlderNewer