Boot sector read successfully, format command in progress.

--- Core/Spect.Net.SpectrumEmu/Devices/Floppy/FloppyDevice.cs
+++ Core/Spect.Net.SpectrumEmu/Devices/Floppy/FloppyDevice.cs
@@ -12,7 +12,6 @@
         private int _commandBytesReceived;
         private int _resultBytesIndex;
         private int _dataResultBytesIndex;
-        private byte _nextSector;
         private byte _st0;
         private byte _st1;
         private byte _st2;
@@ -60,19 +59,24 @@
         public bool NonDmaMode { get; private set; }

         /// <summary>
-        /// Represents head 0 or 1
-        /// </summary>
-        public int HeadNumber { get; private set; }
-
-        /// <summary>
         /// Represents the selected drive
         /// </summary>
         public int SelectedDrive { get; private set; }

         /// <summary>
-        /// Gets the current cylinder values
-        /// </summary>
-        public byte[] CurrentCylinders { get; } = new byte[4];
+        /// Gets the current head values
+        /// </summary>
+        public byte[] Heads { get; } = new byte[4];
+
+        /// <summary>
+        /// Gets the current track values
+        /// </summary>
+        public byte[] CurrentTracks { get; } = new byte[4];
+
+        /// <summary>
+        /// Gets the current sector values
+        /// </summary>
+        public byte[] CurrentSectors { get; } = new byte[4];

         /// <summary>
         /// Resets this device
@@ -86,10 +90,10 @@
             _st0 = _st1 = _st2 = _st3 = 0x00;
             for (var i = 0; i < 4; i++)
             {
-                CurrentCylinders[i] = 0x00;
+                CurrentTracks[i] = 0x00;
+                CurrentSectors[i] = 0x00;
             }
             _execStatus = 0x80;
-            _nextSector = 1;
             _multiTrack = false;
             _skipDeletedData = false;
             _floppyFile = VirtualFloppyFile.OpenOrCreateFloppyFile(@"C:\Temp\FloppyFile\vfddFile.vfdd");
@@ -222,9 +226,9 @@
                 }
                 else if (cmd == 0x08)
                 {
-                    // --- Sense inteerupt status, no more command bytes
-                    _st0 = (byte)(_execStatus | (HeadNumber == 0 ? 0x04 : 0x00) | (SelectedDrive & 0x03));
-                    SendResult(new[] { _st0, CurrentCylinders[SelectedDrive] });
+                    // --- Sense interrupt status, no more command bytes
+                    _st0 = (byte)(_execStatus | (Heads[SelectedDrive] == 0 ? 0x00 : 0x04) | (SelectedDrive & 0x03));
+                    SendResult(new[] { _st0, CurrentTracks[SelectedDrive] });
                     _execStatus = 0x80;
                     return;
                 }
@@ -241,7 +245,14 @@
                     _lastCommand = Command.ReadData;
                     _multiTrack = (cmd & 0x80) != 0;
                     _skipDeletedData = (cmd & 0x20) != 0;
-                    _parameters = new byte[7];
+                    _commandBytesReceived = 0;
+                    _parameters = new byte[8];
+                }
+                else if ((cmd & 0xBD) == 0x0D)
+                {
+                    _lastCommand = Command.FormatTrack;
+                    _commandBytesReceived = 0;
+                    _parameters = new byte[5];
                 }
                 else
                 {
@@ -270,59 +281,89 @@
                     break;

                 case Command.SenseDriveStatus:
-                    HeadNumber = (cmd >> 2) & 0x01;
                     SelectedDrive = cmd & 0x03;
-                    _st3 = (byte)(0b0011_1000 | (HeadNumber == 0 ? 0x04 : 0x00) | (SelectedDrive & 0x03));
+                    Heads[SelectedDrive] = (byte)((cmd >> 2) & 0x01);
+                    _st3 = (byte)(0b0011_1000 | (Heads[SelectedDrive] == 0 ? 0x00 : 0x04) | (SelectedDrive & 0x03));
                     SendResult(new [] { _st3 });
                     break;

                 case Command.Recalibrate:
                     SelectedDrive = cmd & 0x03;
-                    CurrentCylinders[SelectedDrive] = 0x00;
+                    CurrentTracks[SelectedDrive] = 0x00;
                     _acceptCommand = true;
+                    _execStatus = 0b0010_0000;
                     break;

                 case Command.Seek:
                     if (_commandBytesReceived == 0)
                     {
-                        HeadNumber = (cmd >> 2) & 0x01;
                         SelectedDrive = cmd & 0x03;
+                        Heads[SelectedDrive] = (byte)((cmd >> 2) & 0x01);
                         _commandBytesReceived++;
                     }
                     else
                     {
-                        CurrentCylinders[SelectedDrive] = (byte)(cmd > 79 ? 79 : cmd);
+                        CurrentTracks[SelectedDrive] = (byte)(cmd > 79 ? 79 : cmd);
+                        CurrentSectors[SelectedDrive] = 1;
                         _execStatus = 0b0010_0000;
-                        _nextSector = 1;
                         _acceptCommand = true;
                     }
                     break;

                 case Command.ReadId:
-                    HeadNumber = (cmd >> 2) & 0x01;
                     SelectedDrive = cmd & 0x03;
+                    Heads[SelectedDrive] = (byte)((cmd >> 2) & 0x01);
                     _commandBytesReceived++;
-                    _st0 = (byte)(SelectedDrive & 0x03);
-                    _st1 = (byte)(_nextSector > 9 ? 0x80 : 0x00);
-                    _st2 = 0x00;
-                    SendResult(new []{ _st0, _st1, _st2,
-                        CurrentCylinders[SelectedDrive],
-                        (byte)HeadNumber,
-                        _nextSector,
-                        (byte)0x02});
-                    _nextSector++;
+                    CurrentSectors[SelectedDrive]++;
+                    _execStatus = 0x00;
+                    SendDataResult();
                     break;

                 case Command.ReadData:
-                    if (_commandBytesReceived < 7)
+                    if (_commandBytesReceived < 8)
                     {
                         _parameters[_commandBytesReceived++] = cmd;
                     }
-                    if (_commandBytesReceived >= 7)
-                    {
-                        // TODO: Read bytes
-
-                    }
+                    if (_commandBytesReceived >= 8)
+                    {
+                        SelectedDrive = _parameters[0] & 0x03;
+                        Heads[SelectedDrive] = (byte)((_parameters[0] >> 2) & 0x01);
+
+                        // --- Check if ID is the same as the current sector
+                        if (_parameters[1] != CurrentTracks[SelectedDrive]
+                            || _parameters[2] != Heads[SelectedDrive]
+                            || _parameters[3] != CurrentSectors[SelectedDrive]
+                            || _parameters[4] != 0x02 && _parameters[4] != 0)
+                        {
+                            _dataResult = null;
+                            _execStatus = 0x40; // --- Command completed abnormally
+                            SendDataResult();
+                            break;
+                        }
+
+                        // --- Read bytes in
+                        var length = _parameters[4] == 0 ? _parameters[7] : 512;
+                        _dataResult = _floppyFile.ReadData(
+                            Heads[SelectedDrive],
+                            CurrentTracks[SelectedDrive],
+                            CurrentSectors[SelectedDrive],
+                            length);
+                        _execStatus = 0x00;
+                        SendDataResult();
+                    }
+                    break;
+
+                case Command.FormatTrack:
+                    if (_commandBytesReceived < 5)
+                    {
+                        _parameters[_commandBytesReceived++] = cmd;
+                    }
+                    if (_commandBytesReceived >= 5)
+                    {
+                        SelectedDrive = _parameters[0] & 0x03;
+                        Heads[SelectedDrive] = (byte)((_parameters[0] >> 2) & 0x01);
+                    }
+
                     break;

                 default:
@@ -345,8 +386,7 @@
             {
                 if (_dataResult != null && _dataResultBytesIndex < _dataResult.Length)
                 {
-                    SetExecutionMode(true);
-                    return _commandResult[_dataResultBytesIndex++];
+                    return _dataResult[_dataResultBytesIndex++];
                 }
                 SetExecutionMode(false);
                 if (_commandResult != null && _resultBytesIndex < _commandResult.Length)
@@ -371,9 +411,32 @@
         {
             _acceptCommand = true;
             _resultBytesIndex = 0;
+            _dataResultBytesIndex = 0;
             SetDioFlag(true);
             _commandResult = result;
             _dataResult = dataResult;
+            if (_dataResult != null)
+            {
+                SetExecutionMode(true);
+            }
+        }
+
+        /// <summary>
+        /// Sends the standard data result package
+        /// </summary>
+        private void SendDataResult()
+        {
+            _st0 = (byte)(_execStatus | (Heads[SelectedDrive] == 0 ? 0x00 : 0x04) | (SelectedDrive & 0x03));
+            _st1 = (byte)(CurrentSectors[SelectedDrive] > 9 ? 0x80 : 0x00);
+            _st2 = 0x00;
+            SendResult(new byte[]
+            {
+                _st0, _st1, _st2,
+                CurrentTracks[SelectedDrive],
+                Heads[SelectedDrive],
+                CurrentSectors[SelectedDrive],
+                0x02
+            }, _dataResult);
         }

         private enum Command: byte


Fixed warning CS0168: The variable 'tce' is declared but never used.

--- DaisyChain/Lavspent.DaisyChain/Stream/PclStreamWrapper.cs
+++ DaisyChain/Lavspent.DaisyChain/Stream/PclStreamWrapper.cs
@@ -76,7 +76,8 @@
             try
             {
                 read = await _stream.ReadAsync(buffer, index, length, ctsl.Token /* cancellationToken*/);
-            } catch (TaskCanceledException tce) when (ctsl.IsCancellationRequested)
+            }
+            catch (TaskCanceledException) when (ctsl.IsCancellationRequested)
             {
                 // timeout
                 read = 0;


Very simple run of the code

Very simple run of the code

Doesn't work yet, but uses the most basic things

--- DemosAndTests/SimpleNugetPackageDependencyTest/Program.cs
+++ DemosAndTests/SimpleNugetPackageDependencyTest/Program.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -15,6 +16,17 @@
     {
         static void Main(string[] args)
         {
+            var rootFile = new FileInfo(@"..\..\..\..\hvsample.root");
+            if (!rootFile.Exists)
+            {
+                Console.WriteLine("Unable to find the input file '" + rootFile.FullName + "'");
+                return;
+            }
+
+            var rf1 = ROOTLINQ.QueryableCollectionTree.CreateQueriable(rootFile);
+
+            var c = rf1.Count();
+            Console.WriteLine("Number of events: {0}", c);
         }
     }
 }


Dev in progress...

Dev in progress...

Dev in progress...

--- DevelopmentInProgress.DipMapper.Test/DipMapperDataTest.cs
+++ DevelopmentInProgress.DipMapper.Test/DipMapperDataTest.cs
@@ -26,13 +26,13 @@
             var activity = conn.Single<Activity>(parameters);

             // Assert
-            Assert.AreEqual(activity.Id, 6);
+            Assert.AreEqual(activity.Id, 1);
             Assert.AreEqual(activity.Name, "Email");
             Assert.AreEqual(activity.Level, 3);
             Assert.AreEqual(activity.IsActive, true);
             Assert.AreEqual(activity.Created, new DateTime(2016, 08, 01));
             Assert.AreEqual(activity.Updated, new DateTime(2016, 08, 01));
-            Assert.AreEqual(activity.ActivityType, 1);
+            Assert.AreEqual(activity.ActivityType, ActivityTypeEnum.Private);
         }
     }
 }


アクティブなタブを閉じても次のタブがアクティブにならなかったのを""""運がよければ""""修正

