Comment added.

Comment added.

--- ProjectMarkdown/CustomControls/CodeTextboxHost.cs
+++ ProjectMarkdown/CustomControls/CodeTextboxHost.cs
@@ -135,6 +135,8 @@

             if (_oldFilePath != _newFilePath)
             {
+                // If _oldFilePath is null, it means we opened a new document for the first time
+                // When a new document is open there is no need for us to look for the empty string and the document loaded cases
                 if (_oldFilePath != null)
                 {
                     _textBoxLoadedWithEmptyString = true;


Add EduProgramProfileRepository.GetEduProgramProfiles_ByEduProgram method

--- R7.University/Data/EduProgramProfileRepository.cs
+++ R7.University/Data/EduProgramProfileRepository.cs
@@ -57,6 +57,11 @@
                 .WithEduProgram ();
         }

+        public IEnumerable<EduProgramProfileInfo> GetEduProgramProfiles_ByEduProgram (int eduProgramId)
+        {
+            return DataProvider.GetObjects<EduProgramProfileInfo> ("WHERE EduProgramID = @0", eduProgramId);
+        }
+
         public IEnumerable<EduProgramProfileInfo> GetEduProgramProfiles_ByEduLevel (int eduLevelId)
         {
             return DataProvider.GetObjects<EduProgramProfileInfo> (


Rewrote lisp-handler to greatly improve performance for bigger devices (like keyboards)

--- RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs
+++ RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.IO;
+using System.Linq;
 using System.Net.Http;
 using System.Runtime.InteropServices;
 using System.Text;
@@ -16,16 +17,21 @@
         private const string GAME_NAME = "RGBNET";
         private const string GAME_DISPLAYNAME = "RGB.NET";
         private const string EVENT_NAME = "UPDATELEDS";
-        private static readonly string HANDLER = $@"(handler ""{EVENT_NAME}""
+        private static readonly string HANDLER = $@"(define (getZone x)
+  (case x
+    {string.Join(Environment.NewLine, Enum.GetValues(typeof(SteelSeriesLedId))
+                                          .Cast<SteelSeriesLedId>()
+                                          .Select(x => x.GetAPIName())
+                                          .Select(ledId => $"    ((\"{ledId}\") {ledId}:)"))}
+  ))
+
+(handler ""{EVENT_NAME}""
   (lambda (data)
     (let* ((device (value: data))
-           (zoneData (frame: data))
-           (zones (frame-keys zoneData)))
-      (do ((zoneDo zones (cdr zoneDo)))
-          ((nil? zoneDo))
-          (let* ((zone (car zoneDo))
-                 (color (get-slot zoneData zone)))
-            (on-device device show-on-zone: color zone))))))
+           (zones (zones: data))
+           (colors (colors: data)))
+      (on-device device show-on-zones: colors (map (lambda (x) (getZone x)) zones)))))
+
 (add-event-per-key-zone-use ""{EVENT_NAME}"" ""all"")
 (add-event-zone-use-with-specifier ""{EVENT_NAME}"" ""all"" ""rgb-1-zone"")
 (add-event-zone-use-with-specifier ""{EVENT_NAME}"" ""all"" ""rgb-2-zone"")
@@ -87,7 +93,8 @@
         {
             _event.Data.Clear();
             _event.Data.Add("value", device);
-            _event.Data.Add("frame", data);
+            _event.Data.Add("colors", data.Values.ToList());
+            _event.Data.Add("zones", data.Keys.ToList());

             TriggerEvent(_event);
         }


Make sure to clear the "Deleting..." message if the task fails

--- Rackspace.VisualStudio.CloudExplorer/AsyncNode.cs
+++ Rackspace.VisualStudio.CloudExplorer/AsyncNode.cs
@@ -152,8 +152,23 @@
             }
         }

+        protected void TryUpdateLabel()
+        {
+            INodeSite nodeSite = GetNodeSite();
+            if (nodeSite != null)
+                nodeSite.UpdateLabel();
+        }
+
         protected void UpdateDisplayAfterDeleted(Task<bool> deleteTask)
         {
+            if (deleteTask.IsFaulted || deleteTask.IsCanceled)
+            {
+                Exception ignored = deleteTask.Exception;
+                _deleteTask = null;
+                TryUpdateLabel();
+                return;
+            }
+
             if (!deleteTask.IsCompleted || !deleteTask.Result)
                 return;


Can no longer maximize dialogs with CanResize set to false by double clicking the title bar.

--- UI/Common/Dialogs/BaseDialog.axaml.cs
+++ UI/Common/Dialogs/BaseDialog.axaml.cs
@@ -85,7 +85,7 @@
         }

         private void TitleBar_OnDoubleTapped(object sender, RoutedEventArgs e) {
-            if (WindowHelper.ToggleWindowStateCommand.CanExecute(this)) {
+            if (this.CanResize && WindowHelper.ToggleWindowStateCommand.CanExecute(this)) {
                 WindowHelper.ToggleWindowStateCommand.Execute(this);
             }
         }


IFileSystem extensions are now default methods on interface

--- src/KitchenSink/FileSystem/IFileSystem.cs
+++ src/KitchenSink/FileSystem/IFileSystem.cs
@@ -8,12 +8,93 @@
     public interface IFileSystem
     {
         void Create(EntryType type, string path);
+
         void Delete(string path);
+
+        void DeleteRecursive(string path)
+        {
+            var entry = GetInfo(path);
+
+            if (entry?.IsFile ?? false)
+            {
+                WriteFile(path).Close();
+            }
+            else if (entry?.IsDirectory ?? false)
+            {
+                foreach (var child in ReadDirectory(path))
+                {
+                    Delete(child.Path);
+                }
+            }
+        }
+
         void Move(string source, string destination);
+
+        void Copy(string source, string destination)
+        {
+            var entry = GetInfo(source);
+
+            if (entry?.IsFile ?? false)
+            {
+                WriteBytes(destination, ReadBytes(source));
+            }
+            else if (entry?.IsDirectory ?? false)
+            {
+                Create(EntryType.Directory, destination);
+
+                foreach (var child in ReadDirectory(source))
+                {
+                    Copy(child.Path, Path.Combine(destination, child.Path.Substring(source.Length)));
+                }
+            }
+            else
+            {
+                throw new PathNotFoundException(source);
+            }
+        }
+
         EntryInfo GetInfo(string path);
+        bool Exists(string path) => GetInfo(path) != null;
+        bool DirectoryExists(string path) => GetInfo(path)?.Type == EntryType.Directory;
+        bool FileExists(string path) => GetInfo(path)?.Type == EntryType.File;
+
         IEnumerable<EntryInfo> ReadDirectory(string path);
+
+        IEnumerable<EntryInfo> ReadDirectoryRecursive(string path)
+        {
+            foreach (var entry in ReadDirectory(path))
+            {
+                yield return entry;
+
+                if (entry.Type != EntryType.Directory) continue;
+
+                foreach (var child in ReadDirectoryRecursive(entry.Path))
+                {
+                    yield return child;
+                }
+            }
+        }
+
         Stream ReadFile(string path);
+
+        IEnumerable<byte> ReadBytes(string path) => ReadFile(path).AsEnumerable();
+        IEnumerable<char> ReadChars(string path, Encoding encoding = null) =>
+            ReadFile(path).AsReader(encoding).AsEnumerableChars();
+        IEnumerable<string> ReadLines(string path, Encoding encoding = null) =>
+            ReadFile(path).AsReader(encoding).AsEnumerableLines();
+        string ReadText(string path, Encoding encoding = null) =>
+            ReadFile(path).Use(s => s.ReadTextToEnd(encoding));
+
         Stream WriteFile(string path, bool append = false);
+
+        void WriteBytes(string path, IEnumerable<byte> bytes) =>
+            bytes.ToStream().Use(s => WriteFile(path).Use(s.CopyTo));
+        void WriteChars(string path, IEnumerable<char> chars, Encoding encoding = null) =>
+            WriteFile(path).AsWriter(encoding).Use(s => chars.ForEach(s.Write));
+        void WriteLines(string path, IEnumerable<string> lines, Encoding encoding = null) =>
+            WriteFile(path).Use(s => lines.ForEach(s.AsWriter(encoding).WriteLine));
+        void WriteText(string path, string text, Encoding encoding = null) =>
+            WriteFile(path).Use(s => s.AsWriter(encoding).Write(text));
     }

     public class EntryInfo
@@ -37,98 +118,4 @@
         Directory,
         File
     }
