#75 Support Array of concrete type for serialization

--- Tweetinvi/JsonExtensions.cs
+++ Tweetinvi/JsonExtensions.cs
@@ -90,18 +90,32 @@
             var type = typeof(T);
             object toSerialize = obj;

-            if (_getSerializableObject.ContainsKey(type))
+            var serializer = GetSerializer(type);
+
+            if (serializer != null)
             {
                 toSerialize = _getSerializableObject[type].GetSerializableObject(obj);
             }
             else if (obj is IEnumerable && type.IsGenericType)
             {
-                var enumerable = (IEnumerable)obj;
-                var genericType = type.GetGenericArguments()[0];
-                if (_getSerializableObject.ContainsKey(genericType))
-                {
+
+                Type genericType = null;
+
+                if (type.IsGenericType)
+                {
+                    genericType = type.GetGenericArguments()[0];
+                }
+                else if (typeof(Array).IsAssignableFrom(type))
+                {
+                    genericType = type.GetElementType();
+                }
+
+                serializer = GetSerializer(genericType);
+
+                if (serializer != null)
+                {
+                    var enumerable = (IEnumerable)obj;
                     var list = new List<object>();
-                    var serializer = _getSerializableObject[genericType];

                     foreach (var o in enumerable)
                     {


CSS updates 2

CSS updates 2

--- UpgradeIt/Views/Page.cshtml
+++ UpgradeIt/Views/Page.cshtml
@@ -113,10 +113,9 @@

-
CMS

-
Mobile

-
Software

-
Hosting

+
About

+
Disclaimer

+
Contact Us

Privacy Policy


Google Checkout is protocol-agnostic

Google Checkout is protocol-agnostic

--- Views/GoogleCheckout.cshtml
+++ Views/GoogleCheckout.cshtml
@@ -57,7 +57,7 @@
     }
 </script>

-<script src="http://checkout.google.com/files/digital/ga_post.js"
+<script src="//checkout.google.com/files/digital/ga_post.js"
   type="text/javascript">
 </script>        }
     }
@@ -118,8 +118,8 @@
     }
 @{
     var buttonUrl = String.Format(Model.UseSandbox ?
-        "http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id={0}" :
-        "http://checkout.google.com/buttons/checkout.gif?merchant_id={0}",
+        "//sandbox.google.com/checkout/buttons/checkout.gif?merchant_id={0}" :
+        "//checkout.google.com/buttons/checkout.gif?merchant_id={0}",
         Model.MerchantId);
     var width = isMini ? 160 : 180;
     var height = isMini ? 43 : 46;


Default layout title restored

Default layout title restored

--- Views/Shared/_Layout.cshtml
+++ Views/Shared/_Layout.cshtml
@@ -3,7 +3,7 @@
 <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>@ViewData["Title"] - WebApplicationJAM</title>
+    <title>@ViewData["Title"] - WebApplication</title>

     <environment names="Development">
         <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />


Bounds has nothing to do with it. It's scale, really

--- ViveGrip/Scripts/Grabber.cs
+++ ViveGrip/Scripts/Grabber.cs
@@ -83,7 +83,7 @@
   }

   Vector3 LocalAnchorPositionFor(ConfigurableJoint joint) {
-    return Vector3.Scale(joint.anchor, transform.GetComponent<Renderer>().bounds.size);
+    return Vector3.Scale(joint.anchor, transform.localScale);
   }

   GameObject InstantiateJointObject() {


prompt for api key first time plugin loaded

--- WakaTime/WakaTimePackage.cs
+++ WakaTime/WakaTimePackage.cs
@@ -67,7 +67,6 @@

             ObjDte = (DTE)GetService(typeof(DTE));
             _dteEvents = ObjDte.Events.DTEEvents;
-            _dteEvents.OnStartupComplete += OnOnStartupComplete;

             _isAsyncLoadSupported = this.IsAsyncPackageSupported();

@@ -99,6 +98,8 @@
                 await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

                 _isAsyncLoadSupported = this.IsAsyncPackageSupported();
+
+                OnOnStartupComplete();

                 return null;
             }).AsVsTask();
@@ -457,7 +458,6 @@
             _docEvents.DocumentSaved -= DocEventsOnDocumentSaved;
             _windowEvents.WindowActivated -= WindowEventsOnWindowActivated;
             _solutionEvents.Opened -= SolutionEventsOnOpened;
-            _dteEvents.OnStartupComplete -= OnOnStartupComplete;

             Timer.Stop();
             Timer.Elapsed -= ProcessHeartbeats;


Use GTK for OSX

Use GTK for OSX

--- WalletWasabi.Gui/Program.cs
+++ WalletWasabi.Gui/Program.cs
@@ -2,6 +2,7 @@
 using AvalonStudio.Shell;
 using System;
 using System.IO;
+using System.Runtime.InteropServices;
 using System.Threading.Tasks;
 using WalletWasabi.Gui.ViewModels;
 using WalletWasabi.Logging;
@@ -50,6 +51,14 @@
 			}
 		}

-		private static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>().UsePlatformDetect().UseReactiveUI();
+		private static AppBuilder BuildAvaloniaApp()
+		{
+			if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+			{
+				return AppBuilder.Configure<App>().UseGtk3().UseSkia().UseReactiveUI();
+			}
+
+			return AppBuilder.Configure<App>().UsePlatformDetect().UseReactiveUI();
+		}
 	}
 }


landing page fixed

landing page fixed

--- Web/Views/Home/Index.cshtml
+++ Web/Views/Home/Index.cshtml
@@ -26,14 +26,13 @@
     <link rel="stylesheet" href="../../assets/vendor/hamburgers/hamburgers.min.css">

     <link rel="stylesheet" href="../../assets/css/unify.css">
-
-    <link rel="stylesheet" href="../../assets/css/custom.css">

-
-

-

+
+

+

+

@@ -53,11 +52,11 @@

                                 @*<input id="inputGroup1_1" class="form-control u-form-control g-brd-white g-font-size-default g-placeholder-gray g-rounded-left-30 g-px-25 g-py-15" type="text" placeholder="Ask a question">
-

-                                    <button class="btn btn-primary g-font-size-18 g-rounded-right-30 g-px-25 g-py-15" type="submit">
-
-                                    </button>
-
*@
+

+                            <button class="btn btn-primary g-font-size-18 g-rounded-right-30 g-px-25 g-py-15" type="submit">
+
+                            </button>
+
*@

@@ -68,7 +67,9 @@

-
+

@@ -80,8 +81,6 @@

-
-


NativeStructs: apply TakeAshUtility.ToStringHelper