--- ImageViewer/ViewModels/MainWindowViewModel.cs
+++ ImageViewer/ViewModels/MainWindowViewModel.cs
@@ -233,17 +233,16 @@
             get { return _SelectedIndex; }
             set
             {
-                if (DeferredImageItems != null && value < DeferredImageItems.Count && value != -1)
-                {
-                    if(value == -1 || DeferredImageItems.Count == value)
+                if (DeferredImageItems != null && value < DeferredImageItems.Count)
+                {
+                    _SelectedIndex = value;
+
+                    if (value != -1)
                     {
-                        return;
+                        SelectedImageWidth = DeferredImageItems[value].Width;
+                        SelectedImageHeight = DeferredImageItems[value].Height;
+                        CalcZoom();
                     }
-                    _SelectedIndex = value;
-
-                    SelectedImageWidth = DeferredImageItems[value].Width;
-                    SelectedImageHeight = DeferredImageItems[value].Height;
-                    CalcZoom();
                 }
                 RaisePropertyChanged();
             }
@@ -422,12 +421,13 @@
             }

             var currentIndex = SelectedIndex;
+            SelectedIndex = -1;
+
             DeferredImageItems.RemoveAt(parameter);
-            SelectedIndex = currentIndex < DeferredImageItems.Count ?
-                parameter == 0 ?
-                    parameter :
-                    currentIndex :
-                DeferredImageItems.Count - 1;
+
+            SelectedIndex = currentIndex < DeferredImageItems.Count ?
+                    currentIndex :
+                    DeferredImageItems.Count - 1;
         }
         #endregion


Added System.IO to default references.

Added System.IO to default references.

--- FlubuCore/Scripting/ScriptLoader.cs
+++ FlubuCore/Scripting/ScriptLoader.cs
@@ -225,6 +225,7 @@
                 typeof(object).GetTypeInfo().Assembly.Location,
                 flubuPath,
                 typeof(ILookup<string, string>).GetTypeInfo().Assembly.Location,
+                typeof(Stream).GetTypeInfo().Assembly.Location,
                 typeof(Expression).GetTypeInfo().Assembly.Location,
                 typeof(MethodInfo).GetTypeInfo().Assembly.Location,
                 typeof(OSPlatform).GetTypeInfo().Assembly.Location,


Removed bad bad code.

Removed bad bad code.

--- FlubuCore/Scripting/ScriptLoader.cs
+++ FlubuCore/Scripting/ScriptLoader.cs
@@ -192,58 +192,54 @@
             }
         }

-        private IEnumerable<MetadataReference> GetBuildScriptReferences(CommandArguments args, AnalyserResult analyserResult, List<string> code, bool oldWay)
-        {
-            try
-            {
-                var coreDir = Path.GetDirectoryName(typeof(object).GetTypeInfo().Assembly.Location);
-                var flubuCoreAssembly = typeof(DefaultBuildScript).GetTypeInfo().Assembly;
-                var flubuPath = flubuCoreAssembly.Location;
-
-                //// Default assemblies that should be referenced.
-                var assemblyReferenceLocations = oldWay ? GetBuildScriptReferencesForOldWayBuildScriptCreation() : GetDefaultReferences(coreDir, flubuPath);
-
-                // Enumerate all assemblies referenced by FlubuCore
-                // and provide them as references to the build script we're about to
-                // compile.
-                AssemblyName[] referencedAssemblies = flubuCoreAssembly.GetReferencedAssemblies();
-                foreach (var referencedAssembly in referencedAssemblies)
-                {
-                    Assembly loadedAssembly = Assembly.Load(referencedAssembly);
-                    if (string.IsNullOrEmpty(loadedAssembly.Location))
-                        continue;
-
-                    assemblyReferenceLocations.Add(loadedAssembly.Location);
-                }
-
-                assemblyReferenceLocations.AddRange(analyserResult.References);
-                assemblyReferenceLocations.AddRange(
-                    _nugetPackageResolver.ResolveNugetPackages(analyserResult.NugetPackages));
-                AddOtherCsFilesToBuildScriptCode(analyserResult, assemblyReferenceLocations, code);
-                assemblyReferenceLocations.AddRange(FindAssemblyReferencesInDirectories(args.AssemblyDirectories));
-                assemblyReferenceLocations =
-                    assemblyReferenceLocations.Distinct().Where(x => !string.IsNullOrEmpty(x)).ToList();
-                IEnumerable<PortableExecutableReference> references = null;
-                references = assemblyReferenceLocations.Select(i => MetadataReference.CreateFromFile(i));
-
-                ////foreach (var assemblyReferenceLocation in assemblyReferenceLocations)
-                ////{
-                ////    try
-                ////    {
-                ////        AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyReferenceLocation);
-                ////    }
-                ////    catch (Exception ex)
-                ////    {
-                ////        Console.WriteLine($"failed: {assemblyReferenceLocation}");
-                ////    }
-                ////}
-
-                return references;
-            }
-            catch (Exception e)
-            {
-                return null;
-            }
+        private IEnumerable<MetadataReference> GetBuildScriptReferences(CommandArguments args,
+            AnalyserResult analyserResult, List<string> code, bool oldWay)
+        {
+            var coreDir = Path.GetDirectoryName(typeof(object).GetTypeInfo().Assembly.Location);
+            var flubuCoreAssembly = typeof(DefaultBuildScript).GetTypeInfo().Assembly;
+            var flubuPath = flubuCoreAssembly.Location;
+
+            //// Default assemblies that should be referenced.
+            var assemblyReferenceLocations = oldWay
+                ? GetBuildScriptReferencesForOldWayBuildScriptCreation()
+                : GetDefaultReferences(coreDir, flubuPath);
+
+            // Enumerate all assemblies referenced by FlubuCore
+            // and provide them as references to the build script we're about to
+            // compile.
+            AssemblyName[] referencedAssemblies = flubuCoreAssembly.GetReferencedAssemblies();
+            foreach (var referencedAssembly in referencedAssemblies)
+            {
+                Assembly loadedAssembly = Assembly.Load(referencedAssembly);
+                if (string.IsNullOrEmpty(loadedAssembly.Location))
+                    continue;
+
+                assemblyReferenceLocations.Add(loadedAssembly.Location);
+            }
+
+            assemblyReferenceLocations.AddRange(analyserResult.References);
+            assemblyReferenceLocations.AddRange(
+                _nugetPackageResolver.ResolveNugetPackages(analyserResult.NugetPackages));
+            AddOtherCsFilesToBuildScriptCode(analyserResult, assemblyReferenceLocations, code);
+            assemblyReferenceLocations.AddRange(FindAssemblyReferencesInDirectories(args.AssemblyDirectories));
+            assemblyReferenceLocations =
+                assemblyReferenceLocations.Distinct().Where(x => !string.IsNullOrEmpty(x)).ToList();
+            IEnumerable<PortableExecutableReference> references = null;
+            references = assemblyReferenceLocations.Select(i => MetadataReference.CreateFromFile(i));
+
+            ////foreach (var assemblyReferenceLocation in assemblyReferenceLocations)
+            ////{
+            ////    try
+            ////    {
+            ////        AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyReferenceLocation);
+            ////    }
+            ////    catch (Exception ex)
+            ////    {
+            ////        Console.WriteLine($"failed: {assemblyReferenceLocation}");
+            ////    }
+            ////}
+
+            return references;
         }

         private List<string> GetDefaultReferences(string coreDir, string flubuPath)


VectorQuantization update: Replace List<T> with VarBigArray<T> to support bigger data set

--- AdvUtils/VectorQuantization.cs
+++ AdvUtils/VectorQuantization.cs
@@ -35,13 +35,15 @@
     {
         protected List<VQCluster> vqClusters;
         protected double[] codebook;
-        protected List<double> dataSet;
+        protected VarBigArray<double> dataSet;
+        protected int dataSetSize;

         public double[] CodeBook { get { return codebook; } }

         public VectorQuantization()
         {
-            dataSet = new List<double>();
+            dataSet = new VarBigArray<double>(1024 * 1024);
+            dataSetSize = 0;
         }

         /// <summary>
@@ -50,7 +52,10 @@
         /// <param name="values"></param>
         public void Add(double[] values)
         {
-            dataSet.AddRange(values);
+            foreach (double value in values)
+            {
+                Add(value);
+            }
         }

         /// <summary>
@@ -59,7 +64,8 @@
         /// <param name="value"></param>
         public void Add(double value)
         {
-            dataSet.Add(value);
+            dataSet[dataSetSize] = value;
+            dataSetSize++;
         }

         public int ComputeVQ(double value)
@@ -74,21 +80,21 @@
         /// <returns></returns>
         public double BuildCodebook(int vqSize)
         {
-            if (vqSize > dataSet.Count)
+            if (vqSize > dataSetSize)
             {
                 Logger.WriteLine(Logger.Level.err, "VQ size should not be greater than data size.");
                 return -1;
             }

-            Logger.WriteLine("Sorting data set (size: {0})...", dataSet.Count);
-            dataSet.Sort();
-
-            Logger.WriteLine("min={0}, max={1}", dataSet[0], dataSet[dataSet.Count - 1]);
+            Logger.WriteLine("Sorting data set (size: {0})...", dataSetSize);
+            dataSet.Sort(0, dataSetSize);
+
+            Logger.WriteLine("min={0}, max={1}", dataSet[0], dataSet[dataSetSize - 1]);

             //Set entire data as a single cluster, and then split it
             double mean, var;
-            ComputeVariables(0, dataSet.Count - 1, out mean, out var);
-            VQCluster c = new VQCluster(mean, var, 0, dataSet.Count - 1);
+            ComputeVariables(0, dataSetSize - 1, out mean, out var);
+            VQCluster c = new VQCluster(mean, var, 0, dataSetSize - 1);
             vqClusters = new List<VQCluster>();
             vqClusters.Add(c);

@@ -120,7 +126,7 @@
                 }
             }

-            distortion = Math.Sqrt(distortion / dataSet.Count);
+            distortion = Math.Sqrt(distortion / dataSetSize);
             return distortion;
         }


Typo in Day 21

Typo in Day 21

--- AdventOfCode/Year2015/Day21.cs
+++ AdventOfCode/Year2015/Day21.cs
@@ -43,7 +43,7 @@
             while (queue.Count > 0)
             {
                 var outfit = queue.Dequeue();
-                int outfitCost = calculateOutfitPrice(outfit);
+                int outfitCost = CalculateOutfitPrice(outfit);

                 // no bother to fight if it aint the cheapest winnable outfit
                 if (outfitCost > cheapestOutfit) { continue; }
@@ -81,7 +81,7 @@
             return cheapestOutfit.ToString();
         }