-
-    public static class FileSystemOperations
-    {
-        public static bool Exists(this IFileSystem fs, string path) =>
-            fs.GetInfo(path) != null;
-
-        public static bool DirectoryExists(this IFileSystem fs, string path) =>
-            fs.GetInfo(path)?.Type == EntryType.Directory;
-
-        public static bool FileExists(this IFileSystem fs, string path) =>
-            fs.GetInfo(path)?.Type == EntryType.File;
-
-        public static void Clear(this IFileSystem fs, string path)
-        {
-            var entry = fs.GetInfo(path);
-
-            if (entry?.IsFile ?? false)
-            {
-                fs.WriteFile(path).Close();
-            }
-            else if (entry?.IsDirectory ?? false)
-            {
-                foreach (var child in fs.ReadDirectory(path))
-                {
-                    fs.Delete(child.Path);
-                }
-            }
-        }
-
-        public static void Copy(this IFileSystem fs, string source, string destination)
-        {
-            var entry = fs.GetInfo(source);
-
-            if (entry?.IsFile ?? false)
-            {
-                fs.ReadFile(source).Use(s => fs.WriteFile(destination).Use(s.CopyTo));
-            }
-            else if (entry?.IsDirectory ?? false)
-            {
-                fs.Create(EntryType.Directory, destination);
-
-                foreach (var child in fs.ReadDirectory(source))
-                {
-                    fs.Copy(child.Path, Path.Combine(destination, child.Path.Substring(source.Length)));
-                }
-            }
-            else
-            {
-                throw new PathNotFoundException(source);
-            }
-        }
-
-        public static IEnumerable<EntryInfo> ReadDirectoryRecursive(this IFileSystem fs, string path)
-        {
-            foreach (var entry in fs.ReadDirectory(path))
-            {
-                yield return entry;
-
-                if (entry.Type != EntryType.Directory) continue;
-
-                foreach (var child in fs.ReadDirectoryRecursive(entry.Path))
-                {
-                    yield return child;
-                }
-            }
-        }
-
-        public static IEnumerable<byte> ReadBytes(this IFileSystem fs, string path) =>
-            fs.ReadFile(path).AsEnumerable();
-
-        public static IEnumerable<char> ReadChars(this IFileSystem fs, string path, Encoding encoding = null) =>
-            fs.ReadFile(path).AsReader(encoding).AsEnumerableChars();
-
-        public static IEnumerable<string> ReadLines(this IFileSystem fs, string path, Encoding encoding = null) =>
-            fs.ReadFile(path).AsReader(encoding).AsEnumerableLines();
-
-        public static string ReadText(this IFileSystem fs, string path, Encoding encoding = null) =>
-            fs.ReadFile(path).Use(s => s.ReadTextToEnd(encoding));
-
-        public static void WriteBytes(this IFileSystem fs, string path, IEnumerable<byte> bytes)
-        {
-            using var stream = bytes.ToStream();
-            fs.WriteFile(path).Use(stream.CopyTo);
-        }
-
-        public static void WriteChars(this IFileSystem fs, string path, IEnumerable<char> chars, Encoding encoding = null) =>
-            fs.WriteFile(path).AsWriter(encoding).Use(s => chars.ForEach(s.Write));
-
-        public static void WriteLines(this IFileSystem fs, string path, IEnumerable<string> lines, Encoding encoding = null) =>
-            fs.WriteFile(path).Use(s => lines.ForEach(s.AsWriter(encoding).WriteLine));
-
-        public static void WriteText(this IFileSystem fs, string path, string text, Encoding encoding = null) =>
-            fs.WriteFile(path).Use(s => s.AsWriter(encoding).Write(text));
-    }
 }


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Server/WebSocketSessionManager.cs
+++ websocket-sharp/Server/WebSocketSessionManager.cs
@@ -276,13 +276,23 @@
     private void broadcast (Opcode opcode, Stream stream, Action completed)
     {
       var cache = new Dictionary <CompressionMethod, Stream> ();
+
       try {
-        Broadcast (opcode, stream, cache);
+        foreach (var session in Sessions) {
+          if (_state != ServerState.Start) {
+            _log.Error ("The service is shutting down.");
+            break;
+          }
+
+          session.Context.WebSocket.Send (opcode, stream, cache);
+        }
+
         if (completed != null)
           completed ();
       }
       catch (Exception ex) {
-        _log.Fatal (ex.ToString ());
+        _log.Error (ex.Message);
+        _log.Debug (ex.ToString ());
       }
       finally {
         foreach (var cached in cache.Values)


[moodle.wp] Harden FileViewModel against crashes.

--- windows/Source/Moodle/ViewModels/FileViewModel.cs
+++ windows/Source/Moodle/ViewModels/FileViewModel.cs
@@ -67,30 +67,32 @@
         {
             await base.OnNavigatedToAsync();

-            IsCached = await _storage.IsStoredAsync( File );
+            await TryExecuteAsync( async _ =>
+            {
+                IsCached = await _storage.IsStoredAsync( File );
+            } );
         }

         private Task ForceDownloadAsync()
         {
             return TryExecuteAsync( async _ =>
             {
-                var bytes = await _downloader.DownloadAsync( File );
-                await _storage.StoreFileAsync( File, bytes );
+                await _storage.StoreFileAsync( File, await _downloader.DownloadAsync( File ) );
                 IsCached = true;
             } );
         }

-        private async Task OpenAsync()
+        private Task OpenAsync()
         {
-            if ( !IsCached )
+            return TryExecuteAsync( async _ =>
             {
-                await ForceDownloadAsync();
-            }
-            // Check IsCached again, it'll be false if ForceDownloadAsync threw.
-            if ( IsCached )
-            {
+                if ( !IsCached )
+                {
+                    await _storage.StoreFileAsync( File, await _downloader.DownloadAsync( File ) );
+                    IsCached = true;
+                }
                 await _storage.OpenFileAsync( File );
-            }
+            } );
         }

         private Task PrintAsync()


remove intentional exception

remove intentional exception

--- src/MarkdownEdit/Models/EditorLoadSave.cs
+++ src/MarkdownEdit/Models/EditorLoadSave.cs
@@ -31,8 +31,7 @@

         public static bool LoadFile(Editor editor, string file, bool updateCursorPosition = true)
         {
-            if (!string.IsNullOrWhiteSpace(file)) throw new NullReferenceException();
-            //if (string.IsNullOrWhiteSpace(file)) return false;
+            if (string.IsNullOrWhiteSpace(file)) return false;
             try
             {
                 var parts = file.Split(new[] {'|'}, 2);


Put tests in the right namespace

Put tests in the right namespace

svn path=/trunk/bitsharp/; revision=96255

--- src/MonoTorrent.Tests/PieceWriterTests.cs
+++ src/MonoTorrent.Tests/PieceWriterTests.cs
@@ -6,7 +6,7 @@
 using MonoTorrent.Client.Messages.Standard;
 using MonoTorrent.Common;

-namespace MonoTorrent.Tests
+namespace MonoTorrent.Client.Tests
 {
 	public class NullWriter : PieceWriter
 	{


Revert "JsonRpc/Logger: fix possible NullReferenceException"

--- src/Nethereum.JsonRpc.Client/RPCLogger.cs
+++ src/Nethereum.JsonRpc.Client/RPCLogger.cs
@@ -50,7 +50,7 @@

             if (HasError(responseMessage) && IsLogErrorEnabled())
             {
-                if (IsLogTraceEnabled())
+                if (!IsLogTraceEnabled())
                 {
                     Log.Trace(GetRPCResponseLogMessage());
                 }
@@ -79,4 +79,4 @@
     }

 }
-#endif
+#endif


Sending order by Assending and Decending as expression

--- Samples.CSharp7/Source/CSharp7.DemoApp/Program.cs
+++ Samples.CSharp7/Source/CSharp7.DemoApp/Program.cs
@@ -38,6 +38,30 @@

             ForegroundColor = ConsoleColor.Yellow;

+            WriteLine($"Using Filter Data for generating Even Numbers");
+            var filterData = new FilterData();
+            filterData.SelectValues(numbers, e => e % 2 == 0)
+                .ForEach(WriteLine);
+
+            WriteLine($"Using Filter Data for generating Even Numbers Using OrderBy");
+            filterData
+                .SelectValues(numbers, e => e % 2 == 0)
+                .OrderBy(e => e)
+                .ToList()
+                .ForEach(WriteLine);
+
+            // Order by Ascending
+            WriteLine($"Using Filter Data for SelectValuesWithOrderBy");
+            filterData
+                .SelectValuesWithOrderBy(numbers, e => e % 2 == 0, e => e)
+                .ForEach(WriteLine);
+
+            // Order by Decending
+            WriteLine($"Using Filter Data for SelectValuesWithOrderBy");
+            filterData
+                .SelectValuesWithOrderBy(numbers, e => e % 2 == 0, e => -e)
+                .ForEach(WriteLine);
+
             Person person = new Person("Shiva", 20_000);
             WriteLine("Person Details");
             WriteLine($"Id: {person.Id}");
@@ -55,22 +79,7 @@
             WriteLine($"Selecting number which are divided by 3");
             SelectValues(numbers, e => e % 3 == 0);

-            WriteLine($"Using Filter Data for generating Even Numbers");
-            var filterData = new FilterData();
-            filterData.SelectValues(numbers, e => e % 2 == 0)
-                .ForEach(WriteLine);
-
-            WriteLine($"Using Filter Data for generating Even Numbers Using OrderBy");
-            filterData
-                .SelectValues(numbers, e => e % 2 == 0)
-                .OrderBy(e => e)
-                .ToList()
-                .ForEach(WriteLine);
-
-            WriteLine($"Using Filter Data for SelectValuesWithOrderBy");
-            filterData
-                .SelectValuesWithOrderBy(numbers, e => e % 2 == 0, e => e)
-                .ForEach(WriteLine);
+

             WriteLine("\n\nPress any key ...");
             Read();


shortcode response fix

shortcode response fix

--- src/Plivo/Resource/Powerpack/Shortcode.cs
+++ src/Plivo/Resource/Powerpack/Shortcode.cs
@@ -13,7 +13,7 @@
         public Shortcode () {

         }
-        public new string Id => NumberPoolUUID;
+        public new string Id => NumberPoolUuid;

         /// <summary>
         /// shortcode
@@ -31,13 +31,13 @@
         /// Gets or sets the created_on.
         /// </summary>
         /// <value>The created_on.</value>
-        public string CountryISO2 { get; set; }
+        public string CountryIso2 { get; set; }

         /// <summary>
         /// Gets or sets the NumberPoolUUID.
         /// </summary>
         /// <value>The NumberPoolUUID.</value>
-        public string NumberPoolUUID { get; set; }
+        public string NumberPoolUuid { get; set; }

         // public Shortcode Get(string memberId)
         // {
@@ -82,9 +82,9 @@

         public override string ToString () {
             return "\n" +
-                "NumberPoolUUID: " + NumberPoolUUID + "\n" +
+                "NumberPoolUUID: " + NumberPoolUuid + "\n" +
                 "Shortcode: " + shortcode + "\n" +
-                "CountryISO2: " + CountryISO2 + "\n" +
+                "CountryISO2: " + CountryIso2 + "\n" +
                 "AddedOn: " + AddedOn + "\n";
         }
     }


use shorter name if type is under code namespace

--- Serenity.Web/CodeGeneration/ScriptDtoGenerator.cs
+++ Serenity.Web/CodeGeneration/ScriptDtoGenerator.cs
@@ -407,6 +407,13 @@
                 (codeNamespace != null && (ns == codeNamespace)) ||
                 (codeNamespace != null && codeNamespace.StartsWith((ns + "."))))
                 return type.Name;
+
+            if (codeNamespace != null)
+            {
+                var idx = codeNamespace.IndexOf('.');
+                if (idx >= 0 && type.FullName.StartsWith(codeNamespace.Substring(0, idx + 1)))
+                    return type.FullName.Substring(idx + 1);
+            }

             return type.FullName;
         }


texts for new view mode

texts for new view mode

--- Serenity.Web/Texts/Texts.Controls.EntityDialog.cs
+++ Serenity.Web/Texts/Texts.Controls.EntityDialog.cs
@@ -16,11 +16,13 @@
                 public static LocalText UpdateButton = "Update";
                 public static LocalText ApplyChangesButton = "Apply Changes";
                 public static LocalText DeleteButton = "Delete";
+                public static LocalText EditButton = "Edit";
                 public static LocalText LocalizationButton = "Localization";
                 public static LocalText LocalizationBack = "Back to Form";
                 public static LocalText LocalizationConfirmation = "Save changes to translations?";
                 public static LocalText NewRecordTitle = "New {0}";
                 public static LocalText EditRecordTitle = "Edit {0}{1}";
+                public static LocalText ViewRecordTitle = "View {0}{1}";
             }
         }
     }


added custom csp attributes for script and style

--- Server/Extensions/ApplicationBuilderExtensions.cs
+++ Server/Extensions/ApplicationBuilderExtensions.cs
@@ -54,11 +54,15 @@
                             .Self()
                             .Data();

-                        builder.AddScriptSrc() // script-src 'self'
-                            .Self();
+                        // builder.AddScriptSrc() // script-src 'self'
+                        //     .Self();

-                        builder.AddStyleSrc() // style-src 'self'
-                            .Self();
+                        // builder.AddStyleSrc() // style-src 'self'
+                        //     .Self();
+
+                        builder.AddUpgradeInsecureRequests(); // upgrade-insecure-requests
+                        builder.AddCustomDirective("script-src", "'self' 'unsafe-inline'");
+                        builder.AddCustomDirective("style-src", "'self' 'unsafe-inline'");

                         builder.AddMediaSrc()
                             .Self();


renamed variable

renamed variable

