Hooked up the RestRegionPlugin Get Region/xxx/terrain so it outputs xml containing the terrain heightmap rather than the old "terrain not implemented" message. The format of the terrain data is: the floats encoded in Base64 and serialised into xml. So I think far from ideal, but as the support for outputting that format was already there... Still need to hook up a method for remotely loading this data.

--- OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
+++ OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
@@ -181,8 +181,12 @@

         protected string RegionTerrain(OSHttpResponse httpResponse, Scene scene)
         {
-            return Failure(httpResponse, OSHttpStatusCode.ServerErrorNotImplemented,
-                           "GET", "terrain not implemented");
+            httpResponse.SendChunked = true;
+            httpResponse.ContentType = "text/xml";
+
+            return scene.Heightmap.SaveToXmlString();
+            //return Failure(httpResponse, OSHttpStatusCode.ServerErrorNotImplemented,
+            //               "GET", "terrain not implemented");
         }

         protected string RegionStats(OSHttpResponse httpResponse, Scene scene)


Forgot to comment an unnecessary log message on my last commit.

--- OpenSim/Framework/Communications/Capabilities/Caps.cs
+++ OpenSim/Framework/Communications/Capabilities/Caps.cs
@@ -630,8 +630,8 @@
         public string NoteCardAgentInventory(string request, string path, string param,
                                              OSHttpRequest httpRequest, OSHttpResponse httpResponse)
         {
-            m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName + "\n" + request);
-            m_log.Debug("[CAPS]: NoteCardAgentInventory Request is: " + request);
+            //m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName + "\n" + request);
+            //m_log.Debug("[CAPS]: NoteCardAgentInventory Request is: " + request);

             //OpenMetaverse.StructuredData.OSDMap hash = (OpenMetaverse.StructuredData.OSDMap)OpenMetaverse.StructuredData.LLSDParser.DeserializeBinary(Utils.StringToBytes(request));
             Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Utils.StringToBytes(request));


* minor: remove serialization and deserializationg sog log messages for now

--- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -424,7 +424,7 @@
             if (!isOriginalXmlFormat)
                 throw new Exception("This constructor must specify the xml is in OpenSim's original format");

-            m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
+            //m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
             int time = System.Environment.TickCount;

             // libomv.types changes UUID to Guid
@@ -491,8 +491,8 @@

         protected void SetFromXml(string xmlData)
         {
-            m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
-            int time = System.Environment.TickCount;
+            //m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
+            //int time = System.Environment.TickCount;

             // libomv.types changes UUID to Guid
             xmlData = xmlData.Replace("<UUID>", "<Guid>");
@@ -539,7 +539,7 @@
             reader.Close();
             sr.Close();

-            m_log.DebugFormat("[SOG]: Finished deserialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time);
+            //m_log.DebugFormat("[SOG]: Finished deserialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time);
         }

         protected virtual SceneObjectPart CreatePartFromXml(XmlTextReader reader)


Only reply RouterAdvertisement to RouterSolicitation

git-svn-id: 8d82213adbbc6b1538a984bace977d31fcb31691@130 2f5d681c-ba19-11dd-a503-ed2d4bea8bb5

--- trunk/src/demos/TAPCfgTest.cs
+++ trunk/src/demos/TAPCfgTest.cs
@@ -30,24 +30,26 @@
 					Console.WriteLine("ICMPv6 packet type {0}", type);
 					Console.WriteLine("Data: {0}", BitConverter.ToString(packet.Payload));

-					NDRouterAdvPacket adv =
-						new NDRouterAdvPacket(IPAddress.Parse("fc00::"));
-					adv.Source = IPAddress.Parse("fe80::211:24ff:fe93:3b66");
-					adv.Destination = packet.Source;
-					adv.HopLimit = 255;
-					byte[] adv_data = adv.Data;
+					if (type == ICMPv6Type.RouterSolicitation) {
+						NDRouterAdvPacket adv =
+							new NDRouterAdvPacket(IPAddress.Parse("fc00::"));
+						adv.Source = IPAddress.Parse("fe80::211:24ff:fe93:3b66");
+						adv.Destination = packet.Source;
+						adv.HopLimit = 255;
+						byte[] adv_data = adv.Data;

-					byte[] frame_data = new byte[14 + adv_data.Length];
-					Array.Copy(frame.Source, 0, frame_data, 0, 6);
-					Array.Copy(new byte[] { 0x00, 0x11, 0x24, 0x93, 0x3b, 0x66 },
-					           0, frame_data, 6, 6);
-					frame_data[12] = (byte) ((int) EtherType.IPv6 >> 8);
-					frame_data[13] = (byte) ((int) EtherType.IPv6 & 0xff);
-					Array.Copy(adv_data, 0, frame_data, 14, adv_data.Length);
+						byte[] frame_data = new byte[14 + adv_data.Length];
+						Array.Copy(frame.Source, 0, frame_data, 0, 6);
+						Array.Copy(new byte[] { 0x00, 0x11, 0x24, 0x93, 0x3b, 0x66 },
+							   0, frame_data, 6, 6);
+						frame_data[12] = (byte) ((int) EtherType.IPv6 >> 8);
+						frame_data[13] = (byte) ((int) EtherType.IPv6 & 0xff);
+						Array.Copy(adv_data, 0, frame_data, 14, adv_data.Length);

-					EthernetFrame fr = new EthernetFrame(frame_data);
-					Console.WriteLine("Wrote packet {0}", BitConverter.ToString(fr.Data));
-					dev.Write(fr);
+						EthernetFrame fr = new EthernetFrame(frame_data);
+						Console.WriteLine("Wrote packet {0}", BitConverter.ToString(fr.Data));
+						dev.Write(fr);
+					}
 				}
 			} else if (frame.EtherType == EtherType.IPv4) {
 				IPv4Packet packet = new IPv4Packet(frame.Payload);


Simplify Page Builder UI

Simplify Page Builder UI

--- Portal.CMS.Web/Areas/Builder/Views/Build/Index.cshtml
+++ Portal.CMS.Web/Areas/Builder/Views/Build/Index.cshtml
@@ -33,8 +33,6 @@
     {
         /* Global Administration Menu */

-

-


Changed AzureEventStoreRepository.SaveEvents to be debug friendlier.

--- Projects/CQRSMagic.Azure/AzureEventStoreRepository.cs
+++ Projects/CQRSMagic.Azure/AzureEventStoreRepository.cs
@@ -37,11 +37,12 @@

         public void SaveEvents(IEnumerable<IEvent> events)
         {
-            // todo: unit tests
-            var entities = events.Select(Serializer.Serialize);
-            var tasks = entities.Select(Repository.AddAsync);
+            foreach (var @event in events)
+            {
+                var entity = Serializer.Serialize(@event);

-            Task.WaitAll(tasks.ToArray());
+                Repository.AddAsync(entity).Wait();
+            }
         }
     }
 }


Develop

Develop

--- ZWave/Driver/Communication/Protocol/Message.cs
+++ ZWave/Driver/Communication/Protocol/Message.cs
@@ -104,17 +104,23 @@
                 if (buffer.Skip(1).Take(buffer.Length - 2).Aggregate((byte)0xFF, (total, next) => (byte)(total ^ next)) != buffer[buffer.Length - 1])
                     throw new ChecksumException("Checksum failure");

-                if (function == Communication.Function.ApplicationCommandHandler)
+                if (type == MessageType.Request)
                 {
-                    return new NodeEvent(payload);
+                    if (function == Communication.Function.ApplicationCommandHandler)
+                    {
+                        return new NodeEvent(payload);
+                    }
+                    if (function == Communication.Function.SendData)
+                    {
+                        return new NodeCommandCompleted(payload);
+                    }
                 }
-                if (type == MessageType.Request && function == Communication.Function.SendData)
+                if (type == MessageType.Response)
                 {
-                    return new NodeCommandCompleted(payload);
-                }
-                if (function != Communication.Function.SendData)
-                {
-                    return new ControllerFunctionCompleted(function, payload);
+                    if (function != Communication.Function.SendData)
+                    {
+                        return new ControllerFunctionCompleted(function, payload);
+                    }
                 }
                 return new UnknownMessage(header, type, function, payload);
             }


Add AnnouncementsEndpoint.GetCurrentAsync(); closes #1

--- Zermelo.API/Endpoints/AnnouncementsEndpoint.cs
+++ Zermelo.API/Endpoints/AnnouncementsEndpoint.cs
@@ -32,6 +32,24 @@
             : base(auth, urlBuilder, httpService, jsonService)
         {

+        }
+
+        /// <summary>
+        /// Get all announcements that should be displayed at the current time.
+        /// </summary>
+        /// <param name="fields">
+        /// The fields (as json keys) to get. Defaults to <c>null</c>, which results in the defaults of the Zermelo API.
+        /// An empty list will also result in the defaults.
+        /// </param>
+        /// <returns>The current announcements.</returns>
+        public async Task<IEnumerable<Announcement>> GetCurrentAsync(List<string> fields = null)
+        {
+            Dictionary<string, string> urlOptions = new Dictionary<string, string>
+            {
+                { "current", "true" }
+            };
+
+            return await GetByCustomUrlOptionsAsync(urlOptions, fields);
         }

         /// <summary>


finish draft (test) implementation of Md5 hash database class into DownloadManager

--- RelhaxModpack/RelhaxModpack/Common/DownloadManager.cs
+++ RelhaxModpack/RelhaxModpack/Common/DownloadManager.cs
@@ -1,6 +1,7 @@
 using RelhaxModpack.Database;
 using RelhaxModpack.UI;
 using RelhaxModpack.Utilities;
+using RelhaxModpack.Utilities.Enums;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -35,6 +36,7 @@
         private MD5 md5Hash;
         private FileStream filestream;
         private RelhaxDownloadProgress downloadProgress;
+        private Md5DatabaseManager databaseManager;

         //RelhaxDownloadProgress params and exit codes TODO

@@ -43,6 +45,7 @@
             webClient = new WebClient();
             md5Hash = MD5.Create();
             downloadProgress = new RelhaxDownloadProgress();
+            databaseManager = new Md5DatabaseManager();
         }

         public async Task DownloadPackagesAsync(List<DatabasePackage> packagesToDownload)
@@ -67,17 +70,28 @@
                 Logging.Warning("CancellationToken is null, no cancellations will be acknowledged for this download operation");
             }