-        internal int calculateOutfitPrice((string weapon, string armor, string ring1, string ring2) outfit)
+        internal int CalculateOutfitPrice((string weapon, string armor, string ring1, string ring2) outfit)
         {
             int cost = weapons[outfit.weapon].cost;
             if (outfit.armor != null) { cost += armor[outfit.armor].cost; }
@@ -137,7 +137,7 @@
             while (queue.Count > 0)
             {
                 var outfit = queue.Dequeue();
-                int outfitCost = calculateOutfitPrice(outfit);
+                int outfitCost = CalculateOutfitPrice(outfit);

                 if (PlayerWinsFromBoss(outfit) == false)
                 {


added reloading state

added reloading state

--- Ai2dShooter/Model/FsmPlayer.cs
+++ Ai2dShooter/Model/FsmPlayer.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Drawing;
 using System.Linq;
+using System.Runtime.CompilerServices;
 using System.Threading;
 using Ai2dShooter.Common;
 using Ai2dShooter.Controller;
@@ -15,18 +16,20 @@
     {
         #region Private Fields

-        private enum State { FindEnemy, AttackEnemy, Combat, FindFriend, Dead }
+        private enum State { FindEnemy, AttackEnemy, Combat, FindFriend, Reload, Dead }

         private static readonly Color[] StateColors =
         {
-            Color.Green, Color.Goldenrod, Color.Red, Color.Pink, Color.DeepSkyBlue
+            Color.Green, Color.Goldenrod, Color.Red, Color.Pink, Color.Purple, Color.DeepSkyBlue
         };

-        private readonly Pen _opponentPen = new Pen(Color.Orange, 2);
+        private readonly Pen _targetPen = new Pen(Color.FromArgb(127, Color.LawnGreen), 4);

         private Cell _targetCell;

         private State _state;
+
+        private int _reloadSteps;

         #endregion

@@ -56,7 +59,7 @@

             // if required, draw a line to the cell that is currently being targeted by the player
             if (_targetCell != null && IsAlive)
-                graphics.DrawLine(_opponentPen, box.X + box.Width/2, box.Y + box.Height/2, _targetCell.X * scaleFactor + box.Width / 2, _targetCell.Y*scaleFactor + box.Height / 2);
+                graphics.DrawLine(_targetPen, box.X + box.Width/2, box.Y + box.Height/2, _targetCell.X * scaleFactor + box.Width / 2, _targetCell.Y*scaleFactor + box.Height / 2);
         }

         public override void StartGame()
@@ -86,8 +89,16 @@
         {
             base.KilledEnemy();

-            // depending on health, look for friends or enemies
-            _state = Health >= HealthyThreshold ? State.FindEnemy : State.FindFriend;
+            // depending on health, look for friends or enemies or reload
+            if (UsesKnife)
+            {
+                _state = State.Reload;
+                _reloadSteps = Constants.ReloadSounds.Length - 1;
+            }
+            else
+                _state = Health >= HealthyThreshold ? State.FindEnemy : State.FindFriend;
+
+            //Console.WriteLine(this + " has killed an enemy and is now " + _state);

             // start movement
             MakeDecision();
@@ -233,6 +244,23 @@
                 case State.Combat:
                     // keep fighting
                     break;
+                case State.Reload:
+                    lock (Constants.MovementLock)
+                    {
+                        Constants.ReloadSounds[_reloadSteps--].Play();
+
+                        if (_reloadSteps == -1)
+                        {
+                            _state = Health >= HealthyThreshold ? State.FindEnemy : State.FindFriend;
+                            Ammo = MaxAmmo;
+                        }
+                        new Thread(() =>
+                        {
+                            Thread.Sleep(25 * Constants.AiMoveTimeout);
+                            MakeDecision();
+                        }).Start();
+                    }
+                    return;
                 default:
                     throw new ArgumentOutOfRangeException();
             }


Check.Unreachable now throws a ControlFlowException.

--- src/Narvalo.Cerbere/Check.cs
+++ src/Narvalo.Cerbere/Check.cs
@@ -9,12 +9,20 @@
     ///
     /// Provides Code Contracts abbreviators and helpers.
     ///
-    // To be used instead of
-    //      Contract.Assert(testCondition);
-    //      Debug.Assert(testCondition);
     [DebuggerStepThrough]
     public static class Check
     {
+        ///
+        ///
+        ///
+        /// <param name="testCondition"></param>
+        /// <remarks>
+        /// To be used instead of
+        ///
+        ///     Contract.Assert(testCondition);
+        ///     Debug.Assert(testCondition);
+        ///
+        /// </remarks>
         [Conditional("DEBUG")]
         [Conditional("CONTRACTS_FULL")]
         public static void True(bool testCondition) => Demand.True(testCondition);
@@ -36,30 +44,13 @@
             Justification = "OpenCover can't discover the tests because of the CONTRACTS_FULL conditional.")]
         public static void AssumeInvariant<T>(T obj) { }

-        ///
-        /// Asserts that a point of execution is unreachable.
-        ///
-        /// <remarks>Adapted from <see cref="!:https://blogs.msdn.microsoft.com/francesco/2014/09/12/how-to-use-cccheck-to-prove-no-case-is-forgotten/"/>.</remarks>
-        /// <example>
-        ///
-        /// switch (myEnum)
-        /// {
-        ///     case MyEnum.DefinedValue:
-        ///         return "DefinedValue";
-        ///     default:
-        ///         throw Acknowledge.Unreachable("Found a missing case in the switch.");
-        /// }
-        ///
-        /// </example>
-        /// <param name="reason">The error message to use if the point of execution is reached.</param>
-        /// <returns>A new instance of the <see cref="NotSupportedException"/> class with the specified error message.</returns>
         [DebuggerHidden]
         [ContractVerification(false)]
-        public static NotSupportedException Unreachable(string reason)
+        public static ControlFlowException Unreachable()
         {
             Contract.Requires(false);

-            return new NotSupportedException(reason);
+            return new ControlFlowException();
         }

         ///
@@ -73,7 +64,33 @@
         ///     case MyEnum.DefinedValue:
         ///         return "DefinedValue";
         ///     default:
-        ///         throw Acknowledge.Unreachable(new MyException("Found a missing case in the switch."));
+        ///         throw Check.Unreachable("Found a missing case in a switch.");
+        /// }
+        ///
+        /// </example>
+        /// <param name="rationale">The error message to use if the point of execution is reached.</param>
+        /// <returns>A new instance of the <see cref="ControlFlowException"/> class with the specified error message.</returns>
+        [DebuggerHidden]
+        [ContractVerification(false)]
+        public static ControlFlowException Unreachable(string rationale)
+        {
+            Contract.Requires(false);
+
+            return new ControlFlowException(rationale);
+        }
+
+        ///
+        /// Asserts that a point of execution is unreachable.
+        ///
+        /// <remarks>Adapted from <see cref="!:https://blogs.msdn.microsoft.com/francesco/2014/09/12/how-to-use-cccheck-to-prove-no-case-is-forgotten/"/>.</remarks>
+        /// <example>
+        ///
+        /// switch (myEnum)
+        /// {
+        ///     case MyEnum.DefinedValue:
+        ///         return "DefinedValue";
+        ///     default:
+        ///         throw Check.Unreachable(new MyException("Found a missing case in a switch."));
         /// }
         ///
         /// </example>


slider function added (for level purposes)

--- Documents/Unity3D/Catcheep/Assets/Scripts/AlienManager.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/AlienManager.cs
@@ -24,6 +24,7 @@
     public GameObject mailPanel;
     public GameObject mailButton;
     public GameObject neededPrayPrefab;
+    public GameObject slider;

     [Header("indication elements")] public GameObject sheepHolder;
     public GameObject sheepNumberText;
@@ -490,7 +491,6 @@

     public void closeMailPanel()
     {
-        receivedMail(true);
         mailButton.GetComponent<Button>().enabled = true;
         for (int i = 2; i < mailPanel.transform.childCount; i++)
         {
@@ -589,6 +589,22 @@
         shipGoingRightButtonClicked();
     }

+    //slider functions
+    void setSlider(int level)
+    {
+        if (level < 50)
+        {
+            slider.GetComponent<Slider>().value = level;
+            PlayerPrefs.SetInt("level",PlayerPrefs.GetInt("level")+1);
+            receivedMail(true);
+            mailButton.GetComponent<Button>().enabled = true;
+        }
+        else
+        {
+            //wining game is put here
+        }
+    }
+
     public void startMenu()
     {
         SceneManager.LoadScene(1);


More fixes/diagnostics to bitmap loading, hopefully it will work in czech now.

--- Engines/FlatRedBallXNA/FlatRedBall/Graphics/BitmapFont.cs
+++ Engines/FlatRedBallXNA/FlatRedBall/Graphics/BitmapFont.cs
@@ -295,7 +295,7 @@
             // I think they're ordered by character
             // index, so we can just find the last one
             // and save some time.
-            int index = fontPattern.LastIndexOf("char id=");
+            int index = fontPattern.LastIndexOf("char id=", fontPattern.Length, StringComparison.InvariantCulture);
             if (index != -1)
             {
                 int ID = StringFunctions.GetIntAfter("char id=", fontPattern, index);
@@ -307,7 +307,17 @@
             }
             else
             {
-                throw new Exception("Could not find the last index of the string \"char id=\" in the font pattern: " + fontPattern);
+                // index is -1, but let's try a regular IndexOf:
+                int forwardIndexOf = fontPattern.IndexOf("char id=");
+                if(forwardIndexOf != -1 && index == -1)
+                {
+                    throw new Exception("How is this possible? LastIndexOf \"char id=\" is returning a value of -1, while IndexOf for the same string is returning an index value)");
+
+                }
+                else
+                {
+                    throw new Exception("Could not find the last index of the string \"char id=\" in the font pattern: " + fontPattern);
+                }
             }
             #endregion

@@ -335,7 +345,7 @@
                 mCharacterInfo['t'].ScaleX = space.ScaleX * 4;
                 mCharacterInfo['t'].Spacing = space.Spacing * 4;

-                index = fontPattern.IndexOf("char id=");
+                index = fontPattern.IndexOf("char id=", 0, StringComparison.InvariantCulture);
                 while (index != -1)
                 {

@@ -346,7 +356,7 @@
                         // The bitmap font may have something like this as the first character:
                         // char id=-1   x=149   y=84    width=10    height=18    xoffset=1     yoffset=7     xadvance=12    page=0  chnl=15
                         // We don't use that, but we don't want to crash on it, so continue onward.
-                        int indexOfID = fontPattern.IndexOf("char id=", index);
+                        int indexOfID = fontPattern.IndexOf("char id=", index, StringComparison.InvariantCulture);
                         index = indexOfID + ID.ToString().Length;

                         continue;
@@ -373,7 +383,7 @@
                         mCharacterInfo[ID] = FillBitmapCharacterInfo(ID, fontPattern, mTextures[0].Width,
                             mTextures[0].Height, mLineHeightInPixels, index);

-                        int indexOfID = fontPattern.IndexOf("char id=", index);
+                        int indexOfID = fontPattern.IndexOf("char id=", index, StringComparison.InvariantCulture);
                         if (indexOfID != -1)
                         {
                             index = indexOfID + ID.ToString().Length;
@@ -385,12 +395,12 @@

                 #region Get Kearning Info

-                index = fontPattern.IndexOf("kerning ");
+                index = fontPattern.IndexOf("kerning ", 0, StringComparison.InvariantCulture);

                 if (index != -1)
                 {

-                    index = fontPattern.IndexOf("first=", index);
+                    index = fontPattern.IndexOf("first=", index, StringComparison.InvariantCulture);

                     while (index != -1)
                     {
@@ -400,7 +410,7 @@

                         mCharacterInfo[ID].SecondLetterKearning.Add(secondCharacter, kearningAmount);

-                        index = fontPattern.IndexOf("first=", index + 1);
+                        index = fontPattern.IndexOf("first=", index + 1, StringComparison.InvariantCulture);
                     }
                 }

@@ -413,14 +423,12 @@
         {
             // standardize before doing anything else
             fntFileName = FileManager.Standardize(fntFileName);
-
-#if !SILVERLIGHT
+

             if (FlatRedBall.IO.FileManager.IsRelative(fntFileName))
             {
                 fntFileName = FlatRedBall.IO.FileManager.RelativeDirectory + fntFileName;
             }
-#endif

             mFontFile = fntFileName;


React to aspnet/Razor#140

React to aspnet/Razor#140

--- src/PageGenerator/Program.cs
+++ src/PageGenerator/Program.cs
@@ -6,7 +6,7 @@
 using System.IO;
 using System.Linq;
 using Microsoft.AspNet.Razor;
-using Microsoft.AspNet.Razor.Generator;
+using Microsoft.AspNet.Razor.CodeGenerators;
 using Microsoft.Framework.Runtime;

 namespace PageGenerator
@@ -32,7 +32,7 @@
             if (diagnosticsLibInfo == null)
             {
                 throw new ArgumentException(string.Format(
-                    "Unable to open library {0}. Is it spelled correctly and listed as a dependency in project.json?",
+                    "Unable to open library {0}. Is it spelled correctly and listed as a dependency in project.json?",
                     args[0]));
             }
             var viewBasePath = Path.Combine(Path.GetDirectoryName(diagnosticsLibInfo.Path), "Views");


Update ConvertingWorksheetToSVG.cs

Update ConvertingWorksheetToSVG.cs

--- Examples/CSharp/Files/Utility/ConvertingWorksheetToSVG.cs
+++ Examples/CSharp/Files/Utility/ConvertingWorksheetToSVG.cs
@@ -9,6 +9,7 @@
     {
         public static void Main(string[] args)
         {
+            //ExStart:1
             // The path to the documents directory.
             string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

@@ -31,8 +32,9 @@
                 {
                     //Output the worksheet into Svg image format
                     sr.ToImage(i, filePath + sheet.Name + i + ".out.svg");
+                    //ExEnd:1
                 }
             }
         }
     }
-}+}


34234

--- testgit23/testgit23/Views/Home/Index.cshtml
+++ testgit23/testgit23/Views/Home/Index.cshtml
@@ -8,7 +8,7 @@

Learn more »

-
ASP.NET -david.z 1655 34234

+
ASP.NET -david.z 1655 34234 test2-brah1


BL-5830 Add safety to PalasoImage function

--- SIL.Windows.Forms/ImageToolbox/Cropping/ImageCropper.cs
+++ SIL.Windows.Forms/ImageToolbox/Cropping/ImageCropper.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Diagnostics;
 using System.Drawing;
 using System.Drawing.Imaging;
@@ -376,7 +376,7 @@

 		public Image GetCroppedImage()
 		{
-			if (_image == null)
+			if (_image == null || _image.Disposed)
 				return null;

 			try
@@ -442,7 +442,8 @@
 		public PalasoImage GetImage()
 		{
 			Image x = GetCroppedImage();
-			if (x == null)
+			// BL-5830 somehow user was cropping an image and this PalasoImage was already disposed
+			if (x == null || _image.Disposed)
 				return null;
 			//we want to retain the metdata of the PalasoImage we started with; we just want to update its actual image
 			_image.Image = x;


Seed accounts for users.

Seed accounts for users.

--- IronBank/IronBank/Migrations/Configuration.cs
+++ IronBank/IronBank/Migrations/Configuration.cs
@@ -18,7 +18,7 @@
         protected override void Seed(IronBankEntities context)
         {
             SeedDefaultUser(context);
-            SeedProductsForDefaultUser(context);
+            SeedProductsForDefaultUsers(context);
             SeedAvailableServices(context);
             SeedConfiguredServices(context);
             context.SaveChanges();
@@ -31,7 +31,7 @@
             userManager.Create(new User() { UserName = "csanchez", Name = "Claudio", LastName = "Sanchez", Email = "csanchez@megsoftconsulting.com", PhoneNumber = "" }, "password");
         }

-        public void SeedProductsForDefaultUser(IronBankEntities context)
+        public void SeedProductsForDefaultUsers(IronBankEntities context)
         {
             var productService = new ProductService(context);
             var userManager = new UserManager<User>(new UserStore<User>(context));
@@ -39,6 +39,11 @@

             productService.Create(user, ProductType.SavingsAccount, ProductCurrency.Pesos, 1000.00);
             productService.Create(user, ProductType.CheckingAccount, ProductCurrency.Pesos, 2000.00);
+
+            user = userManager.FindByName("csanchez");
+
+            productService.Create(user, ProductType.SavingsAccount, ProductCurrency.Pesos, 25000.00);
+            productService.Create(user, ProductType.CheckingAccount, ProductCurrency.Pesos, 50000.00);
         }

         public void SeedAvailableServices(IronBankEntities context)


Implement RRCA (0x0F)

Implement RRCA (0x0F)

--- JAGBE/GB/Computation/Execution/Instruction.cs
+++ JAGBE/GB/Computation/Execution/Instruction.cs
@@ -99,13 +99,20 @@

             ops[0x00] = new Opcode(0, 0, (a, b, c) => true); // NOP

-            ops[0x07] = new Opcode(0, 0, (op, mem, step) =>
+            ops[0x07] = new Opcode(0, 0, (op, mem, step) => // RLCA
             {
                 mem.R.F = mem.R.A.GetBit(7) ? RFlags.CB : (byte)0;
                 mem.R.A <<= 1;
                 return true;
             });
             ops[0x08] = new Opcode(0, 0, Alu.Loading.LdA16Sp);
+
+            ops[0x0F] = new Opcode(0, 0, (op, mem, step) => // RRCA
+            {
+                mem.R.F = mem.R.A.GetBit(0) ? RFlags.CB : (byte)0;
+                mem.R.A >>= 1;
+                return true;
+            });

             ops[0x17] = new Opcode(0, 0, (op, mem, step) =>
             {


GetTimeBefore() and GetFinalFireTime() throw NotImplementedException

--- src/Quartz/CronExpression.cs
+++ src/Quartz/CronExpression.cs
@@ -2120,7 +2120,7 @@
         public virtual DateTimeOffset? GetTimeBefore(DateTimeOffset? endTime)
         {
             // TODO: implement
-            return null;
+            throw new NotImplementedException();
         }

         /// <summary>
@@ -2131,7 +2131,7 @@
         public virtual DateTimeOffset? GetFinalFireTime()
         {
             // TODO: implement QUARTZ-423
-            return null;
+            throw new NotImplementedException();
         }

         /// <summary>


write postings to memory stream

write postings to memory stream

--- src/ResinCore/IO/LcrsTrie.cs
+++ src/ResinCore/IO/LcrsTrie.cs
@@ -154,10 +154,12 @@

                 if (node.PostingsStream == null)
                 {
-                    node.PostingsStream = new FileStream(
-                        Path.Combine(Path.GetTempFileName()),
-                        FileMode.Create, FileAccess.ReadWrite,
-                        FileShare.None, 4096*100, FileOptions.DeleteOnClose);
+                    //node.PostingsStream = new FileStream(
+                    //    Path.Combine(Path.GetTempFileName()),
+                    //    FileMode.Create, FileAccess.ReadWrite,
+                    //    FileShare.None, 4096*100, FileOptions.DeleteOnClose);
+
+                    node.PostingsStream = new MemoryStream();
                 }

                 postings.Serialize(node.PostingsStream);


Adding ShouldBeAssignableFrom overloads to ObjectAssertExtensions.

git-svn-id: 9e384c7f341d262c82c7f4ee69348ce6128ff240@6 5d8c1840-34e5-11de-9d05-31133e6853b1

--- xUnit.BDD/ObjectAssertExtensions.cs
+++ xUnit.BDD/ObjectAssertExtensions.cs
@@ -86,6 +86,29 @@
             Assert.IsType(expectedType, @object);
         }

+		/// <summary>
+		/// Verifies that an object is the given type or a derived type.
+		/// </summary>
+		/// <typeparam name="T">The type the object should be</typeparam>
+		/// <param name="object">The object to be evaluated</param>
+		/// <returns>The object, casted to type T when successful</returns>
+		/// <exception cref="Xunit.Sdk.IsAssignableFromException">Thrown when the object is not assignable from the given type</exception>
+		public static T ShouldBeAssignableFrom<T>(this object @object)
+		{
+			return Assert.IsAssignableFrom<T>(@object);
+		}
+
+		/// <summary>
+		/// Verifies that an object is the given type or a derived type.
+		/// </summary>
+		/// <param name="object">The object to be evaluated</param>
+		/// <param name="expectedType">The type the object should be</param>
+		/// <exception cref="Xunit.Sdk.IsAssignableFromException">Thrown when the object is not assignable from the given type</exception>
+		public static void ShouldBeAssignableFrom(this object @object, Type expectedType)
+		{
+			Assert.IsAssignableFrom(expectedType, @object);
+		}
+
         /// <summary>
         /// Verifies that two objects are equal, using a default comparer.
         /// </summary>


Calculate TimeToRead on demand

Calculate TimeToRead on demand

--- src/SmartReader/Article.cs
+++ src/SmartReader/Article.cs
@@ -41,9 +41,6 @@
         public string? SiteName { get; private set; }
         /// <value>The length in bytes of <c>Content</c></value>
         public int Length { get; private set; }
-        /// <value>The average time to read</value>
-        /// <remarks>It is based on http://iovs.arvojournals.org/article.aspx?articleid=2166061</remarks>
-        public TimeSpan TimeToRead { get; private set; }
         /// <value>The publication date, which can be parsed or read in the metadata</value>
         public DateTime? PublicationDate { get; private set; }
         /// <value>It indicates whether an article was actually found</value>
@@ -58,8 +55,13 @@

         private readonly IElement? _element = null;
         private readonly Reader? _reader;
+        private TimeSpan? _timeToRead = null;

         internal IElement? Element => _element;
+
+        /// <value>The average time to read</value>
+        /// <remarks>It is based on http://iovs.arvojournals.org/article.aspx?articleid=2166061</remarks>
+        public TimeSpan TimeToRead => _timeToRead ??= TimeToReadCalculator.Calculate(this);

         internal Article(Uri uri, string title, string byline, string dir, string? language, string? author, IElement element, Metadata metadata, bool readable, Reader reader)
         {
@@ -79,7 +81,6 @@
             Author = string.IsNullOrWhiteSpace(metadata.Author) ? author : metadata.Author;
             SiteName = metadata.SiteName;
             IsReadable = readable;
-            TimeToRead = TimeToReadCalculator.Calculate(this);
             FeaturedImage = metadata.FeaturedImage;
         }

@@ -100,7 +101,6 @@
             Language = "";
             PublicationDate = new DateTime();
             Author = "";
-            TimeToRead = new TimeSpan();
             FeaturedImage = "";
         }


Included the update frequency

Included the update frequency

--- AngleSharp/Css/RenderDevice.cs
+++ AngleSharp/Css/RenderDevice.cs
@@ -25,6 +25,7 @@
             DeviceType = Kind.Screen;
             IsInterlaced = false;
             IsGrid = false;
+            Frequency = 60;
         }

         /// <summary>
@@ -91,6 +92,15 @@
         }

         /// <summary>
+        /// Gets or sets the update frequency of the device in frames / s.
+        /// </summary>
+        public Int32 Frequency
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
         /// Gets or sets the number of color bits of the device, e.g. 32.
         /// </summary>
         public Int32 ColorBits


Change signature

Change signature

--- CSGL.Vulkan/CommandBuffer.cs
+++ CSGL.Vulkan/CommandBuffer.cs
@@ -177,7 +177,7 @@
         }

         public void PipelineBarrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags flags,
-            List<MemoryBarrier> memoryBarriers, List<BufferMemoryBarrier> bufferMemoryBarriers, List<ImageMemoryBarrier> imageMemoryBarriers) {
+            IList<MemoryBarrier> memoryBarriers, IList<BufferMemoryBarrier> bufferMemoryBarriers, IList<ImageMemoryBarrier> imageMemoryBarriers) {

             int mbCount = 0;
             int bbCount = 0;


UserDetails and UpdateUser functionality added to AccountController.

--- FourWheel/FourWheels.Web/Controllers/AccountController.cs
+++ FourWheel/FourWheels.Web/Controllers/AccountController.cs
@@ -10,23 +10,40 @@
 using FourWheels.Data.Models;
 using FourWheels.Web.App_Start;
 using FourWheels.Web.Models.AccountViewModels;
+using FourWheels.Web.Models.UserViewModels;
+using FourWheels.Services.Contracts;
+using Bytes2you.Validation;
+using AutoMapper;
+using FourWheels.Web.Models.CarViewModels;
+using AutoMapper.QueryableExtensions;

 namespace FourWheels.Web.Controllers
 {
     [Authorize]
     public class AccountController : Controller
     {
+        private readonly IUserServices userServices;
+        private readonly IMapper mapper;
+
         private ApplicationSignInManager _signInManager;
         private ApplicationUserManager _userManager;

-        public AccountController()
-        {
-        }
-
-        public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager )
-        {
-            UserManager = userManager;
-            SignInManager = signInManager;
+        public AccountController(IUserServices userServices, IMapper mapper)
+        {
+            Guard.WhenArgument(userServices, "userServices").IsNull().Throw();
+            Guard.WhenArgument(mapper, "mapper").IsNull().Throw();
+
+            this.userServices = userServices;
+            this.mapper = mapper;
+        }
+
+        public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager)
+        {
+            Guard.WhenArgument(userServices, "userServices").IsNull().Throw();
+            Guard.WhenArgument(mapper, "mapper").IsNull().Throw();
+
+            this.UserManager = userManager;
+            this.SignInManager = signInManager;
         }

         public ApplicationSignInManager SignInManager
@@ -35,9 +52,9 @@
             {
                 return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>();
             }
-            private set
-            {
-                _signInManager = value;
+            private set
+            {
+                _signInManager = value;
             }
         }

@@ -53,17 +70,59 @@
             }
         }

-        //
-        // GET: /Account/Login
+        [HttpGet]
+        [Authorize]
+        public ActionResult UserDetails()
+        {
+            var userId = User.Identity.GetUserId();
+            var user = this.userServices.GetUserById(userId);
+            var userModel = this.mapper.Map<UserDetailsViewModel>(user);
+
+            return this.View(userModel);
+        }
+
+        [HttpPost]
+        [Authorize]
+        [ValidateAntiForgeryToken]
+        public ActionResult UpdateUserInfo(UserDetailsViewModel model)
+        {
+            var userId = User.Identity.GetUserId();
+            var user = this.userServices.GetUserById(userId);
+
+            Guard.WhenArgument(user, "user").IsNull().Throw();
+
+            user.Email = model.Email;
+            user.FullName = model.FullName;
+            user.PhoneNumber = model.PhoneNumber;
+
+            this.userServices.UpdateUserInfo(user);
+
+            return this.Json(JsonRequestBehavior.AllowGet);
+        }
+
+        [HttpGet]
+        public ActionResult UserAds()
+        {
+            var userId = User.Identity.GetUserId();
+
+            var model = this.userServices
+                .AllUserAds(userId)
+                .ProjectTo<CarAdBasicInfoViewModel>()
+                .ToList();
+
+            Guard.WhenArgument(model, "model").IsNull().Throw();
+
+            return this.View(model);
+        }
+
         [AllowAnonymous]
         public ActionResult Login(string returnUrl)
         {
             ViewBag.ReturnUrl = returnUrl;
-            return View();
-        }
-
-        //
-        // POST: /Account/Login
+            return this.View();
+        }
+
+
         [HttpPost]
         [AllowAnonymous]
         [ValidateAntiForgeryToken]
@@ -71,7 +130,7 @@
         {
             if (!ModelState.IsValid)
             {
-                return View(model);
+                return this.View(model);
             }

             // This doesn't count login failures towards account lockout
@@ -80,67 +139,23 @@
             switch (result)
             {
                 case SignInStatus.Success:
-                    return RedirectToLocal(returnUrl);
+                    return this.RedirectToLocal(returnUrl);
                 case SignInStatus.LockedOut:
-                    return View("Lockout");
+                    return this.View("Lockout");
                 case SignInStatus.RequiresVerification:
-                    return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
+                    return this.RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
                 case SignInStatus.Failure:
                 default:
                     ModelState.AddModelError("", "Invalid login attempt.");
-                    return View(model);
-            }
-        }
-
-        //
-        // GET: /Account/VerifyCode
-        [AllowAnonymous]
-        public async Task<ActionResult> VerifyCode(string provider, string returnUrl, bool rememberMe)
-        {
-            // Require that the user has already logged in via username/password or external login
-            if (!await SignInManager.HasBeenVerifiedAsync())
-            {
-                return View("Error");
-            }
-            return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe });
-        }
-
-        //
-        // POST: /Account/VerifyCode
-        [HttpPost]
-        [AllowAnonymous]
-        [ValidateAntiForgeryToken]
-        public async Task<ActionResult> VerifyCode(VerifyCodeViewModel model)
-        {
-            if (!ModelState.IsValid)
-            {
-                return View(model);
-            }
-
-            // The following code protects for brute force attacks against the two factor codes.
-            // If a user enters incorrect codes for a specified amount of time then the user account
-            // will be locked out for a specified amount of time.
-            // You can configure the account lockout settings in IdentityConfig
-            var result = await SignInManager.TwoFactorSignInAsync(model.Provider, model.Code, isPersistent:  model.RememberMe, rememberBrowser: model.RememberBrowser);
-            switch (result)
-            {
-                case SignInStatus.Success:
-                    return RedirectToLocal(model.ReturnUrl);
-                case SignInStatus.LockedOut:
-                    return View("Lockout");
-                case SignInStatus.Failure:
-                default:
-                    ModelState.AddModelError("", "Invalid code.");
-                    return View(model);
-            }
-        }
-
-        //
+                    return this.View(model);
+            }
+        }
+
         // GET: /Account/Register
         [AllowAnonymous]
         public ActionResult Register()
         {
-            return View();
+            return this.View();
         }

         //