--- iOS/Helpers/HealtKitAccess.cs
+++ iOS/Helpers/HealtKitAccess.cs
@@ -156,18 +156,17 @@
 		public async Task<double> QueryLastRegistratedWalkingDistance()
 		{

-			var heightType = HKQuantityType.GetQuantityType (HKQuantityTypeIdentifierKey.DistanceWalkingRunning);
+			var distanceType = HKQuantityType.GetQuantityType (HKQuantityTypeIdentifierKey.DistanceWalkingRunning);
 			double lastRegistratedWalkingDistance = 0.0;

 			var timeSortDescriptor = new NSSortDescriptor (HKSample.SortIdentifierEndDate, false);
-			var query = new HKSampleQuery (heightType, new NSPredicate (IntPtr.Zero), 1, new NSSortDescriptor[] { timeSortDescriptor },
+						var query = new HKSampleQuery (distanceType, new NSPredicate (IntPtr.Zero), 1, new NSSortDescriptor[] { timeSortDescriptor },
 				(HKSampleQuery resultQuery, HKSample[] results, NSError error) => {
 					HKQuantity quantity = null;
 					string resultString = string.Empty;
 					if (results.Length != 0) {
 						var quantitySample = (HKQuantitySample) results [results.Length - 1];
 						quantity = quantitySample.Quantity;
-
 						lastRegistratedWalkingDistance = quantity.GetDoubleValue(HKUnit.Meter);

 						HealthKitDataContext.ActiveHealthKitData.DistanceReadings.TotalDistanceOfLastRecording = lastRegistratedWalkingDistance;
@@ -179,6 +178,7 @@
 			m_healthKitStore.ExecuteQuery (query);
 			return lastRegistratedWalkingDistance;
 		}
+

 		public async Task<int> QueryLastRegistratetHeartRate()
 		{
@@ -218,11 +218,11 @@

 		public async Task<int> QueryLastRegistratedSteps()
 		{
-			var heightType = HKQuantityType.GetQuantityType (HKQuantityTypeIdentifierKey.StepCount);
+			var stepType = HKQuantityType.GetQuantityType (HKQuantityTypeIdentifierKey.StepCount);
 			int lastRegistratedSteps = 0;

 			var timeSortDescriptor = new NSSortDescriptor (HKSample.SortIdentifierEndDate, false);
-			var query = new HKSampleQuery (heightType, new NSPredicate (IntPtr.Zero), 1, new NSSortDescriptor[] { timeSortDescriptor },
+			var query = new HKSampleQuery (stepType, new NSPredicate (IntPtr.Zero), 1, new NSSortDescriptor[] { timeSortDescriptor },
 				(HKSampleQuery resultQuery, HKSample[] results, NSError error) => {

 					HKQuantity quantity = null;


FileRepeater set implementations fix

FileRepeater set implementations fix

--- Signum.Web.Extensions/Files/FileRepeaterHelper.cs
+++ Signum.Web.Extensions/Files/FileRepeaterHelper.cs
@@ -43,8 +43,10 @@
                 //Write FileLine template
                 TypeElementContext<FilePathDN> templateTC = new TypeElementContext<FilePathDN>(null, (TypeContext)fileRepeater.Parent, 0);
                 using (FileLine fl = new FileLine(typeof(FilePathDN), templateTC.Value, templateTC, "", templateTC.PropertyRoute) { Remove = false, AsyncUpload = fileRepeater.AsyncUpload, FileType = fileRepeater.FileType, OnlyValue = true })
+                {
+                    fl.Implementations = fileRepeater.Implementations;
                     sb.AddLine(EntityBaseHelper.EmbeddedTemplate(fileRepeater, helper.InternalFileLine(fl)));
-
+                }
                 using (sb.Surround(new HtmlTag("div").IdName(fileRepeater.Compose(EntityRepeaterKeys.ItemsContainer))))
                 {
                     if (fileRepeater.UntypedValue != null)
@@ -98,7 +100,10 @@
                     TypeContext<FilePathDN> tc = (TypeContext<FilePathDN>)TypeContextUtilities.CleanTypeContext(itemTC);

                     using (FileLine fl = new FileLine(typeof(FilePathDN), tc.Value, itemTC, "", tc.PropertyRoute) { Remove = false, OnlyValue = true })
+                    {
+                        fl.Implementations = fileRepeater.Implementations;
                         sb.AddLine(helper.InternalFileLine(fl));
+                    }
                 }
             }

@@ -118,7 +123,8 @@

             FileRepeater fl = new FileRepeater(context.Type, context.UntypedValue, context, null, context.PropertyRoute);

-            //Navigator.ConfigureEntityBase(el, Reflector.ExtractLite(typeof(S)) ?? typeof(S), false);
+            EntityBaseHelper.ConfigureEntityBase(fl, typeof(S).CleanType());
+
             Common.FireCommonTasks(fl);

             if (settingsModifier != null)


Add bake overrides prototype

Add bake overrides prototype

--- SlicerConfiguration/SliceSettingsDetailControl.cs
+++ SlicerConfiguration/SliceSettingsDetailControl.cs
@@ -149,6 +149,9 @@
 				{ "Import".Localize(), ImportSettingsMenu_Click },
 				{ "Export".Localize(), ExportSettingsMenu_Click },
 				{ "Reset to defaults".Localize(), RestoreAllSettingsMenu_Click },
+#if DEBUG
+				{ "Bake Overrides".Localize(), BakeOverrides_Click },
+#endif
 			};

 			//Add the menu items to the menu itself
@@ -158,6 +161,22 @@
 			}
 		}

+		private bool BakeOverrides_Click()
+		{
+			var activeSettings = ActiveSliceSettings.Instance;
+			foreach(var keyValue in activeSettings.UserLayer)
+			{
+				activeSettings.OemLayer[keyValue.Key] = keyValue.Value;
+			}
+
+			activeSettings.UserLayer.Clear();
+			activeSettings.SaveChanges();
+
+			ApplicationController.Instance.ReloadAdvancedControlsPanel();
+
+			return true;
+		}
+
 		private void SettingsDetail_SelectionChanged(object sender, EventArgs e)
 		{
 			RebuildSlicerSettings(null, null);


Implement equality for Range3Single

Implement equality for Range3Single

--- SolidworksAddinFramework/Geometry/Range3Single.cs
+++ SolidworksAddinFramework/Geometry/Range3Single.cs
@@ -13,6 +13,16 @@
     /// </summary>
     public struct Range3Single
     {
+        public static bool operator ==(Range3Single left, Range3Single right)
+        {
+            return left.Equals(right);
+        }
+
+        public static bool operator !=(Range3Single left, Range3Single right)
+        {
+            return !left.Equals(right);
+        }
+
         public Vector3 P0 { get; }

         public Vector3 P1 { get; }
@@ -71,6 +81,26 @@
             action(v);
             v = new Vector3(XMax, YMax, ZMax);
             action(v);
+        }
+
+        public bool Equals(Range3Single other)
+        {
+            return P0.Equals(other.P0) && P1.Equals(other.P1);
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (ReferenceEquals(null, obj))
+                return false;
+            return obj is Range3Single && Equals((Range3Single) obj);
+        }
+
+        public override int GetHashCode()
+        {
+            unchecked
+            {
+                return (P0.GetHashCode()*397) ^ P1.GetHashCode();
+            }
         }


Fixed generic parameter accuracy

Fixed generic parameter accuracy

--- Source/Miruken/Callback/Policy/CovariantPolicy.cs
+++ Source/Miruken/Callback/Policy/CovariantPolicy.cs
@@ -33,7 +33,7 @@
                      ? 2000 : (int?)null;
             if (key.IsGenericParameter)
                 return key.GetGenericParameterConstraints()
-                    .Min(constraint => Accuracy(type, constraint));
+                    .Min(constraint => Accuracy(constraint, type));
             return type.IsAssignableFrom(key)
                  ? GetAccuracy(type, key)
                  : (int?)null;


Weird file state from previous merge

Weird file state from previous merge

--- UMAProject/Assets/UMA/Editor/UMADNAHelperTools.cs
+++ UMAProject/Assets/UMA/Editor/UMADNAHelperTools.cs
@@ -7,7 +7,6 @@
 using System.Text;
 using System.Collections.Generic;
 using UMA;
-using UMAEditor;

 namespace UMAEditor
 {


fix labeling error

fix labeling error

--- src/Sir.VectorSpace/SerializableVector.cs
+++ src/Sir.VectorSpace/SerializableVector.cs
@@ -11,7 +11,7 @@
     [System.Diagnostics.DebuggerDisplay("{Label}")]
     public class SerializableVector : ISerializableVector
     {
-        public object Label { get; }
+        public object Label { get; private set; }
         public Vector<float> Value { get; private set; }
         public int ComponentCount => ((SparseVectorStorage<float>)Value.Storage).ValueCount;
         public int[] Indices { get { return ((SparseVectorStorage<float>)Value.Storage).Indices; } }
@@ -79,6 +79,7 @@
         public void AddInPlace(ISerializableVector vector)
         {
             Value = Value.Add(vector.Value);
+            Label = $"{Label} {vector.Label}";
         }

         public ISerializableVector Add(ISerializableVector vector)


Make Price conversions to double/float explicit, only decimal remains implicit

--- src/Spreads.Extensions/DataTypes/Price.cs
+++ src/Spreads.Extensions/DataTypes/Price.cs
@@ -130,7 +130,7 @@
         }

         public decimal AsDecimal => (this);
-        public double AsDouble => (this);
+        public double AsDouble => (double)(this);
         public Price AsUnqualified => IsQualified ? new Price(_value) : this;

         public bool IsQualified => _value >> 63 == 1UL;
@@ -272,11 +272,14 @@
             _value = mantissa;
         }

-        public static implicit operator double(Price price) {
+        // NB only decimal is implicit because it doesn't lose precision
+        // there are no conversions to other direction, only ctor
+
+        public static explicit operator double(Price price) {
             return price.Mantissa * DoubleFractions10[price.Exponent];
         }

-        public static implicit operator float(Price price) {
+        public static explicit operator float(Price price) {
             return (float)(price.Mantissa * DoubleFractions10[price.Exponent]);
         }


Refactor condition validation

Refactor condition validation

--- src/Take.Blip.Builder/Models/Condition.cs
+++ src/Take.Blip.Builder/Models/Condition.cs
@@ -51,23 +51,12 @@
                 throw new ValidationException("The entity name should be provided if the comparsion source is entity");
             }

-            if ((Comparison == ConditionComparison.Exists || Comparison == ConditionComparison.NotExists) && (Values != null && Values.Length >= 0))
+            if (Comparison.GetComparisonType() == ComparisonType.Unary && Values != null && Values.Length > 0)
             {
                 throw new ValidationException("The condition values should not be provided if comparison is Exists or NotExists");
             }

-            if ( (Comparison == ConditionComparison.Equals ||
-                  Comparison == ConditionComparison.NotEquals ||
-                  Comparison == ConditionComparison.Contains ||
-                  Comparison == ConditionComparison.StartsWith ||
-                  Comparison == ConditionComparison.EndsWith ||
-                  Comparison == ConditionComparison.GreaterThan ||
-                  Comparison == ConditionComparison.LessThan ||
-                  Comparison == ConditionComparison.GreaterThanOrEquals ||
-                  Comparison == ConditionComparison.LessThanOrEquals ||
-                  Comparison == ConditionComparison.Matches ||
-                  Comparison == ConditionComparison.ApproximateTo) &&
-                 (Values == null || Values.Length == 0))
+            if (Comparison.GetComparisonType() == ComparisonType.Binary && (Values == null || Values.Length == 0))
             {
                 throw new ValidationException("The condition values should be provided if comparison is not Exists or NotExists");
             }


Fixed bug with IAlbum.IsAvailable. Was always returning true

--- src/Torshify/Core/Native/Spotify.Album.cs
+++ src/Torshify/Core/Native/Spotify.Album.cs
@@ -24,6 +24,7 @@
         /// <seealso cref="sp_album_is_loaded"/>
         /// </remarks>
         [DllImport("spotify")]
+        [return: MarshalAs(UnmanagedType.I1)]
         internal static extern bool sp_album_is_available(IntPtr albumPtr);

         /// <summary>


Fixing error.

Fixing error.

git-svn-id: fb418c05146d7d73e8e43178c8c6500e5efdaad4@1153 90d2b0b2-0e11-ba47-89f1-85e69862abc4

--- src/Uncas.Core/Properties/AssemblyInfo.cs
+++ src/Uncas.Core/Properties/AssemblyInfo.cs
@@ -1,5 +1,5 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
+using System;
+using System.Reflection;
 using System.Runtime.InteropServices;

 // General Information about an assembly is controlled through the following
@@ -13,6 +13,7 @@
 [assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
+[assembly: CLSCompliant(true)]

 // Setting ComVisible to false makes the types in this assembly not visible
 // to COM components.  If you need to access a type in this assembly from


Add InternalsVisibleTo for DynamicProxyGenAssembly2


Fixed auto-fit offset calculation

Fixed auto-fit offset calculation

--- src/Wpf.Controls.PanAndZoom/ZoomBorder.cs
+++ src/Wpf.Controls.PanAndZoom/ZoomBorder.cs
@@ -307,9 +307,20 @@
             {
                 double zx = panelWidth / elementWidth;
                 double zy = panelHeight / elementHeight;
-                double cx = elementWidth / 2.0;
-                double cy = elementHeight / 2.0;
-                _matrix = MatrixHelper.ScaleAt(zx, zy, cx, cy);
+                double cx = elementWidth < panelWidth ? elementWidth / 2.0 : 0.0;
+                double cy = elementHeight < panelHeight ? elementHeight / 2.0 : 0.0;
+                if (elementWidth > panelWidth && elementHeight > panelHeight)
+                {
+                    cx = (panelWidth - elementWidth * zx) / 2.0;
+                    cy = (panelHeight - elementHeight * zy) / 2.0;
+                    _matrix = MatrixHelper.ScaleAt(zx, zy, 0.0, 0.0);
+                    _matrix.OffsetX = cx;
+                    _matrix.OffsetY = cy;
+                }
+                else
+                {
+                    _matrix = MatrixHelper.ScaleAt(zx, zy, cx, cy);
+                }
                 Invalidate();
             }
         }
@@ -323,9 +334,20 @@
                 double zx = panelWidth / elementWidth;
                 double zy = panelHeight / elementHeight;
                 double zoom = Min(zx, zy);
-                double cx = elementWidth / 2.0;
-                double cy = elementHeight / 2.0;
-                _matrix = MatrixHelper.ScaleAt(zoom, zoom, cx, cy);
+                double cx = elementWidth < panelWidth ? elementWidth / 2.0 : 0.0;
+                double cy = elementHeight < panelHeight ? elementHeight / 2.0 : 0.0;
+                if (elementWidth > panelWidth && elementHeight > panelHeight)
+                {
+                    cx = (panelWidth - elementWidth * zoom) / 2.0;
+                    cy = (panelHeight - elementHeight * zoom) / 2.0;
+                    _matrix = MatrixHelper.ScaleAt(zoom, zoom, 0.0, 0.0);
+                    _matrix.OffsetX = cx;
+                    _matrix.OffsetY = cy;
+                }
+                else
+                {
+                    _matrix = MatrixHelper.ScaleAt(zoom, zoom, cx, cy);
+                }
                 Invalidate();
             }
         }
@@ -339,9 +361,20 @@
                 double zx = panelWidth / elementWidth;
                 double zy = panelHeight / elementHeight;
                 double zoom = Max(zx, zy);
-                double cx = elementWidth / 2.0;
-                double cy = elementHeight / 2.0;
-                _matrix = MatrixHelper.ScaleAt(zoom, zoom, cx, cy);
+                double cx = elementWidth < panelWidth ? elementWidth / 2.0 : 0.0;
+                double cy = elementHeight < panelHeight ? elementHeight / 2.0 : 0.0;
+                if (elementWidth > panelWidth && elementHeight > panelHeight)
+                {
+                    cx = (panelWidth - elementWidth * zoom) / 2.0;
+                    cy = (panelHeight - elementHeight * zoom) / 2.0;
+                    _matrix = MatrixHelper.ScaleAt(zoom, zoom, 0.0, 0.0);
+                    _matrix.OffsetX = cx;
+                    _matrix.OffsetY = cy;
+                }
+                else
+                {
+                    _matrix = MatrixHelper.ScaleAt(zoom, zoom, cx, cy);
+                }
                 Invalidate();
             }
         }


:shirt: Fix warning

:shirt: Fix warning

--- src/Yarhl.UnitTests/IO/DataReaderTests.cs
+++ src/Yarhl.UnitTests/IO/DataReaderTests.cs
@@ -672,7 +672,7 @@
             // that single-bytes code unit match a byte of other code units.
             // It doesn't happen in UTF-16 since it was well-designed :D
             byte[] buffer = {
-                0x82, 0x50, 0x41, 0x40, 0x00
+                0x82, 0x50, 0x41, 0x40, 0x00,
             };
             stream.Write(buffer, 0, buffer.Length);


Throttle filters to update less often.

Throttle filters to update less often.

--- WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
+++ WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -119,6 +119,7 @@
 				}).DisposeWith(Disposables);

 			_filtersLeft = HashChain.WhenAnyValue(x => x.HashesLeft)
+				.Throttle(TimeSpan.FromMilliseconds(100))
 				.ObserveOn(RxApp.MainThreadScheduler)
 				.ToProperty(this, x => x.FiltersLeft)
 				.DisposeWith(Disposables);


CA-253047: Wrong prechecks are performed in Automated Updates mode if an update has been previously uploaded

Reset the PrecheckPage.PoolUpdate property on leaving the SelectPatch page, because it needs to be null for the Automated Updates mode and for the single update mode it will be updated on leaving the Upload page.

Signed-off-by: Mihaela Stoica <be95049f8e30d921fc7e2579c00c48bd84c40606@citrix.com>

--- XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs
+++ XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs
@@ -144,6 +144,8 @@

                 PatchingWizard_PrecheckPage.IsInAutomatedUpdatesMode = wizardIsInAutomatedUpdatesMode;
                 PatchingWizard_PrecheckPage.Patch = existPatch;
+                PatchingWizard_PrecheckPage.PoolUpdate = null; //reset the PoolUpdate property; it will be updated on leaving the Upload page, if this page is visible
+
                 PatchingWizard_PatchingPage.Patch = existPatch;

                 PatchingWizard_PrecheckPage.SelectedUpdateType = updateType;


analog clock display improvements

analog clock display improvements

--- YAPA.WPF.Themes/DefaultTheme2/MainWindow2.xaml.cs
+++ YAPA.WPF.Themes/DefaultTheme2/MainWindow2.xaml.cs
@@ -19,13 +19,17 @@
             InitializeComponent();

             Loaded += MainWindow2_Loaded;
+            viewModel.Engine.OnStarted += Engine_OnStarted;
+
+        }
+
+        private void Engine_OnStarted()
+        {
+            startDate = DateTime.Now;
         }

         private void MainWindow2_Loaded()
         {
-            dateTime = DateTime.Now;
-
-
             this.dispatchTimer = new DispatcherTimer();
             this.dispatchTimer.Interval = new TimeSpan(0, 0, 1);
             this.dispatchTimer.Tick += dispatchTimer_Tick;
@@ -33,12 +37,13 @@
         }

         const float PI = 3.141592654F;
