Skip to content

Instantly share code, notes, and snippets.

using System.Linq;
using System.Windows.Input;
using FirstFloor.ModernUI.Windows.Controls;
public static class ModernCommands
{
static ModernCommands()
{
var nextBinding = new CommandBinding(ModernCommands.NextTab, ExecuteNextTab, CanExecuteNextTab);
CommandManager.RegisterClassCommandBinding(typeof(ModernTab), nextBinding);
var prevBinnding = new CommandBinding(ModernCommands.PreviousTab, ExecutePreviousTab, CanExecutePreviousTab);
public class Machine : INotifyPropertyChanged
{
private Tool _tool;
public event PropertyChangedEventHandler PropertyChanged;
public event EventHandler<ToolChangedEventArgs> ToolChanged;
public Tool Tool
{
public class NreDemo : INotifyPropertyChanged
{
private int _value;
private int _count;
public event PropertyChangedEventHandler PropertyChanged;
public int Value
{
get { return _value; }
set
using System;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
public class MainMenuButton : ButtonBase
{
public static readonly DependencyProperty ImageSourceProperty = DependencyProperty.Register(
"ImageSource",
typeof(ImageSource),
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Specialized;
public class FixedSizedQueue<T> : IEnumerable<T>, INotifyCollectionChanged
{
readonly ConcurrentQueue<T> _innerQueue = new ConcurrentQueue<T>();
public FixedSizedQueue(int size)
{
public static Vector<double> FitPolynomial(List<Point> data, int polynomialDegree)
{
//http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html
Matrix<double> vanderMondeMatrix = new DenseMatrix(data.Count(), polynomialDegree + 1);
for (int i = 0; i < data.Count(); i++)
{
var xValue = data[i].X;
for (int j = 0; j < (polynomialDegree + 1); j++)
{
vanderMondeMatrix[i, j] = Math.Pow(xValue, j);
public class PointSetFitterTest
{
[Test]
public void MapPointSets()
{
var xs = new List<Point3D>
{
new Point3D(0, 0, 0),
new Point3D(1, 0, 0),
new Point3D(0, 1, 0),
clear; // What is the command to clear the scilab console?
A=[1,0,0,-3;
0,1,0,4;
0,0,1,5;
0,0,0,1]
x=[1,0,0,0,2;
0,1,0,0,0;
0,0,1,0,3;
using Ninject;
using NUnit.Framework;
public class Class1
{
[Test]
public void CompRoot()
{
var kernel = new StandardKernel();
var fuu = kernel.Get<Fuu>();
public class History<T> : IEnumerable<HistoryItem<T>>, INotifyCollectionChanged
{
private readonly ConcurrentStack<HistoryItem<T>> _stack = new ConcurrentStack<HistoryItem<T>>();
public void Push(T item)
{
_stack.Push(new HistoryItem<T>(item));
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item));
}
public IEnumerator<HistoryItem<T>> GetEnumerator()