@@ -150,27 +165,33 @@
         [ValidateAntiForgeryToken]
         public async Task<ActionResult> Register(RegisterViewModel model)
         {
-            if (ModelState.IsValid)
-            {
-                var user = new User { UserName = model.Username, Email = model.Email, PhoneNumber = model.PhoneNumber};
+            var userCheck = await UserManager.FindByNameAsync(model.Username);
+            if (userCheck != null)
+            {
+
+            }
+
+            if (this.ModelState.IsValid)
+            {
+                var user = new User { UserName = model.Username, Email = model.Email, PhoneNumber = model.PhoneNumber, FullName = model.FullName };
                 var result = await UserManager.CreateAsync(user, model.Password);
                 if (result.Succeeded)
                 {
-                    await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);
-
+                    await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
+
                     // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771
                     // Send an email with this link
                     // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                     // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                     // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking here");

-                    return RedirectToAction("HomeIndex", "Home");
+                    return this.RedirectToAction("HomeIndex", "Home");
                 }
                 AddErrors(result);
             }

             // If we got this far, something failed, redisplay form
-            return View(model);
+            return this.View(model);
         }

         //
@@ -180,10 +201,10 @@
         {
             if (userId == null || code == null)
             {
-                return View("Error");
+                return this.View("Error");
             }
             var result = await UserManager.ConfirmEmailAsync(userId, code);
-            return View(result.Succeeded ? "ConfirmEmail" : "Error");
+            return this.View(result.Succeeded ? "ConfirmEmail" : "Error");
         }

         //