-        DateTime dateTime;
+        DateTime startDate;
+        DateTime clockTime;
         DispatcherTimer dispatchTimer;

         private void DrawClock()
         {
-            dateTime = DateTime.Now;
+            clockTime = DateTime.Now;
             var canvas = Math.Min(InkCanvas.ActualHeight, InkCanvas.ActualWidth);

             float clockHeight = (int)canvas;
@@ -63,10 +68,10 @@

             InkCanvas.Children.Clear();

-            int minute = dateTime.Minute;
-            int sec = dateTime.Second;
+            int minute = clockTime.Minute;
+            int sec = clockTime.Second;

-            float hour = dateTime.Hour % 12 + (float)dateTime.Minute / 60;
+            float hour = clockTime.Hour % 12 + (float)clockTime.Minute / 60;

             float hourRadian = hour * 360 / 12 * PI / 180;
             float minRadian = minute * 360 / 60 * PI / 180;
@@ -78,7 +83,7 @@

             if (ViewModel.Engine.IsRunning)
             {
-                var currMin = dateTime.Minute;
+                var currMin = startDate.Minute;
                 var duration = ViewModel.Engine.WorkTime;
                 var periodColor = Colors.Green;

@@ -88,7 +93,7 @@
                     duration = ViewModel.Engine.BreakTime;
                 }

-                for (int i = currMin; i < currMin + duration - ViewModel.Engine.Elapsed / 60; i++)
+                for (int i = currMin; i < currMin + duration; i++)
                 {
                     DrawLine(
                         centerX + (float)(clockRadius / 1.50F * System.Math.Sin(i * 6 * PI / 180)),


Add support for GIF and media with audio tracks.

--- UrlTitling/BinaryHandler.cs
+++ UrlTitling/BinaryHandler.cs
@@ -31,6 +31,9 @@
                 case MediaType.Png:
                     type = "PNG";
                     break;
+                case MediaType.Gif:
+                    type = "GIF";
+                    break;
                 case MediaType.Matroska:
                     type = "Matroska";
                     break;
@@ -53,6 +56,8 @@
         {
             var sizeStr = FormatSize(info.Size);
             var timeStr = FormatTime(info.Duration);
+            if (timeStr != string.Empty && info.HasAudio)
+                timeStr += " ♫";

             string binaryInfo;
             if (info.Dimensions.Width > 0 && info.Dimensions.Height > 0)
@@ -114,6 +119,7 @@
         public MediaType Type { get; private set; }
         public Dimensions Dimensions { get; private set; }
         public TimeSpan Duration { get; private set; }
+        public bool HasAudio { get; private set; }
         public long Size { get; private set; }

@@ -126,6 +132,7 @@
             Type = props.Type;
             Dimensions = props.Dimensions;
             Duration = props.Duration;
+            HasAudio = props.HasAudio;
             Size = size;
         }
     }


mejor impresion vigenere

mejor impresion vigenere

--- VRC4/VRC4/Model/Vigenere.cs
+++ VRC4/VRC4/Model/Vigenere.cs
@@ -37,7 +37,7 @@
                 ascii %= 256; //byte

                 Ciphertext[count++] = (byte)ascii;
-                Work += string.Format("{0}. Replaced {1} for {2} with key letter {3} \n", count, letter.ToString(),
+                Work += string.Format("{0}. Replaced {1} for {2} with key byte {3} \n", count, letter.ToString(),
                     ((byte)ascii).ToString(), k.ToString());

             }
@@ -65,7 +65,7 @@
                 ascii %= 256;

                 Plaintext[count++] = (byte)ascii;
-                Work += string.Format("{0}. Replaced {1} for {2} with key letter {3} \n", count, letter.ToString(),
+                Work += string.Format("{0}. Replaced {1} for {2} with key byte {3} \n", count, letter.ToString(),
                     ((byte)ascii).ToString(), k.ToString());

             }


Fixing css

Fixing css

--- Views/Shared/_Layout.cshtml
+++ Views/Shared/_Layout.cshtml
@@ -8,7 +8,7 @@
     <meta name="norton-safeweb-site-verification" content="j4sxt77z5r0bjdr0dtop1kxd9doxbh3j-ihyor4qov5-oeobeyovmwnrehhonoqsz51oubc1ltutqg91o4gxyi8libtccuj1dbe48-0arefktgmd8z0evfa93xb0biub" />
     @RenderSection("meta", required: false)
     <title>@ViewBag.Title</title>
-    <link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.4/material.light_blue-pink.min.css" />
+    <link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.light_blue-pink.min.css" />
     <link rel="stylesheet" type="text/css" href="~/dist/css/bundle/front.css" />
     <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
     @RenderSection("css", required: false)


Fixed a bug I knew I would need to fix and forgot about when loading Properties from JSON.

--- Vineyard/schema/Property.cs
+++ Vineyard/schema/Property.cs
@@ -37,7 +37,17 @@

         public Property(string name, IProperty_Source source, Trellis trellis)
         {
-            type = (Kind)Enum.Parse(typeof(Kind), source.type, true);
+            signature = new Signature();
+
+            if (source.type == "list")
+            {
+                type = signature.type = Kind.reference;
+
+            }
+            else
+            {
+                type = signature.type = (Kind)Enum.Parse(typeof(Kind), source.type, true);
+            }
             if (source.default_value != null)
                 default_value = source.default_value;


Throw for negative count of marbles condition

--- Web.UI.Tests/SimpleSteps.cs
+++ Web.UI.Tests/SimpleSteps.cs
@@ -18,7 +18,10 @@
         [When(@"I give away (.*) marbles")]
         public void WhenIGiveAwayMarbles(int count)
         {
-            MarblesCount = Math.Max(0, MarblesCount - count);
+            if (count > MarblesCount)
+                throw new ArgumentOutOfRangeException("count must be less than to equal to MarblesCount.");
+
+            MarblesCount = MarblesCount - count;
         }

         [Then(@"I should have (.*) marbles")]


Setting the desktop title

Setting the desktop title

--- Web/Views/Home/Index.cshtml
+++ Web/Views/Home/Index.cshtml
@@ -14,6 +14,8 @@
         <meta name="format-detection" content="telephone=no"/>
         <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />

+        <meta name="apple-mobile-web-app-title" content="Read Every Word">
+
         <link rel="apple-touch-icon" sizes="152X152" href="~/Content/images/AppIcon152x152.png" />
         <link rel="apple-touch-icon" sizes="120X120" href="~/Content/images/AppIcon120x120.png" />
         <link rel="apple-touch-icon" sizes="76X76" href="~/Content/images/AppIcon76x76.png" />


Add #Blob Read() method

Add #Blob Read() method

--- dot10/dotNET/BlobStream.cs
+++ dot10/dotNET/BlobStream.cs
@@ -5,9 +5,42 @@
 	/// Represents the #Blob stream
 	/// </summary>
 	public class BlobStream : DotNetStream {
+		static readonly byte[] noData = new byte[0];
+
 		/// <inheritdoc/>
 		public BlobStream(IImageStream imageStream, StreamHeader streamHeader)
 			: base(imageStream, streamHeader) {
 		}
+
+		/// <summary>
+		/// Reads data
+		/// </summary>
+		/// <param name="offset">Offset of data</param>
+		/// <returns>The data or null if invalid offset</returns>
+		public byte[] Read(uint offset) {
+			// The CLR has a special check for offset 0. It always interprets it as
+			// 0-length data, even if that first byte isn't 0 at all.
+			if (offset == 0)
+				return noData;
+			if (!IsValidOffset(offset))
+				return null;
+			imageStream.Position = offset;
+			uint length;
+			if (!ReadCompressedUInt32(out length))
+				return null;
+			if (imageStream.Position + length < length || imageStream.Position + length > imageStream.Length)
+				return null;
+			return imageStream.ReadBytes((int)length);	// length <= 0x1FFFFFFF so this cast does not make it negative
+		}
+
+		/// <summary>
+		/// Reads data just like <see cref="Read"/>, but returns an empty array if
+		/// offset is invalid
+		/// </summary>
+		/// <param name="offset">Offset of data</param>
+		/// <returns>The data</returns>
+		public byte[] ReadNoNull(uint offset) {
+			return Read(offset) ?? noData;
+		}
 	}
 }


Add MetaData property

Add MetaData property

--- dot10/dotNET/DotNetFile.cs
+++ dot10/dotNET/DotNetFile.cs
@@ -15,6 +15,13 @@
 			Unknown,
 			Compressed,	// #~ (normal)
 			ENC,		// #- (edit and continue)
+		}
+
+		/// <summary>
+		/// Returns a <see cref="IMetaData"/>
+		/// </summary>
+		public IMetaData MetaData {
+			get { return metaData; }
 		}

 		/// <summary>


ShellControl. Fixed when subitem hides pane after toggle click.

--- src/AppStudio.Uwp/Controls/ShellControl/ShellControl.cs
+++ src/AppStudio.Uwp/Controls/ShellControl/ShellControl.cs
@@ -123,6 +123,7 @@
                 }
                 _lviewSub.SelectedItem = null;
             }