--- WpfUtility/NativeStructs.cs
+++ WpfUtility/NativeStructs.cs
@@ -1,8 +1,9 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Text;
-using System.Runtime.InteropServices;
+using TakeAshUtility;

 namespace WpfUtility.Native {

@@ -18,21 +19,26 @@
     [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     struct WINDOWPLACEMENT {
+
         public uint length;
+
+        [PrintMember("x4")]
         public uint flags;
+
+        [PrintMember]
         public SW showCmd;
+
+        [PrintMember]
         public POINT minPosition;
+
+        [PrintMember]
         public POINT maxPosition;
+
+        [PrintMember]
         public RECT normalPosition;

         public override string ToString() {
-            return String.Join(", ", new[] {
-                "flags:" + flags,
-                "showCmd:" + showCmd,
-                "minPosition:{" + minPosition + "}",
-                "maxPosition:{" + maxPosition + "}",
-                "normalPosition:{" + normalPosition + "}",
-            });
+            return this.MembersToString();
         }
     }

@@ -60,7 +66,11 @@
     [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     struct POINT {
+
+        [PrintMember]
         public int X;
+
+        [PrintMember]
         public int Y;

         public POINT(int x, int y) {
@@ -69,19 +79,24 @@
         }

         public override string ToString() {
-            return String.Join(", ", new[] {
-                "X:" + X,
-                "Y:" + Y,
-            });
+            return this.MembersToString();
         }
     }

     [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     struct RECT {
+
+        [PrintMember]
         public int Left;
+
+        [PrintMember]
         public int Top;
+
+        [PrintMember]
         public int Right;
+
+        [PrintMember]
         public int Bottom;

         public RECT(int left, int top, int right, int bottom) {
@@ -92,12 +107,7 @@
         }

         public override string ToString() {
-            return String.Join(", ", new[] {
-                "Left:" + Left,
-                "Top:" + Top,
-                "Right:" + Right,
-                "Bottom:" + Bottom,
-            });
+            return this.MembersToString();
         }
     }
 }


- whitespace

- whitespace

--- Packager/Program.cs
+++ Packager/Program.cs
@@ -115,7 +115,6 @@
                 new UriValidator(),
                 new MembersValidator()
             });
-

             container.RegisterSingleton<IObserverCollection>(()=>new ObserverCollection()
                 {


fix smart collection tests

fix smart collection tests


Return new list everytime

Return new list everytime


[trunk] Test13 on OSX now generates an application bundle since it's a GUI app

--- testpackages/Test13/dev/Test13.cs
+++ testpackages/Test13/dev/Test13.cs
@@ -1,9 +1,19 @@
 // Automatically generated by Opus v0.00
 namespace Test13
 {
-    // Define module classes here
     class QtApplication : C.Application
     {
+        public QtApplication()
+        {
+            this.UpdateOptions += delegate(Opus.Core.IModule module, Opus.Core.Target target) {
+                var osxLink = module.Options as C.ILinkerOptionsOSX;
+                if (osxLink != null)
+                {
+                    osxLink.ApplicationBundle = true;
+                }
+            };
+        }
+
         [Opus.Core.ModuleTargets(Platform=Opus.Core.EPlatform.Windows)]
         class Win32ResourceFile : C.Win32Resource
         {


Closes #3847.

Closes #3847.


When saving, don't create a cell object if it's not going to be used.

--- ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Save.cs
+++ ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Save.cs
@@ -3702,111 +3702,126 @@
                     var dataType = opCell.DataType;
                     var cellReference = (opCell.Address).GetTrimmedAddress();

-                    Cell cell;
+                    var isEmpty = opCell.IsEmpty(true);
+
+                    Cell cell = null;
                     if (cellsByReference.ContainsKey(cellReference))
+                    {
                         cell = cellsByReference[cellReference];
-                    else
+                        if (isEmpty)
+                        {
+                            cell.Remove();
+                        }
+                    }
+
+                    if (!isEmpty)
                     {
-                        cell = new Cell();
-                        cell.CellReference = new StringValue(cellReference);
-
-                        if (isNewRow)
-                            row.AppendChild(cell);
-                        else
+                        if (cell == null)
                         {
-                            var newColumn = XLHelper.GetColumnNumberFromAddress(cellReference);
-
-                            Cell cellBeforeInsert = null;
-                            int[] lastCo = {Int32.MaxValue};
-                            foreach (var c in mRows.Where(kp => kp.Key > newColumn).Where(c => lastCo[0] > c.Key))
-                            {
-                                cellBeforeInsert = c.Value;
-                                lastCo[0] = c.Key;
-                            }
-                            if (cellBeforeInsert == null)
+                            cell = new Cell();
+                            cell.CellReference = new StringValue(cellReference);
+
+                            if (isNewRow)
                                 row.AppendChild(cell);
                             else
-                                row.InsertBefore(cell, cellBeforeInsert);
+                            {
+                                var newColumn = XLHelper.GetColumnNumberFromAddress(cellReference);
+
+                                Cell cellBeforeInsert = null;
+                                int[] lastCo = { Int32.MaxValue };
+                                foreach (var c in mRows.Where(kp => kp.Key > newColumn).Where(c => lastCo[0] > c.Key))
+                                {
+                                    cellBeforeInsert = c.Value;
+                                    lastCo[0] = c.Key;
+                                }
+                                if (cellBeforeInsert == null)
+                                    row.AppendChild(cell);
+                                else
+                                    row.InsertBefore(cell, cellBeforeInsert);
+                            }
                         }
-                    }
-
-                    cell.StyleIndex = styleId;
-                    var formula = opCell.FormulaA1;
-                    if (opCell.HasFormula)
-                    {
-                        if (formula.StartsWith("{"))
+
+                        cell.StyleIndex = styleId;
+                        var formula = opCell.FormulaA1;
+                        if (opCell.HasFormula)
                         {
-                            formula = formula.Substring(1, formula.Length - 2);
-                            var f = new CellFormula {FormulaType = CellFormulaValues.Array};
-
-                            if (opCell.FormulaReference == null)
-                                opCell.FormulaReference = opCell.AsRange().RangeAddress;
-                            if (opCell.FormulaReference.FirstAddress.Equals(opCell.Address))
+                            if (formula.StartsWith("{"))
                             {
-                                f.Text = formula;
-                                f.Reference = opCell.FormulaReference.ToStringRelative();
+                                formula = formula.Substring(1, formula.Length - 2);
+                                var f = new CellFormula { FormulaType = CellFormulaValues.Array };
+
+                                if (opCell.FormulaReference == null)
+                                    opCell.FormulaReference = opCell.AsRange().RangeAddress;
+                                if (opCell.FormulaReference.FirstAddress.Equals(opCell.Address))
+                                {
+                                    f.Text = formula;
+                                    f.Reference = opCell.FormulaReference.ToStringRelative();
+                                }
+
+                                cell.CellFormula = f;
                             }
-
-                            cell.CellFormula = f;
+                            else
+                            {
+                                cell.CellFormula = new CellFormula();
+                                cell.CellFormula.Text = formula;
+                            }
+
+                            cell.CellValue = null;
                         }
                         else
                         {
-                            cell.CellFormula = new CellFormula();
-                            cell.CellFormula.Text = formula;
-                        }
-
-                        cell.CellValue = null;
-                    }
-                    else
-                    {
-                        cell.CellFormula = null;
-
-                        cell.DataType = opCell.DataType == XLCellValues.DateTime ? null : GetCellValue(opCell);
-
-                        var cellValue = new CellValue();
-                        if (dataType == XLCellValues.Text)
-                        {
-                            if (opCell.InnerText.Length == 0)
-                                cell.CellValue = null;
+                            cell.CellFormula = null;
+
+                            cell.DataType = opCell.DataType == XLCellValues.DateTime ? null : GetCellValue(opCell);
+
+                            if (dataType == XLCellValues.Text)
+                            {
+                                if (opCell.InnerText.Length == 0)
+                                    cell.CellValue = null;
+                                else
+                                {
+                                    if (opCell.ShareString)
+                                    {
+                                        var cellValue = new CellValue();
+                                        cellValue.Text = opCell.SharedStringId.ToString();
+                                        cell.CellValue = cellValue;
+                                    }
+                                    else
+                                    {
+                                        var text = opCell.GetString();
+                                        var t = new Text(text);
+                                        if (text.PreserveSpaces())
+                                            t.Space = SpaceProcessingModeValues.Preserve;
+
+                                        cell.InlineString = new InlineString { Text = t };
+                                    }
+                                }
+                            }
+                            else if (dataType == XLCellValues.TimeSpan)
+                            {
+                                var timeSpan = opCell.GetTimeSpan();
+                                var cellValue = new CellValue();
+                                cellValue.Text =
+                                    XLCell.BaseDate.Add(timeSpan).ToOADate().ToString(CultureInfo.InvariantCulture);
+                                cell.CellValue = cellValue;
+                            }
+                            else if (dataType == XLCellValues.DateTime || dataType == XLCellValues.Number)
+                            {
+                                if (!XLHelper.IsNullOrWhiteSpace(opCell.InnerText))
+                                {
+                                    var cellValue = new CellValue();
+                                    cellValue.Text = Double.Parse(opCell.InnerText).ToString(CultureInfo.InvariantCulture);
+                                    cell.CellValue = cellValue;
+                                }
+                            }
                             else
                             {
-                                if (opCell.ShareString)
-                                {
-                                    cellValue.Text = opCell.SharedStringId.ToString();
-                                    cell.CellValue = cellValue;
-                                }
-                                else
-                                {
-                                    var text = opCell.GetString();
-                                    var t = new Text(text);
-                                    if (text.PreserveSpaces())
-                                        t.Space = SpaceProcessingModeValues.Preserve;
-
-                                    cell.InlineString = new InlineString {Text = t};
-                                }
+                                var cellValue = new CellValue();
+                                cellValue.Text = opCell.InnerText;
+                                cell.CellValue = cellValue;
                             }
                         }
-                        else if (dataType == XLCellValues.TimeSpan)
-                        {
-                            var timeSpan = opCell.GetTimeSpan();
-                            cellValue.Text =
-                                XLCell.BaseDate.Add(timeSpan).ToOADate().ToString(CultureInfo.InvariantCulture);
-                            cell.CellValue = cellValue;
-                        }
-                        else if (dataType == XLCellValues.DateTime || dataType == XLCellValues.Number)
-                        {
-                            if (!XLHelper.IsNullOrWhiteSpace(opCell.InnerText))
-                                cellValue.Text = Double.Parse(opCell.InnerText).ToString(CultureInfo.InvariantCulture);
-                            cell.CellValue = cellValue;
-                        }
-                        else
-                        {
-                            cellValue.Text = opCell.InnerText;
-                            cell.CellValue = cellValue;
-                        }
                     }
-                    if (opCell.IsEmpty(true))
-                        cell.Remove();
                 }
                 xlWorksheet.Internals.CellsCollection.deleted.Remove(distinctRow);
             }


Add number formatted

Add number formatted

--- PaperBoy/Program.cs
+++ PaperBoy/Program.cs
@@ -113,7 +113,7 @@
       {
         if (OutsideWeekEnd())
         {
-          result = GetWebClientBinaries(url, fileName) ? string.Format("download ok and file saved in {0}\nThe size of the file is {1} bytes.", fileName,
+          result = GetWebClientBinaries(url, fileName) ? string.Format("download ok and file saved in {0}\nThe size of the file is {1:n0} bytes.", fileName,
              FileGetSize(fileName)) : "error while downloading";
         }
         else


Make copy more cancelable

Make copy more cancelable

--- PolygonMesh/Mesh.cs
+++ PolygonMesh/Mesh.cs
@@ -727,8 +727,7 @@
 		public void MergeMeshEdges(CancellationToken cancellationToken, Action<double, string> reportProgress = null)
 		{
 			HashSet<MeshEdge> markedForDeletion = new HashSet<MeshEdge>();
-			Stopwatch maxProgressReport = new Stopwatch();
-			maxProgressReport.Start();
+			Stopwatch maxProgressReport = Stopwatch.StartNew();

 			for (int i = 0; i < MeshEdges.Count; i++)
 			{
@@ -1195,11 +1194,21 @@
 			// This will add all the edges to the new mesh
 			Dictionary<int, int> meshEdgeIndexDictionary = GetMeshEdgeToIndexDictionary(edgesToCopy, newMesh);

+			if(cancellationToken.IsCancellationRequested)
+			{
+				return null;
+			}
+
 			progress?.Invoke(.2, "Copy Faces".Localize());
 			for (int faceIndex = 0; faceIndex < facesToCopy.Count; faceIndex++)
 			{
 				Face faceToCopy = facesToCopy[faceIndex];
 				newMesh.Faces.Add(new Face(newMesh));
+			}
+
+			if (cancellationToken.IsCancellationRequested)
+			{
+				return null;
 			}

 			// now set all the data for the new mesh
@@ -1217,6 +1226,11 @@
 				newVertex.Normal = vertexToCopy.Normal;
 			}

+			if (cancellationToken.IsCancellationRequested)
+			{
+				return null;
+			}
+
 			progress?.Invoke(.5, "Copy Edges".Localize());
 			newMesh.MeshEdges.Capacity = edgesToCopy.Capacity;
 			for (int meshEdgeIndex = 0; meshEdgeIndex < edgesToCopy.Count; meshEdgeIndex++)
@@ -1235,10 +1249,20 @@
 				//newMesh.MeshEdges.Add(newMeshEdge);
 			}

+			if (cancellationToken.IsCancellationRequested)
+			{
+				return null;
+			}
+
 			progress?.Invoke(.6, "Copy State".Localize());
 			newMesh.Faces.Capacity = facesToCopy.Capacity;
 			for (int faceIndex = 0; faceIndex < facesToCopy.Count; faceIndex++)
 			{
+				if (cancellationToken.IsCancellationRequested)
+				{
+					return null;
+				}
+
 				Face faceToCopy = facesToCopy[faceIndex];
 				Face newface = newMesh.Faces[faceIndex];


Clean code - added GetHashCode functions

--- KspCraftOrganizerPlugin/Services/CraftSortingHelper.cs
+++ KspCraftOrganizerPlugin/Services/CraftSortingHelper.cs
@@ -172,6 +172,11 @@
 			return this.function == c2.function;
 		}

+
+		public override int GetHashCode() {
+			return this.function.GetHashCode();
+		}
+
 		public bool isSame(ICraftSortFunction other) {
 			return this.Equals(other);
 		}
@@ -202,7 +207,12 @@
 				return this.tagGroupName == c2.tagGroupName;
 			}

+			public override int GetHashCode() {
+				return this.tagGroupName.GetHashCode();
+			}
+
 			public override string functionData { get { return tagGroupName; } }
+
 		}
 	}


Remove unused type

Remove unused type

--- agg/Platform/AggContext.cs
+++ agg/Platform/AggContext.cs
@@ -132,10 +132,5 @@
 			public string SystemWindowProvider { get; set; } = "MatterHackers.Agg.UI.WinformsSystemWindowProvider, agg_platform_win32";
 			public string SystemWindow { get; set; } = "MatterHackers.Agg.UI.BitmapSystemWindow, agg_platform_win32";
 		}
-
-		public class SliceEngineSettings
-		{
-			public bool RunInProcess { get; set; } = false;
-		}
 	}
 }


Implemented NULL/NOT NULL into migration system It was already there, but the SQL was not generated in the column definition

--- src/w_time/data/schema/Column.cs
+++ src/w_time/data/schema/Column.cs
@@ -76,9 +76,18 @@
                 definitionSQL.AppendFormat("IDENTITY({0},{1}) ", seed, increment);
             }

-            if(this.Default != null)
+            if (this.Default != null)
             {
                 definitionSQL.AppendFormat("DEFAULT \"{0}\" ", this.Default);
+            }
+
+            if (!this.IsNullable)
+            {
+                definitionSQL.Append(" NOT NULL ");
+            }
+            else
+            {
+                definitionSQL.Append(" NULL ");
             }

             if (this.IsPrimaryKey)


[PRaveen 4/7] was poplating Datauri instead of Data_Uri so now populating it now.

--- lib/commonAPI/mediacapture/ext/platform/wp8/src/Camera_impl.cs
+++ lib/commonAPI/mediacapture/ext/platform/wp8/src/Camera_impl.cs
@@ -45,7 +45,7 @@

             VideoBrush Rho_PhotoCameraBrush;
             Canvas Rho_PhotoCameraCanvas;
-            TextBox txtDebug = new TextBox();
+
             Grid Store_PreviousGridElements=new Grid();
             // Holds current flash mode.

