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 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 );
View fibersTest.cpp
#define NOMINMAX
#include <windows.h>
#include <stdio.h>
#include <stdint.h>
#include <array>
#include <algorithm>
void printStack( const char* what )
View memcpy.asm
page ,132
title memcpy - Copy source memory bytes to destination
;memcpy.asm - contains memcpy and memmove routines
; Copyright (c) Microsoft Corporation. All rights reserved.
; memcpy() copies a source memory buffer to a destination buffer.
; Overlapping buffers are not treated specially, so propogation may occur.
View ChineseDecode.cs
using System;
using System.Text;
using System.IO;
namespace ChineeseDecode
class Program
static void main( string path )
View Lines.cs
using System.Windows;
// Base class for lines
abstract class LineBase
// First and second point of the line
public readonly Point p0, p2;
public override string ToString()
View SyncTest.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace ThreadsTest
static class Program
static readonly object syncRoot = new object();
static readonly int[] array = new int[] { 1,2,3,4,5,6 };
View FixEncoding.cs
// (c) 2018
// 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.
// The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement.
// In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or
View shared-ptr-example.cpp
#include <stdint.h>
#include <string>
#include <vector>
#include <array>
#include <memory>
// Can be hundreds of megabytes in these vectors
class Mesh
std::string name;
You can’t perform that action at this time.