Skip to content

Instantly share code, notes, and snippets.

Konstantin Const-me

Block or report user

Report or block Const-me

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View brightness-vc2015.asm
VecInteger r, g, b;
loadRgb( src, r, g, b );
00007FF735AD11C0 vmovdqu xmm6,xmmword ptr [rcx-10h]
00007FF735AD11C5 vmovdqu xmm7,xmmword ptr [rcx-20h]
loadRgb( src + 2, r, g, b );
00007FF735AD11CA vmovdqu xmm9,xmmword ptr [rcx]
00007FF735AD11CE vmovdqu xmm8,xmmword ptr [rcx+10h]
Const-me / SimdBrightness.cs
Created Nov 21, 2019
.NET Core SSE Test, with static readonly constants
View SimdBrightness.cs
using System;
using System.Diagnostics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace SimdBrightness
static class Program
/// <summary>Load 4 pixels of RGB</summary>
View MappedFileTest.cs
// Tested with .NET Core 2.2, will likely work with the rest of the runtimes
using System;
using System.Diagnostics;
using System.IO.MemoryMappedFiles;
using System.Linq;
using System.Runtime.InteropServices;
namespace MappedFileTest
static class Program
View generic.cs
static class Utils
/// <summary>Append a new item to list, return that item</summary>
public static E appendNew<E>( List<E> list ) where E : new()
E newVal = new E();
list.Add( newVal );
return newVal;
Const-me / wpf-window-message-hook.cs
Created Jun 18, 2019
Subclassing WPF window to handle custom messages
View wpf-window-message-hook.cs
using System;
using System.Windows;
using System.Windows.Interop;
static class SubclassWindow
// Call this from the constructor of your main window. SourceInitialized event is raised long after the constructor.
public static void initialize( Window wnd )
wnd.SourceInitialized += ( object sender, EventArgs e ) => sourceInitialized( wnd );
View invalid-file.cpp
#include <stdio.h>
int main()
// Invalid 2 octet sequence:
FILE* f = fopen( "/home/kosta/\xc3\x28", "w" );
fclose( f );
Const-me / EigenVecTest.cpp
Created Jun 5, 2019
A quick test of small Eigen vector classes. Tested on visual Studio 15.9.2, release 64 bit.
View EigenVecTest.cpp
#include "stdafx.h"
// A quick test of small Eigen vector classes. Tested on visual Studio 15.9.2, release 64 bit.
#include "Eigen/Dense"
#include <d3d11.h>
View triples.cpp
#include <iostream>
#include <array>
#include <experimental/generator>
using namespace std::experimental;
using Triple = std::array<int, 3>;
// Generate infinite sequence of Pythagorean triples
generator<Triple> triples()
View gtengine-bug.cpp
#include "stdafx.h"
#include <SimpleMath.h>
using DirectX::SimpleMath::Vector2;
#include <Mathematics/GteIntrSegment2Segment2.h>
inline gte::Vector2<float> _gte( const Vector2& dx )
return gte::Vector2<float>{ dx.x, dx.y };
View EastlWindows.cpp
#include "stdafx.h"
#include <EASTL/allocator.h>
namespace eastl
// Implement assertion failure. This version just traps to debugger.
void __cdecl AssertionFailure( const char *af )
OutputDebugStringA( af );
You can’t perform that action at this time.