@@ -120,6 +120,9 @@
             /// <param name="strId"> Front or Back camera</param>
             public void InitializeCameraProperties(string strId)
             {
+                double WidthofScreen = 0;
+                double HeightofScreen = 0;
+
                 CRhoRuntime.getInstance().logEvent("Camera class-->Entered InitializeCameraProperties ");
                 try
                 {
@@ -211,11 +214,24 @@
                 }
                 CameraRotation = new Dictionary<PageOrientation, Dictionary<string, double>>();

+                try
+                {
+                    WidthofScreen = Application.Current.Host.Content.ActualWidth;
+                    HeightofScreen = Application.Current.Host.Content.ActualHeight;
+                }
+                catch (Exception ex)
+                {
+                    MainPage.LayoutGrid().Dispatcher.BeginInvoke(delegate()
+                    {
+                        WidthofScreen = Application.Current.Host.Content.ActualWidth;
+                        HeightofScreen = Application.Current.Host.Content.ActualHeight;
+                    });
+                }
                 Dictionary<string, double> LandscapeLeft = new Dictionary<string, double>();

                 LandscapeLeft.Add("rotation", -90);
-                LandscapeLeft.Add("Height", Application.Current.Host.Content.ActualWidth);
-                LandscapeLeft.Add("Width", Application.Current.Host.Content.ActualHeight);
+                LandscapeLeft.Add("Height", WidthofScreen);
+                LandscapeLeft.Add("Width", HeightofScreen);
                 LandscapeLeft.Add("CameraType", 0);

                 CameraRotation.Add(PageOrientation.LandscapeLeft, LandscapeLeft);
@@ -224,8 +240,8 @@

                 Dictionary<string, double> LandscapeRight = new Dictionary<string, double>();
                 LandscapeRight.Add("rotation", 90);
-                LandscapeRight.Add("Height", Application.Current.Host.Content.ActualWidth);
-                LandscapeRight.Add("Width", Application.Current.Host.Content.ActualHeight);
+                LandscapeRight.Add("Height", WidthofScreen);
+                LandscapeRight.Add("Width", HeightofScreen);

                 CameraRotation.Add(PageOrientation.LandscapeRight, LandscapeRight);

@@ -233,16 +249,16 @@

                 Dictionary<string, double> PortraitDown = new Dictionary<string, double>();
                 PortraitDown.Add("rotation", 0);
-                PortraitDown.Add("Height", Application.Current.Host.Content.ActualHeight);
-                PortraitDown.Add("Width", Application.Current.Host.Content.ActualWidth);
+                PortraitDown.Add("Height", HeightofScreen);
+                PortraitDown.Add("Width", WidthofScreen);
                 PortraitDown.Add("front", -180);

                 CameraRotation.Add(PageOrientation.PortraitDown, PortraitDown);

                 Dictionary<string, double> PortraitUp = new Dictionary<string, double>();
                 PortraitUp.Add("rotation", 0);
-                PortraitUp.Add("Height", Application.Current.Host.Content.ActualHeight);
-                PortraitUp.Add("Width", Application.Current.Host.Content.ActualWidth);
+                PortraitUp.Add("Height", HeightofScreen);
+                PortraitUp.Add("Width", WidthofScreen);
                 PortraitUp.Add("front", 180);

                 CameraRotation.Add(PageOrientation.PortraitUp, PortraitUp);
@@ -980,10 +996,7 @@
                     m_Take_Picture_Output["image_format"] = string.Empty;
                     m_Take_Picture_Output["imageFormat"] = string.Empty;
                 }
-                new Thread(() =>
-                {
-                    m_StoreTakePictureResult.set(m_Take_Picture_Output);
-                }).Start();
+                m_StoreTakePictureResult.set(m_Take_Picture_Output);
             }

             protected AudioVideoCaptureDevice Device { get; set; }
@@ -1003,7 +1016,7 @@
                     Rho_PhotoCameraCanvas.Dispatcher.BeginInvoke(delegate()
                     {
                         // Write message.
-                        txtDebug.Text = "Camera initialized.";
+
                         Rho_StillCamera.FlashMode = Rho_FlashMode;
                         try
                         {
@@ -1028,10 +1041,7 @@
                     m_Take_Picture_Output["message"] = e.Exception.Message;
                     m_Take_Picture_Output["image_format"] = string.Empty;
                     m_Take_Picture_Output["imageFormat"] = string.Empty;
-                    new Thread(() =>
-                    {
-                        m_StoreTakePictureResult.set(m_Take_Picture_Output);
-                    }).Start();
+                    m_StoreTakePictureResult.set(m_Take_Picture_Output);
                 }
             }

@@ -1179,10 +1189,11 @@
                 wb.SaveJpeg(outputStream, wb.PixelWidth, wb.PixelHeight, 0, 100);
                 outputStream.Close();
                 TakePicture_output["imageUri"] = storageFile.Name;
-                new Thread(() =>
-                {
-                    StoreTakePictureResult.set(TakePicture_output);
-                }).Start();
+                TakePicture_output["image_uri"] = storageFile.Name;
+
+                StoreTakePictureResult.set(TakePicture_output);
+
+
             }

             /// <summary>
@@ -1223,7 +1234,7 @@

                         string returnablevalue = "";
                         m_Take_Picture_Output["status"] = "ok";
-                        m_Take_Picture_Output["imageUri"] = returnablevalue;
+
                         m_Take_Picture_Output["imageHeight"] = PictDetails.Height.ToString();
                         m_Take_Picture_Output["imageWidth"] = PictDetails.Width.ToString();

@@ -1258,11 +1269,9 @@

                                 returnablevalue = "data:image/jpeg;base64," + strbase64;
                                 m_Take_Picture_Output["image_uri"] = returnablevalue;
+                                m_Take_Picture_Output["imageUri"] = returnablevalue;
                                 e.ImageStream.Close();
-                                new Thread(() =>
-                                {
-                                    m_StoreTakePictureResult.set(m_Take_Picture_Output);
-                                }).Start();
+                                m_StoreTakePictureResult.set(m_Take_Picture_Output);
                             }
                         }
                         catch (Exception ex)
@@ -1283,10 +1292,7 @@
                         m_Take_Picture_Output["image_format"] = string.Empty;
                         m_Take_Picture_Output["imageFormat"] = string.Empty;
                         e.ImageStream.Close();
-                        new Thread(() =>
-                        {
-                            m_StoreTakePictureResult.set(m_Take_Picture_Output);
-                        }).Start();
+                        m_StoreTakePictureResult.set(m_Take_Picture_Output);
                     }

                 });
@@ -1668,18 +1674,19 @@
                         catch (Exception ex)
                         {
                             CRhoRuntime.getInstance().logEvent("Camera class-->Not an Image");
+                            m_choosePicture_output["imageUri"] = ReturnValue;
+                            m_choosePicture_output["image_uri"] = ReturnValue;
+                            m_StorechoosePictureResult.set(m_choosePicture_output);
                         }
-                        m_choosePicture_output["imageUri"] = ReturnValue;
+
                     }
                     else
                     {
                         m_choosePicture_output["status"] = "cancel";
                         m_choosePicture_output["image_format"] = string.Empty;
                         m_choosePicture_output["imageFormat"] = string.Empty;
-                        new Thread(() =>
-                        {
-                            m_StorechoosePictureResult.set(m_choosePicture_output);
-                        }).Start();
+                        m_StorechoosePictureResult.set(m_choosePicture_output);
+
                     }
                 }
                 catch (Exception ex)
@@ -1688,10 +1695,7 @@
                     m_choosePicture_output["status"] = "error";
                     m_choosePicture_output["message"] = ex.Message;
                     m_choosePicture_output["image_format"] = string.Empty;
-                    new Thread(() =>
-                    {
-                        m_StorechoosePictureResult.set(m_choosePicture_output);
-                    }).Start();
+                    m_StorechoosePictureResult.set(m_choosePicture_output);
                 }

@@ -1768,10 +1772,10 @@

                 choosePicture_output["imageUri"] = storageFile.Name;
-                new Thread(() =>
-                {
-                    StorechoosePictureResult.set(choosePicture_output);
-                }).Start();
+                choosePicture_output["image_uri"] = storageFile.Name;
+                StorechoosePictureResult.set(choosePicture_output);
+
+
             }

             /// <summary>


Cameras default to monochrome rather than bayer.

--- cs/libpsinc/src/Camera.cs
+++ cs/libpsinc/src/Camera.cs
@@ -184,9 +184,9 @@

 		/// <summary>
-		/// True if the camera has a monochrome imaging chip, otherwise false.
-		/// </summary>
-		protected bool monochrome = false;
+		/// True if the camera has a bayer encoding imaging chip, otherwise false.
+		/// </summary>
+		protected bool bayer = false;

 		/// <summary>
@@ -382,9 +382,6 @@
 		/// chip type and colour depth on the specified bus with a given camera serial number.
 		///
 		/// </summary>
-		/// <param name="type">string describing the imaging chip present in the connected hardware</param>
-		/// <param name="monochrome">If set to <c>true</c> the imaging chip in the hardware is monochrome, otherwise it is a bayer-colour chip.</param>
-		/// <param name="supplementary">Supplementary XML defining any connected Devices.</param>
 		/// <param name="serial">Serial number of the camera to connect to as a regular expression.
 	 	/// If empty the Camera will connect to the first available camera on the specified bus.</param>
 		/// <param name="bus">Bus ID to find the device on. If set to zero, the acquirer will look for the first device with a
@@ -418,7 +415,7 @@

 					if (this.transport.Connected)
 					{
-						var colour	= this.monochrome ? ColourMode.Monochrome : this.Colour ? ColourMode.BayerColour : ColourMode.BayerGrey;
+						var colour	= this.bayer ? (this.Colour ? ColourMode.BayerColour : ColourMode.BayerGrey) : ColourMode.Monochrome;
 						image		= this.Capture(this.Mode, colour, this.Flash);
 					}
 					else this.transport.Initialise();
@@ -505,7 +502,7 @@
 							default:	cameraType = Camera.defaultType;	break;
 						}

-						this.monochrome = (description[2] & 0x01) > 0;
+						this.bayer = (description[2] & 0x01) == 0;
 					}

 					int count	= description[header + 1];


try catches catch things

try catches catch things


Updated delete/undelete methods to handle unmanaged objects.


Added new RSAAsymetricKey (byte[] cspBlob) ctor

--- RSAAsymmetricKey.cs
+++ RSAAsymmetricKey.cs
@@ -38,74 +38,19 @@
 		{
 		}

