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
// Runs tasks in parallel with a max concurrency. | |
// - `tasks` param should be an iterable collection of promises | |
// - `concurrency` is the maximum number of tasks to run at once | |
// - returns an array of results in same order as returned from | |
// the tasks. Each result is an object with either `value` key | |
// if the promise returned a value, or `error` if the task threw | |
// an error. | |
async function runParallel(tasks, concurrency) | |
{ |
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
using SkiaSharp; | |
using System; | |
using System.Data.Common; | |
using System.Runtime.InteropServices.ComTypes; | |
using Topten.GuiKit.DataTransfer; | |
using Topten.RichTextKit; | |
using Topten.RichTextKit.Editor; | |
namespace Topten.GuiKit | |
{ |
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
#include <Adafruit_NeoPixel.h> | |
#include <MIDI.h> | |
#define PIN_COLOR_LEDS 6 | |
#define CC_TEMPO_LEDS 127 | |
#define BEAT_MASK 0x0F | |
#define BEATS_SHIFT 4 | |
#define BEATS_OFFSET 2 | |
#define BEATS_MASK 0x0F |
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
in#include <Adafruit_NeoPixel.h> | |
#include <MIDI.h> | |
#define PIN_COLOR_LEDS 6 | |
#define CC_TEMPO_LEDS 127 | |
#define BEAT_MASK 0x0F | |
#define COLOR_DOWNBEAT 0x001000 | |
#define COLOR_OTHERBEATS 0x080000 | |
#define MILLIS_FLASH 100 |
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
let fs = require('fs'); | |
let string_decoder = require('string_decoder'); | |
// Synchronously read the content of a text file one line at a time | |
// Note, caller must complete the iteration for file to be closed | |
// ie: don't break out early from the loop calling this function | |
function* getFileLinesSync(filename, encoding) | |
{ | |
let fd = fs.openSync(filename); | |
let buf = Buffer.allocUnsafe(32768); |
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
// This is the root Class1.cs file | |
public partial class Class1 | |
{ | |
public string Platform | |
{ | |
get => impl_GetPlatform(); | |
} | |
} | |
// This goes in PlatformWin/Class1.cs |
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
<PropertyGroup> | |
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks> | |
</PropertyGroup> |
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
<PropertyGroup Condition="$(Configuration.EndsWith('Win'))"> | |
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants> | |
</PropertyGroup> | |
<PropertyGroup Condition="$(Configuration.EndsWith('Osx'))"> | |
<DefineConstants>$(DefineConstants);OSX</DefineConstants> | |
</PropertyGroup> | |
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))"> | |
<DefineConstants>$(DefineConstants);NET4</DefineConstants> |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace DpiTest | |
{ | |
class Program |
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
void Load() | |
{ | |
// Standard messages | |
Add(0x0000, new unused()); // WM_NULL | |
Add(0x0001, new WM_NC_OR_CREATE(false)); // WM_CREATE | |
Add(0x0002, new WM_DESTROY()); // WM_DESTROY | |
Add(0x0003, new copy()); // WM_MOVE | |
Add(0x0005, new copy()); // WM_SIZE | |
Add(0x0006, new WM_ACTIVATE()); // WM_ACTIVATE | |
// etc... |
NewerOlder