+            _currentItem = null;
             _content.Children.Clear();
             _container.Visibility = Visibility.Collapsed;


Answered code comment

Answered code comment

--- src/AutoTest.TestRunner/AutoTest.TestRunners/Program.cs
+++ src/AutoTest.TestRunner/AutoTest.TestRunners/Program.cs
@@ -119,6 +119,7 @@
             var message = getException((Exception)args.ExceptionObject);

             // TODO: Seriously!? Firgure out what thread is causing the app domain unload exception
+			// Yean, seriously. When user code throws background exceptions we want them to know.
             if (!_arguments.CompatabilityMode && !args.ExceptionObject.GetType().Equals(typeof(System.AppDomainUnloadedException)))
             {
                 var finalOutput = new TestResult("Any", "", "", 0, "An unhandled exception was thrown while running a test.", TestState.Panic,


少し変更しました。

少し変更しました。

--- VoteClient/Model/ConnectionCounter.cs
+++ VoteClient/Model/ConnectionCounter.cs
@@ -44,7 +44,7 @@
             {
                 for (var n = 101; n <= 104; ++n)
                 {
-                    var address = NicoString.GetMessageServerAddress(n);
+                    var address = NicoString.GetCommunityMessageServerAddress(n);
                     var ips = Dns.GetHostAddresses(address);

                     foreach (var ip in ips)


Update Index.cshtml

Update Index.cshtml

--- Web/Areas/Hub/Views/Home/Index.cshtml
+++ Web/Areas/Hub/Views/Home/Index.cshtml
@@ -60,7 +60,7 @@

-                                Stock Status per commodity
+                                Stock Status per commodity(in MT)


Build fix

Build fix

--- src/Catel.Core/Catel.Core.NET40/Reflection/TypeCache.cs
+++ src/Catel.Core/Catel.Core.NET40/Reflection/TypeCache.cs
@@ -81,6 +81,9 @@

         static TypeCache()
         {
+            ShouldIgnoreAssemblyEvaluators = new List<Func<Assembly, bool>>();
+            ShouldIgnoreTypeEvaluators = new List<Func<Assembly, Type, bool>>();
+
 #if NET
             AppDomain.CurrentDomain.AssemblyLoad += OnAssemblyLoaded;

@@ -94,9 +97,6 @@
                 }
             }
 #endif
-
-            ShouldIgnoreAssemblyEvaluators = new List<Func<Assembly, bool>>();
-            ShouldIgnoreTypeEvaluators = new List<Func<Assembly, Type, bool>>();
         }

 #if NET
@@ -680,8 +680,7 @@
 #endif

             var assemblyFullName = assembly.FullName;
-            if (assemblyFullName.StartsWith("System.Reflection.RuntimeAssembly") ||
-                assemblyFullName.Contains("Anonymously Hosted DynamicMethods Assembly"))
+            if (assemblyFullName.Contains("Anonymously Hosted DynamicMethods Assembly"))
             {
                 return true;
             }


Change tab order

Change tab order

--- src/Core2D.Avalonia/Dock/Factories/EditorDockFactory.cs
+++ src/Core2D.Avalonia/Dock/Factories/EditorDockFactory.cs
@@ -122,20 +122,20 @@

             // Right / Bottom

+            var shapeView = new ShapeTool
+            {
+                Id = nameof(ShapeTool),
+                Width = double.NaN,
+                Height = double.NaN,
+                Title = "Shape"
+            };
+
             var toolsView = new ToolsTool
             {
                 Id = nameof(ToolsTool),
                 Width = double.NaN,
                 Height = double.NaN,
                 Title = "Tools"
-            };
-
-            var shapeView = new ShapeTool
-            {
-                Id = nameof(ShapeTool),
-                Width = double.NaN,
-                Height = double.NaN,
-                Title = "Shape"
             };

             var dataView = new DataTool
@@ -256,8 +256,8 @@
                         CurrentView = toolsView,
                         Views = new ObservableCollection<IView>
                         {
+                            shapeView,
                             toolsView,
-                            shapeView,
                             dataView,
                             styleView,
                             templateView


Updated Elasticsearch Manager to better handle and report issues starting elasticsearch

--- Worker.Common/ElasticsearchManager.cs
+++ Worker.Common/ElasticsearchManager.cs
@@ -68,7 +68,7 @@

             if (dir.Exists)
             {
-                foreach (var file in dir.EnumerateFiles())
+                foreach (var file in dir.EnumerateFiles("*",SearchOption.AllDirectories))
                 {
                     file.Delete();
                 }
@@ -159,37 +159,59 @@

         public virtual void StartAndBlock(CancellationToken token)
         {
+
             if (!token.IsCancellationRequested)
             {
+
                 string startupScript = Path.Combine(_elasticRoot, "bin", "elasticsearch.bat");
                 _process = new Process();
                 _process.StartInfo = new ProcessStartInfo
                 {
-                    FileName = startupScript
+                    FileName = startupScript,
+                    UseShellExecute = false,
+                    RedirectStandardOutput = true
                 };

+                _process.OutputDataReceived += (object sender, DataReceivedEventArgs e) =>
+                {
+                    /*
+                     * I don't like this. Only alternative is to patch the batch file.
+                     * Created issue: https://github.com/elasticsearch/elasticsearch/issues/8913
+                     */
+                    if(e.Data == "JAVA_HOME environment variable must be set!")
+                    {
+                        Trace.TraceError("Batch script could not read JAVA_HOME variable");
+                        _process.Kill();
+
+                        Trace.TraceInformation("Killed elastic search.");
+                    }
+                };
+
+
                 Trace.TraceInformation("Starting Elasticsearch with script {0}", startupScript);

                 _process.Start();
-            }
-
-
-            using(var waitHandle = new SafeWaitHandle(_process.Handle, false))
-            using (var processEnded = new ManualResetEvent(false))
-            {
-                processEnded.SafeWaitHandle = waitHandle;
+                _process.BeginOutputReadLine();
+
+                var processEnded = new ManualResetEvent(false);
+
+                processEnded.SafeWaitHandle = new SafeWaitHandle(_process.Handle, false);

                 int index = WaitHandle.WaitAny(new[] { processEnded, token.WaitHandle });
-
+                Trace.TraceInformation("One more more ES handles signaled: " + index);
+
                 //If the signal came from the caller cancellation token close the window
                 if (index == 1)
                 {
                     Stop();
                 }
-            }
-
+
+
+            }

         }
+
+

         public virtual void Stop()
         {


Refactor to lambda expression

Refactor to lambda expression

--- src/DependencyInjection/BuilderExtensions/Responsive.cs
+++ src/DependencyInjection/BuilderExtensions/Responsive.cs
@@ -18,28 +18,20 @@
                 throw new ArgumentNullException(nameof(builder));

             builder.Services.TryAddTransient<IResponsiveService, ResponsiveService>();
-            builder.AddRazorViewLocation();
-            builder.AddRazorPageLocation();
+            builder.Services.AddRazorViewLocation();
+            builder.Services.AddRazorPageLocation();

             return builder;
         }

-        private static IDetectionBuilder AddRazorViewLocation(this IDetectionBuilder builder)
-        {
-            builder.Services.Configure<RazorViewEngineOptions>(options =>
+        private static IServiceCollection AddRazorViewLocation(this IServiceCollection services)
+            => services.Configure<RazorViewEngineOptions>(options =>
             {
                 options.ViewLocationExpanders.Add(new ResponsiveViewLocationExpander(ResponsiveViewLocationFormat.Suffix));
                 options.ViewLocationExpanders.Add(new ResponsiveViewLocationExpander(ResponsiveViewLocationFormat.Subfolder));
             });

-            return builder;
-        }
-
-        private static IDetectionBuilder AddRazorPageLocation(this IDetectionBuilder builder)
-        {
-            builder.Services.Configure<RazorPagesOptions>(options => { });
-
-            return builder;
-        }
+        private static IServiceCollection AddRazorPageLocation(this IServiceCollection services)
+            => services.Configure<RazorPagesOptions>(options => { });
     }
 }


Localization for Buddy tab added.

Localization for Buddy tab added.

--- yafsrc/YetAnotherForum.NET/pages/profile.ascx.cs
+++ yafsrc/YetAnotherForum.NET/pages/profile.ascx.cs
@@ -219,6 +219,7 @@
       this.ProfileTabs.Views["StatisticsTab"].Text = GetText("STATISTICS");
       this.ProfileTabs.Views["AvatarTab"].Text = GetText("AVATAR");
       this.ProfileTabs.Views["Last10PostsTab"].Text = GetText("LAST10");
+      this.ProfileTabs.Views["BuddyListTab"].Text = GetText("BUDDIES");

       if (PageContext.BoardSettings.AvatarUpload && userData.HasAvatarImage)


Update ParallelExploderTests.cs

Update ParallelExploderTests.cs

--- src/FireworksNet.Tests/Explode/ParallelExploderTests.cs
+++ src/FireworksNet.Tests/Explode/ParallelExploderTests.cs
@@ -61,7 +61,7 @@
             Assert.Equal(expectedBirthStepNumber, explosion.StepNumber);
         }

-        [Theory, MemberData("DataForTestMethodExploderOfParallelExploder")]
+        [Theory, MemberData("DataForTestMethodExplodeOfParallelExploder")]
         public void Explode_PassEachParameterAsNullAndOtherIsCorrect_ArgumentExceptionThrown(
             Firework epicenter, IEnumerable<double> qualities, int currentStepNumber, Type exceptionType,  string expectedParamName)
         {


Documentation update

Documentation update

--- src/FubarDev.WebDavServer/Props/Store/IPropertyStore.cs
+++ src/FubarDev.WebDavServer/Props/Store/IPropertyStore.cs
@@ -36,40 +36,112 @@
         [ItemCanBeNull]
         Task<XElement> GetAsync([NotNull] IEntry entry, [NotNull] XName name, CancellationToken cancellationToken);

+        /// <summary>
+        /// Sets a dead property for the given <paramref name="entry"/> to the given <paramref name="element"/>
+        /// </summary>
+        /// <param name="entry">The entry to set the property <paramref name="element"/> for</param>
+        /// <param name="element">The element to set the <paramref name="entry"/> for</param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns>The async task</returns>
         [NotNull]
         Task SetAsync([NotNull] IEntry entry, [NotNull] XElement element, CancellationToken cancellationToken);

+        /// <summary>
+        /// Removes a dead property with a given <paramref name="name"/> from the given <paramref name="entry"/>
+        /// </summary>
+        /// <param name="entry">The entry to remove the dead property with the given <paramref name="name"/> from</param>
+        /// <param name="name">The name of the parameter to remove from the <paramref name="entry"/></param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns><see langref="true"/> when there was a dead property with the given <paramref name="name"/> that could be removed</returns>
         [NotNull]
         Task<bool> RemoveAsync([NotNull] IEntry entry, [NotNull] XName name, CancellationToken cancellationToken);

+        /// <summary>
+        /// Gets all dead properties for a given <paramref name="entry"/>
+        /// </summary>
+        /// <param name="entry">The entry to get all the dead properties for</param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns>The collection of all dead properties</returns>
         [NotNull]
         [ItemNotNull]
         Task<IReadOnlyCollection<XElement>> GetAsync([NotNull] IEntry entry, CancellationToken cancellationToken);

+        /// <summary>
+        /// Sets all given dead <paramref name="properties"/> for the given <paramref name="entry"/>
+        /// </summary>
+        /// <param name="entry">The entry to set all the dead <paramref name="properties"/> for</param>
+        /// <param name="properties">The properties to set for the given <paramref name="entry"/></param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns>The async task</returns>
         [NotNull]
         Task SetAsync([NotNull] IEntry entry, [NotNull] [ItemNotNull] IEnumerable<XElement> properties, CancellationToken cancellationToken);

+        /// <summary>
+        /// Remove multiple dead properties by its name at once from the given <paramref name="entry"/>
+        /// </summary>
+        /// <param name="entry">The entry to remove the given property <paramref name="names"/> from</param>
+        /// <param name="names">The names of the dead properties to remove from the given <paramref name="entry"/></param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns>A collection of booleans where a <see langref="true"/> value indicates that there was a dead property for a given
+        /// name that could be removed from the <paramref name="entry"/></returns>
         [NotNull]
         [ItemNotNull]
         Task<IReadOnlyCollection<bool>> RemoveAsync([NotNull] IEntry entry, [NotNull] [ItemNotNull] IEnumerable<XName> names, CancellationToken cancellationToken);

+        /// <summary>
+        /// Remove all dead property from a given <paramref name="entry"/>
+        /// </summary>
+        /// <param name="entry">The entry to remove all the dead properties from</param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns>The async task</returns>
         [NotNull]
         Task RemoveAsync([NotNull] IEntry entry, CancellationToken cancellationToken);

+        /// <summary>
+        /// Creates a dead property by its <paramref name="name"/> for a given <paramref name="entry"/>
+        /// </summary>
+        /// <param name="entry">The entry to create the dead property with the given <paramref name="name"/> for</param>
+        /// <param name="name">The name of the dead property to create for the given <paramref name="entry"/> for</param>
+        /// <returns>The created dead property with the given <paramref name="name"/> for the given <paramref name="entry"/></returns>
         [NotNull]
         IDeadProperty Create([NotNull] IEntry entry, [NotNull] XName name);

+        /// <summary>
+        /// Loads the dead property with the given <paramref name="name"/> into a <see cref="IDeadProperty"/> implementation
+        /// </summary>
+        /// <param name="entry">The entry to load the dead property for</param>
+        /// <param name="name">The name of the dead property</param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns>The implementation of the dead property</returns>
         [NotNull]
         [ItemNotNull]
         Task<IDeadProperty> LoadAsync([NotNull] IEntry entry, [NotNull] XName name, CancellationToken cancellationToken);

+        /// <summary>
+        /// Loads all dead properties for a given <paramref name="entry"/> into <see cref="IDeadProperty"/> implementations
+        /// </summary>
+        /// <param name="entry">The entry to load the dead properties for</param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns>The collection of the loaded dead properties</returns>
         [NotNull]
         [ItemNotNull]
         Task<IReadOnlyCollection<IDeadProperty>> LoadAsync([NotNull] IEntry entry, CancellationToken cancellationToken);

+        /// <summary>
+        /// Gets the entity tag for a given <paramref name="entry"/>
+        /// </summary>
+        /// <param name="entry">The entry to get the entity tag for</param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns>The loaded entity tag</returns>
         [NotNull]
         Task<EntityTag> GetETagAsync([NotNull] IEntry entry, CancellationToken cancellationToken);

+        /// <summary>
+        /// Updates an entity tag for a given <paramref name="entry"/>
+        /// </summary>
+        /// <param name="entry">The entry to get the entity tag for</param>
+        /// <param name="cancellationToken">The cancellation token</param>
+        /// <returns>The updated entity tag</returns>
         [NotNull]
         Task<EntityTag> UpdateETagAsync([NotNull] IEntry entry, CancellationToken cancellationToken);
     }


Fixed mixing CORS method and CORS headers

--- src/HttpMessage/Headers/Request/RequestHeaderFactory.cs
+++ src/HttpMessage/Headers/Request/RequestHeaderFactory.cs
@@ -19,8 +19,8 @@
                 [ContentTypeHeader.NAME] = CreateRequestContentType,
                 [AcceptCharsetHeader.NAME] = CreateResponseContentCharset,
                 [AcceptEncodingHeader.NAME] = CreateResponseAcceptEncoding,
-                [AccessControlRequestMethodHeader.NAME] = x => new AccessControlRequestHeadersHeader(x),
-                [AccessControlRequestHeadersHeader.NAME] = x => new AccessControlRequestMethodHeader(x),
+                [AccessControlRequestHeadersHeader.NAME] = x => new AccessControlRequestHeadersHeader(x),
+                [AccessControlRequestMethodHeader.NAME] = x => new AccessControlRequestMethodHeader(x),
                 [OriginHeader.NAME] = x => new OriginHeader(x)
             };
         }