+		public RSAAsymmetricKey (byte[] cspBlob)
+		{
+			using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
+			{
+				rsa.ImportCspBlob (cspBlob);
+
+				ImportRSAParameters (rsa.ExportParameters (true));
+			}
+		}
+
 		public RSAAsymmetricKey (RSAParameters parameters)
 		{
-			int len = 0;
-			len += (parameters.D != null) ? parameters.D.Length : 0;
-			len += (parameters.DP != null) ? parameters.DP.Length : 0;
-			len += (parameters.DQ != null) ? parameters.DQ.Length : 0;
-			len += (parameters.InverseQ != null) ? parameters.InverseQ.Length : 0;
-			len += (parameters.P != null) ? parameters.P.Length : 0;
-			len += (parameters.Q != null) ? parameters.Q.Length : 0;
-
-			while ((len % 16) != 0)
-				len++;
-
-			if (len != 0)
-				this.privateKey = new byte[len];
-
-			int index = 0;
-			if (parameters.D != null)
-			{
-				Buffer.BlockCopy (parameters.D, 0, this.privateKey, index, parameters.D.Length);
-				this.d = new ArraySegment<byte> (this.privateKey, index, parameters.D.Length);
-				index += parameters.D.Length;
-			}
-
-			if (parameters.DP != null)
-			{
-				Buffer.BlockCopy (parameters.DP, 0, this.privateKey, index, parameters.DP.Length);
-				this.dp = new ArraySegment<byte> (this.privateKey, index, parameters.DP.Length);
-				index += parameters.DP.Length;
-			}
-
-			if (parameters.DQ != null)
-			{
-				Buffer.BlockCopy (parameters.DQ, 0, this.privateKey, index, parameters.DQ.Length);
-				this.dq = new ArraySegment<byte> (this.privateKey, index, parameters.DQ.Length);
-				index += parameters.DQ.Length;
-			}
-
-			if (parameters.InverseQ != null)
-			{
-				Buffer.BlockCopy (parameters.InverseQ, 0, this.privateKey, index, parameters.InverseQ.Length);
-				this.iq = new ArraySegment<byte> (this.privateKey, index, parameters.InverseQ.Length);
-				index += parameters.InverseQ.Length;
-			}
-
-			if (parameters.P != null)
-			{
-				Buffer.BlockCopy (parameters.P, 0, this.privateKey, index, parameters.P.Length);
-				this.p = new ArraySegment<byte> (this.privateKey, index, parameters.P.Length);
-				index += parameters.P.Length;
-			}
-
-			if (parameters.Q != null)
-			{
-				Buffer.BlockCopy (parameters.Q, 0, this.privateKey, index, parameters.Q.Length);
-				this.q = new ArraySegment<byte> (this.privateKey, index, parameters.Q.Length);
-				index += parameters.Q.Length;
-			}
-
-			if (this.privateKey != null)
-				ProtectedMemory.Protect (this.privateKey, MemoryProtectionScope.SameProcess);
-
-			this.publicKey = new byte[parameters.Modulus.Length + parameters.Exponent.Length];
-			Buffer.BlockCopy (parameters.Modulus, 0, this.publicKey, 0, parameters.Modulus.Length);
-			Buffer.BlockCopy (parameters.Exponent, 0, this.publicKey, parameters.Modulus.Length, parameters.Exponent.Length);
-			this.exponentOffset = parameters.Modulus.Length;
-
-			SetupSignature();
+			ImportRSAParameters (parameters);
 		}

 		public RSAAsymmetricKey (IValueReader reader)
@@ -414,6 +359,76 @@
 			using (SHA1CryptoServiceProvider sha = new SHA1CryptoServiceProvider())
 				PublicSignature = sha.ComputeHash (this.publicKey);
 		}
+
+		private void ImportRSAParameters (RSAParameters parameters)
+		{
+			int len = 0;
+			len += (parameters.D != null) ? parameters.D.Length : 0;
+			len += (parameters.DP != null) ? parameters.DP.Length : 0;
+			len += (parameters.DQ != null) ? parameters.DQ.Length : 0;
+			len += (parameters.InverseQ != null) ? parameters.InverseQ.Length : 0;
+			len += (parameters.P != null) ? parameters.P.Length : 0;
+			len += (parameters.Q != null) ? parameters.Q.Length : 0;
+
+			while ((len % 16) != 0)
+				len++;
+
+			if (len != 0)
+				this.privateKey = new byte[len];
+
+			int index = 0;
+			if (parameters.D != null)
+			{
+				Buffer.BlockCopy (parameters.D, 0, this.privateKey, index, parameters.D.Length);
+				this.d = new ArraySegment<byte> (this.privateKey, index, parameters.D.Length);
+				index += parameters.D.Length;
+			}
+
+			if (parameters.DP != null)
+			{
+				Buffer.BlockCopy (parameters.DP, 0, this.privateKey, index, parameters.DP.Length);
+				this.dp = new ArraySegment<byte> (this.privateKey, index, parameters.DP.Length);
+				index += parameters.DP.Length;
+			}
+
+			if (parameters.DQ != null)
+			{
+				Buffer.BlockCopy (parameters.DQ, 0, this.privateKey, index, parameters.DQ.Length);
+				this.dq = new ArraySegment<byte> (this.privateKey, index, parameters.DQ.Length);
+				index += parameters.DQ.Length;
+			}
+
+			if (parameters.InverseQ != null)
+			{
+				Buffer.BlockCopy (parameters.InverseQ, 0, this.privateKey, index, parameters.InverseQ.Length);
+				this.iq = new ArraySegment<byte> (this.privateKey, index, parameters.InverseQ.Length);
+				index += parameters.InverseQ.Length;
+			}
+
+			if (parameters.P != null)
+			{
+				Buffer.BlockCopy (parameters.P, 0, this.privateKey, index, parameters.P.Length);
+				this.p = new ArraySegment<byte> (this.privateKey, index, parameters.P.Length);
+				index += parameters.P.Length;
+			}
+
+			if (parameters.Q != null)
+			{
+				Buffer.BlockCopy (parameters.Q, 0, this.privateKey, index, parameters.Q.Length);
+				this.q = new ArraySegment<byte> (this.privateKey, index, parameters.Q.Length);
+				index += parameters.Q.Length;
+			}
+
+			if (this.privateKey != null)
+				ProtectedMemory.Protect (this.privateKey, MemoryProtectionScope.SameProcess);
+
+			this.publicKey = new byte[parameters.Modulus.Length + parameters.Exponent.Length];
+			Buffer.BlockCopy (parameters.Modulus, 0, this.publicKey, 0, parameters.Modulus.Length);
+			Buffer.BlockCopy (parameters.Exponent, 0, this.publicKey, parameters.Modulus.Length, parameters.Exponent.Length);
+			this.exponentOffset = parameters.Modulus.Length;
+
+			SetupSignature();
+		}
 	}
 	#endif
 }


Precompute RantPattern tokens for huge perf boost

RantPattern's constructor uses GenerateTokens to split the given pattern into
a lazy sequence of lexer tokens. When RantEngine.Do is called, it creates a
new VM, which creates a new RantState, which creates a new PatternReader,
which finally evaluates the given pattern's token sequence using .ToArray().
However, the results of the evaluation are not cached (IEnumerable won't do
that automatically). This makes using RantPattern.FromString/FromFile mostly
useless, since the pattern is parsed again and again for each iteration.

The performance issue is fixed by calling .ToList() after GenerateTokens in
RantPattern's constructor. This change improves pattern evaluation performance
by at least 15-25x in synthetic benchmarks.

--- Rant/RantPattern.cs
+++ Rant/RantPattern.cs
@@ -1,8 +1,7 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.IO;
+using System.Linq;

-using Rant.Engine;
 using Rant.Engine.Compiler;
 using Rant.Engine.Constructs;
 using Rant.Stringes;
@@ -54,7 +53,7 @@
             _type = type;
             _code = code;
             _stringe = code.ToStringe();
-            _tokens = RantLexer.GenerateTokens(_stringe);
+            _tokens = RantLexer.GenerateTokens(_stringe).ToList();
         }

         internal RantPattern(RantPattern derived, IEnumerable<Token<R>> sub)


test 13:23

test 13:23

--- RawPack/Packager.cs
+++ RawPack/Packager.cs
@@ -1,6 +1,6 @@
 // --------------------------------------------------------------------------------------------------------------------
 // <copyright file="Packager.cs" company="">
-//   Copyright (c) Carl Lewis. All rights reserved.
+//   Copyright (c) Carl Lewis. All rights reserved.
 // </copyright>
 // <summary>
 //   Packages RAW files such that they may be uploaded to Flickr.


Task Scheduler Fixes

Task Scheduler Fixes

Removed the task from being hidden
Added prompt to replace scheduled task if it is already there

--- letsencrypt-win-simple/Program.cs
+++ letsencrypt-win-simple/Program.cs
@@ -415,34 +415,42 @@

             using (var taskService = new TaskService())
             {
+                bool addTask = true;
                 if (settings.ScheduledTaskName == taskName)
                 {
+                    addTask = false;
+                    Console.WriteLine($"\nDo you want to replace the existing {taskName} task? (Y/N) ");
+                    if (!PromptYesNo())
+                        return;
+                    addTask = true;
                     Console.WriteLine($" Deleting existing Task {taskName} from Windows Task Scheduler.");
                     taskService.RootFolder.DeleteTask(taskName, false);
                 }

-                Console.WriteLine($" Creating Task {taskName} with Windows Task Scheduler at 9am every day.");
-
-                // Create a new task definition and assign properties
-                var task = taskService.NewTask();
-                task.RegistrationInfo.Description = "Check for renewal of ACME certificates.";
-
-                var now = DateTime.Now;
-                var runtime = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0);
-                task.Triggers.Add(new DailyTrigger { DaysInterval = 1, StartBoundary = runtime });
-
-                var currentExec = Assembly.GetExecutingAssembly().Location;
-
-                // Create an action that will launch Notepad whenever the trigger fires
-                task.Actions.Add(new ExecAction(currentExec, $"--renew --baseuri \"{BaseURI}\"", Path.GetDirectoryName(currentExec)));
-
-                task.Principal.RunLevel = TaskRunLevel.Highest; // need admin
-                task.Settings.Hidden = true; // don't pop up a command prompt every day
-
-                // Register the task in the root folder
-                taskService.RootFolder.RegisterTaskDefinition(taskName, task);
-
-                settings.ScheduledTaskName = taskName;
+                if (addTask == true)
+                {
+                    Console.WriteLine($" Creating Task {taskName} with Windows Task Scheduler at 9am every day.");
+
+                    // Create a new task definition and assign properties
+                    var task = taskService.NewTask();
+                    task.RegistrationInfo.Description = "Check for renewal of ACME certificates.";
+
+                    var now = DateTime.Now;
+                    var runtime = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0);
+                    task.Triggers.Add(new DailyTrigger { DaysInterval = 1, StartBoundary = runtime });
+
+                    var currentExec = Assembly.GetExecutingAssembly().Location;
+
+                    // Create an action that will launch the app with the renew paramaters whenever the trigger fires
+                    task.Actions.Add(new ExecAction(currentExec, $"--renew --baseuri \"{BaseURI}\"", Path.GetDirectoryName(currentExec)));
+
+                    task.Principal.RunLevel = TaskRunLevel.Highest; // need admin
+
+                    // Register the task in the root folder
+                    taskService.RootFolder.RegisterTaskDefinition(taskName, task);
+
+                    settings.ScheduledTaskName = taskName;
+                }
             }
         }


サンプル追加

サンプル追加

--- csharp/SampleBot/ApiSamples/Program.cs
+++ csharp/SampleBot/ApiSamples/Program.cs
@@ -29,7 +29,7 @@
                 Console.WriteLine("文章類似度計算: 4");
                 Console.WriteLine("顔検出: 5");
                 Console.WriteLine("感情検出: 6");
-
+                Console.WriteLine("対話: 7");
                 Console.WriteLine("終了: 999");
                 Console.Write(":");
                 var command = Console.ReadLine();
@@ -89,6 +89,20 @@
                         Console.WriteLine("驚き: " + resultEmotionDetect.First().Scores.Surprise);
                         Console.WriteLine("幸福: " + resultEmotionDetect.First().Scores.Happiness);
                         break;
+                    case "7":
+                        Console.WriteLine("対話API 対話モード(DialogueAsync) 開始");
+                        var resultDialogue1 = DialogueAsync(_docomoApiKey).Result.Result;
+                        Console.WriteLine(resultDialogue1);
+
+                        Console.WriteLine("対話API しりとりモード-連続的な対話を行うケース(DialogueModeSrtrAsync) 開始");
+                        var resultDialogue2 = DialogueModeSrtrAsync(_docomoApiKey).Result;
+                        Console.WriteLine(string.Join(">", resultDialogue2));
+
+
+                        Console.WriteLine("対話API 対話モード-ユーザーの情報を追加したケース-赤ちゃん風(DialogueUserAsync) 開始");
+                        var resultDialogue3 = DialogueUserAsync(_docomoApiKey).Result.Result;
+                        Console.WriteLine(resultDialogue3);
+                        break;
                     default:
                         Console.WriteLine("そのようなコマンドはありません");
                         break;
