Skip to content

Instantly share code, notes, and snippets.

View bradphelan's full-sized avatar

Brad Phelan bradphelan

View GitHub Profile
public class TwoWayBindingWithConversionDemo
{
public class Model : ReactiveObject
{
/// <summary>
/// The model length will be in units meters
/// </summary>
[Reactive] public double LengthInMeters { get; set;}
}
using Microsoft.Azure;
using Microsoft.WindowsAzure;
using Owin;
using Weingartner.Distribution.Website.Accounts;
using Weingartner.Distribution.Website.Storage;
using Weingartner.Distribution.Website.Storage.Azure;
namespace Weingartner.Distribution.Website.Hosting.Azure
{
public class AzureStartup
/// <summary>
/// Faster version of intersect than the eyeshot code.
/// </summary>
/// <param name="this"></param>
/// <param name="other"></param>
/// <param name="intersection"></param>
/// <returns>Returns true if there is an intersection. Returns false if it is colinear.</returns>
public static bool Intersect(this Segment2D @this, Segment2D other, out Point2D intersection)
{
intersection = null;
False : Evil time is 668
True : Good time is 261
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using devDept.Geometry;
using Xunit;
using Xunit.Abstractions;
Vector3D Normal(Solid3D.Face face, Point3D p)
{
return face
.Parametric
.SelectMany
(s => s.PointInversion( p, 1e-3, out var coord2D )
? Some((p: s.PointAt(coord2D), n: s.Normal(coord2D)))
: None )
.MaxBy(q => p.DistanceTo(q.p))
[0].n;
private static bool IsTangentConnected( Solid3D.Face face0, Solid3D.Face face1, Solid3D.Edge edge)
{
var angle = 1.5 / 180 * Math.PI;
// Then the two faces share an edge.
var surfaces0 = face0.Parametric;
var surfaces1 = face1.Parametric;
Vector3D Normal(Surface[] surfaces, Point3D p)
{
using devDept.Eyeshot.Entities;
using devDept.Geometry;
using ReactiveUI;
using System;
using System.Drawing;
using System.Reactive.Linq;
using System.Runtime.CompilerServices;
using Weingartner.EyeshotExtensions;
using Weingartner.EyeshotExtensions.Assembly3D;
public class Foo
{
public static string Y = X;
public static string Z = Y;
public static string X = "hello";
}
[StaFact]
@bradphelan
bradphelan / build log
Created October 31, 2017 07:31
Build Logs
1>------ Build started: Project: RebuildBug, Configuration: Debug Any CPU ------
1>Building with tools version "15.0".
1>Project file contains ToolsVersion="". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="15.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=293424.
1>Target "_CheckForUnsupportedTargetFramework" skipped, due to false condition; ('$(_UnsupportedTargetFrameworkError)' == 'true') was evaluated as ('' == 'true').
1>Target _CollectTargetFrameworkForTelemetry:
1> Using "Telemetry" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1> Task "Telemetry"
1> Done executing task "Telemetry".
1>Target "_CheckForUnsupportedNETCoreVersion" skipped, due to false condition; ('$(TargetFrameworkIdenti