@@ -191,7 +212,7 @@
         [AllowAnonymous]
         public ActionResult ForgotPassword()
         {
-            return View();
+            return this.View();
         }

         //
@@ -207,7 +228,7 @@
                 if (user == null || !(await UserManager.IsEmailConfirmedAsync(user.Id)))
                 {
                     // Don't reveal that the user does not exist or is not confirmed
-                    return View("ForgotPasswordConfirmation");
+                    return this.View("ForgotPasswordConfirmation");
                 }

                 // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771
@@ -219,7 +240,7 @@
             }

             // If we got this far, something failed, redisplay form
-            return View(model);
+            return this.View(model);
         }

         //
@@ -227,7 +248,7 @@
         [AllowAnonymous]
         public ActionResult ForgotPasswordConfirmation()
         {
-            return View();
+            return this.View();
         }

         //
@@ -235,7 +256,7 @@
         [AllowAnonymous]
         public ActionResult ResetPassword(string code)
         {
-            return code == null ? View("Error") : View();
+            return code == null ? View("Error") : this.View();
         }

         //
@@ -247,7 +268,7 @@
         {
             if (!ModelState.IsValid)
             {
-                return View(model);
+                return this.View(model);
             }
             var user = await UserManager.FindByNameAsync(model.Email);
             if (user == null)
@@ -265,128 +286,6 @@
         }

         //
-        // GET: /Account/ResetPasswordConfirmation
-        [AllowAnonymous]
-        public ActionResult ResetPasswordConfirmation()
-        {
-            return View();
-        }
-
-        //
-        // POST: /Account/ExternalLogin
-        [HttpPost]
-        [AllowAnonymous]
-        [ValidateAntiForgeryToken]
-        public ActionResult ExternalLogin(string provider, string returnUrl)
-        {
-            // Request a redirect to the external login provider
-            return new ChallengeResult(provider, Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }));
-        }
-
-        //
-        // GET: /Account/SendCode
-        [AllowAnonymous]
-        public async Task<ActionResult> SendCode(string returnUrl, bool rememberMe)
-        {
-            var userId = await SignInManager.GetVerifiedUserIdAsync();
-            if (userId == null)
-            {
-                return View("Error");
-            }
-            var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(userId);
-            var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList();
-            return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe });
-        }
-
-        //
-        // POST: /Account/SendCode
-        [HttpPost]
-        [AllowAnonymous]
-        [ValidateAntiForgeryToken]
-        public async Task<ActionResult> SendCode(SendCodeViewModel model)
-        {
-            if (!ModelState.IsValid)
-            {
-                return View();
-            }
-
-            // Generate the token and send it
-            if (!await SignInManager.SendTwoFactorCodeAsync(model.SelectedProvider))
-            {
-                return View("Error");
-            }
-            return RedirectToAction("VerifyCode", new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe });
-        }
-
-        //
-        // GET: /Account/ExternalLoginCallback
-        [AllowAnonymous]
-        public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
-        {
-            var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
-            if (loginInfo == null)
-            {
-                return RedirectToAction("Login");
-            }
-
-            // Sign in the user with this external login provider if the user already has a login
-            var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false);
-            switch (result)
-            {
-                case SignInStatus.Success:
-                    return RedirectToLocal(returnUrl);
-                case SignInStatus.LockedOut:
-                    return View("Lockout");
-                case SignInStatus.RequiresVerification:
-                    return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = false });
-                case SignInStatus.Failure:
-                default:
-                    // If the user does not have an account, then prompt the user to create an account
-                    ViewBag.ReturnUrl = returnUrl;
-                    ViewBag.LoginProvider = loginInfo.Login.LoginProvider;
-                    return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = loginInfo.Email });
-            }
-        }
-
-        //
-        // POST: /Account/ExternalLoginConfirmation
-        [HttpPost]
-        [AllowAnonymous]
-        [ValidateAntiForgeryToken]
-        public async Task<ActionResult> ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl)
-        {
-            if (User.Identity.IsAuthenticated)
-            {
-                return RedirectToAction("HomeIndex", "Manage");
-            }
-
-            if (ModelState.IsValid)
-            {
-                // Get the information about the user from the external login provider
-                var info = await AuthenticationManager.GetExternalLoginInfoAsync();
-                if (info == null)
-                {
-                    return View("ExternalLoginFailure");
-                }
-                var user = new User { UserName = model.Username, Email = model.Email };
-                var result = await UserManager.CreateAsync(user);
-                if (result.Succeeded)
-                {
-                    result = await UserManager.AddLoginAsync(user.Id, info.Login);
-                    if (result.Succeeded)
-                    {
-                        await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
-                        return RedirectToLocal(returnUrl);
-                    }
-                }
-                AddErrors(result);
-            }
-
-            ViewBag.ReturnUrl = returnUrl;
-            return View(model);
-        }
-
-        //
         // POST: /Account/LogOff
         [HttpPost]
         [ValidateAntiForgeryToken]
@@ -394,14 +293,6 @@
         {
             AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
             return RedirectToAction("HomeIndex", "Home");
-        }
-
-        //
-        // GET: /Account/ExternalLoginFailure
-        [AllowAnonymous]
-        public ActionResult ExternalLoginFailure()
-        {
-            return View();
         }

         protected override void Dispose(bool disposing)