@@ -133,6 +147,53 @@
             var text2 = "今日は電車で公園に行きました";
             var client = new Similarity(docomoApiKey);
             var result = await client.ExecAsync(text1, text2);
+            return result;
+        }
+
+        private static async Task<Dialogue.ResultSet> DialogueAsync(string docomoApiKey) {
+            var text = "おはよう、こんにちは、こんばんわ。";
+            var client = new Dialogue(docomoApiKey);
+            var result = await client.ExecAsync(text);
+            return result;
+        }
+
+        private static async Task<List<string>> DialogueModeSrtrAsync(string docomoApiKey) {
+            var srtr = new List<string>();
+
+            var text = "さくら";
+            srtr.Add(text);
+            var client = new Dialogue(docomoApiKey);
+            var result = await client.ExecAsync(text, mode:Dialogue.DialogueMode.SRTR);
+            srtr.Add(result.Result);
+
+            text = "適当な文字";
+            srtr.Add(text);
+            //resultのIDを渡して対話を続ける
+            result = await client.ExecAsync(text, mode: Dialogue.DialogueMode.SRTR, id:result.ID);
+            srtr.Add(result.Result);
+
+            return srtr;
+        }
+
+        private static async Task<Dialogue.ResultSet> DialogueUserAsync(string docomoApiKey) {
+            var text = "こんにちは";
+            var user = new Dialogue.UserInfo();
+            //これらの情報は全てオプションなのですべて指定する必要はない
+
+            user.BirthDay = new DateTime(1996, 1, 31);
+            //誕生日から年齢と星座を変換
+            user.ConverBirthDayToAge();
+            user.ConvertBirthDayToConstellations();
+            user.NickName = "舞黒花子";
+            user.NickNameYomi = "マイクロハナコ";
+            //地域名を指定しているがここの天気は？と聞いても何故か場所を教えろと答えるので意味が無いかも（APIコンソールも同様）
+            user.Place = "東京";
+            //Dialogue.Areas に利用可能な地域一覧が格納されている
+            user.Sex = Dialogue.Sex.MALE;
+            user.BloodType = Dialogue.BloodType.A;
+
+            var client = new Dialogue(docomoApiKey);
+            var result = await client.ExecAsync(text, user:user, characterId:30);
             return result;
         }


slight modification to include accounting for uri creation in the group afiliation controller

--- src/EPiServer.SocialAlloy.Web/Social/Controllers/MembershipAffiliationBlockController.cs
+++ src/EPiServer.SocialAlloy.Web/Social/Controllers/MembershipAffiliationBlockController.cs
@@ -51,7 +51,7 @@
                 {
                     var memberFilter = new SocialMemberFilter
                     {
-                        UserId = userId,
+                        UserId = userRepository.CreateAuthenticatedUri(userId),
                         PageSize = currentBlock.DisplayPageSize
                     };
                     var listOfSocialMembers = this.memberRepository.Get(memberFilter);


Fix disabled breakpoints being hit.

Fix disabled breakpoints being hit.

--- src/MonoDevelop.PowerShell/MonoDevelop.PowerShell.Debugging/PowerShellDebuggerSession.cs
+++ src/MonoDevelop.PowerShell/MonoDevelop.PowerShell.Debugging/PowerShellDebuggerSession.cs
@@ -153,11 +153,13 @@

 		async Task UpdateBreakpoints (string fileName, IEnumerable<Breakpoint> breakpointsForFile)
 		{
+			var enabledBreakpoints = breakpointsForFile.Where (breakpoint => breakpoint.Enabled);
+
 			var message = new SetBreakpointsRequestArguments {
 				Source = new Source {
 					Path = fileName
 				},
-				Breakpoints = breakpointsForFile.Select (CreateSourceBreakpoint).ToArray ()
+				Breakpoints = enabledBreakpoints.Select (CreateSourceBreakpoint).ToArray ()
 			};
 			await debugClient.SendRequest (SetBreakpointsRequest.Type, message);


camera is now public

camera is now public

--- raytracer/raytracer/core/Camera.cs
+++ raytracer/raytracer/core/Camera.cs
@@ -7,7 +7,7 @@
     ///     A camera may also use lens.
     ///     <seealso cref="Film" />
     /// </summary>
-    internal abstract class Camera
+    public abstract class Camera
     {
         /// <summary>
         ///     Generate a ray from a camera sample


Fixes repo browser 404 issue

Fixes repo browser 404 issue

--- src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/BrowseRepository.aspx.cs
+++ src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/BrowseRepository.aspx.cs
@@ -49,7 +49,7 @@

             iframeGen.Text =
                 string.Format(
-                    "",
+                    "",
                     url, repoGuid, category, Request.ServerVariables["SERVER_NAME"],
                     Request.ServerVariables["SERVER_PORT"], IOHelper.ResolveUrl(SystemDirectories.Umbraco),
                     IOHelper.ResolveUrl(SystemDirectories.Umbraco).Trim('/'), repoGuid,


Fix release build

Fix release build

--- src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/LValueFlowCapturesProvider.cs
+++ src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/LValueFlowCapturesProvider.cs
@@ -1,12 +1,15 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

-using System.Collections.Generic;
 using System.Collections.Immutable;
-using System.Diagnostics;
-using System.Linq;
 using System.Runtime.CompilerServices;
 using Analyzer.Utilities.Extensions;
 using Analyzer.Utilities.PooledObjects;
+
+#if DEBUG
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+#endif

 namespace Microsoft.CodeAnalysis.FlowAnalysis.DataFlow
 {


Fix merge

Fix merge

--- src/VisualStudio/Core/Def/Implementation/LanguageClient/LiveShareLanguageServerClient.cs
+++ src/VisualStudio/Core/Def/Implementation/LanguageClient/LiveShareLanguageServerClient.cs
@@ -27,4 +27,6 @@
         {
         }
     }
+
+    public override string Name => ServicesVSResources.Live_Share_CSharp_Visual_Basic_Language_Server_Client;
 }


Add editorconfig setting

Add editorconfig setting

--- src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CodeStyle/CodeStyleOptions2.cs
+++ src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CodeStyle/CodeStyleOptions2.cs
@@ -351,8 +351,8 @@
         public static readonly PerLanguageOption2<CodeStyleOption2<bool>> PreferNamespaceMatchFolderStructure = CreateOption(
             CodeStyleOptionGroups.ExpressionLevelPreferences, nameof(PreferNamespaceMatchFolderStructure),
             defaultValue: TrueWithSuggestionEnforcement,
-            storageLocations: new OptionStorageLocation2[] {
-                new RoamingProfileStorageLocation($"TextEditor.%LANGUAGE%.Specific.{nameof(PreferNamespaceMatchFolderStructure)}")});
+            editorconfigKeyName: "dotnet_style_namespace_match_folder",
+            roamingProfileStorageKeyName: $"TextEditor.%LANGUAGE%.Specific.{nameof(PreferNamespaceMatchFolderStructure)}");

         static CodeStyleOptions2()
         {


Fix - Passato oggetto giusto alla notifica SignalR dopo la composizione Partenza

--- src/backend/SO115App.SignalR/Sender/ComposizionePartenza/NotificationConfermaPartenze.cs
+++ src/backend/SO115App.SignalR/Sender/ComposizionePartenza/NotificationConfermaPartenze.cs
@@ -74,7 +74,9 @@
             boxInterventi = (BoxInterventi)this._BoxRichiestehandler.Handle(BoxRichiestequery).BoxRichieste;
             boxMezzi = (BoxMezzi)this._BoxMezzihandler.Handle(BoxMezziquery).BoxMezzi;

-            await _notificationHubContext.Clients.Group(conferma.ConfermaPartenze.CodiceSede).SendAsync("ModifyAndNotifySuccess", sintesi);
+            conferma.ConfermaPartenze.Chiamata = sintesi;
+
+            await _notificationHubContext.Clients.Group(conferma.ConfermaPartenze.CodiceSede).SendAsync("ModifyAndNotifySuccess", conferma.ConfermaPartenze);
             await _notificationHubContext.Clients.Group(conferma.ConfermaPartenze.CodiceSede).SendAsync("NotifyGetBoxInterventi", boxInterventi);
             await _notificationHubContext.Clients.Group(conferma.ConfermaPartenze.CodiceSede).SendAsync("NotifyGetBoxMezzi", boxMezzi);
         }


Better example of scoped properties in console sample

--- samples/Elmah.Io.NLog.Console/Program.cs
+++ samples/Elmah.Io.NLog.Console/Program.cs
@@ -23,9 +23,11 @@
             infoMessage.Properties.Add("Some list", new[] { 1, 2, 3 });
             log.Info(infoMessage);

-            // Decorate all log messages in this thread with a custom property
-            MappedDiagnosticsContext.Set("application", "Thread app");
-            log.Trace("This is a trace message");
+            // Decorate all log messages within this scope with a custom property
+            using (log.PushScopeProperty("application", "Thread app"))
+            {
+                log.Trace("This is a trace message");
+            }

             // Example of using structured logging. {user} will go into the User field on elmah.io
             log.Info("This is info with some structured logging: {quote} from {user}", "Hasta la vista, baby", "Arnold Schwarzenegger");


All configuration of default timeout for Plug instances.

--- src/mindtouch.dream/plug/Plug.cs
+++ src/mindtouch.dream/plug/Plug.cs
@@ -76,8 +76,14 @@
         private static log4net.ILog _log = LogUtils.CreateLog();
         private static List<IPlugEndpoint> _endpoints = new List<IPlugEndpoint>();

-        //--- Class Constructors ---
+        //--- Class Constructor ---
         static Plug() {
+
+            // read custom timeout value to use as default for plugs from app settings
+            double defaultTimeout;
+            if(double.TryParse(System.Configuration.ConfigurationManager.AppSettings["plug-default-timeout"], out defaultTimeout)) {
+                DEFAULT_TIMEOUT = TimeSpan.FromSeconds(defaultTimeout);
+            }

             // let's find all IPlugEndpoint derived, concrete classes
             foreach(Type type in typeof(Plug).Assembly.GetTypes()) {


Fix login bug.

Fix login bug.

--- OpenSim/Services/MessagingService/MessagingModules/FriendsProcessing/FriendsProcessing.cs
+++ OpenSim/Services/MessagingService/MessagingModules/FriendsProcessing/FriendsProcessing.cs
@@ -131,9 +131,12 @@
                                 else
                                 {
                                     IUserAgentService uas = m_registry.RequestModuleInterface<IUserAgentService> ();
-                                    bool online = uas.RemoteStatusNotification (friend, us, isOnline);
-                                    if (online)
-                                        OnlineFriends.Add (FriendToInform);
+                                    if (uas != null)
+                                    {
+                                        bool online = uas.RemoteStatusNotification (friend, us, isOnline);
+                                        if (online)
+                                            OnlineFriends.Add (FriendToInform);
+                                    }
                                 }
                             }
                         }


DE2251: Fix merge issue

DE2251: Fix merge issue

--- SignInCheckIn/MinistryPlatform.Translation.Test/Repositories/ChildSigninRepositoryTest.cs
+++ SignInCheckIn/MinistryPlatform.Translation.Test/Repositories/ChildSigninRepositoryTest.cs
@@ -327,7 +327,7 @@
                 {
                     ParticipantId = 13,
                     ContactId = 1444,
-                    HouseholdId = otherHouseholdId,
+                    HouseholdId = otherHouseholdId.GetValueOrDefault(),
                     HouseholdPositionId = 2,
                     FirstName = "First2",
                     LastName = "Last2",


Boot Elasticsearch once'

Boot Elasticsearch once'

--- Source/EventFlow.Elasticsearch.Tests/IntegrationTests/ElasticsearchReadModelStoreTests.cs
+++ Source/EventFlow.Elasticsearch.Tests/IntegrationTests/ElasticsearchReadModelStoreTests.cs
@@ -50,6 +50,18 @@
         private ElasticsearchRunner.ElasticsearchInstance _elasticsearchInstance;
         private string _indexName;

+        [TestFixtureSetUp]
+        public void FixtureSetUp()
+        {
+            _elasticsearchInstance = ElasticsearchRunner.StartAsync().Result;
+        }
+
+        [TestFixtureTearDown]
+        public void FixtureTearDown()
+        {
+            _elasticsearchInstance.DisposeSafe("Failed to close Elasticsearch down");
+        }
+
         public class TestReadModelDescriptionProvider : IReadModelDescriptionProvider
         {
             private readonly string _indexName;
@@ -71,7 +83,6 @@
         {
             try
             {
-                _elasticsearchInstance = ElasticsearchRunner.StartAsync().Result;
                 _indexName = $"eventflow-test-{Guid.NewGuid().ToString("D")}";

                 var testReadModelDescriptionProvider = new TestReadModelDescriptionProvider(_indexName);
@@ -128,7 +139,6 @@
                 _elasticClient.DeleteIndex(
                     _indexName,
                     r => r.RequestConfiguration(c => c.AllowedStatusCodes((int)HttpStatusCode.NotFound)));
-                _elasticsearchInstance.DisposeSafe("Failed to close Elasticsearch down");
             }
             catch (Exception e)
             {


Implement conical tool end angle optional parameter

--- TessellationAndVoxelizationGeometryLibrary/Voxelization/VoxelizedSolid_PublicFunctions.cs
+++ TessellationAndVoxelizationGeometryLibrary/Voxelization/VoxelizedSolid_PublicFunctions.cs
@@ -1428,6 +1428,10 @@
                 case "cone":
                     var angle = toolOptions[1];
                     return GetVoxelsWithinCircle(vox, dir, toolDia / 2);
+                    double angle;
+                    if (toolOptions.Length < 2) angle = 118;
+                    else if (!double.TryParse(toolOptions[1], out angle))
+                        angle = 118;
                 default:
                     return GetVoxelsWithinCircle(vox, dir, toolDia / 2);
             }


Simplify/remove redundant code from invert and erode, add some comments

--- TessellationAndVoxelizationGeometryLibrary/Voxelization/VoxelizedSolid_PublicFunctions.cs
+++ TessellationAndVoxelizationGeometryLibrary/Voxelization/VoxelizedSolid_PublicFunctions.cs
@@ -926,7 +926,7 @@
                     BoundingSolid(vox, level + 1);
                     return;
                 }
-                ChangeVoxelToFull(vox, false);
+                ChangeVoxelToFull(vox, true);
             });
         }
         #endregion
@@ -941,7 +941,6 @@
         private void Invert(long parent, int level, bool onSurface)
         {
             var descendants = level != lastLevel;
-            var level0 = level == 0;
             var coords = GetChildVoxelCoords(parent, level);
             //foreach (var coord in coords)
             Parallel.ForEach(coords, coord =>
@@ -960,14 +959,14 @@
                             Invert(vox, level + 1, true);
                             break;
                         }
-                        ChangeVoxelToFull(vox, false);
+                        ChangeVoxelToFull(vox, true);
                         break;
                     case VoxelRoleTypes.Full:
-                        ChangeVoxelToEmpty(vox, descendants, !level0);
+                        ChangeVoxelToEmpty(vox, descendants, true);
                         break;
                     case VoxelRoleTypes.Partial:
                         if (descendants) Invert(vox, level + 1, overSurface);
-                        else ChangeVoxelToEmpty(vox, false, !level0);
+                        else ChangeVoxelToEmpty(vox, false, true);
                         break;
                 }
             });