-            foreach (DatabasePackage package in packagesToDownload)
-            {
-                Logging.Debug(Utilities.Enums.LogOptions.ClassName, "Download of package {0} from formed URL {1}", package.PackageName, UrlBase + package.ZipFile);
+            //load md5 database manager before downloading packages
+            if (!databaseManager.DatabaseLoaded)
+                databaseManager.LoadMd5Database(ApplicationConstants.MD5HashDatabaseXmlFile);
+
+            for (int i = 0; i < packagesToDownload.Count; i++)
+            {
+                DatabasePackage package = packagesToDownload[i];
+                Logging.Info(LogOptions.ClassName, "Download {0} of {1}, package {2} start", i + 1, packagesToDownload.Count, package.PackageName);
+                Logging.Debug(LogOptions.ClassName, "Download of package {0} from formed URL {1}", package.PackageName, UrlBase + package.ZipFile);
                 await DownloadPackageAsync(package);
+                Logging.Info(LogOptions.ClassName, "Download {0} of {1}, package {2} finish", i + 1, packagesToDownload.Count, package.PackageName);
             }
         }

         public async Task DownloadPackageAsync(DatabasePackage package)
         {
+            if (!databaseManager.DatabaseLoaded)
+                databaseManager.LoadMd5Database(ApplicationConstants.MD5HashDatabaseXmlFile);
+
             string downloadUrl = UrlBase + package.ZipFile;
             string downloadLocation = Path.Combine(DownloadLocationBase, package.ZipFile);
+
             Logging.Debug("Delete {0} if exists", downloadLocation);
             if (File.Exists(downloadLocation))
                 FileUtils.FileDelete(downloadLocation);
@@ -93,6 +107,7 @@
                 {
                     try
                     {
+                        Logging.Debug(LogOptions.ClassName, "Opening download stream and file write stream for {0}", package.ZipFile);
                         using (stream = webClient.OpenRead(downloadUrl))
                         using (filestream = new FileStream(downloadLocation, FileMode.Create, FileAccess.Write))
                         {
@@ -114,8 +129,9 @@
                                         sBuilder.Append(md5Hash.Hash[i].ToString("x2"));
                                     }
                                     Hash = sBuilder.ToString();
-
-                                    if ((!Hash.Equals("f") && (!Hash.Equals(package.CRC))))
+                                    Logging.Info(LogOptions.ClassName, "Hash for package {0} calculated to be {1}", package.PackageName, Hash);
+
+                                    if ((!package.CRC.Equals("f") && (!Hash.Equals(package.CRC))))
                                     {
                                         //download failed, the hash doesn't match. try again
                                         if (failCount == 3)
@@ -126,15 +142,6 @@
                                     }
                                     else
                                     {
-                                        if (Hash.Equals("f"))
-                                        {
-                                            Logging.Info("The hash was calculated to be {0}, but package reports {1} to mean it's a beta package that can change. Skipping saving to database.", Hash, package.CRC);
-                                        }
-                                        else
-                                        {
-                                            //save to local database cache file
-                                            //TODO
-                                        }
                                         ThrowIfCancellationRequested();
                                         Progress.Report(downloadProgress);

@@ -142,6 +149,10 @@
                                         md5Hash.Clear();
                                         stream.Close();
                                         package.DownloadFlag = false;
+
+                                        //save to local database cache file, even if the crc is "f". The loading in the selection list will skip getting the hash if the crc is f
+                                        databaseManager.UpdateFileEntry(package.ZipFile, File.GetLastWriteTime(downloadLocation), Hash);
+                                        databaseManager.SaveMd5Database(ApplicationConstants.MD5HashDatabaseXmlFile);

                                         //set the failCount for loop to jump out and the userRetry to stop asking
                                         failCount = 4;


Add color comments.

Add color comments.

--- RosaroterPanterWPF/RosaroterPanterWPF/Models/Tasks.cs
+++ RosaroterPanterWPF/RosaroterPanterWPF/Models/Tasks.cs
@@ -17,13 +17,44 @@
         /// </summary>
         public static readonly Color White = new Color(255, 255, 255);

+        /// <summary>
+        /// The color yellow.
+        /// </summary>
         public static readonly Color Yellow = new Color(0xFF, 0xFF, 0x00);
+
+        /// <summary>
+        /// The color green.
+        /// </summary>
         public static readonly Color Green = new Color(0xFF, 0xFF, 0x00);
+
+        /// <summary>
+        /// The color red.
+        /// </summary>
         public static readonly Color Red = new Color(0xFF, 0x00, 0x00);
+
+        /// <summary>
+        /// The color blue.
+        /// </summary>
         public static readonly Color Blue = new Color(0x00, 0x00, 0xFF);
+
+        /// <summary>
+        /// The color purple.
+        /// </summary>
         public static readonly Color Purple = new Color(0x6A, 0x5A, 0xCD);
+
+        /// <summary>
+        /// The 'color' black.
+        /// </summary>
         public static readonly Color Black = new Color(0x00, 0x00, 0x00);
+
+        /// <summary>
+        /// The color orange.
+        /// </summary>
         public static readonly Color Orange = new Color(0xFF, 0x8C, 0x00);
+
+        /// <summary>
+        /// The color pink red.
+        /// </summary>
         public static readonly Color PinkRed = new Color(0xFF, 0x00, 0xFF);

         /// <summary>


fixed reverse ordering

fixed reverse ordering

--- Server/Server.WebApi/Controllers/QuizzesController.cs
+++ Server/Server.WebApi/Controllers/QuizzesController.cs
@@ -298,25 +298,25 @@
             {
                 return quizzes.OrderByDescending(q => q.CreatedOn);
             }
+
             switch (httpQuery.OrderBy)
             {
                 case ResultOrder.ByDate:
-                    quizzes = quizzes.OrderBy(q => q.CreatedOn);
-                    break;
+                    return httpQuery.OrderDescending
+                        ? quizzes.OrderByDescending(q => q.CreatedOn)
+                        : quizzes.OrderBy(q => q.CreatedOn);
                 case ResultOrder.ByRating:
-                    quizzes = quizzes.OrderBy(q => q.Ratings.Average(r => r.Value));
-                    break;
+                    return httpQuery.OrderDescending
+                        ? quizzes.OrderByDescending(q => q.Ratings.Average(r => r.Value))
+                        : quizzes.OrderBy(q => q.Ratings.Average(r => r.Value));
                 case ResultOrder.ByNumberOfQuestions:
-                    quizzes = quizzes.OrderBy(q => q.Questions.Count);
-                    break;
+                    return httpQuery.OrderDescending
+                        ? quizzes.OrderByDescending(q => q.Questions.Count)
+                        : quizzes.OrderBy(q => q.Questions.Count);
                 case ResultOrder.ByTimesTaken:
-                    quizzes = quizzes.OrderBy(q => q.TimesSolved);
-                    break;
-            }
-
-            if (httpQuery.OrderDescending)
-            {
-                quizzes = quizzes.Reverse();
+                    return httpQuery.OrderDescending
+                        ? quizzes.OrderByDescending(q => q.TimesSolved)
+                        : quizzes.OrderBy(q => q.TimesSolved);
             }

             return quizzes;


Graph date fix.

Graph date fix.

--- Source/Twitta.Website/Views/Home/SearchResults.cshtml
+++ Source/Twitta.Website/Views/Home/SearchResults.cshtml
@@ -63,6 +63,11 @@

 <script>

+    Date.prototype.addHours = function (h) {
+        this.setHours(this.getHours() + h);
+        return this;
+    }
+
     function viewModel(model) {
         var self = {};
         self.words = ko.observableArray();
@@ -286,7 +291,7 @@
                     type: 'line',
                     name: data.words[i],
                     pointInterval: data.timeInterval,
-                    pointStart: window.start, // TODO: Set this to the actual start of the range
+                    pointStart: window.start != null ? Date.UTC(2014, 2, 01, window.start.getUTCHours(), 0, 0) : Date.UTC(2014, 2, 01, new Date().getUTCHours(), 0, 0), // TODO: Set this to the actual start of the range
                     data: data.counts[i]
                 });
             }
@@ -392,7 +397,7 @@
                     type: 'line',
                     name: data.words[i],
                     pointInterval: data.timeInterval,
-                    pointStart: window.start, // TODO: Set this to the actual start of the range
+                    pointStart: window.start != null ? Date.UTC(2014, 2, 01, window.start.getUTCHours(), 0, 0) : Date.UTC(2014, 2, 01, new Date().getUTCHours(), 0, 0), // TODO: Set this to the actual start of the range
                     data: data.counts[i]
                 });
             }


- Removed invalid sample file

- Removed invalid sample file

