Skip to content

Instantly share code, notes, and snippets.

View mellinoe's full-sized avatar

Eric Mellino mellinoe

View GitHub Profile
eric@erme-u1610:~/projects/tests/helloworld$ lldb-3.6 /home/eric/dotnet/dotnet /home/eric/dotnet/sdk/1.0.0-preview2-003121/csc.dll
(lldb) target create "/home/eric/dotnet/dotnet"
Current executable set to '/home/eric/dotnet/dotnet' (x86_64).
(lldb) settings set -- target.run-args "/home/eric/dotnet/sdk/1.0.0-preview2-003121/csc.dll"
(lldb) run
Process 18985 launching
Process 18985 launched: '/home/eric/dotnet/dotnet' (x86_64)
(lldb)
Unhandled Exception: terminate called after throwing an instance of 'PAL_SEHException'
Process 18985 stopped
# Creating a new docker image for use in an official build
Our official build in VS Online builds coreclr in a docker container. The images for this are stored on Chris Costa's docker hub account: https://hub.docker.com/r/chcosta/dotnetcore/. When adding support for a new distro, you need to create a docker image with the appropriate prerequisites for use in building the coreclr repository.
Notes when making a new image:
Run the build steps that the official build uses to ensure that the image will work as expected. https://devdiv.visualstudio.com/DevDiv/_build/index?context=allDefinitions&path=%5C&definitionId=1713&_a=completed
Running dotnet commands will add a ton of binary data to your home directory. Delete the ~/.nuget directory to avoid bloating the size of the docker image.
@mellinoe
mellinoe / cpp-complex.cpp
Created January 26, 2017 22:56
C++ Complex boundary results
// C++ Code:
#include <complex>
#include <stdio.h>
using namespace std;
void DoTests(complex<double> c)
{
auto sq = sqrt(c);
auto h = hypot(c.real(), c.imag());
// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. All rights reserved.
// Metadata version: v4.0.22220
.assembly extern System.Runtime
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. All rights reserved.
// Metadata version: v4.0.30319
.assembly extern System.Runtime
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
@mellinoe
mellinoe / blog0.cs
Last active February 8, 2017 08:24
Material material = rc.ResourceFactory.CreateMaterial(rc,
"vertex", "fragment",
new MaterialVertexInput(VertexPositionColor.SizeInBytes,
new MaterialVertexInputElement(
"Position", VertexSemanticType.Position, VertexElementFormat.Float3),
new MaterialVertexInputElement(
"Color", VertexSemanticType.Color, VertexElementFormat.Float4)),
new MaterialInputs<MaterialGlobalInputElement>(
new MaterialGlobalInputElement(
"ViewProjectionMatrix", MaterialInputType.Matrix4x4, viewProjection)),
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
OpenTKWindow window = new SameThreadWindow();
RenderContext rc;
if (isWindows && !args.Contains("opengl"))
{
rc = new D3DRenderContext(window)
}
else
{
rc = new OpenGLRenderContext(window);
VertexBuffer vb = rc.ResourceFactory.CreateVertexBuffer(
Cube.Vertices,
new VertexDescriptor(VertexPositionColor.SizeInBytes, 2),
isDynamic:false);
IndexBuffer ib = rc.ResourceFactory.CreateIndexBuffer(
Cube.Indices,
isDynamic: false);
DynamicDataProvider<Matrix4x4> viewProjection = new DynamicDataProvider<Matrix4x4>();
while (window.Exists)
{
InputSnapshot snapshot = window.GetInputSnapshot(); // Process window events.
rc.ClearBuffer(); // Clear the screen.
rc.SetViewport(0, 0, window.Width, window.Height); // Ensure the viewport covers the whole window, in case it was resized.
float timeFactor = Environment.TickCount / 1000f; // Get a rough time estimate.
viewProjection.Data =
// Create a rotated camera matrix based on the current time.
Matrix4x4.CreateLookAt(