@@ -1258,54 +1257,47 @@
             var pBounds = true;
             var entryCoord = new [] { 0, 0, 0 };

+            //foreach depth or timestep
             foreach (var initCoord in mask)
             {
-                var sBounds = true;
                 var startCoord = initCoord.add(shift, 3);
                 if (!pBounds && startCoord.subtract(entryCoord, 3).norm2() > tLimit)
                     break;

                 var tShift = startCoord.subtract(mask[0], 3);

+                //Iterate over the template of the slice mask
+                //to move them to the appropriate location but
+                //need to be sure that we are in the space (not negative)
                 foreach (var voxCoord in sliceMask)
                 {
                     var coord = voxCoord.add(tShift, 3);
-                    //ToDo: This pBounds check is causing issues. Removing it fixes some issues but then makes new issues
-                    //Potentially fixed by removing the check and adding a precede/exceed check down below, marked by: *p/e*
-                    if (/*pBounds && */PrecedesBounds(coord, dir)) continue;
+                    if (PrecedesBounds(coord, dir)) continue;
                     if (pBounds)
                     {
                         entryCoord = startCoord.ToArray();
                         pBounds = false;
                     }
                     if (SucceedsBounds(coord, dir)) continue;
-                    sBounds = false;
                     var eVox = GetVoxelID(coord, lastLevel);
                     var dVox = designedSolid.GetVoxelID(eVox, lastLevel);
                     var role = Constants.GetRole(dVox);
+                    //Return if you've left the part or you've hit the as-designed part
                     if (role == VoxelRoleTypes.Full ||
                         (role == VoxelRoleTypes.Partial && stopAtPartial))
-                    {
-                        sBounds = true;
-                        break;
-                    }
-                }
-
+                        return;
+                }
+
+                //Continue if you haven't yet started (you're still outside of the shape)
                 if (pBounds) continue;
-                if (sBounds) break;
-
+
+                //So, now we need to remove the voxels at this valid timestep
+                //This is iterate over the same template of the slice mask as before
                 foreach (var voxCoord in sliceMask)
                 {
-                    //ToDo: A child voxel inside a full parent voxel is being set to empty, and the parent voxel is
-                    //determined to also be empty when it should instead be made partial. This is because none of
-                    //the child voxels exist within the parent voxel
-                    //Adding all descendants to full voxels fixes this issues. May be problem in Invert()
                     var coord = voxCoord.add(tShift, 3);
-                    if (OutsideBounds(coord)) continue; //*p/e*
+                    if (OutsideBounds(coord)) continue;
                     var eVox = GetVoxelID(coord, lastLevel);
-                    var parent = GetParentVoxel(eVox);
-                    if (Constants.GetRole(parent) == VoxelRoleTypes.Full)
-                        ChangeVoxelToPartial(parent, true);
                     ChangeVoxelToEmpty(eVox, false, true);
                 }
             }


Refactorings

Refactorings

--- WWCP_Core/Entities/RoamingNetwork/ChargingStationOperator/ChargingPool/ChargingPool_Id.cs
+++ WWCP_Core/Entities/RoamingNetwork/ChargingStationOperator/ChargingPool/ChargingPool_Id.cs
@@ -138,7 +138,7 @@
         public static ChargingPool_Id Generate(ChargingStationOperator_Id  OperatorId,
                                                Address                     Address,
                                                GeoCoordinate?              GeoLocation  = null,
-                                               String                      HelperId     = "",
+                                               //String                      HelperId     = "",
                                                Byte                        Length       = 15,
                                                Func<String, String>        Mapper       = null)
         {
@@ -154,8 +154,8 @@
                                              String.Concat(
                                                  OperatorId.  ToString(),
                                                  Address.     ToString(),
-                                                 GeoLocation?.ToString() ?? "",
-                                                 HelperId                ?? ""
+                                                 GeoLocation?.ToString() ?? ""
+                                                 //HelperId                ?? ""
                                              )
                                          )).
                                          ToHexString().


added enum and new method detecting microphase

--- WelderCalculator/WelderCalculator/Helpers/SchaefflerHelpers/SchaefflerMicrophaseHelper.cs
+++ WelderCalculator/WelderCalculator/Helpers/SchaefflerHelpers/SchaefflerMicrophaseHelper.cs
@@ -2,8 +2,43 @@

 namespace WelderCalculator.Helpers.SchaefflerHelpers
 {
+    public enum Microphase
+    {
+        FM,
+        M,
+        AM,
+        A,
+        MF,
+        AMF,
+        AF,
+        F,
+        Unknown
+    }
+
     public class SchaefflerMicrophaseHelper
     {
+        public Microphase GetMicrophaseForPoint(PointF point)
+        {
+            if (FMContainst(point))
+                return Microphase.FM;
+            if (MContains(point))
+                return Microphase.M;
+            if (AMContains(point))
+                return Microphase.AM;
+            if (AContains(point))
+                return Microphase.A;
+            if (MFContains(point))
+                return Microphase.MF;
+            if (AMFContains(point))
+                return Microphase.AMF;
+            if (AFContains(point))
+                return Microphase.AF;
+            if (FContains(point))
+                return Microphase.F;
+            else
+                return Microphase.Unknown;
+        }
+
         public bool FMContainst(PointF point)
         {
             return point.X >= 0 &&


Refactor: Scope correction

Refactor: Scope correction

--- src/reni2/Struct/CompoundView.cs
+++ src/reni2/Struct/CompoundView.cs
@@ -344,7 +344,8 @@
             return ContextReferenceType.Result(category, () => CodeBase.ReferenceCode(Compound));
         }

-        internal ContextReferenceType ContextReferenceType => this.CachedValue(() => new ContextReferenceType(this));
+        [DisableDump]
+        ContextReferenceType ContextReferenceType => this.CachedValue(() => new ContextReferenceType(this));

     }
 }


Reduce verbosity of STBI errors

Reduce verbosity of STBI errors

--- osu.Framework/Graphics/Textures/TextureUpload.cs
+++ osu.Framework/Graphics/Textures/TextureUpload.cs
@@ -98,7 +98,7 @@
                 if (e is DllNotFoundException)
                     stbiNotFound = true;

-                Logger.Error(e, "Texture could not be loaded via STB; falling back to ImageSharp.");
+                Logger.Log($"Texture could not be loaded via STB; falling back to ImageSharp: {e.Message}");
                 stream.Position = initialPos;
                 return Image.Load<TPixel>(stream);
             }


Fix interpolating clock going backwards

Fix interpolating clock going backwards

--- osu.Framework/Timing/InterpolatingFramedClock.cs
+++ osu.Framework/Timing/InterpolatingFramedClock.cs
@@ -86,6 +86,8 @@
                 //if we differ from the elapsed time of the source, let's adjust for the difference.
                 CurrentInterpolatedTime += (FramedSourceClock.CurrentTime - CurrentInterpolatedTime) / 8;
             }
+
+            CurrentInterpolatedTime = Rate > 0 ? Math.Max(LastInterpolatedTime, CurrentInterpolatedTime) : Math.Min(LastInterpolatedTime, CurrentInterpolatedTime);
         }
     }
 }


emu's doubletap cheese nerf

emu's doubletap cheese nerf

--- osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -33,7 +33,7 @@
         public Speed(Mod[] mods, IBeatmap beatmap, double clockRate)
             : base(mods)
         {
-            greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
+            //greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
         }

         protected override double StrainValueOf(DifficultyHitObject current)
@@ -46,19 +46,15 @@
             double distance = Math.Min(single_spacing_threshold, osuCurrent.TravelDistance + osuCurrent.JumpDistance);
             double deltaTime = current.DeltaTime;