lookAt

lookAt

--- CSharpGL/Maths/glm_camera.cs
+++ CSharpGL/Maths/glm_camera.cs
@@ -74,15 +74,19 @@
             vec3 standardUp = right.cross(forward);

             mat4 Result = new mat4(1);
+            // Left (X) Axis
             Result[0, 0] = right.x;
+            Result[0, 1] = standardUp.x;
+            Result[0, 2] = -forward.x;
+            // Up (Y) Axis
             Result[1, 0] = right.y;
+            Result[1, 1] = standardUp.y;
+            Result[1, 2] = -forward.y;
+            // Forward (Z) Axis
             Result[2, 0] = right.z;
-            Result[0, 1] = standardUp.x;
-            Result[1, 1] = standardUp.y;
             Result[2, 1] = standardUp.z;
-            Result[0, 2] = -forward.x;
-            Result[1, 2] = -forward.y;
             Result[2, 2] = -forward.z;
+            // Translation
             Result[3, 0] = -right.dot(eye);// dot(s, eye);
             Result[3, 1] = -standardUp.dot(eye);// dot(u, eye);
             Result[3, 2] = forward.dot(eye);// dot(f, eye);


Fixes sorting problem

Fixes sorting problem

--- Snittlistan.Web/Areas/V2/ViewModels/ExtensionMethods.cs
+++ Snittlistan.Web/Areas/V2/ViewModels/ExtensionMethods.cs
@@ -21,7 +21,7 @@

         public static IEnumerable<ResultHeaderReadModel> SortResults(this IEnumerable<ResultHeaderReadModel> results)
         {
-            return results.OrderBy(r => TeamLevelSortOrder[r.TeamLevel]).ThenBy(r => r.Date);
+            return results.OrderBy(r => TeamLevelSortOrder[r.TeamLevel.ToUpper()]).ThenBy(r => r.Date);
         }
     }
 }


Remove an unnecessary string cast

Remove an unnecessary string cast

--- src/SimpleJson/SimpleJson.cs
+++ src/SimpleJson/SimpleJson.cs
@@ -1271,26 +1271,27 @@
         [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
         public virtual object DeserializeObject(object value, Type type)
         {
+            string str = value as string;
+
+            if (type == typeof (Guid) && String.IsNullOrEmpty(str))
+                return default(Guid);
+
             if (value == null)
-            {
-                if (type == typeof(Guid))
-                    return default(Guid);
                 return null;
-            }
+
             object obj = null;
-            if (value is string)
-            {
-                string str = value as string;
-                if (!string.IsNullOrEmpty(str))
+
+            if (str != null)
+            {
+                if (str.Length != 0) // We know it can't be null now.
                 {
                     if (type == typeof(DateTime) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(DateTime)))
-                        obj = DateTime.ParseExact(str, Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);
-                    else if (type == typeof(DateTimeOffset) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(DateTimeOffset)))
-                        obj = DateTimeOffset.ParseExact(str, Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);
-                    else if (type == typeof(Guid) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(Guid)))
-                        obj = new Guid(str);
-                    else
-                        obj = str;
+                        return DateTime.ParseExact(str, Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);
+                    if (type == typeof(DateTimeOffset) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(DateTimeOffset)))
+                        return DateTimeOffset.ParseExact(str, Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);
+                    if (type == typeof(Guid) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(Guid)))
+                        return new Guid(str);
+                    return str;
                 }
                 else
                 {
@@ -1301,11 +1302,12 @@
                     else
                         obj = str;
                 }
+                // Empty string case
+                if (!ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(Guid))
+                    return str;
             }
             else if (value is bool)
                 obj = value;
-            else if (value == null)
-                obj = null;
             else if ((value is long && type == typeof(long)) || (value is double && type == typeof(double)))
                 obj = value;
             else if ((value is double && type != typeof(double)) || (value is long && type != typeof(long)))


Append 'copy' to dulicated notes

Append 'copy' to dulicated notes

--- Source/AlephNote.App/WPF/Windows/MainWindowViewmodel.cs
+++ Source/AlephNote.App/WPF/Windows/MainWindowViewmodel.cs
@@ -981,6 +981,11 @@
 			var text = SelectedNote.Text;
 			var tags = SelectedNote.Tags.ToList();

+			var ntitle = title + " (copy)";
+			int i = 2;
+			while (Repository.Notes.Any(n => n.Title.ToLower() == ntitle.ToLower())) ntitle = title + " (copy-" + (i++) + ")";
+			title = ntitle;
+
 			SelectedNote = Repository.CreateNewNote(path);

 			SelectedNote.Title = title;


AddAPI: ReportGameServerStatus

AddAPI: ReportGameServerStatus

--- ApiScheme/Scheme/GameServer.cs
+++ ApiScheme/Scheme/GameServer.cs
@@ -167,4 +167,26 @@
     public class ReportMessageOut : Out
     {
     }
+
+    public class ReportGameServerStatusIn : In
+    {
+        public string host;
+        public int port;
+        public string name;
+        public int players;
+        public int maxPlayers;
+        public int framesPerInterval;
+        public double reportIntervalSeconds;
+        public double maxElapsedSeconds;
+
+        public override string ToString()
+        {
+            return string.Format("[ReportGameServerStatusIn host:{0} port:{1} name:{2} players:{3} maxPlayers:{4} framesPerInterval:{5} reportIntervalSeconds:{6} maxElapsedSeconds:{7}]",
+                host, port, name, players, maxPlayers, framesPerInterval, reportIntervalSeconds, maxElapsedSeconds);
+        }
+    }
+    public class ReportGameServerStatusOut : Out
+    {
+
+    }
 }


Added a method to the CameraXZController to center the camera on a point, based on a specific distance.

--- Camera/CameraXZController.cs
+++ Camera/CameraXZController.cs
@@ -23,7 +23,7 @@

     public void SetViewBounds(Rect viewBounds, Vector3 initialFocusStartingPoint) {
         Camera = Camera ?? this.GetRequiredComponent<Camera>();
-        // Assuming the camera angle doesn't change, what is the view point area,
+        // Assuming the camera angle doesn't change, what is the view point area,
         // and determine what space the camera can move inside of that area.

         // Determine the distance that the camera needs to be to include the whole view,
@@ -39,6 +39,13 @@

         IsCameraClamped = viewBounds.size.magnitude > 0;
         ClampedViewRect = new Rect().Center(cameraEndPosition.Vector2XZ(), viewBounds.size);
+        SetCameraLocation(cameraEndPosition);
+    }
+
+    public void SetCameraFocusPoint(Vector3 focusPoint, float distance) {
+        var cameraDirection = transform.forward;
+        var cameraEndPosition = focusPoint + -cameraDirection * distance;
+
         SetCameraLocation(cameraEndPosition);
     }


Enabled sorting for combo boxes

Enabled sorting for combo boxes

