This file contains 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.Numerics; | |
namespace Clipping { | |
// https://fr.mathworks.com/matlabcentral/fileexchange/51550-3d-and-2d-homogeneous-space-line-clipping-using-liang-barsky-algorithm | |
public class LiangBarskyClippingHomogeneous { | |
float _t0; | |
float _t1; |
This file contains 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; | |
namespace OneFileTools { | |
/// <summary> | |
/// Awsh Undo helper | |
/// </summary> |
This file contains 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.IO; | |
using System.Net; | |
using System.Text; | |
using System.Threading; | |
// AForge Video Library | |
// AForge.NET framework | |
// | |
// Copyright © Andrew Kirillov, 2007-2008 |
This file contains 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.Concurrent; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace MSPEventAggregator { | |
void sample_usage() { | |
var hub = new MessageHub(); | |
This file contains 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
public class GenericPointList<T> : IPointList { | |
List<T> innerList; | |
Func<T, double> ySelector; | |
Func<T, double> xSelector; | |
public GenericPointList(List<T> list, Func<T, double> xSelector, Func<T, double> ySelector) { | |
innerList = list; | |
this.xSelector = xSelector; | |
this.ySelector = ySelector; | |
} |
This file contains 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.Drawing; | |
using System.IO; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace SimpleMJPEGStreamViewer { | |
static class SimpleMJPEGDecoder { |
This file contains 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
// Inspired by http://stackoverflow.com/q/301809/24472 | |
public static string Property<TProp>(Expression<Func<T, TProp>> expression) | |
{ | |
var s = expression.Body.ToString(); | |
var p = s.Remove(0, s.IndexOf('.') + 1); | |
return p; | |
} | |
// Example: |
This file contains 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.Reflection; | |
namespace System | |
{ | |
internal static class ObjectExtensions | |
{ | |
public static PropertyInfo GetPropertyInfo(this Type type, string name) | |
{ | |
string[] bits = name.Split('.'); | |
for (int i = 0; i < bits.Length - 1; i++) |
This file contains 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
// sourceSize = source control size | |
// targetSize = target control size | |
// center of the zoom | |
// zoom radius | |
static Rectangle Zoom(Size sourceSize, Size targetSize, Point center, int radius) | |
{ | |
var f = Math.Min((double)targetSize.Width / ((double)radius * 2d), (double)targetSize.Height / ((double)radius * 2d)); | |
var loc = new Point((int)((-center.X + radius) * f), (int)((-center.Y + radius) * f)); |
This file contains 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.IO; | |
using System.Linq; | |
using System.Reflection; | |
namespace System | |
{ | |
public static class AssemblyResolver | |
{ | |
internal static void Hook(params string[] folders) | |
{ |
NewerOlder