+            // Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
+            if (Previous.Count > 0)
+            {
+                deltaTime = Math.Max(Previous[0].DeltaTime, deltaTime);
+            }
+
             double speedBonus = 1.0;
             if (deltaTime < min_speed_bonus)
                 speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
-
-            // Doubletap detection
-            if (Previous.Count > 0)
-            {
-                var osuPrevious = (OsuDifficultyHitObject)Previous[0];
-                if ( (osuPrevious.DeltaTime / osuCurrent.DeltaTime) >= 3 && osuCurrent.DeltaTime <= (2 * greatWindow))
-                {
-                    return 0;
-                }
-            }

             double angleBonus = 1.0;

@@ -76,7 +72,7 @@
                 }
             }

-            return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / osuCurrent.StrainTime;
+            return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / deltaTime;
         }
     }
 }


Add metronome sound

Add metronome sound

Placeholder pending follow-up from @nekodex (which as discussed should
probably have a second sound for the metronome locking into "stopped"
position).

--- osu.Game/Screens/Edit/Timing/MetronomeDisplay.cs
+++ osu.Game/Screens/Edit/Timing/MetronomeDisplay.cs
@@ -3,6 +3,8 @@

 using System;
 using osu.Framework.Allocation;
+using osu.Framework.Audio;
+using osu.Framework.Audio.Sample;
 using osu.Framework.Audio.Track;
 using osu.Framework.Bindables;
 using osu.Framework.Extensions.LocalisationExtensions;
@@ -31,12 +33,16 @@

         private IAdjustableClock metronomeClock;

+        private Sample clunk;
+
         [Resolved]
         private OverlayColourProvider overlayColourProvider { get; set; }

         [BackgroundDependencyLoader]
-        private void load()
-        {
+        private void load(AudioManager audio)
+        {
+            clunk = audio.Samples.Get(@"Multiplayer/countdown-tick");
+
             const float taper = 25;
             const float swing_vertical_offset = -23;
             const float lower_cover_height = 32;
@@ -269,8 +275,15 @@

             if (currentAngle != 0 && Math.Abs(currentAngle - targetAngle) > angle * 1.8f && isSwinging)
             {
-                using (stick.BeginDelayedSequence(beatLength / 2))
+                using (BeginDelayedSequence(beatLength / 2))
+                {
                     stick.FlashColour(overlayColourProvider.Content1, beatLength, Easing.OutQuint);
+                    Schedule(() =>
+                    {
+                        clunk.Frequency.Value = RNG.NextDouble(0.98f, 1.02f);
+                        clunk?.Play();
+                    });
+                }
             }
         }
     }


Remove decimal part of UR Counter and rename methods

--- osu.Game/Screens/Play/HUD/UnstableRateCounter.cs
+++ osu.Game/Screens/Play/HUD/UnstableRateCounter.cs
@@ -6,7 +6,6 @@
 using System.Linq;
 using osu.Framework.Allocation;
 using osu.Framework.Bindables;
-using osu.Framework.Extensions.LocalisationExtensions;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Sprites;
@@ -21,7 +20,7 @@

 namespace osu.Game.Screens.Play.HUD
 {
-    public class UnstableRateCounter : RollingCounter<double>, ISkinnableDrawable
+    public class UnstableRateCounter : RollingCounter<int>, ISkinnableDrawable
     {
         public bool UsesFixedAnchor { get; set; }

@@ -37,7 +36,7 @@

         public UnstableRateCounter()
         {
-            Current.Value = 0.0;
+            Current.Value = 0;
         }

         [BackgroundDependencyLoader]
@@ -48,10 +47,8 @@
                 DrawableCount.FadeTo(e.NewValue ? 1 : alpha_when_invalid, 1000, Easing.OutQuint));
         }

-        private bool isUrInvalid(JudgementResult judgement)
-        {
-            return judgement.HitObject.HitWindows is HitWindows.EmptyHitWindows || !judgement.IsHit;
-        }
+        private bool changesUnstableRate(JudgementResult judgement)
+            => !(judgement.HitObject.HitWindows is HitWindows.EmptyHitWindows) && judgement.IsHit;

         protected override void LoadComplete()
         {
@@ -63,28 +60,28 @@

         private void onJudgementAdded(JudgementResult judgement)
         {
-            if (isUrInvalid(judgement)) return;
+            if (!changesUnstableRate(judgement)) return;

             hitOffsets.Add(judgement.TimeOffset);
-            updateUr();
+            updateDisplay();
         }

         private void onJudgementReverted(JudgementResult judgement)
         {
-            if (judgement.FailedAtJudgement || isUrInvalid(judgement)) return;
+            if (judgement.FailedAtJudgement || !changesUnstableRate(judgement)) return;

             hitOffsets.RemoveAt(hitOffsets.Count - 1);
-            updateUr();
+            updateDisplay();
         }

-        private void updateUr()
+        private void updateDisplay()
         {
             // At Count = 0, we get NaN, While we are allowing count = 1, it will be 0 since average = offset.
             if (hitOffsets.Count > 0)
             {
                 double mean = hitOffsets.Average();
                 double squares = hitOffsets.Select(offset => Math.Pow(offset - mean, 2)).Sum();
-                Current.Value = Math.Sqrt(squares / hitOffsets.Count) * 10;
+                Current.Value = (int)(Math.Sqrt(squares / hitOffsets.Count) * 10);
                 valid.Value = true;
             }
             else
@@ -92,11 +89,6 @@
                 Current.Value = 0;
                 valid.Value = false;
             }
-        }
-
-        protected override LocalisableString FormatCount(double count)
-        {
-            return count.ToString("0.00");
         }

         protected override IHasText CreateText() => new TextComponent
@@ -108,6 +100,8 @@
         {
             base.Dispose(isDisposing);

+            if (scoreProcessor == null) return;
+
             scoreProcessor.NewJudgement -= onJudgementAdded;
             scoreProcessor.JudgementReverted -= onJudgementReverted;
         }
@@ -116,20 +110,11 @@
         {
             public LocalisableString Text
             {
-                get => fullValue.ToLocalisableString("0.00 UR");
-                set
-                {
-                    fullValue = Convert.ToDouble(value.ToString());
-                    intPart.Text = fullValue.ToLocalisableString("0");
-                    decimalPart.Text = (fullValue - Math.Truncate(fullValue))
-                        .ToLocalisableString(".00 UR");
-                }
+                get => text.Text;
+                set => text.Text = value;
             }

-            private double fullValue;
-
-            private readonly OsuSpriteText intPart;
-            private readonly OsuSpriteText decimalPart;
+            private readonly OsuSpriteText text;

             public TextComponent()
             {
@@ -140,17 +125,18 @@
                     AutoSizeAxes = Axes.Both,
                     Children = new Drawable[]
                     {
-                        intPart = new OsuSpriteText
+                        text = new OsuSpriteText
                         {
                             Anchor = Anchor.BottomLeft,
                             Origin = Anchor.BottomLeft,
                             Font = OsuFont.Numeric.With(size: 16, fixedWidth: true)
                         },
-                        decimalPart = new OsuSpriteText
+                        new OsuSpriteText
                         {
                             Anchor = Anchor.BottomLeft,
                             Origin = Anchor.BottomLeft,
                             Font = OsuFont.Numeric.With(size: 8, fixedWidth: true),
+                            Text = "UR",
                             Padding = new MarginPadding { Bottom = 1.5f },
                         }
                     }


[V2] Prebuilt dynamic libraries for VSSolution projects are added to the linker settings

--- packages/C/dev/VSSolutionBuilder/CApplication.cs
+++ packages/C/dev/VSSolutionBuilder/CApplication.cs
@@ -16,6 +16,7 @@
 // You should have received a copy of the GNU Lesser General Public License
 // along with BuildAMation.  If not, see <http://www.gnu.org/licenses/>.
 #endregion // License
+using Bam.Core.V2; // for EPlatform.PlatformExtensions
 namespace C
 {
 namespace V2
@@ -33,6 +34,59 @@
             System.Collections.ObjectModel.ReadOnlyCollection<Bam.Core.V2.Module> libraries,
             System.Collections.ObjectModel.ReadOnlyCollection<Bam.Core.V2.Module> frameworks)
         {
+            // inspect prebuilt library dependencies, which are added as part of the linker options
+            foreach (var input in libraries)
+            {
+                if (input.MetaData != null)
+                {
+                    continue;
+                }
+
+                if (input is C.V2.StaticLibrary)
+                {
+                    // TODO: probably a simplification of the DLL codepath
+                    throw new System.NotImplementedException();
+                }
+                else if (input is C.V2.DynamicLibrary)
+                {
+                    var linker = sender.Settings as C.V2.ICommonLinkerOptions;
+                    if (sender.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
+                    {
+                        var libraryPath = input.GeneratedPaths[C.V2.DynamicLibrary.ImportLibraryKey].Parse();
+                        var libraryDir = System.IO.Path.GetDirectoryName(libraryPath);
+                        var libraryName = System.IO.Path.GetFileName(libraryPath);
+                        linker.LibraryPaths.AddUnique(Bam.Core.V2.TokenizedString.Create(libraryDir, null));
+                        linker.Libraries.AddUnique(libraryName);
+                    }
+                    else
+                    {
+                        var libraryPath = input.GeneratedPaths[C.V2.DynamicLibrary.Key].Parse();
+                        var libraryDir = System.IO.Path.GetDirectoryName(libraryPath);
+                        linker.LibraryPaths.AddUnique(Bam.Core.V2.TokenizedString.Create(libraryDir, null));
+                        if ((sender.Tool as C.V2.LinkerTool).UseLPrefixLibraryPaths)
+                        {
+                            var libName = System.IO.Path.GetFileNameWithoutExtension(libraryPath);
+                            libName = libName.Substring(3); // trim off lib prefix
+                            linker.Libraries.AddUnique(System.String.Format("-l{0}", libName));
+                        }
+                        else
+                        {
+                            var libraryName = System.IO.Path.GetFileName(libraryPath);
+                            linker.Libraries.AddUnique(libraryName);
+                        }
+                    }
+                }
+                else if (input is C.V2.CSDKModule)
+                {
+                    // do nothing for SDKs
+                    continue;
+                }
+                else
+                {
+                    throw new Bam.Core.Exception("Don't know how to handle this library module, {0}", input.ToString());
+                }
+            }
+
             var platform = sender.Linker is VisualC.V2.Linker64 ? VSSolutionBuilder.V2.VSSolutionMeta.EPlatform.SixtyFour : VSSolutionBuilder.V2.VSSolutionMeta.EPlatform.ThirtyTwo;
             VSSolutionBuilder.V2.VSCommonLinkableProject application = null;
             if (sender is DynamicLibrary)
@@ -94,19 +148,22 @@
                 }
             }

+            // loop over libraries that have been built in projects, and which require a dependency set up
             foreach (var input in libraries)
             {
+                if (null == input.MetaData)
+                {
+                    // prebuilts handled earlier
+                    continue;
+                }
+
                 if (input is C.V2.StaticLibrary)
                 {
                     application.AddStaticLibrary(input.MetaData as VSSolutionBuilder.V2.VSProjectStaticLibrary);
                 }
                 else if (input is C.V2.DynamicLibrary)
                 {
-                    if (null != input.MetaData)
-                    {
-                        application.AddDynamicLibrary(input.MetaData as VSSolutionBuilder.V2.VSProjectDynamicLibrary);
-                    }
-                    // TODO: could be a prebuilt DLL
+                    application.AddDynamicLibrary(input.MetaData as VSSolutionBuilder.V2.VSProjectDynamicLibrary);
                 }
                 else if (input is C.V2.CSDKModule)
                 {
@@ -115,7 +172,7 @@
                 }
                 else
                 {
-                    throw new Bam.Core.Exception("Don't know how to handle this: other");
+                    throw new Bam.Core.Exception("Don't know how to handle this library module, {0}", input.ToString());
                 }
             }
         }


Re-added setter for deprecated ComponentPresentation.Conditions (for API compatibility), but have it throw an exception

--- source/DD4T.ContentModel/ContentModel.cs
+++ source/DD4T.ContentModel/ContentModel.cs
@@ -154,6 +154,13 @@
                     return TargetGroupConditions.Select(t => t.TargetGroup.Conditions).SelectMany(x => x).ToList();
                 }
                 return null;
