This file contains hidden or 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.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); |
This file contains hidden or 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 Machine : INotifyPropertyChanged | |
| { | |
| private Tool _tool; | |
| public event PropertyChangedEventHandler PropertyChanged; | |
| public event EventHandler<ToolChangedEventArgs> ToolChanged; | |
| public Tool Tool | |
| { |
This file contains hidden or 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 NreDemo : INotifyPropertyChanged | |
| { | |
| private int _value; | |
| private int _count; | |
| public event PropertyChangedEventHandler PropertyChanged; | |
| public int Value | |
| { | |
| get { return _value; } | |
| set |
This file contains hidden or 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.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) | |
| { |
This file contains hidden or 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 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); |
This file contains hidden or 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 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), |
This file contains hidden or 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
| 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; |
This file contains hidden or 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 Ninject; | |
| using NUnit.Framework; | |
| public class Class1 | |
| { | |
| [Test] | |
| public void CompRoot() | |
| { | |
| var kernel = new StandardKernel(); | |
| var fuu = kernel.Get<Fuu>(); |
This file contains hidden or 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 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() |