--- Source/deployment/samples/Sandboxing/HostSimlified.cs
+++ Source/deployment/samples/Sandboxing/HostSimlified.cs
@@ -1,60 +0,0 @@
-using System;
-using System.Security;
-using System.Security.Permissions;
-using CSScriptLibrary;
-
-class Host
-{
-    static public void Main()
-    {
-        var CreateSomeFile = CSScript.LoadMethod(
-                        @"using System.IO;
-                          public static void Test()
-                          {
-                              try
-                              {
-                                  using (var f = File.Open(""somefile.txt"", FileMode.OpenOrCreate))
-                                    Console.WriteLine(""File.Open: success"");
-                               }
-                               catch (Exception e)
-                               {
-                                   Console.WriteLine(e.GetType().ToString() + "": "" + e.Message);
-                               }
-                          }")
-                         .GetStaticMethod();
-
-        var permissionSet = new PermissionSet(PermissionState.None);
-        permissionSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
-
-        CreateSomeFile(); //call will succeed as as the set of permissions is a default permissions set for this assembly
-
-        Sandbox.With(SecurityPermissionFlag.Execution) //call will fail as the set of permissions is insufficient
-               .Execute(()=>CreateSomeFile());
-
-        CreateSomeFile(); //call will succeed as as the set of permissions set back to default
-
-        //this is a logical equivalent of Sandbox.With.Execute syntactic sugar
-        ExecuteInSandbox(permissionSet,               //call will fail as the set of permissions is insufficient
-                        ()=>CreateSomeFile());
-
-        CreateSomeFile(); //call will succeed as as the set of permissions set back to default
-    }
-
-    static void ExecuteInSandbox(PermissionSet permissionSet, Action action)
-    {
-        permissionSet.PermitOnly();
-        try
-        {
-            action();
-        }
-        catch (Exception e)
-        {
-            Console.WriteLine(e.GetType().ToString() + ": " + e.Message);
-        }
-        finally
-        {
-            CodeAccessPermission.RevertPermitOnly();
-        }
-    }
-}
-


Fixed stimulus positions

Fixed stimulus positions

--- StroopTest/Views/ReactionPages/FormReactExposition.cs
+++ StroopTest/Views/ReactionPages/FormReactExposition.cs
@@ -336,17 +336,20 @@

         private void wordExposition()
         {
-            int[] screenPosition = ScreenPosition();
+            // configuring label that have word stimulus dimensions, color and position
             wordLabel = new System.Windows.Forms.Label();
             wordLabel.AutoSize = true;
             wordLabel.Font = new Font("Arial", executingTest.ProgramInUse.StimuluSize, FontStyle.Bold);
-            wordLabel.Location = new Point(screenPosition[X], screenPosition[Y]);
             wordLabel.Text = wordsList[wordCounter];
             currentStimulus = wordsList[wordCounter];
             wordLabel.Visible = true;
-            wordLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            //wordLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             wordLabel.ForeColor = ColorTranslator.FromHtml(executingTest.ProgramInUse.StimulusColor);
             wordLabel.Enabled = true;
+
+            int[] screenPosition = ScreenPosition(wordLabel.PreferredSize);
+            wordLabel.Location = new Point(screenPosition[X], screenPosition[Y]);
+
             wordCounter++;
             if(wordCounter == wordsList.Length)
             {
@@ -357,9 +360,9 @@

         private void drawImage()
         {
-            int[] screenPosition = ScreenPosition();
             imgPictureBox = new PictureBox();
             imgPictureBox.Size = new Size(executingTest.ProgramInUse.StimuluSize, executingTest.ProgramInUse.StimuluSize);
+            int[] screenPosition = ScreenPosition(imgPictureBox.Size);
             imgPictureBox.Location = new Point(screenPosition[X], screenPosition[Y]);
             imgPictureBox.Image = Image.FromFile(imagesList[imageCounter]);
             currentStimulus = imagesList[imageCounter];
@@ -584,62 +587,62 @@
         }

         /* creates a x and y vector according to program stimulus distance randomly, accordingly to program, that can be 1, 2, 4 or 8 positions */
-        private int[] ScreenPosition (){
+        private int[] ScreenPosition (Size size){
             switch (executingTest.ProgramInUse.NumberPositions)
             {
                 case 1:
-                    return centerShapePosition();
+                    return centerShapePosition(size);
                 case 2:
-                    return randomScreenTwoPositions();
+                    return randomScreenTwoPositions(size);
                 case 4:
-                    return randomScreenFourPositions();
+                    return randomScreenFourPositions(size);
                 case 8:
-                    return randomScreenEightPositions();
+                    return randomScreenEightPositions(size);
                 default:
                     throw new Exception(LocRM.GetString("positionInvalid", currentCulture));
             }
         }

         /* creates a x and y vector on center of the screen */
-        private int[] centerShapePosition()
+        private int[] centerShapePosition(Size size)
         {
             currentPosition = 0;
             float[] clientMiddle = { (ClientSize.Width / 2), (ClientSize.Height / 2) };
-            return new int[] { (int)clientMiddle[X], (int)clientMiddle[Y] };
+            return new int[] { (int)clientMiddle[X]-(size.Width/2), (int)clientMiddle[Y]-(size.Height/2) };
         }

         /* creates a x and y vector according to program stimulus distance randomly, from two different positions */
-        private int[] randomScreenTwoPositions()
+        private int[] randomScreenTwoPositions(Size size)
         {
             Random random = new Random();
             int index = random.Next(1, 3);
             currentPosition = index;

             float[] clientMiddle = { (ClientSize.Width / 2), (ClientSize.Height / 2) };
-            int x = (int)(clientMiddle[X]) + positions[index, X];
-            int y = (int)(clientMiddle[Y]) + positions[index, Y];
+            int x = (int)(clientMiddle[X]) + positions[index, X] - (size.Width/2);
+            int y = (int)(clientMiddle[Y]) + positions[index, Y] - (size.Height/2);

             int[] coordinates = CoordinatesWithinRange(x, y);
             return coordinates;
         }

         /* creates a x and y vector according to program stimulus distance randomly, from four different positions */
-        private int[] randomScreenFourPositions()
+        private int[] randomScreenFourPositions(Size size)
         {
             Random random = new Random();
             int index = random.Next(1, 5);
             currentPosition = index;

             float[] clientMiddle = { (ClientSize.Width / 2), (ClientSize.Height / 2) };
-            int x = (int)(clientMiddle[X]) + positions[index, X];
-            int y = (int)(clientMiddle[Y]) + positions[index, Y];
+            int x = (int)(clientMiddle[X]) + positions[index, X] - (size.Width / 2);
+            int y = (int)(clientMiddle[Y]) + positions[index, Y] - (size.Height / 2);

             int[] coordinates = CoordinatesWithinRange(x, y);
             return coordinates;
         }

         /* creates a x and y vector according to program stimulus distance randomly, from eight different positions */
-        private int[] randomScreenEightPositions()
+        private int[] randomScreenEightPositions(Size size)
         {

             Random random = new Random();
@@ -647,13 +650,41 @@
             currentPosition = index;

             float[] clientMiddle = { (ClientSize.Width / 2), (ClientSize.Height / 2) };
-            int x = (int)(clientMiddle[X]) + positions[index, X];
-            int y = (int)(clientMiddle[Y]) + positions[index, Y];
+            int x = (int)(clientMiddle[X]) + positions[index, X] - (size.Width / 2);
+            int y = (int)(clientMiddle[Y]) + positions[index, Y] - (size.Height / 2);

             int[] coordinates = CoordinatesWithinRange(x, y);
             return coordinates;
         }

+        private int[] wordLabelWithinRange(int x, int y)
+        {
+            Size sizeofLabel = wordLabel.Size;
+            x = x + sizeofLabel.Width;
+            y = y + sizeofLabel.Height;
+
+            float[] clientSize = { (ClientSize.Width), (ClientSize.Height) };
+            if (x > clientSize[X])
+            {
+                x = (int)clientSize[X] - sizeofLabel.Width;
+            }
+            else if (x < 1)
+            {
+                x = 1;
+            }
+
+            if (y > clientSize[Y])
+            {
+                y = (int)clientSize[Y] - sizeofLabel.Height;
+            }
+            else if (y < 1)
+            {
+                y = 1;
+            }
+
+            return new int[] { x, y };
+        }
+
         // checks if generated coordinates for stimulus are within screen range and if they are not, put them inside of it
         private int[] CoordinatesWithinRange(int x, int y)
         {
@@ -682,31 +713,31 @@
         // draw on screen filled square stimulus
         private void drawFullSquareShape()
         {
-
-            int[] screenPosition = this.ScreenPosition();
+            float widthSquare = executingTest.ProgramInUse.StimuluSize;
+            float heightSquare = executingTest.ProgramInUse.StimuluSize;
+
+            SolidBrush myBrush = new SolidBrush(ColorTranslator.FromHtml(executingTest.ProgramInUse.StimulusColor));
+            Graphics formGraphicsSquare = CreateGraphics();
+
+            int[] screenPosition = this.ScreenPosition(new Size((int)widthSquare, (int)heightSquare));
             float xSquare = screenPosition[X];
             float ySquare = screenPosition[Y];
+            formGraphicsSquare.FillRectangle(myBrush, xSquare, ySquare, widthSquare, heightSquare);
+            formGraphicsSquare.Dispose();
+
+        }
+
+        private void drawSquareShape()
+        {
             float widthSquare = executingTest.ProgramInUse.StimuluSize;
             float heightSquare = executingTest.ProgramInUse.StimuluSize;

-            SolidBrush myBrush = new SolidBrush(ColorTranslator.FromHtml(executingTest.ProgramInUse.StimulusColor));
+            Pen myPen = new Pen(ColorTranslator.FromHtml(executingTest.ProgramInUse.StimulusColor));
             Graphics formGraphicsSquare = CreateGraphics();
-            formGraphicsSquare.FillRectangle(myBrush, xSquare, ySquare, widthSquare, heightSquare);
-            formGraphicsSquare.Dispose();
-
-        }
-
-        private void drawSquareShape()
-        {
-            int[] screenPosition = this.ScreenPosition();
+
+            int[] screenPosition = this.ScreenPosition(new Size((int)widthSquare, (int)heightSquare));
             float xSquare = screenPosition[X];
             float ySquare = screenPosition[Y];
-
-            float widthSquare = executingTest.ProgramInUse.StimuluSize;
-            float heightSquare = executingTest.ProgramInUse.StimuluSize;
-
-            Pen myPen = new Pen(ColorTranslator.FromHtml(executingTest.ProgramInUse.StimulusColor));
-            Graphics formGraphicsSquare = CreateGraphics();
             formGraphicsSquare.DrawRectangle(myPen, xSquare, ySquare, widthSquare, heightSquare);
             formGraphicsSquare.Dispose();

@@ -714,31 +745,31 @@

         private void drawFullCircleShape()
         {
-            int[] screenPosition = this.ScreenPosition();
+            float widthEllipse = executingTest.ProgramInUse.StimuluSize;
+            float heightEllipse = executingTest.ProgramInUse.StimuluSize;
+
+            SolidBrush myBrush = new SolidBrush(ColorTranslator.FromHtml(executingTest.ProgramInUse.StimulusColor));
+            Graphics formGraphicsEllipse = CreateGraphics();
+
+            int[] screenPosition = this.ScreenPosition(new Size((int)widthEllipse, (int)heightEllipse));
             float xEllipse = screenPosition[X];
             float yEllipse = screenPosition[Y];
-
+            formGraphicsEllipse.FillEllipse(myBrush, xEllipse, yEllipse, widthEllipse, heightEllipse);
+            formGraphicsEllipse.Dispose();
+
+        }
+
+        private void drawCircleShape()
+        {
             float widthEllipse = executingTest.ProgramInUse.StimuluSize;
             float heightEllipse = executingTest.ProgramInUse.StimuluSize;

-            SolidBrush myBrush = new SolidBrush(ColorTranslator.FromHtml(executingTest.ProgramInUse.StimulusColor));
+            Pen myPen = new Pen(ColorTranslator.FromHtml(executingTest.ProgramInUse.StimulusColor));
             Graphics formGraphicsEllipse = CreateGraphics();
-            formGraphicsEllipse.FillEllipse(myBrush, xEllipse, yEllipse, widthEllipse, heightEllipse);
-            formGraphicsEllipse.Dispose();
-
-        }
-
-        private void drawCircleShape()
-        {
-            int[] screenPosition = this.ScreenPosition();
+
+            int[] screenPosition = this.ScreenPosition(new Size((int)widthEllipse, (int)heightEllipse));
             float xEllipse = screenPosition[X];
             float yEllipse = screenPosition[Y];
-
-            float widthEllipse = executingTest.ProgramInUse.StimuluSize;
-            float heightEllipse = executingTest.ProgramInUse.StimuluSize;
-
-            Pen myPen = new Pen(ColorTranslator.FromHtml(executingTest.ProgramInUse.StimulusColor));
-            Graphics formGraphicsEllipse = CreateGraphics();
             formGraphicsEllipse.DrawEllipse(myPen, xEllipse, yEllipse, widthEllipse, heightEllipse);
             formGraphicsEllipse.Dispose();
         }
@@ -778,8 +809,10 @@
         private Point[] createTrianglePoints()
         {
             int[] clientMiddle = { (ClientSize.Width / 2), (ClientSize.Height / 2) };
-            int[] screenPosition = this.ScreenPosition();
             int heightTriangle = executingTest.ProgramInUse.StimuluSize;
+            int[] screenPosition = this.ScreenPosition(new Size(heightTriangle, heightTriangle));
+            screenPosition[X] -= heightTriangle / 3;
+            screenPosition[Y] += heightTriangle / 2;

             Point point1 = new Point( screenPosition[X] + (heightTriangle / 3), (heightTriangle / 2) + screenPosition[Y]);
             Point point2 = new Point( (8 * heightTriangle / 6) + screenPosition[X], (heightTriangle / 2) + screenPosition[Y]);


Added extension method to create a IFileReference from an IFile

--- SyncTool.FileSystem/main/FileSystem/FileExtensions.cs
+++ SyncTool.FileSystem/main/FileSystem/FileExtensions.cs
@@ -22,5 +22,14 @@
         {
             return file.GetExtension().TrimStart(s_TrimChars).Equals(extension.TrimStart(s_TrimChars), StringComparison.InvariantCultureIgnoreCase);
         }
+
+        public static IFileReference ToReference(this IFile file)
+        {
+            if (file == null)
+            {
+                throw new ArgumentNullException(nameof(file));
+            }
+            return new FileReference(file.Path, file.LastWriteTime, file.Length);
+        }
     }
 }


Texture: implement CUBEMAP_RADIANCE_SH

Texture: implement CUBEMAP_RADIANCE_SH

--- ValveResourceFormat/Resource/ResourceTypes/Texture.cs
+++ ValveResourceFormat/Resource/ResourceTypes/Texture.cs
@@ -67,6 +67,8 @@

         private int[] CompressedMips;
         private bool IsActuallyCompressedMips;
+
+        private float[] RadianceCoefficients;

         public ushort ActualWidth => NonPow2Width > 0 ? NonPow2Width : Width;
         public ushort ActualHeight => NonPow2Height > 0 ? NonPow2Height : Height;
@@ -124,6 +126,8 @@
                     var prevOffset = reader.BaseStream.Position;

                     reader.BaseStream.Position += offset;
+                    ExtraData.Add(type, reader.ReadBytes((int)size));
+                    reader.BaseStream.Position -= size;

                     if (type == VTexExtraData.FILL_TO_POWER_OF_TWO)
                     {
@@ -135,18 +139,11 @@
                             NonPow2Width = nw;
                             NonPow2Height = nh;
                         }
-
-                        reader.BaseStream.Position -= 6;
-                    }
-
-                    ExtraData.Add(type, reader.ReadBytes((int)size));
-
-                    if (type == VTexExtraData.COMPRESSED_MIP_SIZE)
-                    {
-                        reader.BaseStream.Position -= size;
-
+                    }
+                    else if (type == VTexExtraData.COMPRESSED_MIP_SIZE)
+                    {
                         var int1 = reader.ReadUInt32(); // 1?
-                        var int2 = reader.ReadUInt32(); // 8?
+                        var mipsOffset = reader.ReadUInt32();
                         var mips = reader.ReadUInt32();

                         if (int1 != 1 && int1 != 0)
@@ -154,18 +151,30 @@
                             throw new InvalidDataException($"int1 got: {int1}");
                         }

-                        if (int2 != 8)
-                        {
-                            throw new InvalidDataException($"int2 expected 8 but got: {int2}");
-                        }
-
                         IsActuallyCompressedMips = int1 == 1; // TODO: Verify whether this int is the one that actually controls compression

                         CompressedMips = new int[mips];
+
+                        reader.BaseStream.Position += mipsOffset - 8;

                         for (var mip = 0; mip < mips; mip++)
                         {
                             CompressedMips[mip] = reader.ReadInt32();
+                        }
+                    }
+                    else if (type == VTexExtraData.CUBEMAP_RADIANCE_SH)
+                    {
+                        var coeffsOffset = reader.ReadUInt32();
+                        var coeffs = reader.ReadUInt32();
+
+                        //Spherical Harmonics
+                        RadianceCoefficients = new float[coeffs];
+
+                        reader.BaseStream.Position += coeffsOffset - 8;
+
+                        for (var c = 0; c < coeffs; c++)
+                        {
+                            RadianceCoefficients[c] = reader.ReadSingle();
                         }
                     }

@@ -572,6 +581,10 @@
                 {
                     writer.WriteLine("{0,-16}   [ {1} mips, sized: {2} ]", string.Empty, CompressedMips.Length, string.Join(", ", CompressedMips));
                 }
+                else if (b.Key == VTexExtraData.CUBEMAP_RADIANCE_SH)
+                {
+                    writer.WriteLine("{0,-16}   [ {1} coefficients: {2} ]", string.Empty, RadianceCoefficients.Length, string.Join(", ", RadianceCoefficients));
+                }
             }

             for (var j = 0; j < NumMipLevels; j++)


(VsIntegration) Formatting: Correction for UNION support and nested entities with no End-Marker

--- VisualStudio/LanguageService/Formatting/Formatting.cs
+++ VisualStudio/LanguageService/Formatting/Formatting.cs
@@ -577,13 +577,28 @@
                 case XSharpLexer.STRUCTURE:
                 case XSharpLexer.VOSTRUCT:
                 case XSharpLexer.ENUM:
+                case XSharpLexer.UNION:
+                    // We are inside something ?
                     if (nestedEntity.Count() > 0)
                     {
                         current = nestedEntity.Peek();
                         switch (current.Item1)
                         {
+                            case XSharpLexer.DELEGATE:
                             case XSharpLexer.FUNCTION:
                             case XSharpLexer.PROCEDURE:
+                            case XSharpLexer.CONSTRUCTOR:
+                            case XSharpLexer.DESTRUCTOR:
+                            case XSharpLexer.ASSIGN:
+                            case XSharpLexer.ACCESS:
+                            case XSharpLexer.METHOD:
+                            case XSharpLexer.PROPERTY:
+                            case XSharpLexer.OPERATOR:
+                            case XSharpLexer.EVENT:
+                            // These can also have no closing end marker
+                            case XSharpLexer.VOSTRUCT:
+                            case XSharpLexer.ENUM:
+                            case XSharpLexer.UNION:
                                 // Move back this opening Keyword
                                 currentIndent = current.Item2;
                                 nestedEntity.Pop();
@@ -622,6 +637,10 @@
                             case XSharpLexer.PROPERTY:
                             case XSharpLexer.OPERATOR:
                             case XSharpLexer.EVENT:
+                            // These can also have no closing end marker
+                            case XSharpLexer.VOSTRUCT:
+                            case XSharpLexer.ENUM:
+                            case XSharpLexer.UNION:
                                 // Move back this opening Keyword
                                 current = nestedEntity.Pop();
                                 currentIndent = current.Item2;
@@ -767,6 +786,8 @@
                                 case XSharpLexer.INTERFACE:
                                 case XSharpLexer.STRUCTURE:
                                 case XSharpLexer.VOSTRUCT:
+                                case XSharpLexer.ENUM:
+                                case XSharpLexer.UNION:
                                     // Do we have such block Type before in the list ?
                                     int found = nestedEntity.FindLastIndex((pair) => pair.Item1 == nextKeyword.Type);
                                     if (found > -1)
@@ -811,6 +832,7 @@
                             case XSharpLexer.STRUCTURE:
                             case XSharpLexer.VOSTRUCT:
                             case XSharpLexer.ENUM:
+                            case XSharpLexer.UNION:
                             case XSharpLexer.ADD:
                             case XSharpLexer.REMOVE:
                             case XSharpLexer.SET:


fix code factor issues.

fix code factor issues.

--- WalletWasabi.Gui/Extensions/BinarySearchExtensions.cs
+++ WalletWasabi.Gui/Extensions/BinarySearchExtensions.cs
@@ -110,9 +110,9 @@
 		///     already, i.e. populated only with this method. The template type for the collection must
 		///     implement IComparable.
 		/// </summary>
-		/// <typeparam name="T">is the type of items in the collection.</typeparam>
-		/// <param name="myself">is "this" reference.</param>
-		/// <param name="item">is the item to insert.</param>
+		/// <typeparam name="T">The type of items in the collection.</typeparam>
+		/// <param name="myself">The "this" reference.</param>
+		/// <param name="item">The item to insert.</param>
 		public static void InsertSorted<T>(this IList<T> myself, T item, bool exclusive = true) where T : IComparable<T>
 		{
 			var index = myself.BinarySearchIndexOf(item);
@@ -132,9 +132,9 @@
 		///     already, i.e. populated only with this method. The template type for the collection must
 		///     implement IComparable.
 		/// </summary>
-		/// <typeparam name="T">is the type of items in the collection.</typeparam>
-		/// <param name="myself">is "this" reference.</param>
-		/// <param name="item">is the item to insert.</param>
+		/// <typeparam name="T">The type of items in the collection.</typeparam>
+		/// <param name="myself">The "this" reference.</param>
+		/// <param name="item">The item to insert.</param>
 		public static T InsertSortedExclusive<T>(this IList<T> myself, T item) where T : IComparable<T>
 		{
 			var index = myself.BinarySearchIndexOf(item);


init dict with capacity

init dict with capacity

--- Wire/Converters/DefaultDictionarySerializerFactory.cs
+++ Wire/Converters/DefaultDictionarySerializerFactory.cs
@@ -38,7 +38,7 @@
             ValueReader reader = (stream, session) =>
             {
                 var count = stream.ReadInt32(session);
-                var instance = (IDictionary)Activator.CreateInstance(type);
+                var instance = (IDictionary)Activator.CreateInstance(type,count);
                 for (int i = 0; i < count; i++)
                 {
                     var entry = (DictionaryEntry)stream.ReadObject(session);


Reduce allocation

Reduce allocation

by setting capacity of the builder to avoid call to EnsureCapacity

--- src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/ItemManager.CompletionListUpdater.cs
+++ src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/ItemManager.CompletionListUpdater.cs
@@ -391,7 +391,13 @@

             private ImmutableArray<CompletionItemWithHighlight> GetHighlightedList(IReadOnlyList<MatchResult<VSCompletionItem>> items, CancellationToken cancellationToken)
             {
-                return items.SelectAsArray(matchResult =>
+                if (items.IsEmpty())
+                {
+                    return ImmutableArray<CompletionItemWithHighlight>.Empty;
+                }
+
+                using var _ = ArrayBuilder<CompletionItemWithHighlight>.GetInstance(items.Count, out var builder);
+                builder.AddRange(items.Select(matchResult =>
                 {
                     cancellationToken.ThrowIfCancellationRequested();
                     var highlightedSpans = _highlightMatchingPortions
@@ -399,7 +405,9 @@
                         : ImmutableArray<Span>.Empty;

                     return new CompletionItemWithHighlight(matchResult.EditorCompletionItem, highlightedSpans);
-                });
+                }));
+
+                return builder.ToImmutable();

                 static ImmutableArray<Span> GetHighlightedSpans(
                     MatchResult<VSCompletionItem> matchResult,


RA-1407 broke out value as var for tomorrow.

--- src/Esfa.Vacancy.Application/Commands/CreateApprenticeship/Validators/ApplicationClosingDateValidator.cs
+++ src/Esfa.Vacancy.Application/Commands/CreateApprenticeship/Validators/ApplicationClosingDateValidator.cs
@@ -8,8 +8,10 @@
     {
         public ApplicationClosingDateValidator()
         {
+            var tomorrow = DateTime.Today.AddDays(1);
+
             RuleFor(closingDate => closingDate)
-                .GreaterThanOrEqualTo(DateTime.Today.AddDays(1))
+                .GreaterThanOrEqualTo(tomorrow)
                 .WithErrorCode(ErrorCodes.CreateApprenticeship.ApplicationClosingDateBeforeTomorrow)
                 .WithMessage(ErrorMessages.CreateApprenticeship.ApplicationClosingDateBeforeTomorrow);
         }


fix function name

fix function name

--- shared/sendToSplunk.csx
+++ shared/sendToSplunk.csx
@@ -11,7 +11,7 @@
 using System.Threading;
 using System.Threading.Tasks;

-public static async Task Run(string[] myEventHubMessages, TraceWriter log)
+public static async Task SendMessagesToSplunk(string[] myEventHubMessages, TraceWriter log)
 {
     string[] unpackedMessages = unpackMessages(myEventHubMessages, log);


Used DocumentEditor to alter the document. InsertBefore not functionnal at the moment !

--- RefactoringEssentials/CSharp/Diagnostics/Synced/RedundanciesInCode/RedundantIfElseBlockCodeFixProvider.cs
+++ RefactoringEssentials/CSharp/Diagnostics/Synced/RedundanciesInCode/RedundantIfElseBlockCodeFixProvider.cs
@@ -1,17 +1,16 @@
+using System.Collections.Generic;
 using Microsoft.CodeAnalysis;
-using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.CodeActions;
 using Microsoft.CodeAnalysis.CodeFixes;
-using System.Threading.Tasks;
-using System.Linq;
-using Microsoft.CodeAnalysis.CodeActions;
-using Microsoft.CodeAnalysis.CSharp;
 using Microsoft.CodeAnalysis.CSharp.Syntax;
 using Microsoft.CodeAnalysis.Editing;
 using Microsoft.CodeAnalysis.Formatting;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading.Tasks;

 namespace RefactoringEssentials.CSharp.Diagnostics
 {
-
     [ExportCodeFixProvider(LanguageNames.CSharp), System.Composition.Shared]
     public class RedundantIfElseBlockCodeFixProvider : CodeFixProvider
     {
@@ -28,49 +27,6 @@
             return WellKnownFixAllProviders.BatchFixer;
         }

-        public override async Task RegisterCodeFixesAsync(CodeFixContext context)
-        {
-            var document = context.Document;
-            var cancellationToken = context.CancellationToken;
-            var span = context.Span;
-            var diagnostics = context.Diagnostics;
-            var root = await document.GetSyntaxRootAsync(cancellationToken);
-            var diagnostic = diagnostics.First();
-            var node = root.FindNode(context.Span) as ElseClauseSyntax;
-            var editor = await DocumentEditor.CreateAsync(document, cancellationToken);
-
-            if (node == null)
-                return;
-
-            var newRoot = root.ReplaceNode(node, node.Statement
-                 .WithLeadingTrivia(node.GetLeadingTrivia())
-                 .WithAdditionalAnnotations(Formatter.Annotation));
-            context.RegisterCodeFix(CodeActionFactory.Create(node.Span, diagnostic.Severity, "Remove redundant 'else'", document.WithSyntaxRoot(newRoot)), diagnostic);
-
-            context.RegisterCodeFix(CodeAction.Create("Convert to 'return' statement", await token =>
-            {
-                var statementCondition = (node as IfStatementSyntax)?.Condition;
-                var newReturn = SyntaxFactory.ReturnStatement(SyntaxFactory.Token(SyntaxKind.ReturnKeyword),
-                    statementCondition, SyntaxFactory.Token(SyntaxKind.SemicolonToken));
-                editor.ReplaceNode(node as IfStatementSyntax, newReturn
-                    .WithLeadingTrivia(node.GetLeadingTrivia())
-                    .WithAdditionalAnnotations(Formatter.Annotation));
-
-
-                var block = node.Parent as BlockSyntax;
-                if (block == null)
-                    return null;
-
-                var returnStatementAfterIfStatementIndex = block.Statements.IndexOf(node as IfStatementSyntax) + 1;
-                var returnStatementToBeEliminated =
-                    block.Statements.ElementAt(returnStatementAfterIfStatementIndex) as ReturnStatementSyntax;
-                editor.RemoveNode(returnStatementToBeEliminated);
-                var newDocument = editor.GetChangedDocument();
-
-                return newDocument;
-            }, string.Empty), diagnostic);
-        }
-
         public async override Task RegisterCodeFixesAsync(CodeFixContext context)
         {
             var document = context.Document;
@@ -80,9 +36,18 @@
             var root = await document.GetSyntaxRootAsync(cancellationToken);
             var diagnostic = diagnostics.First();
             var node = root.FindNode(context.Span) as ElseClauseSyntax;
-            var editor = await DocumentEditor.CreateAsync(document, cancellationToken);
+            if (node == null)
+                return;

-
+            context.RegisterCodeFix(CodeAction.Create("Remove redundant 'else'", async token =>
+            {
+                var editor = await DocumentEditor.CreateAsync(document, cancellationToken);
+                var syntaxList = new List<SyntaxNode>{node.Statement};
+                editor.RemoveNode(node);
+                editor.InsertBefore(node,syntaxList);
+                var newDocument = editor.GetChangedDocument();
+                return newDocument;
+            }, string.Empty), diagnostic);
         }
     }
 }


Added note for settings

Added note for settings

--- aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared/Components/RightSideBar/Default.cshtml
+++ aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared/Components/RightSideBar/Default.cshtml
@@ -64,6 +64,8 @@

+
+
This settings are just for demonstration!


Update DeviceGroupQuery.cs (#3221)

Update DeviceGroupQuery.cs (#3221)

* Update DeviceGroupQuery.cs

Fixed timing of the first change of behaviour, moved from OnReceive to Constructor method

* Update DeviceGroupQuery.cs

Fixed exit condition check on stillWaiting instead of repliesSoFar

--- docs/examples/Tutorials/Tutorial4/DeviceGroupQuery.cs
+++ docs/examples/Tutorials/Tutorial4/DeviceGroupQuery.cs
@@ -18,6 +18,7 @@
         {
             private ICancelable queryTimeoutTimer;

+            #region query-state
             public DeviceGroupQuery(Dictionary<IActorRef, string> actorToDeviceId, long requestId, IActorRef requester, TimeSpan timeout)
             {
                 ActorToDeviceId = actorToDeviceId;
@@ -26,6 +27,8 @@
                 Timeout = timeout;

                 queryTimeoutTimer = Context.System.Scheduler.ScheduleTellOnceCancelable(timeout, Self, CollectionTimeout.Instance, Self);
+
+                Become(WaitingForReplies(new Dictionary<string, ITemperatureReading>(), new HashSet<IActorRef>(ActorToDeviceId.Keys)));
             }

             protected override void PreStart()
@@ -47,12 +50,6 @@
             public long RequestId { get; }
             public IActorRef Requester { get; }
             public TimeSpan Timeout { get; }
-
-            #region query-state
-            protected override void OnReceive(object message)
-            {
-                Become(WaitingForReplies(new Dictionary<string, ITemperatureReading>(), new HashSet<IActorRef>(ActorToDeviceId.Keys)));
-            }

             public UntypedReceive WaitingForReplies(
                 Dictionary<string, ITemperatureReading> repliesSoFar,
@@ -106,7 +103,7 @@

                 repliesSoFar.Add(deviceId, reading);

-                if (repliesSoFar.Count == 0)
+                if (stillWaiting.Count == 0)
                 {
                     Requester.Tell(new RespondAllTemperatures(RequestId, repliesSoFar));
                     Context.Stop(Self);
@@ -116,7 +113,12 @@
                     Context.Become(WaitingForReplies(repliesSoFar, stillWaiting));
                 }
             }
-            #endregion
+            #endregion
+
+            protected override void OnReceive(object message)
+            {
+
+            }

             public static Props Props(Dictionary<IActorRef, string> actorToDeviceId, long requestId, IActorRef requester, TimeSpan timeout) =>
                 Akka.Actor.Props.Create(() => new DeviceGroupQuery(actorToDeviceId, requestId, requester, timeout));


Bumped version. Pushed to NuGet.

Bumped version. Pushed to NuGet.

--- sln/Ensues.Security/Properties/AssemblyInfo.cs
+++ sln/Ensues.Security/Properties/AssemblyInfo.cs
@@ -15,7 +15,7 @@
 [assembly: Guid("8b9ce40c-a3c7-45a1-88b0-417b09b30ac2")]

 [assembly: AssemblyVersion("0.2.0")]
-[assembly: AssemblyFileVersion("0.2.0.4")]
+[assembly: AssemblyFileVersion("0.2.0.6")]
 [assembly: AssemblyInformationalVersion("0.2.0")]

 [assembly: InternalsVisibleTo("Ensues.Security.Tests")]


JimEvans: Removing unused code in .NET drag and drop tests.

git-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@12286 07704840-8298-11de-bf8c-fd130f914ac9

--- dotnet/test/WebDriver.Common.Tests/DragAndDropTest.cs
+++ dotnet/test/WebDriver.Common.Tests/DragAndDropTest.cs
@@ -153,12 +153,8 @@
             // Wait until all event handlers are installed.
             System.Threading.Thread.Sleep(500);

-            // The below is the proper way to accomplish the drag and drop.
-            // Uncomment when the interactions API has been completely implemented
-            // in all browsers.
             Actions actionProvider = new Actions(driver);
             actionProvider.DragAndDrop(toDrag, dropInto).Perform();
-            //((IRenderedWebElement)toDrag).DragAndDropOn((IRenderedWebElement)dropInto);

             string text = dropInto.FindElement(By.TagName("p")).Text;


Cleanup parsing logic

Cleanup parsing logic

--- source/Craft.Net.Networking/ChatTransciever.cs
+++ source/Craft.Net.Networking/ChatTransciever.cs
@@ -5,32 +5,30 @@

 namespace Craft.Net.Networking
 {
-    //Lowercase because that's the way vanilla sends the "color" field
-    //In fact, the vanilla server will not have it any other way.
     public enum ChatColor
     {
-        black,
-        dark_blue,
-        dark_green,
-        dark_aqua,
-        dark_red,
-        dark_purple,
-        gold,
-        gray,
-        dark_gray,
-        blue,
-        green,
-        aqua,
-        red,
-        light_purple,
-        yellow,
-        white,
-        obfuscated,
-        bold,
-        strikethrough,
-        underline,
-        italic,
-        reset
+        BLACK,
+        DARK_BLUE,
+        DARK_GREEN,
+        DARK_AQUA,
+        DARK_RED,
+        DARK_PURPLE,
+        GOLD,
+        GRAY,
+        DARK_GRAY,
+        BLUE,
+        GREEN,
+        AQUA,
+        RED,
+        LIGHT_PURPLE,
+        YELLOW,
+        WHITE,
+        OBFUSCATED,
+        BOLD,
+        STRIKETHROUGH,
+        UNDERLINE,
+        ITALIC,
+        RESET,
     }

     //Lowercase because that's the way vanilla sends the "clickEvent" field.
@@ -58,25 +56,11 @@
     {
         #region Properties

-        protected string _rawMessage;
-        public string RawMessage
-        {
-            get { return _rawMessage; }
-        }
-
-        protected string _text;
-        public string Text
-        {
-            get { return _text; }
-            private set { _text = value; }
-        }
-
-        protected ChatColor _color;
-        public ChatColor Color
-        {
-            get { return _color; }
-            protected set { _color = value; }
-        }
+        public string RawMessage { get; private set; }
+
+        public string Text { get; protected set; }
+
+        public ChatColor Color { get; protected set; }

         /// <summary>
         /// Gets or sets a value indicating whether this <see cref="Craft.Net.Networking.ChatMessage"/> is bolded.
@@ -109,13 +93,8 @@
         /// Can be overriden by submessages with a different value.
         /// </summary>
         public bool Obfuscated { get; protected set; }
-
-        protected ChatActionType _action;
-        public ChatActionType Action
-        {
-            get { return _action; }
-            protected set { _action = value; }
-        }
+
+        public ChatActionType Action { get; protected set; }

         /// <summary>
         /// Gets or sets the chat action value.
@@ -123,23 +102,13 @@
         /// </summary>
         public string ChatActionValue { get; protected set; }

-        protected ChatHoverActionType _hoverAction;
-        public ChatHoverActionType HoverAction
-        {
-            get { return _hoverAction; }
-            protected set { _hoverAction = value; }
-        }
+        public ChatHoverActionType HoverAction { get; protected set; }

         public string ChatHoverActionValue { get; protected set; }

         public bool IsCommand { get; private set; }

-        protected IList<ChatMessage> _subMessages;
-        public IList<ChatMessage> SubMessages
-        {
-            get { return _subMessages; }
-            protected set { _subMessages = value; }
-        }
+        public IList<ChatMessage> SubMessages { get; protected set; }

         #endregion

@@ -147,17 +116,18 @@

         public ChatMessage(string Message)
         {
-            _rawMessage = Message;
+            RawMessage = Message;
             try
             {
                 Init(JObject.Parse(Message));
-            } catch (Newtonsoft.Json.JsonReaderException)
+            }
+            catch (Newtonsoft.Json.JsonReaderException)
             {
                 //If Newtonsoft.Json couldn't parse it, that means we got something that isn't a new-format chat message.
                 // (Or there's a bug in the server)
                 //So we're just gona set the text content and call it a day.
-                _text = Message;
-                if (_text.StartsWith("/"))
+                Text = Message;
+                if (Text.StartsWith("/"))
                     this.IsCommand = true;
             }
         }
@@ -169,80 +139,85 @@

         private void Init(JObject obj)
         {
-            JToken temp;
-            #region parsing
-            if (obj.TryGetValue("text", out temp))
-            {
-                _text = (string)temp;
+            if (obj["text"] != null)
+            {
+                Text = obj.Value<string>("text");
             }
             // Try to parse enumerations
-            if (obj.TryGetValue("color", out temp))
-            {
-                if (!ChatColor.TryParse((string)temp.ToString(), out _color))
-                    this.Color = ChatColor.reset;
+            if (obj["color"] != null)
+            {
+                var color = obj.Value<string>("color").ToUpper();
+                ChatColor c;
+                if (!ChatColor.TryParse(color, out c))
+                    this.Color = ChatColor.RESET;
+                else
+                    this.Color = c;
             }
             else
             {
-                this.Color = ChatColor.reset;
-            }
-            if (obj.TryGetValue("clickEvent", out temp))
-            {
-                if (!ChatActionType.TryParse((string)temp, out _action))
-                    _action = ChatActionType.none;
+                this.Color = ChatColor.RESET;
+            }
+            if (obj["clickEvent"] != null)
+            {
+                var action = obj.Value<String>("clickEvent");
+                ChatActionType c;
+                if (!ChatActionType.TryParse(action, out c))
+                    this.Action = ChatActionType.none;
+                else
+                    this.Action = c;
             }
             else
             {
-                _action = ChatActionType.none;
-            }
-            if (obj.TryGetValue("hoverEvent", out temp))
-            {
-                if (!ChatHoverActionType.TryParse((string)temp, out _hoverAction))
-                    _hoverAction = ChatHoverActionType.none;
+                this.Action = ChatActionType.none;
+            }
+            if (obj["hoverEvent"] != null)
+            {
+                var hover = obj.Value<string>("hoverEvent");
+                ChatHoverActionType c;
+                if (!ChatHoverActionType.TryParse(hover, out c))
+                    this.HoverAction = ChatHoverActionType.none;
+                else
+                    this.HoverAction = c;
             }
             else
             {
-                _hoverAction = ChatHoverActionType.none;
+                this.HoverAction = ChatHoverActionType.none;
             }
             //Parse booleans
-            if (obj.TryGetValue("bold", out temp))
-            {
-                Bold = (bool)temp;
-            }
-            if (obj.TryGetValue("italic", out temp))
-            {
-                Italic = (bool)temp;
-            }
-            if (obj.TryGetValue("underlined", out temp))
-            {
-                Underlined = (bool)temp;
-            }
-            if (obj.TryGetValue("strikethrough", out temp))
-            {
-                StrikeThrough = (bool)temp;
-            }
-            if (obj.TryGetValue("obfuscated", out temp))
-            {
-                StrikeThrough = (bool)temp;
-            }
-            #endregion
-            #region recursion
-
-            if (obj.TryGetValue("extra", out temp))
-            {
-                if (temp.Type == JTokenType.Array)
+            if (obj["bold"] != null)
+            {
+                Bold = obj.Value<bool>("bold");
+            }
+            if (obj["italic"] != null)
+            {
+                Italic = obj.Value<bool>("italic");
+            }
+            if (obj["underlined"] != null)
+            {
+                Underlined = obj.Value<bool>("underlined");
+            }
+            if (obj["strikethrough"] != null)
+            {
+                StrikeThrough = obj.Value<bool>("strikethrough");
+            }
+            if (obj["obfuscated"] != null)
+            {
+                Obfuscated = obj.Value<bool>("obfuscated");
+            }
+
+            if (obj["extra"] != null)
+            {
+                this.SubMessages = new List<ChatMessage>();
+                foreach (object o in (JArray)obj["extra"])
                 {
-                    _subMessages = new List<ChatMessage>();
-                    foreach (object o in (JArray)obj["extra"])
+                    if (o.GetType() == typeof(JValue))
                     {
-                        if (o.GetType() == typeof(JValue))
-                        {
-                            Console.WriteLine(((JValue)o).Type);
-                            _subMessages.Add(new ChatMessage((string)((JValue)o).Value));
-                        }
-                        else
-                        {
-                            _subMessages.Add(new ChatMessage((JObject)o));
-                        }
+                        Console.WriteLine(((JValue)o).Type);
+                        this.SubMessages.Add(new ChatMessage((string)((JValue)o).Value));
+                    }
+                    else
+                    {
+                        this.SubMessages.Add(new ChatMessage((JObject)o));
                     }
                 }
             }
@@ -250,8 +225,6 @@
             #endregion
         }

-        #endregion
-
         #region Public methods

         public string FullText()
@@ -263,9 +236,9 @@
         public override string ToString()
         {
             string extras = "[";
-            if (_subMessages != null)
-            {
-                foreach (ChatMessage c in _subMessages)
+            if (SubMessages != null)
+            {
+                foreach (ChatMessage c in SubMessages)
                 {
                     extras += c.ToString();
                     extras += ",";
@@ -278,9 +251,9 @@
                 "\"text\":\"{0}\",\"bold\":{1},\"italic\":{2},\"underlined\":{3},\"strikethrough\":{4},\"obfuscated\":{5}" +
                 "\"color\":{6},\"clickEvent\":{{\"action\":\"{7}\",\"value\":\"{8}\"}},\"hoverEvent\":{{\"action\":\"{9}\",\"value\":\"{10}\"}}," +
                 "\"extra\":{11}",
-                _text, Bold, Italic, Underlined, StrikeThrough, Obfuscated, _color,
-                ((_action != ChatActionType.none) ? _action.ToString() : ""), ChatActionValue,
-                ((_hoverAction != ChatHoverActionType.none) ? _hoverAction.ToString() : ""), ChatHoverActionValue, extras
+                Text, Bold, Italic, Underlined, StrikeThrough, Obfuscated, Color,
+                ((Action != ChatActionType.none) ? Action.ToString() : ""), ChatActionValue,
+                ((HoverAction != ChatHoverActionType.none) ? HoverAction.ToString() : ""), ChatHoverActionValue, extras
                 ) + "}";
         }


Fix ToolPathResolver to not require framework when only one file matches

--- source/Nuke.Common/Tooling/ToolPathResolver.cs
+++ source/Nuke.Common/Tooling/ToolPathResolver.cs
@@ -54,11 +54,14 @@
                     : directory.Parent.NotNull().Name;
             }

-            var frameworks = packageExecutablePaths.ToDictionary(GetFramework,x => x,StringComparer.OrdinalIgnoreCase);
+            var frameworks = packageExecutablePaths.ToDictionary(GetFramework, x => x, StringComparer.OrdinalIgnoreCase);
+            ControlFlow.Assert(frameworks.Count > 0, "frameworks.Count > 0");
+            if (frameworks.Count == 1)
+                return frameworks.Values.Single();
+
             ControlFlow.Assert(framework != null && frameworks.ContainsKey(framework),
-                new[] { $"Package executable {frameworks.First().Key.SingleQuote()} [{packageId}] requires a framework:" }
+                new[] { $"Package executable {packageExecutables.JoinCommaOr()} [{packageId}] requires a framework:" }
                     .Concat(frameworks.Keys.Select(x => $" - {x}")).JoinNewLine());
-
             return frameworks[framework];
         }


* Added coderwall

* Added coderwall


Improved error handling in Splunk.Sdk.Entity<TEntity>.CreateEntity

--- sources/splunk-sdk-csharp/Splunk/Sdk/Entity.cs
+++ sources/splunk-sdk-csharp/Splunk/Sdk/Entity.cs
@@ -33,6 +33,7 @@

 namespace Splunk.Sdk
 {
+    using Microsoft.CSharp.RuntimeBinder;
     using System;
     using System.Collections.Generic;
     using System.Diagnostics.Contracts;
@@ -301,13 +302,24 @@
             }
             else
             {
+                dynamic acl;
+
                 try
                 {
-                    entity.Namespace = new Namespace(content.Eai.Acl.Owner, content.Eai.Acl.App);
-                }
-                catch (NullReferenceException e)
-                {
-                    throw new InvalidDataException(); // TODO: Diagnostics
+                    acl = content.Eai.Acl;
+                }
+                catch (RuntimeBinderException e)
+                {
+                    throw new InvalidDataException("", e); // TODO: Diagnostics
+                }
+
+                try
+                {
+                    entity.Namespace = new Namespace(acl.Owner, acl.App);
+                }
+                catch (ArgumentException e)
+                {
+                    throw new InvalidDataException("", e); // TODO: Diagnostics
                 }
             }


Cover case when initialTextGenerator returns null.

--- Sandra.UI/AppTemplate/JsonTextBox.cs
+++ Sandra.UI/AppTemplate/JsonTextBox.cs
@@ -154,7 +154,7 @@
                 {
                     if (initialTextGenerator != null)
                     {
-                        Text = initialTextGenerator();
+                        Text = initialTextGenerator() ?? string.Empty;
                     }
                 },
                 whenOption2: loadedText =>


Backport of writing optional amounts with profile awareness in ZUGFeRD 2.0

--- ZUGFeRD/InvoiceDescriptor20Writer.cs
+++ ZUGFeRD/InvoiceDescriptor20Writer.cs
@@ -724,11 +724,11 @@
         } // !Save()

-        private void _writeOptionalAmount(ProfileAwareXmlTextWriter writer, string tagName, decimal? value, int numDecimals = 2)
+        private void _writeOptionalAmount(ProfileAwareXmlTextWriter writer, string tagName, decimal? value, int numDecimals = 2, Profile profile = Profile.Unknown)
         {
             if (value.HasValue && (value.Value != decimal.MinValue))
             {
-                writer.WriteStartElement(tagName);
+                writer.WriteStartElement(tagName, profile);
                 writer.WriteAttributeString("currencyID", this.Descriptor.Currency.EnumToString());
                 writer.WriteValue(_formatDecimal(value.Value, numDecimals));
                 writer.WriteEndElement(); // !tagName


Added much more command extensions

Added much more command extensions

--- src/Aggregates.NET/Extensions/BusExtensions.cs
+++ src/Aggregates.NET/Extensions/BusExtensions.cs
@@ -56,6 +56,78 @@
             // All commands get a response so we'll need to register a callback
             return bus.Send(destination, command).AsCommandResult();
         }
+        public static Task Command(this IBus bus, Action<ICommand> command)
+        {
+            // All commands get a response so we'll need to register a callback
+            return bus.Send(command).AsCommandResult();
+        }
+        public static Task Command(this IBus bus, string destination, Action<ICommand> command)
+        {
+            // All commands get a response so we'll need to register a callback
+            return bus.Send(destination, command).AsCommandResult();
+        }
+        public static Task Command(this IBus bus, Address destination, Action<ICommand> command)
+        {
+            // All commands get a response so we'll need to register a callback
+            return bus.Send(destination, command).AsCommandResult();
+        }
+
+        /// <summary>
+        /// Send the command, don't care if its rejected
+        /// </summary>
+        /// <param name="bus"></param>
+        /// <param name="command"></param>
+        /// <returns></returns>
+        public static async Task PassiveCommand(this IBus bus, Action<ICommand> command)
+        {
+            try
+            {
+                await bus.Send(command).AsCommandResult();
+            }
+            catch (CommandRejectedException) { }
+        }
+        public static async Task PassiveCommand(this IBus bus, ICommand command)
+        {
+            try
+            {
+                await bus.Send(command).AsCommandResult();
+            }
+            catch (CommandRejectedException) { }
+        }
+        public static async Task PassiveCommand(this IBus bus, string destination, Action<ICommand> command)
+        {
+            try
+            {
+                await bus.Send(destination, command).AsCommandResult();
+            }
+            catch (CommandRejectedException) { }
+        }
+        public static async Task PassiveCommand(this IBus bus, Address destination, Action<ICommand> command)
+        {
+            try
+            {
+                await bus.Send(destination, command).AsCommandResult();
+            }
+            catch (CommandRejectedException) { }
+        }
+        public static async Task PassiveCommand(this IBus bus, string destination, ICommand command)
+        {
+            try
+            {
+                await bus.Send(destination, command).AsCommandResult();
+            }
+            catch (CommandRejectedException) { }
+        }
+        public static async Task PassiveCommand(this IBus bus, Address destination, ICommand command)
+        {
+            try
+            {
+                await bus.Send(destination, command).AsCommandResult();
+            }
+            catch (CommandRejectedException) { }
+        }
+
+
         public static void ReplyAsync(this IHandleContext context, object message)
         {
             var incoming = context.Context.PhysicalMessage;


Add additional support for AeroProgressBar

--- AeroSuite/Controls/AeroProgressBar.cs
+++ AeroSuite/Controls/AeroProgressBar.cs
@@ -44,6 +44,7 @@
             }
             set
             {
+                this.state = value;
                 if (!PlatformHelper.VistaOrHigher && !PlatformHelper.VisualStylesEnabled)
                 {
                     //This feature is not natively supported on other platforms.
@@ -65,8 +66,6 @@
                 {
                     this.UpdateState();
                 }
-
-                this.state = value;
             }
         }


Update SepaDebitTransfer.cs

Update SepaDebitTransfer.cs

--- SepaWriter/SepaDebitTransfer.cs
+++ SepaWriter/SepaDebitTransfer.cs
@@ -94,7 +94,7 @@
             grpHdr.NewElement("CtrlSum", StringUtils.FormatAmount(headerControlSum));
             grpHdr.NewElement("InitgPty").NewElement("Nm", InitiatingPartyName);
             if (InitiatingPartyId != null)
-                grpHdr.NewElement("InitgPty").NewElement("Id", InitiatingPartyId);
+                XmlUtils.GetFirstElement(xml, "CstmrDrctDbtInitn//InitgPty").NewElement("Id", InitiatingPartyId);

             // Part 2: Payment Information for each Sequence Type.
             foreach (SepaSequenceType seqTp in Enum.GetValues(typeof(SepaSequenceType)))
@@ -201,4 +201,4 @@
             return aSchema == SepaSchema.Pain00800102 || aSchema == SepaSchema.Pain00800103;
         }
     }
-}+}


Bump up Binarry Logger file format version (#2136)

Due to new BuildEventContext.EvaluationID

--- src/Build/Logging/BinaryLogger/BinaryLogger.cs
+++ src/Build/Logging/BinaryLogger/BinaryLogger.cs
@@ -16,7 +16,10 @@
     /// <remarks>The logger is public so that it can be instantiated from MSBuild.exe via command-line switch.</remarks>
     public sealed class BinaryLogger : ILogger
     {
-        internal const int FileFormatVersion = 1;
+        // version 2:
+        //   - new BuildEventContext.EvaluationID
+        //   - new record kinds: ProjectEvaluationStarted, ProjectEvaluationFinished
+        internal const int FileFormatVersion = 2;

         private Stream stream;
         private BinaryWriter binaryWriter;


Fix incorrect "see cref" in XML documentation

--- src/AdvApi32/AdvApi32.cs
+++ src/AdvApi32/AdvApi32.cs
@@ -1157,7 +1157,7 @@
         /// privilege set.</param>
         /// <param name="ImpersonationLevel">Specifies a value from the <see cref="SECURITY_IMPERSONATION_LEVEL"/>
         /// enumeration that indicates the impersonation level of the new token.</param>
-        /// <param name="TokenType">pecifies one of the following values from the <see cref="TokenType"/> enumeration.</param>
+        /// <param name="TokenType">pecifies one of the following values from the <see cref="TOKEN_TYPE"/> enumeration.</param>
         /// <param name="phNewToken">A pointer to a <see cref="SafeObjectHandle"/> variable that receives the new token.</param>
         /// <returns>If the function succeeds, the function returns a nonzero value.
         /// If the function fails, it returns zero.To get extended error information, call GetLastError.</returns>


Include metric name in Netuitive JSON payload

--- src/CollectdWinService/WriteNetuitivePlugin.cs
+++ src/CollectdWinService/WriteNetuitivePlugin.cs
@@ -12,7 +12,7 @@
     internal class WriteNetuitivePlugin : ICollectdWritePlugin
     {

-        private const string NetuitiveMetricFormat = @"{{""id"":""{0}"", ""unit"":""{1}""}}";
+        private const string NetuitiveMetricFormat = @"{{""id"":""{0}"", ""unit"":""{1}"", ""name"":""{2}""}}";

         private const string NetuitiveSampleFormat = @"{{""metricId"":""{0}"", ""timestamp"":{1}, ""val"":{2}}}";

@@ -118,7 +118,7 @@
                 if (metric.Values.Length == 1)
                 {
                     // Simple case - just one metric in type
-                    metricList.Add(string.Format(NetuitiveMetricFormat, metricId, metric.TypeName));
+                    metricList.Add(string.Format(NetuitiveMetricFormat, metricId, metric.TypeName, metricId));
                     sampleList.Add(string.Format(NetuitiveSampleFormat, metricId, (long)metric.Epoch * 1000, metric.Values[0]));
                 }
                 else if (metric.Values.Length > 1)
@@ -135,7 +135,7 @@
                         foreach (DataSource ds in dsList)
                         {
                             // Include the Types.db suffix in the metric name
-                            metricList.Add(string.Format(NetuitiveMetricFormat, metricId, metric.TypeName));
+                            metricList.Add(string.Format(NetuitiveMetricFormat, metricId, metric.TypeName, metricId));
                             sampleList.Add(string.Format(NetuitiveSampleFormat, metricId + "." + ds.Name, (long)metric.Epoch * 1000, metric.Values[ix++]));
                         }
                     }


Clearing HttpClient Default User Agent Headers before adding the header; otherwise, as HttpClient is reused, the header size grows to Salesforce throwing 413 error response.

--- src/CommonLibrariesForNET/ServiceHttpClient.cs
+++ src/CommonLibrariesForNET/ServiceHttpClient.cs
@@ -33,14 +33,15 @@
             }
             else
             {
-                _httpClient = httpClient;
-            }
-
+                _httpClient = httpClient;
+            }
+
+            _httpClient.DefaultRequestHeaders.UserAgent.Clear();
             _httpClient.DefaultRequestHeaders.UserAgent.ParseAdd(string.Concat(UserAgent, "/", ApiVersion));
             _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

             _httpClient.DefaultRequestHeaders.Accept.Clear();
-            _httpClient.DefaultRequestHeaders.AcceptEncoding.Clear();
+            _httpClient.DefaultRequestHeaders.AcceptEncoding.Clear();
             _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
             _httpClient.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip"));
         }


have a little different relF

have a little different relF

--- SignalGenerator/Dsp/PADsynth.cs
+++ SignalGenerator/Dsp/PADsynth.cs
@@ -161,7 +161,7 @@
         /// <returns></returns>
         protected virtual double relF(int nh)
         {
-            return nh * (1.0 + nh * 0.1);
+            return nh;// nh * (1.0 + nh * 0.1);
         }
         /// <summary>
         /// This is the profile of one harmonic


add to confirmed

add to confirmed

--- Anlab.Mvc/Views/Order/Confirmed.cshtml
+++ Anlab.Mvc/Views/Order/Confirmed.cshtml
@@ -63,12 +63,13 @@

+                Analysis
+                Sop
                 Per Test
                 Quantity
                 SubTotal
                 Setup Cost
                 Test Total
-                Analysis

@@ -80,17 +81,19 @@
                     continue;
                 }

+                    @test.Analysis
+                    @temp.Sop
                     @test.Cost.ToString("C")
                     x @Model.OrderDetails.Quantity
                     @test.SubTotal.ToString("C")
                     @test.SetupCost.ToString("C")
                     @test.Total.ToString("C")
-                    @test.Analysis

             }

+

@@ -112,6 +115,7 @@

+
                 @(String.Format("{0:C}", Model.OrderDetails.GrandTotal))
                 Total


Another AlphaImage bug in IconEntry ...

Another AlphaImage bug in IconEntry ...


Fix for "this week", now includes the whole week.

--- SimpleReport.Model/Parameter.cs
+++ SimpleReport.Model/Parameter.cs
@@ -163,7 +163,7 @@
             switch (period)
             {
                 case ParameterPeriods.ThisWeek:
-                    return new[] { now.GetFirstDateOfWeek().ToShortDateString(), DateTime.Today.ToShortDateString() };
+                    return new[] { now.GetFirstDateOfWeek().ToShortDateString(), now.GetLastDateOfWeek().ToShortDateString() };
                 case ParameterPeriods.LastWeek:
                     return new[] { now.GetFirstDateOfWeek().AddDays(-7).ToShortDateString(), now.GetLastDateOfWeek().AddDays(-7).ToShortDateString() };
                 case ParameterPeriods.ThisMonth:


--- src/Cuemon.Core/Range.cs
+++ src/Cuemon.Core/Range.cs
@@ -62,8 +62,8 @@
         public bool Equals(Range<T> x, Range<T> y)
         {
             if (ReferenceEquals(x, y)) return true;
-            if (ReferenceEquals(x, null)) return false;
-            if (ReferenceEquals(y, null)) return false;
+            if (x is null) return false;
+            if (y is null) return false;
             if (x.GetType() != y.GetType()) return false;
             return EqualityComparer<T>.Default.Equals(x.Start, y.Start) && EqualityComparer<T>.Default.Equals(x.End, y.End);
         }


Fixed a loop list scrolling bug.

Fixed a loop list scrolling bug.

--- Source/Scripts/UI/ScrollPane.cs
+++ Source/Scripts/UI/ScrollPane.cs
@@ -456,13 +456,8 @@
 		{
 			_owner.EnsureBoundsCorrect();

-			if (_loop == 1 && _overlapSize.x > 0)
-			{
-				if (value < 0.001f)
-					value += _contentSize.x / 2;
-				else if (value >= _overlapSize.x)
-					value -= _contentSize.x / 2;
-			}
+			if (_loop == 1)
+				LoopCheckingNewPos(ref value, 0);

 			value = Mathf.Clamp(value, 0, _overlapSize.x);
 			if (value != _xPos)
@@ -490,13 +485,8 @@
 		{
 			_owner.EnsureBoundsCorrect();

-			if (_loop == 2 && _overlapSize.y > 0)
-			{
-				if (value < 0.001f)
-					value += _contentSize.y / 2;
-				else if (value >= _overlapSize.y)
-					value -= _contentSize.y / 2;
-			}
+			if (_loop == 2)
+				LoopCheckingNewPos(ref value, 1);

 			value = Mathf.Clamp(value, 0, _overlapSize.y);
 			if (value != _yPos)
@@ -836,9 +826,6 @@

 			if (_overlapSize.y > 0)
 			{
-				if (_loop != 0 && _yPos == 0)
-					ani = false;
-
 				float bottom = _yPos + _viewSize.y;
 				if (setFirst || rect.y <= _yPos || rect.height >= _viewSize.y)
 				{
@@ -859,9 +846,6 @@
 			}
 			if (_overlapSize.x > 0)
 			{
-				if (_loop != 0 && _xPos == 0)
-					ani = false;
-
 				float right = _xPos + _viewSize.x;
 				if (setFirst || rect.x <= _xPos || rect.width >= _viewSize.x)
 				{
@@ -1764,7 +1748,7 @@

 		private void ShowScrollBar(bool val)
 		{
-			if(!Application.isPlaying)
+			if (!Application.isPlaying)
 				__showScrollBar(val);
 			else if (val)
 			{
@@ -1787,6 +1771,11 @@
 				_hzScrollBar.displayObject.visible = _scrollBarVisible && !_hScrollNone;
 		}

+		float GetLoopPartSize(float division, int axis)
+		{
+			return (_contentSize[axis] + (axis == 0 ? ((GList)_owner).columnGap : ((GList)_owner).lineGap)) / division;
+		}
+
 		/// <summary>
 		/// 对当前的滚动位置进行循环滚动边界检查。当到达边界时，回退一半内容区域（循环滚动内容大小通常是真实内容大小的偶数倍）。
 		/// </summary>
@@ -1798,13 +1787,12 @@
 			{
 				if (_xPos < 0.001f)
 				{
-					_xPos += _contentSize.x / 2;
+					_xPos += GetLoopPartSize(2, 0);
 					changed = true;
-
 				}
 				else if (_xPos >= _overlapSize.x)
 				{
-					_xPos -= _contentSize.x / 2;
+					_xPos -= GetLoopPartSize(2, 0);
 					changed = true;
 				}
 			}
@@ -1812,12 +1800,12 @@
 			{
 				if (_yPos < 0.001f)
 				{
-					_yPos += _contentSize.y / 2;
+					_yPos += GetLoopPartSize(2, 1);
 					changed = true;
 				}
 				else if (_yPos >= _overlapSize.y)
 				{
-					_yPos += _contentSize.y / 2 - _overlapSize.y;
+					_yPos -= GetLoopPartSize(2, 1);
 					changed = true;
 				}
 			}
@@ -1845,21 +1833,62 @@
 		{
 			if (endPos[axis] > 0)
 			{
-				float tmp = _tweenStart[axis] - _contentSize[axis] / 2;
+				float halfSize = GetLoopPartSize(2, axis);
+				float tmp = _tweenStart[axis] - halfSize;
 				if (tmp <= 0 && tmp >= -_overlapSize[axis])
 				{
-					endPos[axis] -= _contentSize[axis] / 2;
+					endPos[axis] -= halfSize;
 					_tweenStart[axis] = tmp;
 				}
 			}
 			else if (endPos[axis] < -_overlapSize[axis])
 			{
-				float tmp = _tweenStart[axis] + _contentSize[axis] / 2;
+				float halfSize = GetLoopPartSize(2, axis);
+				float tmp = _tweenStart[axis] + halfSize;
 				if (tmp <= 0 && tmp >= -_overlapSize.x)
 				{
-					endPos[axis] += _contentSize[axis] / 2;
+					endPos[axis] += halfSize;
 					_tweenStart[axis] = tmp;
 				}
+			}
+		}
+
+		void LoopCheckingNewPos(ref float value, int axis)
+		{
+			if (_overlapSize[axis] == 0)
+				return;
+
+			float pos = axis == 0 ? _xPos : _yPos;
+			bool changed = false;
+			if (value < 0.001f)
+			{
+				value += GetLoopPartSize(2, axis);
+				if (value > pos)
+				{
+					float v = GetLoopPartSize(6, axis);
+					v = Mathf.CeilToInt((value - pos) / v) * v;
+					pos = Mathf.Clamp(pos + v, 0, _overlapSize[axis]);
+					changed = true;
+				}
+			}
+			else if (value >= _overlapSize[axis])
+			{
+				value -= GetLoopPartSize(2, axis);
+				if (value < pos)
+				{
+					float v = GetLoopPartSize(6, axis);
+					v = Mathf.CeilToInt((pos - value) / v) * v;
+					pos = Mathf.Clamp(pos - v, 0, _overlapSize[axis]);
+					changed = true;
+				}
+			}
+
+			if (changed)
+			{
+				if (axis == 0)
+					_container.x = -(int)pos;
+				else
+					_container.y = -(int)pos;
 			}
 		}


User header value

User header value

--- Source/Snooze/ResourceResult.cs
+++ Source/Snooze/ResourceResult.cs
@@ -191,7 +191,7 @@
         {
             foreach (var header in _headers)
             {
-                context.HttpContext.Response.AppendHeader(header.Key, header.ToString());
+                context.HttpContext.Response.AppendHeader(header.Key, header.Value.ToString());
             }
         }


Settings are saved even when New disk dialog is canceled.

--- Source/VhdAttach/NewDiskForm.cs
+++ Source/VhdAttach/NewDiskForm.cs
@@ -28,12 +28,10 @@
         }

         private void Form_FormClosed(object sender, FormClosedEventArgs e) {
-            if (this.DialogResult == DialogResult.OK) {
-                Settings.LastSize = Convert.ToInt32(nudSize.Value);
-                Settings.LastSizeUnitIndex = dudSizeUnit.SelectedIndex;
-                Settings.LastSizeThousandBased = chbThousandSize.Checked;
-                Settings.LastSizeFixed = radFixed.Checked;
-            }
+            Settings.LastSize = Convert.ToInt32(nudSize.Value);
+            Settings.LastSizeUnitIndex = dudSizeUnit.SelectedIndex;
+            Settings.LastSizeThousandBased = chbThousandSize.Checked;
+            Settings.LastSizeFixed = radFixed.Checked;
         }

@@ -93,7 +91,7 @@
         private void control_Changed(object sender, EventArgs e) {
             var sizeInBytes = GetSizeInBytes();
             txtSizeInBytes.Text = string.Format(CultureInfo.CurrentCulture, "{0:#,##0}", sizeInBytes);
-
+
             var sizeInBytesOk = (sizeInBytes >= 8 * 1000 * 1000 / 4096 * 4096);
             if (sizeInBytesOk == false) {
                 erpError.SetError(btnOK, "Disk is too small.");


removed Language declaration (was hiding base class)

--- SimpleTmdbWrapper/Queries/MovieQuery.cs
+++ SimpleTmdbWrapper/Queries/MovieQuery.cs
@@ -8,8 +8,6 @@
     public class MovieQuery : Query<Tmdb.Movie>
     {
         public MovieAddons Addons { get; private set; }
-
-        public string Language { get; set; }

         public MovieQuery()
         {


Add more test cases

Add more test cases

--- src/Compilers/CSharp/Test/Semantic/SourceGeneration/GeneratorDriverTests_Attributes_FullyQualifiedName.cs
+++ src/Compilers/CSharp/Test/Semantic/SourceGeneration/GeneratorDriverTests_Attributes_FullyQualifiedName.cs
@@ -190,14 +190,16 @@
             step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Single()));
     }

-    [Fact]
-    public void FindAssemblyAttribute2()
+    [Theory]
+    [InlineData("")]
+    [InlineData("class WithoutAttributes { }")]
+    public void FindAssemblyAttribute2(string source2)
     {
         var source1 = @"
 using System;
 [assembly: CLSCompliant(true)]
 ";
-        var source2 = "";
+
         var parseOptions = TestOptions.RegularPreview;
         Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDll, parseOptions: parseOptions);

@@ -215,14 +217,16 @@
             step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.First()));
     }

-    [Fact]
-    public void FindAssemblyAttribute3()
+    [Theory]
+    [InlineData("")]
+    [InlineData("class WithoutAttributes { }")]
+    public void FindAssemblyAttribute3(string source1)
     {
         var source2 = @"
 using System;
 [assembly: CLSCompliant(true)]
 ";
-        var source1 = "";
+
         var parseOptions = TestOptions.RegularPreview;
         Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDll, parseOptions: parseOptions);


invert control

invert control

--- src/Features/CSharp/Portable/Completion/CompletionProviders/EnumAndCompletionListTagCompletionProvider.cs
+++ src/Features/CSharp/Portable/Completion/CompletionProviders/EnumAndCompletionListTagCompletionProvider.cs
@@ -144,35 +144,31 @@
             // as an 'int' type, not the enum type.

             // See if we're after a common enum-combining operator.
-            if (token.Kind() != SyntaxKind.BarToken &&
-                token.Kind() != SyntaxKind.AmpersandToken &&
-                token.Kind() != SyntaxKind.CaretToken)
-            {
-                return null;
-            }
-
-            // See if the type we're looking at is the underlying type for the enum we're contained in.
-            var containingType = semanticModel.GetEnclosingNamedType(token.SpanStart, cancellationToken);
-            if (containingType?.TypeKind != TypeKind.Enum ||
-                !type.Equals(containingType.EnumUnderlyingType))
-            {
-                return null;
-            }
-
-            // If so, walk back to the token before the operator token and see if it binds to a member
-            // of this enum.
-            var previousToken = token.GetPreviousToken();
-            var symbol = semanticModel.GetSymbolInfo(previousToken.Parent, cancellationToken).Symbol;
-
-            if (symbol?.Kind != SymbolKind.Field ||
-                !containingType.Equals(symbol.ContainingType))
-            {
-                return null;
-            }
-
-            // If so, then offer this as a place for enum completion for the enum we're currently
-            // inside of.
-            return containingType;
+            if (token.Kind() == SyntaxKind.BarToken ||
+                token.Kind() == SyntaxKind.AmpersandToken ||
+                token.Kind() == SyntaxKind.CaretToken)
+            {
+                // See if the type we're looking at is the underlying type for the enum we're contained in.
+                var containingType = semanticModel.GetEnclosingNamedType(token.SpanStart, cancellationToken);
+                if (containingType?.TypeKind == TypeKind.Enum &&
+                    type.Equals(containingType.EnumUnderlyingType))
+                {
+                    // If so, walk back to the token before the operator token and see if it binds to a member
+                    // of this enum.
+                    var previousToken = token.GetPreviousToken();
+                    var symbol = semanticModel.GetSymbolInfo(previousToken.Parent, cancellationToken).Symbol;
+
+                    if (symbol?.Kind == SymbolKind.Field &&
+                        containingType.Equals(symbol.ContainingType))
+                    {
+                        // If so, then offer this as a place for enum completion for the enum we're currently
+                        // inside of.
+                        return containingType;
+                    }
+                }
+            }
+
+            return null;
         }

         protected override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CancellationToken cancellationToken)


Updates shipment chain inventory task to correct GetAll variants issue.

--- src/Merchello.Core/Chains/ShipmentCreation/RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask.cs
+++ src/Merchello.Core/Chains/ShipmentCreation/RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask.cs
@@ -65,7 +65,11 @@
         {
             var trackableItems = Order.InventoryTrackedItems().Where(x => KeysToShip.Contains(x.Key)).ToArray();

-            var variants = _productVariantService.GetByKeys(trackableItems.Select(x => x.ExtendedData.GetProductVariantKey())).ToArray();
+            var trackableKeys = trackableItems.Select(x => x.ExtendedData.GetProductVariantKey()).ToArray();
+
+            var variants = trackableKeys.Any() ?
+                _productVariantService.GetByKeys(trackableKeys).ToArray() :
+                Enumerable.Empty<IProductVariant>().ToArray();

             if (variants.Any())
             {


Add win32 method back (win)

Add win32 method back (win)

--- src/ui/windows/TogglDesktop/TogglDesktop/EditForm.cs
+++ src/ui/windows/TogglDesktop/TogglDesktop/EditForm.cs
@@ -59,8 +59,7 @@
     public void SetWindowPos(bool onTop)
     {
         this.remainOnTop = onTop;
-        // FIXME: this seems to hang now:
-        // Win32.SetWindowPos(this.Handle, onTop ? Win32.HWND_TOPMOST : Win32.HWND_NOTOPMOST, 0, 0, 0, 0, Win32.SWP_NOMOVE | Win32.SWP_NOSIZE);
+        Win32.SetWindowPos(this.Handle, onTop ? Win32.HWND_TOPMOST : Win32.HWND_NOTOPMOST, 0, 0, 0, 0, Win32.SWP_NOMOVE | Win32.SWP_NOSIZE);
     }

     private void mouseDown(MouseEventArgs e)


Update Syncer.cs

Update Syncer.cs

--- src/GitHubSync/Syncer.cs
+++ src/GitHubSync/Syncer.cs
@@ -86,7 +86,7 @@
         return true;
     }

-    internal async Task<IEnumerable<UpdateResult>> Sync(
+    internal async Task<IReadOnlyList<UpdateResult>> Sync(
         Mapper diff,
         SyncOutput expectedOutput,
         IEnumerable<string> labelsToApplyOnPullRequests = null,
@@ -114,8 +114,11 @@
         return results;
     }

-    async Task<UpdateResult> ProcessUpdates(SyncOutput expectedOutput, IList<Tuple<Parts, IParts>> updatesPerOwnerRepositoryBranch,
-        string[] labels, string description)
+    async Task<UpdateResult> ProcessUpdates(
+        SyncOutput expectedOutput,
+        IList<Tuple<Parts, IParts>> updatesPerOwnerRepositoryBranch,
+        string[] labels,
+        string description)
     {
         var branchName = $"GitHubSync-{DateTimeOffset.UtcNow:yyyyMMdd-HHmmss}";
         var root = updatesPerOwnerRepositoryBranch.First().Item1.RootTreePart;
@@ -123,7 +126,11 @@
         string commitSha;

         var isCollaborator = await gateway.IsCollaborator(root.Owner, root.Repository);
-        if (!isCollaborator)
+        if (isCollaborator)
+        {
+            commitSha = await ProcessUpdatesInTargetRepository(root, updatesPerOwnerRepositoryBranch);
+        }
+        else
         {
             log("User is not a collaborator, need to create a fork");

@@ -133,10 +140,6 @@
             }

             commitSha = await ProcessUpdatesInFork(root, branchName, updatesPerOwnerRepositoryBranch);
-        }
-        else
-        {
-            commitSha = await ProcessUpdatesInTargetRepository(root, updatesPerOwnerRepositoryBranch);
         }

         if (expectedOutput == SyncOutput.CreateCommit)


issue 55, fixed title or description toast text truncating when building against 64 bit arch

--- src/Acr.UserDialogs.iOS/MessageBar/MessageView.cs
+++ src/Acr.UserDialogs.iOS/MessageBar/MessageView.cs
@@ -195,13 +195,13 @@
 			TitleColor.SetColor ();

 			var titleRectangle = new CGRect (xOffset, yOffset, titleLabelSize.Width, titleLabelSize.Height);
-			Title.DrawString (titleRectangle, TitleFont, UILineBreakMode.TailTruncation, UITextAlignment.Left);
+            Title.DrawString(titleRectangle, new UIStringAttributes { Font = TitleFont, ForegroundColor = TitleColor });
 			yOffset += titleLabelSize.Height;

 			CGSize descriptionLabelSize = DescriptionSize ();
 			DescriptionColor.SetColor ();
 			var descriptionRectangle = new CGRect (xOffset, yOffset, descriptionLabelSize.Width, descriptionLabelSize.Height);
-			Description.DrawString (descriptionRectangle, DescriptionFont, UILineBreakMode.TailTruncation, UITextAlignment.Left);
+            Description.DrawString(descriptionRectangle, new UIStringAttributes { Font = DescriptionFont, ForegroundColor = DescriptionColor });
 		}