Add set accessor back to LastAsyncCommandBase, so Syro works again

--- src/IF.Lastfm.Core/Api/Commands/LastAsyncCommandBase.cs
+++ src/IF.Lastfm.Core/Api/Commands/LastAsyncCommandBase.cs
@@ -12,10 +12,17 @@
     /// </summary>
     public abstract class LastAsyncCommandBase
     {
+        private string _methodName;
+
         public string Method
         {
             get
             {
+                if (!String.IsNullOrEmpty(_methodName))
+                {
+                    return _methodName;
+                }
+
                 var methodNameAttribute = this.GetType().GetTypeInfo().GetCustomAttribute<ApiMethodNameAttribute>();
                 if (methodNameAttribute == null)
                 {
@@ -24,6 +31,7 @@
                 }
                 return methodNameAttribute.Text;
             }
+            internal set { _methodName = value; }
         }

         public Dictionary<string, string> Parameters { get; set; }


Remove unneeded visibility change

Remove unneeded visibility change

--- Winston/OS/JunctionPoint.cs
+++ Winston/OS/JunctionPoint.cs
@@ -10,7 +10,7 @@
     /// Provides access to NTFS junction points in .NET
     /// From here: http://www.codeproject.com/Articles/15633/Manipulating-NTFS-Junction-Points-in-NET
     /// </summary>
-    public static class JunctionPoint
+    static class JunctionPoint
     {
         /// <summary>
         /// The file or directory is not a reparse point.


Added test for check of OnStateChanged is called when channel state changes

--- src/Lime.Protocol.UnitTests/Network/ChannelBaseTests.cs
+++ src/Lime.Protocol.UnitTests/Network/ChannelBaseTests.cs
@@ -143,6 +143,7 @@
             await target.SendMessageAsync(message);

             // Assert
+            moduleMock.Verify(m => m.OnStateChanged(SessionState.Established), Times.Once());
             _transport.Verify(t => t.SendAsync(moduleMessage, It.IsAny<CancellationToken>()), Times.Once());
         }

@@ -170,6 +171,7 @@
             await target.SendMessageAsync(message);

             // Assert
+            moduleMock.Verify(m => m.OnStateChanged(SessionState.Established), Times.Once());
             _transport.Verify(t => t.SendAsync(message, It.IsAny<CancellationToken>()), Times.Never);
         }


-n  [Issue #45] Added a unit test to be sure that Polymorphic Singleton bindings correctly map to the same instance

--- .tests/extensions/injector/TestInjectionBinder.cs
+++ .tests/extensions/injector/TestInjectionBinder.cs
@@ -224,6 +224,25 @@
 		}

 		[Test]
+		public void TestPolymorphicSingleton()
+		{
+			binder.Bind<ISimpleInterface> ().Bind<IAnotherSimpleInterface> ().To<PolymorphicClass> ().ToSingleton();
+
+			ISimpleInterface callOnce = binder.GetInstance<ISimpleInterface> () as ISimpleInterface;
+			Assert.NotNull (callOnce);
+			Assert.IsInstanceOf<PolymorphicClass> (callOnce);
+
+			IAnotherSimpleInterface callAgain = binder.GetInstance<IAnotherSimpleInterface> () as IAnotherSimpleInterface;
+			Assert.NotNull (callAgain);
+			Assert.IsInstanceOf<PolymorphicClass> (callAgain);
+
+			callOnce.intValue = 42;
+
+			Assert.AreSame (callOnce, callAgain);
+			Assert.AreEqual (42, (callAgain  as ISimpleInterface).intValue);
+		}
+
+		[Test]
 		public void TestNamedInstanceBeforeUnnamedInstance()
 		{
 			binder.Bind<ISimpleInterface> ().To<SimpleInterfaceImplementer> ().ToName(SomeEnum.ONE);


Revert previous commit.  Embarrassing. :(

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@5405

--- src/NHibernate.Test/NHSpecificTest/BasicClassFixture.cs
+++ src/NHibernate.Test/NHSpecificTest/BasicClassFixture.cs
@@ -705,10 +705,7 @@
 			originalCount = basicClass.StringBag.Count;

 			ISession s = OpenSession();
-			// There used to be a transaction started on s and commited before the Close().
-			// This transaction was removed since it was causing a deadlock with SQLite.
-			// This is a theoretical improvement as well, since the transaction could
-			// be in a mode that would prevent non-repeatable reads, hence breaking the test.
+			ITransaction t = s.BeginTransaction();

 			ISession s2 = OpenSession();
 			ITransaction t2 = s2.BeginTransaction();
@@ -724,6 +721,7 @@
 			Assert.AreEqual(originalCount + 1, bc.StringBag.Count, "was refreshed correctly");

 			s.Delete(bc);
+			t.Commit();
 			s.Close();
 		}


Added fixup for IFileSystemReader

Added fixup for IFileSystemReader

Unity doesn't seem to support resolving via the greediest resolvable
constructor, it just tries to use the greediest and blows up if
something won't resolve. To workaround this DefaultFileSystemReader
is now registered into the container.

--- src/Nancy.Bootstrappers.Unity/UnityNancyBootstrapper.cs
+++ src/Nancy.Bootstrappers.Unity/UnityNancyBootstrapper.cs
@@ -79,6 +79,10 @@
             container.RegisterType(typeof(IEnumerable<ITypeConverter>), typeof(UnityEnumerableShim<ITypeConverter>));
             container.RegisterType(typeof(IEnumerable<IBodyDeserializer>), typeof(UnityEnumerableShim<IBodyDeserializer>));
             container.RegisterType(typeof(IEnumerable<IStartup>), typeof(UnityEnumerableShim<IStartup>));
+
+            // Added this in here because Unity doesn't seem to support
+            // resolving using the greediest resolvable constructor
+            container.RegisterType<IFileSystemReader, DefaultFileSystemReader>(new ContainerControlledLifetimeManager());
         }

         /// <summary>


Update StaticContentConventionBuilder.cs

Typo on directory-based should be file-based

--- src/Nancy/Conventions/StaticContentConventionBuilder.cs
+++ src/Nancy/Conventions/StaticContentConventionBuilder.cs
@@ -72,7 +72,7 @@
         }

         /// <summary>
-        /// Adds a directory-based convention for static convention.
+        /// Adds a file-based convention for static convention.
         /// </summary>
         /// <param name="requestedFile">The file that should be matched with the request.</param>
         /// <param name="contentFile">The file that should be served when the requested path is matched.</param>
@@ -289,4 +289,4 @@
             }
         }
     }
-}+}


Remove usage of Attachment.Filename property (obsolete)

--- source/XeroApi.ConsoleTests/Program.cs
+++ source/XeroApi.ConsoleTests/Program.cs
@@ -288,9 +288,9 @@
             {
                 Console.WriteLine("The uploaded attachment filesize {0} does not match the original filesize {1}", attachment.ContentLength, attachmentFileInfo.Length);
             }