+            }
+            set
+            {
+                if (value!=null)
+                {
+                    throw new Exception("Cannot set conditions directly - set these via TargetGroupConditions property");
+                }
             }
         }


Fix for FFImage

Fix for FFImage

--- source/FFImageLoading.Windows/FFImage.cs
+++ source/FFImageLoading.Windows/FFImage.cs
@@ -27,7 +27,9 @@
                 VerticalAlignment = VerticalAlignment.Stretch,
                 Opacity = 1.0f,
             };
-            Content = internalImage;
+            Content = internalImage;
+
+			Transformations = new List<FFImageLoading.Work.ITransformation>();
         }

         public string Source


throw exception for config problems

throw exception for config problems

--- source/mtee/Application/Configuration.cs
+++ source/mtee/Application/Configuration.cs
@@ -6,6 +6,7 @@
 using System;
 using System.Collections.Generic;
 using System.IO;
+using System.Reflection;
 using System.Xml;
 using fitnesse.mtee.engine;
 using fitnesse.mtee.model;
@@ -43,7 +44,12 @@
         }

         private void LoadNode(string typeName, XmlNode methodNode) {
-            new Processor<string>().Invoke(GetItem(typeName), methodNode.Name, NodeParameters(methodNode));
+            try {
+                new Processor<string>().Invoke(GetItem(typeName), methodNode.Name, NodeParameters(methodNode));
+            }
+            catch (TargetInvocationException e) {
+                throw e.InnerException;
+            }
         }

         private static Tree<string> NodeParameters(XmlNode node) {


Fix Cursor dose redirect all Methods to its inner Cursor.

--- source/MongoDB/Obsolete/Cursor.cs
+++ source/MongoDB/Obsolete/Cursor.cs
@@ -32,6 +32,7 @@
         /// <param name="spec">The spec.</param>
         /// <returns></returns>
         public ICursor Spec(Document spec){
+            _cursor.Spec(spec);
             return this;
         }

@@ -101,6 +102,7 @@
         /// <param name="fields">The fields.</param>
         /// <returns></returns>
         public ICursor Sort(Document fields){
+            _cursor.Sort(fields);
             return this;
         }

@@ -110,6 +112,7 @@
         /// <param name="index">The index.</param>
         /// <returns></returns>
         public ICursor Hint(Document index){
+            _cursor.Hint(index);
             return this;
         }


Add GravatarEmail in UserProfile

Add GravatarEmail in UserProfile

--- git-newhand.Web/Models/AccountModels.cs
+++ git-newhand.Web/Models/AccountModels.cs
@@ -21,6 +21,8 @@
     [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
     public int UserId { get; set; }
     public string UserName { get; set; }
+    public string GravatarEmail { get; set; }
+    public string DisplayName { get; set; }
   }

   public class RegisterExternalLoginModel {


c# core: channel group sub after channel sub

--- csharp.net/PubNub-Messaging/PubnubCore.cs
+++ csharp.net/PubNub-Messaging/PubnubCore.cs
@@ -2691,15 +2691,6 @@
             bool channelGroupSubscribeOnly = false;
             bool channelSubscribeOnly = false;

-            if (rawChannels != null && rawChannels.Length > 0 && rawChannelGroups == null)
-            {
-                channelSubscribeOnly = true;
-            }
-            if (rawChannels != null && rawChannels.Length == 0 && rawChannelGroups != null && rawChannelGroups.Length > 0)
-            {
-                channelGroupSubscribeOnly = true;
-            }
-
             string channel = (rawChannels != null) ? string.Join(",", rawChannels) : "";
             string channelGroup = (rawChannelGroups != null) ? string.Join(",", rawChannelGroups) : "";

@@ -2852,7 +2843,16 @@
 				string[] channels = multiChannelSubscribe.Keys.ToArray<string> ();
                 string[] channelGroups = multiChannelGroupSubscribe.Keys.ToArray<string>();

-				RequestState<T> state = new RequestState<T>();
+                if (channels != null && channels.Length > 0 && (channelGroups == null || channelGroups.Length == 0))
+                {
+                    channelSubscribeOnly = true;
+                }
+                if (channelGroups != null && channelGroups.Length > 0 && (channels == null || channels.Length == 0))
+                {
+                    channelGroupSubscribeOnly = true;
+                }
+
+                RequestState<T> state = new RequestState<T>();
                 if (channelGroupSubscribeOnly)
                 {
                     _channelRequest.AddOrUpdate(",", state.Request, (key, oldValue) => state.Request);


Refactor

Refactor

--- osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs
+++ osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs
@@ -220,12 +220,23 @@

         public class FilterableGroupedDifficultyIcon : GroupedDifficultyIcon
         {
+            private readonly List<CarouselBeatmap> items;
+
             public FilterableGroupedDifficultyIcon(List<CarouselBeatmap> items, RulesetInfo ruleset)
                 : base(items.Select(i => i.Beatmap).ToList(), ruleset, Color4.White)
             {
+                this.items = items;
+
+                foreach (var item in items)
+                    item.Filtered.BindValueChanged(_ => Scheduler.AddOnce(updateFilteredDisplay));
+
+                updateFilteredDisplay();
+            }
+
+            private void updateFilteredDisplay()
+            {
                 // for now, fade the whole group based on the ratio of hidden items.
-                items.ForEach(item => item.Filtered.BindValueChanged(_ =>
-                    this.FadeTo(1 - 0.9f * ((float)items.Count(i => i.Filtered.Value) / items.Count), 100), true));
+                this.FadeTo(1 - 0.9f * ((float)items.Count(i => i.Filtered.Value) / items.Count), 100);
             }
         }
     }


change: DumpData#Importの入力長を5以上も許容

change: DumpData#Importの入力長を5以上も許容

--- Sharp98/DumpData.cs
+++ Sharp98/DumpData.cs
@@ -96,7 +96,7 @@
             if (buffer == null)
                 throw new ArgumentNullException(nameof(buffer));

-            if (buffer.Length <= 1 || buffer.Length > 6)
+            if (buffer.Length <= 1)
                 throw new ArgumentOutOfRangeException(nameof(buffer));

             if (buffer[0] < 0x80)
@@ -105,8 +105,8 @@
                 return new DumpData(buffer[0], 0, 0, 0);
             else if (buffer[0] == 0xfe)
             {
-                var array = new byte[buffer.Length - 1];
-                Array.Copy(buffer, 1, array, 0, buffer.Length - 1);
+                var array = new byte[5];
+                Array.Copy(buffer, 1, array, 0, 5);
                 return new DumpData(buffer[0], 0, 0, GetVVValue(array));
             }
             else


Fixed assembly loading.

Fixed assembly loading.

--- source/XSharp.Compiler/Program.cs
+++ source/XSharp.Compiler/Program.cs
@@ -77,7 +77,7 @@
               }
               else if (xExt == ".DLL")
               {
-                xAssemblies.Add(Assembly.ReflectionOnlyLoadFrom(xVal));
+                xAssemblies.Add(Assembly.LoadFrom(xVal));
               }
               else
               {


Fixing linter errors

Fixing linter errors

--- speech/api/Recognize/Recognize.cs
+++ speech/api/Recognize/Recognize.cs
@@ -209,7 +209,7 @@
                 LanguageCode = "en",
                 // The `model` value must be one of the following:
                 // "video", "phone_call", "command_and_search", "default"
-                Model = model
+                Model = model
             }, RecognitionAudio.FromFile(filePath));
             foreach (var result in response.Results)
             {


includeShared opt-in for backwards compat

--- src/Api/Controllers/CiphersController.cs
+++ src/Api/Controllers/CiphersController.cs
@@ -67,10 +67,17 @@
         }

         [HttpGet("")]
-        public async Task<ListResponseModel<CipherResponseModel>> Get(bool includeFolders = true)
+        public async Task<ListResponseModel<CipherResponseModel>> Get(bool includeFolders = true, bool includeShared = false)
         {
             var userId = _userService.GetProperUserId(User).Value;
             var ciphers = await _cipherRepository.GetManyByUserIdAsync(userId);
+
+            // For backwards compat, do not include shared ciphers. Can be removed in a future release.
+            if(!includeShared)
+            {
+                ciphers = ciphers.Where(c => !c.OrganizationId.HasValue).ToList();
+            }
+
             var responses = ciphers.Select(c => new CipherResponseModel(c)).ToList();

             // Folders are included for backwards compat. Can be removed in a future release.


Add basic tests for HashAlgorithm.Verify/TryVerify

--- tests/Base/HashAlgorithmTests.cs
+++ tests/Base/HashAlgorithmTests.cs
@@ -94,5 +94,75 @@
         }

         #endregion
+
+        #region TryVerify
+
+        [Theory]
+        [MemberData(nameof(HashAlgorithms))]
+        public static void TryVerifyWithSpanTooSmall(Type algorithmType)
+        {
+            var a = (HashAlgorithm)Activator.CreateInstance(algorithmType);
+
+            Assert.False(a.TryVerify(ReadOnlySpan<byte>.Empty, new byte[a.HashSize - 1]));
+        }
+
+        [Theory]
+        [MemberData(nameof(HashAlgorithms))]
+        public static void TryVerifyWithSpanTooLarge(Type algorithmType)
+        {
+            var a = (HashAlgorithm)Activator.CreateInstance(algorithmType);
+
+            Assert.False(a.TryVerify(ReadOnlySpan<byte>.Empty, new byte[a.HashSize + 1]));
+        }
+
+        [Theory]
+        [MemberData(nameof(HashAlgorithms))]
+        public static void TryVerifyWithSpanSuccess(Type algorithmType)
+        {
+            var a = (HashAlgorithm)Activator.CreateInstance(algorithmType);
+
+            var d = ReadOnlySpan<byte>.Empty;
+
+            var hash = a.Hash(d);
+
+            Assert.True(a.TryVerify(d, hash));
+        }
+
+        #endregion
+
+        #region Verify
+
+        [Theory]
+        [MemberData(nameof(HashAlgorithms))]
+        public static void VerifyWithSpanTooSmall(Type algorithmType)
+        {
+            var a = (HashAlgorithm)Activator.CreateInstance(algorithmType);
+
+            Assert.Throws<CryptographicException>(() => a.Verify(ReadOnlySpan<byte>.Empty, new byte[a.HashSize - 1]));
+        }
+
+        [Theory]
+        [MemberData(nameof(HashAlgorithms))]
+        public static void VerifyWithSpanTooLarge(Type algorithmType)
+        {
+            var a = (HashAlgorithm)Activator.CreateInstance(algorithmType);
+
+            Assert.Throws<CryptographicException>(() => a.Verify(ReadOnlySpan<byte>.Empty, new byte[a.HashSize + 1]));
+        }
+
+        [Theory]
+        [MemberData(nameof(HashAlgorithms))]
+        public static void VerifyWithSpanSuccess(Type algorithmType)
+        {
+            var a = (HashAlgorithm)Activator.CreateInstance(algorithmType);
+
+            var d = ReadOnlySpan<byte>.Empty;
+
+            var hash = a.Hash(d);
+
+            a.Verify(d, hash);
+        }
+
+        #endregion
     }
 }