--- InventoryManagement/InventoryManagement/Form1.Designer.cs
+++ InventoryManagement/InventoryManagement/Form1.Designer.cs
@@ -28,244 +28,249 @@
 		/// </summary>
 		private void InitializeComponent()
 		{
-			this.components = new System.ComponentModel.Container();
-			this.label1 = new System.Windows.Forms.Label();
-			this.txtName = new System.Windows.Forms.TextBox();
-			this.label2 = new System.Windows.Forms.Label();
-			this.cboPlatform = new System.Windows.Forms.ComboBox();
-			this.label3 = new System.Windows.Forms.Label();
-			this.cboPublisher = new System.Windows.Forms.ComboBox();
-			this.label4 = new System.Windows.Forms.Label();
-			this.cboDeveloper = new System.Windows.Forms.ComboBox();
-			this.label5 = new System.Windows.Forms.Label();
-			this.dtpReleaseDate = new System.Windows.Forms.DateTimePicker();
-			this.label6 = new System.Windows.Forms.Label();
-			this.cboCategory = new System.Windows.Forms.ComboBox();
-			this.label7 = new System.Windows.Forms.Label();
-			this.cboRating = new System.Windows.Forms.ComboBox();
-			this.dg1 = new System.Windows.Forms.DataGridView();
-			this.cmdInsert = new System.Windows.Forms.Button();
-			this.cmdUpdate = new System.Windows.Forms.Button();
-			this.cmdDelete = new System.Windows.Forms.Button();
-			this.cmdClear = new System.Windows.Forms.Button();
-			this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
+			this.components=new System.ComponentModel.Container();
+			this.label1=new System.Windows.Forms.Label();
+			this.txtName=new System.Windows.Forms.TextBox();
+			this.label2=new System.Windows.Forms.Label();
+			this.cboPlatform=new System.Windows.Forms.ComboBox();
+			this.label3=new System.Windows.Forms.Label();
+			this.cboPublisher=new System.Windows.Forms.ComboBox();
+			this.label4=new System.Windows.Forms.Label();
+			this.cboDeveloper=new System.Windows.Forms.ComboBox();
+			this.label5=new System.Windows.Forms.Label();
+			this.dtpReleaseDate=new System.Windows.Forms.DateTimePicker();
+			this.label6=new System.Windows.Forms.Label();
+			this.cboCategory=new System.Windows.Forms.ComboBox();
+			this.label7=new System.Windows.Forms.Label();
+			this.cboRating=new System.Windows.Forms.ComboBox();
+			this.dg1=new System.Windows.Forms.DataGridView();
+			this.cmdInsert=new System.Windows.Forms.Button();
+			this.cmdUpdate=new System.Windows.Forms.Button();
+			this.cmdDelete=new System.Windows.Forms.Button();
+			this.cmdClear=new System.Windows.Forms.Button();
+			this.bindingSource1=new System.Windows.Forms.BindingSource(this.components);
 			((System.ComponentModel.ISupportInitialize)(this.dg1)).BeginInit();
 			((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
 			this.SuspendLayout();
 			//
 			// label1
 			//
-			this.label1.AutoSize = true;
-			this.label1.Location = new System.Drawing.Point(12, 9);
-			this.label1.Name = "label1";
-			this.label1.Size = new System.Drawing.Size(35, 13);
-			this.label1.TabIndex = 0;
-			this.label1.Text = "Name";
+			this.label1.AutoSize=true;
+			this.label1.Location=new System.Drawing.Point(12,9);
+			this.label1.Name="label1";
+			this.label1.Size=new System.Drawing.Size(35,13);
+			this.label1.TabIndex=0;
+			this.label1.Text="Name";
 			//
 			// txtName
 			//
-			this.txtName.Location = new System.Drawing.Point(53, 6);
-			this.txtName.MaxLength = 32;
-			this.txtName.Name = "txtName";
-			this.txtName.Size = new System.Drawing.Size(177, 20);
-			this.txtName.TabIndex = 1;
+			this.txtName.Location=new System.Drawing.Point(53,6);
+			this.txtName.MaxLength=32;
+			this.txtName.Name="txtName";
+			this.txtName.Size=new System.Drawing.Size(177,20);
+			this.txtName.TabIndex=1;
 			//
 			// label2
 			//
-			this.label2.AutoSize = true;
-			this.label2.Location = new System.Drawing.Point(262, 9);
-			this.label2.Name = "label2";
-			this.label2.Size = new System.Drawing.Size(45, 13);
-			this.label2.TabIndex = 2;
-			this.label2.Text = "Platform";
+			this.label2.AutoSize=true;
+			this.label2.Location=new System.Drawing.Point(262,9);
+			this.label2.Name="label2";
+			this.label2.Size=new System.Drawing.Size(45,13);
+			this.label2.TabIndex=2;
+			this.label2.Text="Platform";
 			//
 			// cboPlatform
 			//
-			this.cboPlatform.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append;
-			this.cboPlatform.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
-			this.cboPlatform.FormattingEnabled = true;
+			this.cboPlatform.AutoCompleteMode=System.Windows.Forms.AutoCompleteMode.Append;
+			this.cboPlatform.AutoCompleteSource=System.Windows.Forms.AutoCompleteSource.ListItems;
+			this.cboPlatform.FormattingEnabled=true;
 			this.cboPlatform.Items.AddRange(new object[] {
             "A123445697502",
             "B1235897260245",
             "C2349857029876026"});
-			this.cboPlatform.Location = new System.Drawing.Point(313, 5);
-			this.cboPlatform.MaxLength = 16;
-			this.cboPlatform.Name = "cboPlatform";
-			this.cboPlatform.Size = new System.Drawing.Size(148, 21);
-			this.cboPlatform.TabIndex = 3;
+			this.cboPlatform.Location=new System.Drawing.Point(313,5);
+			this.cboPlatform.MaxLength=16;
+			this.cboPlatform.Name="cboPlatform";
+			this.cboPlatform.Size=new System.Drawing.Size(148,21);
+			this.cboPlatform.Sorted=true;
+			this.cboPlatform.TabIndex=3;
 			//
 			// label3
 			//
-			this.label3.AutoSize = true;
-			this.label3.Location = new System.Drawing.Point(494, 9);
-			this.label3.Name = "label3";
-			this.label3.Size = new System.Drawing.Size(50, 13);
-			this.label3.TabIndex = 4;
-			this.label3.Text = "Publisher";
+			this.label3.AutoSize=true;
+			this.label3.Location=new System.Drawing.Point(494,9);
+			this.label3.Name="label3";
+			this.label3.Size=new System.Drawing.Size(50,13);
+			this.label3.TabIndex=4;
+			this.label3.Text="Publisher";
 			//
 			// cboPublisher
 			//
-			this.cboPublisher.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append;
-			this.cboPublisher.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
-			this.cboPublisher.FormattingEnabled = true;
+			this.cboPublisher.AutoCompleteMode=System.Windows.Forms.AutoCompleteMode.Append;
+			this.cboPublisher.AutoCompleteSource=System.Windows.Forms.AutoCompleteSource.ListItems;
+			this.cboPublisher.FormattingEnabled=true;
 			this.cboPublisher.Items.AddRange(new object[] {
             "pub A",
             "pub B",
             "pub C"});
-			this.cboPublisher.Location = new System.Drawing.Point(550, 5);
-			this.cboPublisher.MaxLength = 32;
-			this.cboPublisher.Name = "cboPublisher";
-			this.cboPublisher.Size = new System.Drawing.Size(141, 21);
-			this.cboPublisher.TabIndex = 5;
+			this.cboPublisher.Location=new System.Drawing.Point(550,5);
+			this.cboPublisher.MaxLength=32;
+			this.cboPublisher.Name="cboPublisher";
+			this.cboPublisher.Size=new System.Drawing.Size(141,21);
+			this.cboPublisher.Sorted=true;
+			this.cboPublisher.TabIndex=5;
 			//
 			// label4
 			//
-			this.label4.AutoSize = true;
-			this.label4.Location = new System.Drawing.Point(12, 40);
-			this.label4.Name = "label4";
-			this.label4.Size = new System.Drawing.Size(56, 13);
-			this.label4.TabIndex = 6;
-			this.label4.Text = "Developer";
+			this.label4.AutoSize=true;
+			this.label4.Location=new System.Drawing.Point(12,40);
+			this.label4.Name="label4";
+			this.label4.Size=new System.Drawing.Size(56,13);
+			this.label4.TabIndex=6;
+			this.label4.Text="Developer";
 			//
 			// cboDeveloper
 			//
-			this.cboDeveloper.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append;
-			this.cboDeveloper.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
-			this.cboDeveloper.FormattingEnabled = true;
+			this.cboDeveloper.AutoCompleteMode=System.Windows.Forms.AutoCompleteMode.Append;
+			this.cboDeveloper.AutoCompleteSource=System.Windows.Forms.AutoCompleteSource.ListItems;
+			this.cboDeveloper.FormattingEnabled=true;
 			this.cboDeveloper.Items.AddRange(new object[] {
             "G",
             "H",
             "J"});
-			this.cboDeveloper.Location = new System.Drawing.Point(74, 37);
-			this.cboDeveloper.MaxLength = 32;
-			this.cboDeveloper.Name = "cboDeveloper";
-			this.cboDeveloper.Size = new System.Drawing.Size(121, 21);
-			this.cboDeveloper.TabIndex = 7;
+			this.cboDeveloper.Location=new System.Drawing.Point(74,37);
+			this.cboDeveloper.MaxLength=32;
+			this.cboDeveloper.Name="cboDeveloper";
+			this.cboDeveloper.Size=new System.Drawing.Size(121,21);
+			this.cboDeveloper.Sorted=true;
+			this.cboDeveloper.TabIndex=7;
 			//
 			// label5
 			//
-			this.label5.AutoSize = true;
-			this.label5.Location = new System.Drawing.Point(201, 40);
-			this.label5.Name = "label5";
-			this.label5.Size = new System.Drawing.Size(72, 13);
-			this.label5.TabIndex = 8;
-			this.label5.Text = "Release Date";
+			this.label5.AutoSize=true;
+			this.label5.Location=new System.Drawing.Point(201,40);
+			this.label5.Name="label5";
+			this.label5.Size=new System.Drawing.Size(72,13);
+			this.label5.TabIndex=8;
+			this.label5.Text="Release Date";
 			//
 			// dtpReleaseDate
 			//
-			this.dtpReleaseDate.Location = new System.Drawing.Point(279, 37);
-			this.dtpReleaseDate.MaxDate = new System.DateTime(2100, 12, 31, 0, 0, 0, 0);
-			this.dtpReleaseDate.MinDate = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
-			this.dtpReleaseDate.Name = "dtpReleaseDate";
-			this.dtpReleaseDate.Size = new System.Drawing.Size(138, 20);
-			this.dtpReleaseDate.TabIndex = 9;
+			this.dtpReleaseDate.Location=new System.Drawing.Point(279,37);
+			this.dtpReleaseDate.MaxDate=new System.DateTime(2100,12,31,0,0,0,0);
+			this.dtpReleaseDate.MinDate=new System.DateTime(1970,1,1,0,0,0,0);
+			this.dtpReleaseDate.Name="dtpReleaseDate";
+			this.dtpReleaseDate.Size=new System.Drawing.Size(138,20);
+			this.dtpReleaseDate.TabIndex=9;
 			//
 			// label6
 			//
-			this.label6.AutoSize = true;
-			this.label6.Location = new System.Drawing.Point(423, 40);
-			this.label6.Name = "label6";
-			this.label6.Size = new System.Drawing.Size(49, 13);
-			this.label6.TabIndex = 10;
-			this.label6.Text = "Category";
+			this.label6.AutoSize=true;
+			this.label6.Location=new System.Drawing.Point(423,40);
+			this.label6.Name="label6";
+			this.label6.Size=new System.Drawing.Size(49,13);
+			this.label6.TabIndex=10;
+			this.label6.Text="Category";
 			//
 			// cboCategory
 			//
-			this.cboCategory.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append;
-			this.cboCategory.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
-			this.cboCategory.FormattingEnabled = true;
+			this.cboCategory.AutoCompleteMode=System.Windows.Forms.AutoCompleteMode.Append;
+			this.cboCategory.AutoCompleteSource=System.Windows.Forms.AutoCompleteSource.ListItems;
+			this.cboCategory.FormattingEnabled=true;
 			this.cboCategory.Items.AddRange(new object[] {
             "G",
             "H",
             "J"});
-			this.cboCategory.Location = new System.Drawing.Point(478, 36);
-			this.cboCategory.MaxLength = 16;
-			this.cboCategory.Name = "cboCategory";
-			this.cboCategory.Size = new System.Drawing.Size(121, 21);
-			this.cboCategory.TabIndex = 11;
+			this.cboCategory.Location=new System.Drawing.Point(478,36);
+			this.cboCategory.MaxLength=16;
+			this.cboCategory.Name="cboCategory";
+			this.cboCategory.Size=new System.Drawing.Size(121,21);
+			this.cboCategory.Sorted=true;
+			this.cboCategory.TabIndex=11;
 			//
 			// label7
 			//
-			this.label7.AutoSize = true;
-			this.label7.Location = new System.Drawing.Point(605, 40);
-			this.label7.Name = "label7";
-			this.label7.Size = new System.Drawing.Size(38, 13);
-			this.label7.TabIndex = 12;
-			this.label7.Text = "Rating";
+			this.label7.AutoSize=true;
+			this.label7.Location=new System.Drawing.Point(605,40);
+			this.label7.Name="label7";
+			this.label7.Size=new System.Drawing.Size(38,13);
+			this.label7.TabIndex=12;
+			this.label7.Text="Rating";
 			//
 			// cboRating
 			//
-			this.cboRating.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append;
-			this.cboRating.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
-			this.cboRating.FormattingEnabled = true;
+			this.cboRating.AutoCompleteMode=System.Windows.Forms.AutoCompleteMode.Append;
+			this.cboRating.AutoCompleteSource=System.Windows.Forms.AutoCompleteSource.ListItems;
+			this.cboRating.FormattingEnabled=true;
 			this.cboRating.Items.AddRange(new object[] {
             "G",
             "H",
             "J"});
-			this.cboRating.Location = new System.Drawing.Point(649, 36);
-			this.cboRating.MaxLength = 2;
-			this.cboRating.Name = "cboRating";
-			this.cboRating.Size = new System.Drawing.Size(42, 21);
-			this.cboRating.TabIndex = 13;
+			this.cboRating.Location=new System.Drawing.Point(649,36);
+			this.cboRating.MaxLength=2;
+			this.cboRating.Name="cboRating";
+			this.cboRating.Size=new System.Drawing.Size(42,21);
+			this.cboRating.Sorted=true;
+			this.cboRating.TabIndex=13;
 			//
 			// dg1
 			//
-			this.dg1.AllowUserToAddRows = false;
-			this.dg1.AllowUserToDeleteRows = false;
-			this.dg1.AllowUserToResizeColumns = false;
-			this.dg1.AllowUserToResizeRows = false;
-			this.dg1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-			this.dg1.Location = new System.Drawing.Point(15, 64);
-			this.dg1.Name = "dg1";
-			this.dg1.ReadOnly = true;
-			this.dg1.Size = new System.Drawing.Size(676, 324);
-			this.dg1.TabIndex = 14;
+			this.dg1.AllowUserToAddRows=false;
+			this.dg1.AllowUserToDeleteRows=false;
+			this.dg1.AllowUserToResizeColumns=false;
+			this.dg1.AllowUserToResizeRows=false;
+			this.dg1.ColumnHeadersHeightSizeMode=System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+			this.dg1.Location=new System.Drawing.Point(15,64);
+			this.dg1.Name="dg1";
+			this.dg1.ReadOnly=true;
+			this.dg1.Size=new System.Drawing.Size(676,324);
+			this.dg1.TabIndex=14;
 			//
 			// cmdInsert
 			//
-			this.cmdInsert.Location = new System.Drawing.Point(478, 394);
-			this.cmdInsert.Name = "cmdInsert";
-			this.cmdInsert.Size = new System.Drawing.Size(88, 23);
-			this.cmdInsert.TabIndex = 15;
-			this.cmdInsert.Text = "Add New Item";
-			this.cmdInsert.UseVisualStyleBackColor = true;
-			this.cmdInsert.Click += new System.EventHandler(this.cmdInsert_Click);
+			this.cmdInsert.Location=new System.Drawing.Point(478,394);
+			this.cmdInsert.Name="cmdInsert";
+			this.cmdInsert.Size=new System.Drawing.Size(88,23);
+			this.cmdInsert.TabIndex=15;
+			this.cmdInsert.Text="Add New Item";
+			this.cmdInsert.UseVisualStyleBackColor=true;
+			this.cmdInsert.Click+=new System.EventHandler(this.cmdInsert_Click);
 			//
 			// cmdUpdate
 			//
-			this.cmdUpdate.Location = new System.Drawing.Point(579, 394);
-			this.cmdUpdate.Name = "cmdUpdate";
-			this.cmdUpdate.Size = new System.Drawing.Size(51, 23);
-			this.cmdUpdate.TabIndex = 16;
-			this.cmdUpdate.Text = "Update";
-			this.cmdUpdate.UseVisualStyleBackColor = true;
-			this.cmdUpdate.Click += new System.EventHandler(this.cmdUpdate_Click);
+			this.cmdUpdate.Location=new System.Drawing.Point(579,394);
+			this.cmdUpdate.Name="cmdUpdate";
+			this.cmdUpdate.Size=new System.Drawing.Size(51,23);
+			this.cmdUpdate.TabIndex=16;
+			this.cmdUpdate.Text="Update";
+			this.cmdUpdate.UseVisualStyleBackColor=true;
+			this.cmdUpdate.Click+=new System.EventHandler(this.cmdUpdate_Click);
 			//
 			// cmdDelete
 			//
-			this.cmdDelete.Location = new System.Drawing.Point(643, 394);
-			this.cmdDelete.Name = "cmdDelete";
-			this.cmdDelete.Size = new System.Drawing.Size(49, 23);
-			this.cmdDelete.TabIndex = 17;
-			this.cmdDelete.Text = "Delete";
-			this.cmdDelete.UseVisualStyleBackColor = true;
-			this.cmdDelete.Click += new System.EventHandler(this.cmdDelete_Click);
+			this.cmdDelete.Location=new System.Drawing.Point(643,394);
+			this.cmdDelete.Name="cmdDelete";
+			this.cmdDelete.Size=new System.Drawing.Size(49,23);
+			this.cmdDelete.TabIndex=17;
+			this.cmdDelete.Text="Delete";
+			this.cmdDelete.UseVisualStyleBackColor=true;
+			this.cmdDelete.Click+=new System.EventHandler(this.cmdDelete_Click);
 			//
 			// cmdClear
 			//
-			this.cmdClear.Location = new System.Drawing.Point(15, 394);
-			this.cmdClear.Name = "cmdClear";
-			this.cmdClear.Size = new System.Drawing.Size(118, 23);
-			this.cmdClear.TabIndex = 18;
-			this.cmdClear.Text = "Clear Fields";
-			this.cmdClear.UseVisualStyleBackColor = true;
-			this.cmdClear.Click += new System.EventHandler(this.cmdClear_Click);
+			this.cmdClear.Location=new System.Drawing.Point(15,394);
+			this.cmdClear.Name="cmdClear";
+			this.cmdClear.Size=new System.Drawing.Size(118,23);
+			this.cmdClear.TabIndex=18;
+			this.cmdClear.Text="Clear Fields";
+			this.cmdClear.UseVisualStyleBackColor=true;
+			this.cmdClear.Click+=new System.EventHandler(this.cmdClear_Click);
 			//
 			// Form1
 			//
-			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-			this.ClientSize = new System.Drawing.Size(708, 423);
+			this.AutoScaleDimensions=new System.Drawing.SizeF(6F,13F);
+			this.AutoScaleMode=System.Windows.Forms.AutoScaleMode.Font;
+			this.ClientSize=new System.Drawing.Size(708,423);
 			this.Controls.Add(this.cmdClear);
 			this.Controls.Add(this.cmdDelete);
 			this.Controls.Add(this.cmdUpdate);
@@ -285,10 +290,10 @@
 			this.Controls.Add(this.label2);
 			this.Controls.Add(this.txtName);
 			this.Controls.Add(this.label1);
-			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
-			this.Name = "Form1";
-			this.Text = "Product Search";
-			this.Load += new System.EventHandler(this.Form1_Load);
+			this.FormBorderStyle=System.Windows.Forms.FormBorderStyle.FixedSingle;
+			this.Name="Form1";
+			this.Text="Product Search";
+			this.Load+=new System.EventHandler(this.Form1_Load);
 			((System.ComponentModel.ISupportInitialize)(this.dg1)).EndInit();
 			((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
 			this.ResumeLayout(false);


Fixed subtle pixel offset issues causing blurry symbols

--- LiveSPICE/Controls/Schematic/SymbolControl.cs
+++ LiveSPICE/Controls/Schematic/SymbolControl.cs
@@ -88,28 +88,25 @@
             ToolTip = new ToolTip() { Content = text };
         }

-        protected override Size MeasureOverride(Size constraint)
+        protected override Size ArrangeOverride(Size arrangeBounds)
         {
             Circuit.Symbol sym = Symbol;
             Point b1 = ToPoint(sym.LowerBound - sym.Position);
             Point b2 = ToPoint(sym.UpperBound - sym.Position);
-            return new Size(
-                Math.Min(Math.Abs(b2.X - b1.X), constraint.Width),
-                Math.Min(Math.Abs(b2.Y - b1.Y), constraint.Height));
+            return new Size(Math.Abs(b2.X - b1.X), Math.Abs(b2.Y - b1.Y));
         }

         protected Matrix Transform
         {
             get
             {
-                Circuit.Coord offset = layout.LowerBound + layout.UpperBound;
-                double scale = Math.Min(Math.Min(ActualWidth / Symbol.Width, ActualHeight / Symbol.Height), 1.0);
+                Circuit.Coord offset = (layout.LowerBound + layout.UpperBound) / 2;

                 Matrix transform = new Matrix();
-                transform.Translate(-offset.x * 0.5, -offset.y * 0.5);
-                transform.Scale(scale, Symbol.Flip ? scale : -scale);
+                transform.Translate(-offset.x, -offset.y);
+                transform.Scale(1.0, Symbol.Flip ? 1.0 : -1.0);
                 transform.Rotate(Symbol.Rotation * -90);
-                transform.Translate(ActualWidth / 2, ActualHeight / 2);
+                transform.Translate(Symbol.Width / 2, Symbol.Height / 2);
                 return transform;
             }
         }


refactor: remove unnecessary @ infront of string literals

--- tests/Yaapii.Atoms.Tests/IO/TeeInputTest.cs
+++ tests/Yaapii.Atoms.Tests/IO/TeeInputTest.cs
@@ -34,7 +34,7 @@
         [Fact]
         public void CopiesFromUrlToFile()
         {
-            var directoryPath = Path.GetTempPath() + @"Yaapii.Atoms.Tests.Temp-Files";
+            var directoryPath = Path.GetTempPath() + "Yaapii.Atoms.Tests.Temp-Files";
             System.IO.Directory.CreateDirectory(directoryPath);

             new LengthOf(
@@ -59,7 +59,7 @@
         [Fact]
         public void CopiesFromFileToFile()
         {
-            var directoryPath = Path.GetTempPath() + @"Yaapii.Atoms.Tests.Temp-Files";
+            var directoryPath = Path.GetTempPath() + "Yaapii.Atoms.Tests.Temp-Files";
             System.IO.Directory.CreateDirectory(directoryPath);

             File.WriteAllText(


fixed leaking RenderTarget2D

fixed leaking RenderTarget2D

--- MacTester/SceneOne/PixelBloomPostProcessor.cs
+++ MacTester/SceneOne/PixelBloomPostProcessor.cs
@@ -17,6 +17,7 @@
 		public PixelBloomPostProcessor( NezContentManager contentManager, RenderTexture layerRenderTexture ) : base( contentManager )
 		{
 			_layerRT = layerRenderTexture;
+			_tempRT = new RenderTexture( newHeight, newWidth );
 		}

@@ -24,7 +25,7 @@
 		{
 			base.onSceneBackBufferSizeChanged( newWidth, newHeight );

-			_tempRT = new RenderTexture( newHeight, newWidth );
+			_tempRT.resize( newHeight, newWidth );
 		}


Update GenGenWorker.cs

Update GenGenWorker.cs

--- MetX/MetX.Standard.Generators/GenGenWorker.cs
+++ MetX/MetX.Standard.Generators/GenGenWorker.cs
@@ -30,7 +30,7 @@
                     GeneratorsProjectGenerator = new GeneratorsCsProjGenerator(options.ToCsProjGeneratorOptions(GenFramework.Standard20));
                     ClientProjectGenerator = new ClientCsProjGenerator(options.ToCsProjGeneratorOptions(GenFramework.Net50));

-                    AspectsProjectGenerator.Setup().Generate().Save();
+                    var aspectsFolder = AspectsProjectGenerator.Setup().Generate().Save().Options.OutputPathResolved();
                     GeneratorsProjectGenerator.Setup().Generate().Save();
                     ClientProjectGenerator.Setup().Generate().Save();
                     break;


Fixed EditQuestListViewModel

Fixed EditQuestListViewModel

--- JustPressPlay/JustPressPlay/ViewModels/AdminViewModels.cs
+++ JustPressPlay/JustPressPlay/ViewModels/AdminViewModels.cs
@@ -552,7 +552,7 @@
             if (work == null)
                 work = new UnitOfWork();

-            var e = from a in work.EntityContext.achievement_template
+            var e = from a in work.EntityContext.quest_template
                     select new EditQuest
                     {
                         ID = a.id,


Wire up the add button to add a tab. Just a stub for right now.

--- ChromeTabs/ChromeTabPanel.cs
+++ ChromeTabs/ChromeTabPanel.cs
@@ -54,26 +54,22 @@

         public ChromeTabPanel()
         {
-            this.maxTabWidth = 100.0;
-            this.minTabWidth = 50.0;
+            this.maxTabWidth = 125.0;
+            this.minTabWidth = 30.0;
             this.leftMargin = 50.0;
             this.rightMargin = 0.0;
             this.overlap = 10.0;
             this.defaultMeasureHeight = 30.0;
-            this.addButtonSize = new Size(20, 12);

             ComponentResourceKey key = new ComponentResourceKey(typeof(ChromeTabPanel), "addButtonStyle");
             Style addButtonStyle = (Style)this.FindResource(key);
-
             this.addButton = new Button { Style = addButtonStyle };
+            this.addButtonSize = new Size(20, 12);
         }

         protected override int VisualChildrenCount
         {
-            get
-            {
-                return base.VisualChildrenCount + 1;
-            }
+            get { return base.VisualChildrenCount + 1; }
         }

         protected override Visual GetVisualChild(int index)
@@ -140,6 +136,13 @@
         protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
         {
             base.OnPreviewMouseLeftButtonDown(e);
+            if (this.addButtonRect.Contains(e.GetPosition(this)))
+            {
+                this.addButton.Background = Brushes.DarkGray;
+                this.InvalidateVisual();
+                return;
+            }
+
             this.downPoint = e.GetPosition(this);
             HitTestResult result = VisualTreeHelper.HitTest(this, this.downPoint);
             if (result == null) { return; }
@@ -155,7 +158,7 @@
         protected override void OnPreviewMouseMove(MouseEventArgs e)
         {
             base.OnPreviewMouseMove(e);
-            if (this.addButtonRect.Contains(e.GetPosition(this)) && this.addButton.Background != Brushes.White)
+            if (this.addButtonRect.Contains(e.GetPosition(this)) && this.addButton.Background != Brushes.White && this.addButton.Background != Brushes.DarkGray)
             {
                 this.addButton.Background = Brushes.White;
                 this.InvalidateVisual();
@@ -174,6 +177,14 @@
         protected override void OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e)
         {
             base.OnPreviewMouseLeftButtonUp(e);
+            if (this.addButtonRect.Contains(e.GetPosition(this)) && this.addButton.Background == Brushes.DarkGray)
+            {
+                this.addButton.Background = null;
+                this.InvalidateVisual();
+                ParentTabControl.AddTab(new Label(), true); // HACK: Do something with default templates, here.
+                return;
+            }
+
             ParentTabControl.ChangeSelectedItem(draggedTab);
             draggedTab = null;
         }