-            else if (attachment.Filename != attachmentFileInfo.Name)
-            {
-                Console.WriteLine("The uploaded attachment filename '{0}' does not match the original filename '{1}'", attachment.Filename, attachmentFileInfo.Name);
+            else if (attachment.FileName != attachmentFileInfo.Name)
+            {
+                Console.WriteLine("The uploaded attachment filename '{0}' does not match the original filename '{1}'", attachment.FileName, attachmentFileInfo.Name);
             }
             else
             {


Update TriageDb.cs

Update TriageDb.cs

- fixed queries
- added getpropertiesasjsonasync(...)

--- src/triage.database/TriageDb.cs
+++ src/triage.database/TriageDb.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.

@@ -65,24 +65,28 @@
         private const string BUCKET_DATA_QUERY = @"
 WITH [BucketHits]([BucketId], [HitCount], [StartTime], [EndTime]) AS
 (
-    SELECT [B].[Id] AS [BucketId], COUNT([D].[Id]) AS [HitCount], @p0 AS [StartTime], @p1 AS [EndTime]
+    SELECT [B].[BucketId] AS [BucketId], COUNT([D].[DumpId]) AS [HitCount], @p0 AS [StartTime], @p1 AS [EndTime]
     FROM [Dumps] [D]
     JOIN [Buckets] [B]
         ON [D].[BucketId] = [B].[BucketId]
         AND [D].[DumpTime] >= @p0
         AND [D].[DumpTime] <= @p1
-    GROUP BY [B].[Id]
+    GROUP BY [B].[BucketId]
 )
-SELECT [B].*, [H].[HitCount], [H].[Start], [H].[End]
+SELECT [B].*, [H].[HitCount], [H].[StartTime], [H].[EndTime]
 FROM [Buckets] AS [B]
 JOIN [BucketHits] AS [H]
     ON [B].[BucketId] = [H].[BucketId]
 ";
+
+        private const string BUCKET_DATA = @"SELECT * FROM [Buckets]";
         public static async Task<IEnumerable<BucketData>> GetBucketDataAsync(DateTime start, DateTime end)
         {
             using (var context = new TriageDbContext(s_connStr))
             {
-                return await context.Database.SqlQuery<BucketData>(BUCKET_DATA_QUERY, start, end).ToArrayAsync();
+                var data = context.Database.SqlQuery<BucketData>(BUCKET_DATA, start, end);
+                var returnValue = await data.ToArrayAsync();
+                return returnValue;
             }
         }

@@ -93,12 +97,34 @@
     AND [DumpTime] >= @p1
     AND [DumpTime] <= @p2
 ";
-        public static async Task<IEnumerable<Dump>> GetBucketDataDumpsAysnc(BucketData bucketData)
+        public static async Task<IEnumerable<Dump>> GetBucketDataDumpsAsync(BucketData bucketData)
         {
             using (var context = new TriageDbContext(s_connStr))
             {
                 return await context.Dumps.SqlQuery(BUCKET_DATA_DUMPS_QUERY, bucketData.BucketId, bucketData.StartTime, bucketData.EndTime).ToArrayAsync();
             }
         }
+
+        private const string PROPERTIES_QUERY = @"
+SELECT *
+FROM [Properties]
+WHERE [DumpId] = @p0
+";
+
+        public static string GetPropertiesAsJsonAsync(Dump dump)
+        {
+            using (var context = new TriageDbContext(s_connStr))
+            {
+                var data = from property in context.Properties.Where(x => x.DumpId == dump.DumpId)
+                        select new
+                        {
+                            DumpId = property.DumpId,
+                            Name = property.Name,
+                            Value = property.Value
+                        };
+
+                return JsonConvert.SerializeObject(data);
+            }
+        }
     }
 }


Make float.Parse work independent of local culture (so it doesn't expect to parse 8,0 for "eight point zero" in France etc)

--- inklecate/StringParser/StringParser.cs
+++ inklecate/StringParser/StringParser.cs
@@ -623,7 +623,7 @@
                 if (ParseString (".") != null) {

                     var afterDecimalPointStr = ParseCharactersFromCharSet (numbersCharacterSet);
-                    return float.Parse (leadingInt+"." + afterDecimalPointStr);
+                    return float.Parse (leadingInt+"." + afterDecimalPointStr, System.Globalization.CultureInfo.InvariantCulture);
                 }
             }


Preventing making the document 'dirty' during initialization. This fixes #65

--- src/managed/OpenLiveWriter.Mshtml/MshtmlEditor.cs
+++ src/managed/OpenLiveWriter.Mshtml/MshtmlEditor.cs
@@ -190,8 +190,14 @@
                     // register for dirty range
                     mshtmlControl.MarkupContainer.RegisterForDirtyRange(this, out _changeSinkCookie);

-                    // perform document complete actions
-                    OnDocumentComplete();
+                    // During performing the document complete action, *something* is causing a document change log, which causes
+                    // IHtmlChangeSink.Notify to fire, making the document 'dirty' even when nothing was changed.
+                    // Suppressing handling of the 'dirty' notification until after document completion actions.
+                    using (SuspendNotification())
+                    {
+                        // perform document complete actions
+                        OnDocumentComplete();
+                    }
                 }
             }
             catch (Exception e)


Add document relationships.

Add document relationships.

--- src/specgen/Program.cs
+++ src/specgen/Program.cs
@@ -29,17 +29,53 @@
                     new XAttribute("Target", r.Target)));
         }

+        private static XElement Part(string name, string contentType, string padding, XElement data)
+        {
+            return new XElement(Pkg + "part",
+                new XAttribute(Pkg + "name", name),
+                new XAttribute(Pkg + "contentType", contentType),
+                (padding != null) ? new XAttribute(Pkg + "padding", padding) : null,
+                new XElement(Pkg + "xmlData",
+                    data));
+        }
+
         private static XElement PackageRelationships()
         {
-            return new XElement(Pkg + "part",
-                new XAttribute(Pkg + "name", "/_rels/.rels"),
-                new XAttribute(Pkg + "contentType", "application/vnd.openxmlformats-package.relationships+xml"),
-                new XAttribute(Pkg + "padding", "512"),
-                new XElement(Pkg + "xmlData",
-                    CreateRelationships(new List<Relationship>
-                    {
-                        new Relationship { Id = "rId1", Type = "officeDocument", Target = "word/document.xml" }
-                    })));
+            return Part(
+                "/_rels/.rels",
+                "application/vnd.openxmlformats-package.relationships+xml",
+                "512",
+                CreateRelationships(new List<Relationship>
+                {
+                    new Relationship {Id = "rId1", Type = "officeDocument", Target = "word/document.xml"}
+                }));
+        }
+
+        private static XElement DocumentRelationships()
+        {
+            return Part(
+                "/word/_rels/document.xml.rels",
+                "application/vnd.openxmlformats-package.relationships+xml",
+                "256",
+                CreateRelationships(new List<Relationship>
+                {
+                    new Relationship {Id = "rId1", Type = "fontTable", Target = "fontTable.xml"},
+                    new Relationship {Id = "rId2", Type = "footer", Target = "footer1.xml"},
+                    new Relationship {Id = "rId3", Type = "footer", Target = "footer2.xml"},
+                    new Relationship {Id = "rId4", Type = "footer", Target = "footer3.xml"},
+                    new Relationship {Id = "rId5", Type = "footer", Target = "footer4.xml"},
+                    new Relationship {Id = "rId6", Type = "footer", Target = "footer5.xml"},
+                    new Relationship {Id = "rId7", Type = "header", Target = "header1.xml"},
+                    new Relationship {Id = "rId8", Type = "header", Target = "header2.xml"},
+                    new Relationship {Id = "rId9", Type = "header", Target = "header3.xml"},
+                    new Relationship {Id = "rId10", Type = "header", Target = "header4.xml"},
+                    new Relationship {Id = "rId11", Type = "header", Target = "header5.xml"},
+                    new Relationship {Id = "rId12", Type = "header", Target = "header6.xml"},
+                    new Relationship {Id = "rId13", Type = "numbering", Target = "numbering.xml"},
+                    new Relationship {Id = "rId14", Type = "settings", Target = "settings.xml"},
+                    new Relationship {Id = "rId15", Type = "styles", Target = "styles.xml"},
+                    new Relationship {Id = "rId16", Type = "webSettings", Target = "webSettings.xml"}
+                }));
         }

         static int Main(string[] args)
@@ -57,7 +93,8 @@
                     new XAttribute(XNamespace.Xmlns + "pkg", Pkg.NamespaceName),
                     new XAttribute(XNamespace.Xmlns + "ors", Ors.NamespaceName),
                     new XAttribute(XNamespace.Xmlns + "prs", Prs.NamespaceName),
-                    PackageRelationships()));
+                    PackageRelationships(),
+                    DocumentRelationships()));

             doc.Save(args[1]);


Adds Or operator

Adds Or operator

--- Amplified.CSharp/src/Extensions/MaybeExtensions.cs
+++ Amplified.CSharp/src/Extensions/MaybeExtensions.cs
@@ -61,13 +61,28 @@
             return source.OrDefault();
         }

-        public static T OrThrow<T>(this Maybe<T> source, [InstantHandle, NotNull] Exception exception)
+        public static T OrThrow<T>(this Maybe<T> source, [NotNull] Exception exception)
         {
             if (source.IsNone)
             {
                 throw exception;
             }
             return source.OrDefault();
+        }
+
+        public static Maybe<T> Or<T>(this Maybe<T> source, Maybe<T> other)
+        {
+            return source.Match(some => some, none => other);
+        }
+
+        public static Maybe<T> Or<T>(this Maybe<T> source, [InstantHandle, NotNull] Func<Maybe<T>> other)
+        {
+            return source.Match(some => some, none => other());
+        }
+
+        public static Maybe<T> Or<T>(this Maybe<T> source, [InstantHandle, NotNull] Func<None, Maybe<T>> other)
+        {
+            return source.Match(some => some, other);
         }

         public static Maybe<TResult> Zip<TFirst, TSecond, TResult>(


Parse a scenario outline where one example fails

--- src/Pickles/Pickles.Test/WhenParsingNUnitResultsFile.cs
+++ src/Pickles/Pickles.Test/WhenParsingNUnitResultsFile.cs
@@ -230,5 +230,28 @@
           TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "inconclusive_1" });
           exampleResult3.ShouldEqual(TestResult.Inconclusive);
         }
+
+        [Test]
+        public void ThenCanReadIndividualResultsFromScenarioOutline_OneFailed_ShouldBeTestResultFailed()
+        {
+          var results = ParseResultsFile();
+          results.SetExampleSignatureBuilder(new NUnitExampleSignatureBuilder());
+
+          var feature = new Feature { Name = "Scenario Outlines" };
+
+          var scenarioOutline = new ScenarioOutline { Name = "This is a scenario outline where one scenario fails", Feature = feature };
+
+          TestResult exampleResultOutline = results.GetScenarioOutlineResult(scenarioOutline);
+          exampleResultOutline.ShouldEqual(TestResult.Failed);
+
+          TestResult exampleResult1 = results.GetExampleResult(scenarioOutline, new[] { "pass_1" });
+          exampleResult1.ShouldEqual(TestResult.Passed);
+
+          TestResult exampleResult2 = results.GetExampleResult(scenarioOutline, new[] { "pass_2" });
+          exampleResult2.ShouldEqual(TestResult.Passed);
+
+          TestResult exampleResult3 = results.GetExampleResult(scenarioOutline, new[] { "fail_1" });
+          exampleResult3.ShouldEqual(TestResult.Failed);
+        }
     }
 }


Update some spelling and capitalization

Update some spelling and capitalization

--- Assets/MRTK/Tools/BuildWindow/BuildDeployWindow.cs
+++ Assets/MRTK/Tools/BuildWindow/BuildDeployWindow.cs
@@ -99,7 +99,7 @@

         private readonly GUIContent UseCSharpProjectsLabel = new GUIContent("Generate C# Debug", "Generate C# Project References for debugging.\nOnly available in .NET Scripting runtime.");

-        private readonly GUIContent gazeInputCapabilityLabel =
+        private readonly GUIContent GazeInputCapabilityLabel =
             new GUIContent("Gaze Input Capability",
                            "If checked, the 'Gaze Input' capability will be added to the AppX manifest after the Unity build.");

@@ -143,7 +143,7 @@

         private readonly GUIContent ViewPlayerLogLabel = new GUIContent("View Player Log", "Launch notepad with more recent player log for listed AppX on either currently selected device or from all devices.");

-        private readonly GUIContent liveCubeModelLabel = new GUIContent("Live Cube Model", "Location of .glb model to use as 3D Launcher");
+        private readonly GUIContent LiveCubeModelLabel = new GUIContent("Live Cube Model", "Location of .glb model to use as 3D Launcher");

         #endregion Labels

@@ -555,7 +555,7 @@
                 // AppX manifest during the build. This option provides a mechanism for people using the
                 // MRTK build tools to auto-append this capability if desired, instead of having to manually
                 // do this each time on their own.
-                bool gazeInputCapabilityEnabled = EditorGUILayout.ToggleLeft(gazeInputCapabilityLabel, UwpBuildDeployPreferences.GazeInputCapabilityEnabled);
+                bool gazeInputCapabilityEnabled = EditorGUILayout.ToggleLeft(GazeInputCapabilityLabel, UwpBuildDeployPreferences.GazeInputCapabilityEnabled);

                 // Enable Research Mode Capability
                 bool researchModeEnabled = EditorGUILayout.ToggleLeft(ResearchModeCapabilityLabel, UwpBuildDeployPreferences.ResearchModeCapabilityEnabled);


Move a little local variable to smaller scope

--- Assets/MapzenGo/Models/CachedDynamicTileManager.cs
+++ Assets/MapzenGo/Models/CachedDynamicTileManager.cs
@@ -29,13 +29,11 @@
         protected override void LoadTile(Vector2 tileTms, Tile tile)
         {
             var url = string.Format(_mapzenUrl, _mapzenLayers, Zoom, tileTms.x, tileTms.y, _mapzenFormat, _key);
-
             var tilePath = Path.Combine(CacheFolderPath, Zoom + "_" + tileTms.x + "_" + tileTms.y);
-            string mapData;
             if (File.Exists(tilePath))
             {
                 var r = new StreamReader(tilePath, Encoding.Default);
-                mapData = r.ReadToEnd();
+                var mapData = r.ReadToEnd();
                 tile.ConstructTile(mapData);
             }
             else


 r59@realmforge.tigris.org (orig r71):  DapperDanH | 2005-12-16 11:02:25 -0500

git-svn-id: 53f2a8ff3606f182ef4420064c1f4a5cdcbe6bb1@662 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Axiom3D/Axiom/Engine/Overlays/Elements/TextArea.cs
+++ Axiom3D/Axiom/Engine/Overlays/Elements/TextArea.cs
@@ -32,8 +32,8 @@
 using Axiom.Core;
 #region Ogre Synchronization Information
 /// <ogresynchronization>
-///     <file name="OgreTextAreaOverlayElement.h"   revision="1.7.2.1" lastUpdated="10/5/2005" lastUpdatedBy="DanielH" />
-///     <file name="OgreTextAreaOverlayElement.cpp" revision="1.9" lastUpdated="10/5/2005" lastUpdatedBy="DanielH" />
+///     <file name="OgreTextAreaOverlayElement.h"   revision="1.7.2.1" lastUpdated="10/21/2005" lastUpdatedBy="DanielH" />
+///     <file name="OgreTextAreaOverlayElement.cpp" revision="1.9" lastUpdated="10/21/2005" lastUpdatedBy="DanielH" />
 /// </ogresynchronization>
 #endregion

@@ -80,6 +80,7 @@
             isTransparent = false;
             alignment = HorizontalAlignment.Center;

+
             colorTop = ColorEx.White;
             colorBottom = ColorEx.White;
             haveColorsChanged = true;
@@ -99,8 +100,8 @@
         /// <param name="size"></param>
         protected void CheckMemoryAllocation( int numChars )
         {
-//            if ( allocSize < numChars )
-//            {
+            if ( allocSize < numChars )
+            {
                 // Create and bind new buffers
                 // Note that old buffers will be deleted automatically through reference counting

@@ -135,7 +136,7 @@
                 allocSize = numChars;
                 // force color buffer regeneration
                 haveColorsChanged = true;
-//            }
+            }
         }

         /// <summary>
@@ -154,31 +155,34 @@
         /// </summary>
         public override void Initialize()
         {
-            // Set up the render operation
-            // Combine positions and texture coords since they tend to change together
-            // since character sizes are different
-            renderOp.vertexData = new VertexData();
-            VertexDeclaration decl = renderOp.vertexData.vertexDeclaration;
-
-            int offset = 0;
-
-            // positions
-            decl.AddElement( POSITION_TEXCOORD, offset, VertexElementType.Float3, VertexElementSemantic.Position );
-            offset += VertexElement.GetTypeSize( VertexElementType.Float3 );
-            // texcoords
-            decl.AddElement( POSITION_TEXCOORD, offset, VertexElementType.Float2, VertexElementSemantic.TexCoords, 0 );
-			offset += VertexElement.GetTypeSize( VertexElementType.Float2 );
-            // colors, stored in seperate buffer since they change less often
-            decl.AddElement( COLORS, 0, VertexElementType.Color, VertexElementSemantic.Diffuse );
-
-            renderOp.operationType = OperationType.TriangleList;
-            renderOp.useIndices = false;
-            renderOp.vertexData.vertexStart = 0;
-
-            // buffers are created in CheckMemoryAllocation
-            CheckMemoryAllocation( DEFAULT_INITIAL_CHARS );
-
-			isInitialised = true;
+			if (!isInitialised)
+			{
+				// Set up the render operation
+				// Combine positions and texture coords since they tend to change together
+				// since character sizes are different
+				renderOp.vertexData = new VertexData();
+				VertexDeclaration decl = renderOp.vertexData.vertexDeclaration;
+
+				int offset = 0;
+
+				// positions
+				decl.AddElement( POSITION_TEXCOORD, offset, VertexElementType.Float3, VertexElementSemantic.Position );
+				offset += VertexElement.GetTypeSize( VertexElementType.Float3 );
+				// texcoords
+				decl.AddElement( POSITION_TEXCOORD, offset, VertexElementType.Float2, VertexElementSemantic.TexCoords, 0 );
+				offset += VertexElement.GetTypeSize( VertexElementType.Float2 );
+				// colors, stored in seperate buffer since they change less often
+				decl.AddElement( COLORS, 0, VertexElementType.Color, VertexElementSemantic.Diffuse );
+
+				renderOp.operationType = OperationType.TriangleList;
+				renderOp.useIndices = false;
+				renderOp.vertexData.vertexStart = 0;
+
+				// buffers are created in CheckMemoryAllocation
+				CheckMemoryAllocation( DEFAULT_INITIAL_CHARS );
+
+				isInitialised = true;
+			}
         }

         /// <summary>
@@ -247,11 +251,11 @@
         /// </summary>
         protected unsafe void UpdateGeometry()
         {
-            if ( font == null)
-            {
-                // must not be initialized yet, probably due to order of creation in a template
-                return;
-            }
+			if(font == null || text == null || !this.isGeomPositionsOutOfDate)
+			{
+				// must not be initialized yet, probably due to order of creation in a template
+				return;
+			}

             int charLength = text.Length;
             // make sure the buffers are big enough


escape paths with double double-quote instead of backslash

--- lib/Session.cs
+++ lib/Session.cs
@@ -398,11 +398,6 @@
             }
         }

-        private string EscapePath(string path)
-        {
-            return '"' + path.Replace("\"", "\\\"") + '"';
-        }
-
         private IPEndPoint ParseAddress(string address)
         {
             string[] tokens = address.Split(',');
@@ -577,6 +572,11 @@
             }
         }

+        private string EscapePath(string path)
+        {
+            return '"' + path.Replace("\"", "\"\"") + '"';
+        }
+
         private byte[] EncodeString(string data)
         {
             return Encoding.UTF8.GetBytes(data);


fix filter for non-unix-epoch timestamps

--- lib/Session.cs
+++ lib/Session.cs
@@ -776,9 +776,9 @@

             int yearDiff = time.Year - 1970;
             if (yearDiff < 0)
-              time.AddYears(-yearDiff);
-
-            return time;
+              return time.AddYears(-yearDiff);
+            else
+              return time;
         }

         private string EscapePath(string path)


Avoid repeated delegate allocations in FileStream.FlushAsync (#8048)

Avoid the `Action<object>` allocation on each invocation of
`FileStream.FlushAsync` on Windows. This change makes the Win32
implementation match Unix.

--- src/mscorlib/corefx/System/IO/FileStream.Win32.cs
+++ src/mscorlib/corefx/System/IO/FileStream.Win32.cs
@@ -1715,7 +1715,7 @@
             if (CanWrite)
             {
                 return Task.Factory.StartNew(
-                    state => FlushOSBuffer(),
+                    state => ((FileStream)state).FlushOSBuffer(),
                     this,
                     cancellationToken,
                     TaskCreationOptions.DenyChildAttach,


Simple typo

Simple typo

Fixed typo

--- samples/multiTenant.WebApp/src/multiTenant.WebApp/Views/Login/HashPassword.cshtml
+++ samples/multiTenant.WebApp/src/multiTenant.WebApp/Views/Login/HashPassword.cshtml
@@ -20,7 +20,7 @@

         Note however, that if you enter the same password into the hash generator, a different hash will be generated each time, so it is not possible
         to just try generating hashes to see if it matches a hash that has been leaked. This makes it very hard for a hacker to get your password from
-        the hash even if he manages to find out the hash. There is a complex algorythm with
+        the hash even if he manages to find out the hash. There is a complex algorithm with
         salt added to make sure the hashes are not deterministic.

@@ -69,4 +69,4 @@
             <input type="submit" value="Make Hash" class="btn btn-default" />

-</form>+</form>


fix(logging): 🐛 try in-mem channel to fix AppInsights

--- services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs
+++ services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs
@@ -21,13 +21,13 @@
         {
             _ = configuration ?? throw new ArgumentNullException(nameof(configuration));

-            using var serverTelemetryChannel = new ServerTelemetryChannel
-            {
-                StorageFolder = configuration.GetSection(ApplicationInsightsOptions.Key)
-                    .Get<ApplicationInsightsOptions>()
-                    .ServerTelemetryChannelStoragePath
-            };
-            services.AddSingleton(typeof(ITelemetryChannel), serverTelemetryChannel);
+            //using var serverTelemetryChannel = new ServerTelemetryChannel
+            //{
+            //    StorageFolder = configuration.GetSection(ApplicationInsightsOptions.Key)
+            //        .Get<ApplicationInsightsOptions>()
+            //        .ServerTelemetryChannelStoragePath
+            //};
+            //services.AddSingleton(typeof(ITelemetryChannel), serverTelemetryChannel);
             services.AddApplicationInsightsTelemetry();
         }


minor syntax fixes

minor syntax fixes

--- remoteGUI/snowCozyGUI/snowCozyGUI/Form1.cs
+++ remoteGUI/snowCozyGUI/snowCozyGUI/Form1.cs
@@ -49,7 +49,7 @@

         private void connectButton_Click(object sender, EventArgs e)
         {
-            if (mClient.connection != null)
+            if (!mClient.connection.valid)
             {
                 //get the ip address string from the textbox
                 mClient.ip = this.ipTextBox.Text;


Tweak Socket.InitializeSockets (#27563)

Tweak Socket.InitializeSockets (#27563)

Scratching an itch; it's called in a bunch of places to ensure sockets have been initialized, but it's not inlineable.  Make it so.

--- src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
+++ src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
@@ -4373,14 +4373,16 @@
         {
             if (!s_initialized)
             {
+                InitializeSocketsCore();
+            }
+
+            void InitializeSocketsCore()
+            {
                 lock (InternalSyncObject)
                 {
                     if (!s_initialized)
                     {
                         SocketPal.Initialize();
-
-                        // Cache some settings locally.
-                        // s_perfCountersEnabled = SocketPerfCounter.Instance.Enabled; // TODO (#7833): Implement socket perf counters.
                         s_initialized = true;
                     }
                 }