Finish the EthernetDevice class (without error handling and asynchronous I/O

--- src/bindings/EthernetDevice.cs
+++ src/bindings/EthernetDevice.cs
@@ -1,5 +1,7 @@

 using System;
+using System.Net;
+using System.Net.Sockets;
 using System.Runtime.InteropServices;

 namespace TAPCfg {
@@ -18,7 +20,10 @@
 		}

 		public void Start(string deviceName) {
-			tapcfg_start(handle, deviceName);
+			int ret = tapcfg_start(handle, deviceName);
+			if (ret < 0) {
+				/* Handle error in starting the device */
+			}
 		}

 		public EthernetFrame Read() {
@@ -55,16 +60,38 @@
 				}
 			}
 			set {
+				int ret;
+
 				if (value) {
-					tapcfg_iface_change_status(handle, 1);
+					ret = tapcfg_iface_change_status(handle, 1);
 				} else {
-					tapcfg_iface_change_status(handle, 0);
+					ret = tapcfg_iface_change_status(handle, 0);
+				}
+
+				if (ret < 0) {
+					/* Handle error in changing the status */
 				}
 			}
 		}

 		public string DeviceName {
 			get { return tapcfg_get_ifname(handle); }
+		}
+
+		public void SetAddress(IPAddress address, byte netbits) {
+			int ret;
+
+			if (address.AddressFamily == AddressFamily.InterNetwork) {
+				ret = tapcfg_iface_set_ipv4(handle, address.ToString(), netbits);
+			} else if (address.AddressFamily == AddressFamily.InterNetworkV6) {
+				ret = tapcfg_iface_add_ipv6(handle, address.ToString(), netbits);
+			} else {
+				return;
+			}
+
+			if (ret < 0) {
+				/* Handle error in setting the address */
+			}
 		}

 		public void Dispose() {
@@ -89,6 +116,8 @@
 		private static void Main(string[] args) {
 			EthernetDevice dev = new EthernetDevice();
 			dev.Start();
+			dev.SetAddress(IPAddress.Parse("192.168.1.1"), 16);
+			dev.SetAddress(IPAddress.Parse("fc00::1"), 64);
 			dev.Enabled = true;

 			System.Threading.Thread.Sleep(100000);
@@ -126,6 +155,6 @@
 		[DllImport("libtapcfg")]
 		private static extern int tapcfg_iface_set_ipv4(IntPtr tapcfg, string addr, byte netbits);
 		[DllImport("libtapcfg")]
-		private static extern int tapcfg_iface_set_ipv6(IntPtr tapcfg, string addr, byte netbits);
+		private static extern int tapcfg_iface_add_ipv6(IntPtr tapcfg, string addr, byte netbits);
 	}
 }


Dont PyObjects precedence in Operator methods

--- src/runtime/methodbinder.cs
+++ src/runtime/methodbinder.cs
@@ -200,13 +200,13 @@
             val += mi.IsGenericMethod ? 1 : 0;
             for (var i = 0; i < num; i++)
             {
-                val += ArgPrecedence(pi[i].ParameterType);
+                val += ArgPrecedence(pi[i].ParameterType, methodInformation);
             }

             var info = mi as MethodInfo;
             if (info != null)
             {
-                val += ArgPrecedence(info.ReturnType);
+                val += ArgPrecedence(info.ReturnType, methodInformation);
                 val += mi.DeclaringType == mi.ReflectedType ? 0 : 3000;
             }

@@ -216,7 +216,7 @@
         /// <summary>
         /// Return a precedence value for a particular Type object.
         /// </summary>
-        internal static int ArgPrecedence(Type t)
+        internal static int ArgPrecedence(Type t, MethodInformation mi)
         {
             Type objectType = typeof(object);
             if (t == objectType)
@@ -224,7 +224,7 @@
                 return 3000;
             }

-            if (t.IsAssignableFrom(typeof(PyObject)))
+            if (t.IsAssignableFrom(typeof(PyObject)) && !OperatorMethod.IsOperatorMethod(mi.MethodBase))
             {
                 return -1;
             }
@@ -283,7 +283,7 @@
                 {
                     return 2500;
                 }
-                return 100 + ArgPrecedence(e);
+                return 100 + ArgPrecedence(e, mi);
             }

             return 2000;


Update StorageContext.cs (#1728)

Update StorageContext.cs (#1728)

StorageContext needs to be public so it can be accessed by Neo Debugger

Co-authored-by: Erik Zhang <c195b508e6f0c57aeafdb5e96947e2b79e6a4b40@neo.org>

--- src/neo/SmartContract/StorageContext.cs
+++ src/neo/SmartContract/StorageContext.cs
@@ -1,6 +1,6 @@
 namespace Neo.SmartContract
 {
-    internal class StorageContext
+    public class StorageContext
     {
         public int Id;
         public bool IsReadOnly;


mpu.exe -l now creates merged source tree.

--- src/mpu/AssetFileImporter.cs
+++ src/mpu/AssetFileImporter.cs
@@ -2,7 +2,7 @@
 //
 // MessagePack for CLI
 //
-// Copyright (C) 2014 FUJIWARA, Yusuke
+// Copyright (C) 2014-2015 FUJIWARA, Yusuke
 //
 //    Licensed under the Apache License, Version 2.0 (the "License");
 //    you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@

 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Globalization;
 using System.IO;
 using System.Linq;
@@ -78,7 +79,7 @@
 						CultureInfo.InvariantCulture,
 						".{0}src{0}MsgPack.Unity3D{0}MsgPack.Unity3D.csproj",
 						Path.DirectorySeparatorChar
-						);
+					);
 			}

 			if ( String.IsNullOrEmpty( outputDirectoryPath ) )
@@ -88,23 +89,34 @@
 						CultureInfo.InvariantCulture,
 						".{0}Assets{0}MsgPack",
 						Path.DirectorySeparatorChar
-						);
+					);
 			}

 			var sourceDirectoryPath = Path.GetDirectoryName( sourceProjectPath );

 			foreach ( var sourceFileRelativePath in this.ParseProjectFile( sourceProjectPath ) )
 			{
-				var destinationFilePath = Path.Combine( outputDirectoryPath, sourceFileRelativePath.StartsWith( "..\\" ) ? sourceFileRelativePath.Substring( 3 ) : sourceFileRelativePath );
+				var destinationFilePath =
+					Path.Combine(
+						outputDirectoryPath,
+						new String(
+							( sourceFileRelativePath.StartsWith( "..\\" ) ? sourceFileRelativePath.Substring( 3 ) : sourceFileRelativePath ) // remove relative
+							.SkipWhile( c => c != '\\') // remove project name portion
+							.Skip( 1 )
+							.ToArray()
+						)
+					);
 				// ReSharper disable once AssignNullToNotNullAttribute
 				Directory.CreateDirectory( Path.GetDirectoryName( destinationFilePath ) );
+
+				Debug.Print( "Copy {0} to {1}", sourceFileRelativePath, destinationFilePath );

 				File.Copy(
 					// ReSharper disable once AssignNullToNotNullAttribute
 					Path.Combine( sourceDirectoryPath, sourceFileRelativePath ),
 					destinationFilePath,
 					this.Overwrite
-					);
+				);
 			}
 		}


adjust iteminfo.. again

adjust iteminfo.. again

--- hybrasyl/World.cs
+++ hybrasyl/World.cs
@@ -902,12 +902,12 @@

             #region ItemInfo
             var itmIndex = 0;
-            for (var i = 0; i < (int)(WorldData.Values<Xml.Item>().Count() / 500); i++)
+            for (var i = 0; i < (int)(WorldData.Values<Xml.Item>().Count() / 600); i++)
             {
                 var iteminfo = new Metafile($"ItemInfo{i}");
                 // TODO: split items into multiple ItemInfo files (DA does ~700 each)
                 var items = WorldData.Values<Xml.Item>().OrderBy(x => x.Name).ToArray();
-                for(var j = 0 + itmIndex; j< (500 + itmIndex); j++)
+                for(var j = 0 + itmIndex; j< (600 + itmIndex); j++)
                 {
                     if (j == items.Length) break;
                     var item = items[j];
@@ -945,7 +945,7 @@
                     iteminfo.Nodes.Add(new MetafileNode(item.Name, level, (int)xclass, weight, tab, desc));
                 }
                 WorldData.Set(iteminfo.Name, iteminfo.Compile());
-                itmIndex += 500;
+                itmIndex += 600;
             }
             #endregion ItemInfo


Remove pointless FillMode specification

Remove pointless FillMode specification

--- osu.Game.Rulesets.Catch/UI/CatcherArea.cs
+++ osu.Game.Rulesets.Catch/UI/CatcherArea.cs
@@ -407,7 +407,6 @@
                 public CatcherSprite()
                 {
                     Size = new Vector2(CATCHER_SIZE);
-                    FillMode = FillMode.Fill;

                     // Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
                     OriginPosition = new Vector2(-0.02f, 0.06f) * CATCHER_SIZE;


Simplified logic

Simplified logic

--- osu.Game/Screens/Play/SongProgressInfo.cs
+++ osu.Game/Screens/Play/SongProgressInfo.cs
@@ -24,6 +24,11 @@
         private int previousPercent;
         private int previousSecond;
         private double previousTimespan;
+
+        private double songLenght => endTime - startTime;
+
+        private bool percentHasChanged = true;
+        private bool secondHasChanged = true;

         private const int margin = 10;

@@ -74,32 +79,30 @@
             base.Update();

             double songCurrentTime = AudioClock.CurrentTime - startTime;
-            int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100);
+            int currentPercent = songCurrentTime < 0 ? 0 : songCurrentTime > songLenght ? 100 : (int)(songCurrentTime / songLenght * 100);
+            int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds;

-            if (currentPercent <= 100)
+            if (percentHasChanged)
             {
-                int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds;
+                progress.Text = currentPercent.ToString() + @"%";
+                previousPercent = currentPercent;
+            }

-                if (currentSecond != previousSecond || previousTimespan < 0 && songCurrentTime > 0)
-                {
-                    previousTimespan = songCurrentTime;
-                    previousSecond = currentSecond;
+            if (secondHasChanged && songCurrentTime < songLenght || previousTimespan < 0 && songCurrentTime > 0)
+            {
+                if (songCurrentTime < 0)
+                    timeCurrent.Text = @"-" + TimeSpan.FromMilliseconds(songCurrentTime - 1000).ToString(@"m\:ss");
+                else
+                    timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss");

-                    if (songCurrentTime < 0)
-                        timeCurrent.Text = @"-" + TimeSpan.FromMilliseconds(songCurrentTime - 1000).ToString(@"m\:ss");
-                    else
-                        timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss");
+                timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss");

-                    timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss");
-                }
+                previousSecond = currentSecond;
+                previousTimespan = songCurrentTime;
+            }

-                if (currentPercent != previousPercent)
-                {
-                    previousPercent = currentPercent;
-
-                    progress.Text = (currentPercent <= 0 ? @"0" : currentPercent.ToString()) + @"%";
-                }
-            }
+            percentHasChanged = currentPercent != previousPercent;
+            secondHasChanged = currentSecond != previousSecond;
         }
     }
 }


remove (now) unnecessary line

remove (now) unnecessary line

--- osu.Game/Screens/Select/PlaySongSelect.cs
+++ osu.Game/Screens/Select/PlaySongSelect.cs
@@ -99,7 +99,6 @@
             if (removeAutoModOnResume)
             {
                 var autoType = Ruleset.Value.CreateInstance().GetAutoplayMod().GetType();
-                SelectedMods.Value = SelectedMods.Value.Where(m => m.GetType() != autoType).ToArray();
                 modSelect.DeselectTypes(new[] { autoType }, true);
                 removeAutoModOnResume = false;
             }


[V2] Ensure there are no duplicates of linked FileReferences

--- packages/XcodeBuilder/dev/XcodeBuilder.cs
+++ packages/XcodeBuilder/dev/XcodeBuilder.cs
@@ -83,6 +83,7 @@
             this.Project = project;
             this.SourceTree = sourceTree;
             this.ExplicitType = explicitType;
+            this.LinkedTo = null;
         }

         public FileReference(string path, FileReference other)
@@ -92,19 +93,20 @@
             this.Project = other.Project;
             this.SourceTree = other.SourceTree;
             this.ExplicitType = other.ExplicitType;
+            this.LinkedTo = other;
         }

         public static FileReference
         MakeLinkedClone(
             Project project,
             Bam.Core.EConfiguration configuration,
-            FileReference other)
+            FileReference originalFileRef)
         {
             // need to constructed a path that is the original, relative to the current project's built products dir
-            var originalPath = other.Path.ToString();
+            var originalPath = originalFileRef.Path.ToString();
             var thisProjectPath = System.String.Format("{0}/{1}/", project.BuiltProductsDir, configuration.ToString());
             var relativePath = Bam.Core.RelativePathUtilities.GetPath(originalPath, thisProjectPath);
-            var clone = project.FindOrCreateFileReference(relativePath, other);
+            var clone = project.FindOrCreateFileReference(relativePath, originalFileRef);
             return clone;
         }

@@ -136,6 +138,12 @@
         {
             get;
             set;
+        }
+
+        public FileReference LinkedTo
+        {
+            get;
+            private set;
         }

         public override string GUID
@@ -644,7 +652,11 @@
         {
             foreach (var fileRef in this.FileReferences)
             {
-                if (fileRef.Path.ToString() == path)
+                if (null == fileRef.LinkedTo)
+                {
+                    continue;
+                }
+                if (fileRef.LinkedTo.GUID == other.GUID)
                 {
                     return fileRef;
                 }


Fixed identation.

Fixed identation.

git-svn-id: bab0c2de90ee11a20376049c2cdee62584491f34@3084 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- Core/Castle.Core.Tests/ConsoleLoggerTestCase.cs
+++ Core/Castle.Core.Tests/ConsoleLoggerTestCase.cs
@@ -67,20 +67,20 @@
 			Assert.AreEqual("[Debug] 'Logger' Some debug message\r\n[Info] 'Logger' Some info message\r\n[Error] 'Logger' Some error message\r\n[Fatal] 'Logger' Some fatal error message\r\n[Warn] 'Logger' Some warn message\r\n", logcontents);
 		}

-        [Test]
-        public void WarnLogger()
-        {
-            ConsoleLogger log = new ConsoleLogger("Logger", LoggerLevel.Warn);
+		[Test]
+		public void WarnLogger()
+		{
+			ConsoleLogger log = new ConsoleLogger("Logger", LoggerLevel.Warn);

-            log.Debug("Some debug message");
-            log.Info("Some info message");
-            log.Error("Some error message");
-            log.Fatal("Some fatal error message");
-            log.Warn("Some warn message");
+			log.Debug("Some debug message");
+			log.Info("Some info message");
+			log.Error("Some error message");
+			log.Fatal("Some fatal error message");
+			log.Warn("Some warn message");

-            String logcontents = outWriter.GetStringBuilder().ToString();
-            Assert.AreEqual("[Error] 'Logger' Some error message\r\n[Fatal] 'Logger' Some fatal error message\r\n[Warn] 'Logger' Some warn message\r\n", logcontents);
-        }
+			String logcontents = outWriter.GetStringBuilder().ToString();
+			Assert.AreEqual("[Error] 'Logger' Some error message\r\n[Fatal] 'Logger' Some fatal error message\r\n[Warn] 'Logger' Some warn message\r\n", logcontents);
+		}

 		[Test]
 		public void ExceptionLogging()


Fixed typo

Fixed typo

--- Core2D.UI.Perspex.Desktop/Util/TextClipboard.cs
+++ Core2D.UI.Perspex.Desktop/Util/TextClipboard.cs
@@ -38,18 +38,18 @@
         }

         /// <summary>
-        /// Return true if clipboard container text string.
+        /// Return true if clipboard contains text string.
         /// </summary>
-        /// <returns>True if clipboard container text string.</returns>
+        /// <returns>True if clipboard contains text string.</returns>
         private async Task<bool> ContainsTextAsync()
         {
             return !string.IsNullOrEmpty(await GetTextAsync());
         }

         /// <summary>
-        /// Return true if clipboard container text string.
+        /// Return true if clipboard contains text string.
         /// </summary>
-        /// <returns>True if clipboard container text string.</returns>
+        /// <returns>True if clipboard contains text string.</returns>
         public async Task<bool> ContainsText()
         {
             return await ContainsTextAsync();


implemented adding cyclists

implemented adding cyclists

--- CyclingApplication/Cycling.Web/Cyclists.aspx.cs
+++ CyclingApplication/Cycling.Web/Cyclists.aspx.cs
@@ -23,6 +23,9 @@
                 this.TextBoxTeam.Text);

             cyclist.Create();
+            // TODO: must be fixed after new cyclist creation, grid should display new rider automatically
+            // not like now with manual reload of the page
+            Response.Redirect("Cyclists.aspx");
         }
     }
 }


Tweaks #ADD The top keyboard number keys can now be used to switch between the available camera view states when the cam view has focus.

--- DualityEditorPlugins/CamView/Modules/CamView.cs
+++ DualityEditorPlugins/CamView/Modules/CamView.cs
@@ -859,6 +859,12 @@
 				Key inputKey = e.KeyCode.ToOpenTKSingle();
 				this.inputKeyPressed = this.inputKeyPressed.And(e.KeyCode.ToOpenTK().Not());
 			}
+
+			if (e.KeyCode >= Keys.D1 && e.KeyCode <= Keys.D9)
+			{
+				if (this.stateSelector.Items.Count > e.KeyCode - Keys.D1)
+					this.stateSelector.SelectedIndex = e.KeyCode - Keys.D1;
+			}
 		}
 		private void glControl_Resize(object sender, EventArgs e)
 		{


Fix The Layout

Fix The Layout

--- DynThings.WebPortal/Views/Shared/_Layout.cshtml
+++ DynThings.WebPortal/Views/Shared/_Layout.cshtml
@@ -69,8 +69,7 @@

-

-

+
         @RenderBody()


added temporary logging

added temporary logging

--- ECDMMessageComposer/ECDMMessageComposerAddin.cs
+++ ECDMMessageComposer/ECDMMessageComposerAddin.cs
@@ -7,6 +7,7 @@
 using SchemaBuilderFramework;
 using UTF_EA = TSF.UmlToolingFramework.Wrappers.EA;
 using EAAddinFramework.SchemaBuilder;
+using EAAddinFramework.Utilities;

 namespace ECDMMessageComposer
 {
@@ -78,10 +79,13 @@
 			UML.Classes.Kernel.Package targetPackage = this.model.getUserSelectedPackage();
 			if (targetPackage != null)
 			{
+				Logger.log("before ECDMMessageComposerAddin::schema.createSubsetModel");
 				schema.createSubsetModel(targetPackage);
+				Logger.log("after ECDMMessageComposerAddin::schema.createSubsetModel");
 				// then make a diagram and put the subset on it
 				UML.Diagrams.ClassDiagram subsetDiagram = this.model.factory.createNewDiagram<UML.Diagrams.ClassDiagram>(targetPackage, targetPackage.name);
-				subsetDiagram.save();
+				subsetDiagram.save();
+				Logger.log("after ECDMMessageComposerAddin::create subsetDiagram");
 				//put the subset elements on the new diagram
 				foreach (SchemaElement schemaElement in schema.elements)
 				{
@@ -94,8 +98,10 @@
 						subsetDiagram.addToDiagram(schemaElement.sourceElement);
 					}
 				}
+				Logger.log("after ECDMMessageComposerAddin::adding elements");
 				//layout the diagram (this will open the diagram as well)
 				subsetDiagram.autoLayout();
+				Logger.log("after ECDMMessageComposerAddin::autolayout");
 			}
 		}
 	}


Don't let the selected artist ever be null

This fixes a crash when changing the library source path

--- Espera/Espera.View/ViewModels/LocalViewModel.cs
+++ Espera/Espera.View/ViewModels/LocalViewModel.cs
@@ -114,7 +114,11 @@
         public ArtistViewModel SelectedArtist
         {
             get { return this.selectedArtist; }
-            set { this.RaiseAndSetIfChanged(ref this.selectedArtist, value); }
+            set
+            {
+                // We don't ever want the selected artist to be null
+                this.RaiseAndSetIfChanged(ref this.selectedArtist, value ?? this.allArtistsViewModel);
+            }
         }

         public bool ShowAddSongsHelperMessage


Try ignoring touch tests.

Try ignoring touch tests.

--- Gu.Wpf.UiAutomation.UiTests/Input/TouchTests.cs
+++ Gu.Wpf.UiAutomation.UiTests/Input/TouchTests.cs
@@ -6,7 +6,7 @@
     using Gu.Wpf.UiAutomation.WindowsAPI;
     using NUnit.Framework;

-    [TestFixture]
+    [Explicit("Temp ignore.")]
     public class TouchTests
     {
         private const string ExeFileName = "WpfApplication.exe";


- "sealed" decoration

- "sealed" decoration

git-svn-id: a5649c7974654692dcf39c1244dd8f20f3116d6c@4658 c0adb3ac-85ad-b347-9a16-a660ac379d24

--- src/reni2/FeatureTest/Array.cs
+++ src/reni2/FeatureTest/Array.cs
@@ -1,12 +1,11 @@
-
-using HWClassLibrary.UnitTest;
+using HWClassLibrary.UnitTest;

 namespace Reni.FeatureTest.Array
 {
     [TestFixture]
     [Target("(()<*5<*3<*5<*1) dump_print")]
     [Output("array(4 bits,(5,3,5,1))")]
-    public class ArrayFromPieces : CompilerTest
+    public sealed class ArrayFromPieces : CompilerTest
     {
         [Test, Category(UnderConstruction),Explicit]
         public override void Run() { BaseRun(); }
@@ -14,7 +13,7 @@
     [TestFixture]
     [Target("(()<*5<*3)<<(()<*5<*1) dump_print")]
     [Output("array(4 bits,(5,3,5,1))")]
-    public class CombineArraysFromPieces : CompilerTest
+    public sealed class CombineArraysFromPieces : CompilerTest
     {
         [Test, Category(UnderConstruction), Explicit]
         public override void Run() { BaseRun(); }
@@ -22,7 +21,7 @@
     [TestFixture]
     [Target("(5 type * 5)(arg/\\) array dump_print")]
     [Output("array(4 bits,(0,1,2,3,4))")]
-    public class FromTypeAndFunction : CompilerTest
+    public sealed class FromTypeAndFunction : CompilerTest
     {
         [Test, Category(UnderConstruction), Explicit]
         public override void Run() { BaseRun(); }


introduced an abstraction for converting nodes

--- Jobs/DMT.VIR.Matcher.Local/VirMatcherJobBase.cs
+++ Jobs/DMT.VIR.Matcher.Local/VirMatcherJobBase.cs
@@ -78,6 +78,11 @@
             return false;
         }

+        protected virtual T ConvertNode<T>(IEdge incomingEdge, INode node) where T : class, INode
+        {
+            return node as T;
+        }
+
         private bool TryMatchPerson(Person person)
         {
             // match person
@@ -94,7 +99,7 @@
                 }

                 neighbour = edge.GetOtherNode(person);
-                var membership = neighbour as Membership;
+                var membership = ConvertNode<Membership>(edge, neighbour);

                 // could not match group leader (maybe because it has already been matched)
                 // then try to match an active membership
@@ -108,7 +113,7 @@
                     }
                 }

-                TryMatchComminityScore(neighbour as CommunityScore);
+                TryMatchComminityScore(ConvertNode<CommunityScore>(edge, neighbour));

                 if (this.pattern.IsFullyMatched)
                 {
@@ -183,7 +188,7 @@
                     }

                     // has group
-                    Group g = edge.GetOtherNode(ms) as Group;
+                    Group g = ConvertNode<Group>(edge, edge.GetOtherNode(ms));
                     if (g != null)
                     {
                         foreach (var groupEdge in g.Edges.Cast<IMatchEdge>())
@@ -194,7 +199,7 @@
                             }

                             // has semester valuation for the specfied semester
-                            SemesterValuation sv = groupEdge.GetOtherNode(g) as SemesterValuation;
+                            SemesterValuation sv = ConvertNode<SemesterValuation>(groupEdge, groupEdge.GetOtherNode(g));
                             if (CheckSemesterValuation(sv, PatternNodes.SemesterValuation))
                             {
                                 // semester valuation is ok, check for next (or prev) version
@@ -207,7 +212,7 @@
                                         continue;
                                     }

-                                    SemesterValuation svNext = svEdge.GetOtherNode(sv) as SemesterValuation;
+                                    SemesterValuation svNext = ConvertNode<SemesterValuation>(svEdge, svEdge.GetOtherNode(sv));
                                     if (CheckSemesterValuation(svNext, PatternNodes.SemesterValuationNext)
                                         && svNext.Edges.Any(svNextEdge => !((IMatchEdge)svNextEdge).IsRemote && svNextEdge.GetOtherNode(svNext) == sv))
                                     {


taglib freezes on certain mp3 files

taglib freezes on certain mp3 files

--- src/TagLib/Mpeg/AudioHeader.cs
+++ src/TagLib/Mpeg/AudioHeader.cs
@@ -243,34 +243,13 @@
 		{
 			this.duration = TimeSpan.Zero;
 			stream_length = 0;
-
-			if (data.Count < 4)
-				throw new CorruptFileException (
-					"Insufficient header length.");
-
-			if (data [0] != 0xFF)
-				throw new CorruptFileException (
-					"First byte did not match MPEG synch.");
-
-			// Checking bits from high to low:
-			//
-			// First 3 bits MUST be set. Bits 4 and 5 can
-			// be 00, 10, or 11 but not 01. One or more of
-			// bits 6 and 7 must be set. Bit 8 can be
-			// anything.
-			if ((data [1] & 0xE6) <= 0xE0 || (data [1] & 0x18) == 0x08)
-				throw new CorruptFileException (
-					"Second byte did not match MPEG synch.");
+
+			string error = GetHeaderError(data);
+			if (error != null) {
+				throw new CorruptFileException (error);
+			}

 			flags = data.ToUInt ();
-
-			if (((flags >> 12) & 0x0F) == 0x0F)
-				throw new CorruptFileException (
-					"Header uses invalid bitrate index.");
-
-			if (((flags >> 10) & 0x03) == 0x03)
-				throw new CorruptFileException (
-					"Invalid sample rate.");

 			xing_header = XingHeader.Unknown;

@@ -732,14 +711,18 @@
 				for (int i = 0; i < buffer.Count - 3 &&
 					(length < 0 || position + i < end); i++)
 					if (buffer [i] == 0xFF &&
-						buffer [i + 1] > 0xE0)
-						try {
-							header = new AudioHeader (
-								buffer.Mid (i, 4),
-								file, position + i);
-							return true;
-						} catch (CorruptFileException) {
+						buffer [i + 1] > 0xE0) {
+						ByteVector data = buffer.Mid(i, 4);
+						if (GetHeaderError(data) == null) {
+							try {
+								header = new AudioHeader(
+									data,
+									file, position + i);
+								return true;
+							} catch (CorruptFileException) {
+							}
 						}
+					}

 				position += File.BufferSize;
 			} while (buffer.Count > 3 && (length < 0 || position < end));
@@ -779,7 +762,35 @@
 		{
 			return Find (out header, file, position, -1);
 		}
+
+		private static string GetHeaderError(ByteVector data)
+		{
+			if (data.Count < 4)
+				return "Insufficient header length.";
+
+			if (data [0] != 0xFF)
+				return "First byte did not match MPEG synch.";
+
+			// Checking bits from high to low:
+			//
+			// First 3 bits MUST be set. Bits 4 and 5 can
+			// be 00, 10, or 11 but not 01. One or more of
+			// bits 6 and 7 must be set. Bit 8 can be
+			// anything.
+			if ((data [1] & 0xE6) <= 0xE0 || (data [1] & 0x18) == 0x08)
+				return "Second byte did not match MPEG synch.";
+
+			uint flags = data.ToUInt ();
+
+			if (((flags >> 12) & 0x0F) == 0x0F)
+				return "Header uses invalid bitrate index.";
+
+			if (((flags >> 10) & 0x03) == 0x03)
+				return "Invalid sample rate.";
+
+			return null;
+		}

 		#endregion
 	}
-}
+}


Add logging.

Add logging.

--- src/TeamCityConsole/Program.cs
+++ src/TeamCityConsole/Program.cs
@@ -7,6 +7,7 @@
 using System.Threading.Tasks;
 using CommandLine;
 using Funq;
+using NLog;
 using TeamCityApi;
 using TeamCityConsole.Commands;
 using TeamCityConsole.Options;
@@ -16,6 +17,8 @@
 {
     class Program
     {
+        private static readonly Logger Log = LogManager.GetCurrentClassLogger();
+
         static void Main(string[] args)
         {
             var container = SetupContainer();
@@ -60,7 +63,7 @@
             {
                 foreach (Exception innerException in e.Flatten().InnerExceptions)
                 {
-                    Console.Out.WriteLine(innerException);
+                    Log.Fatal(innerException);
                 }
             }
         }


#203 make dates UTC

#203 make dates UTC

--- NakedFunctions/NakedFunctions.Services/Clock.cs
+++ NakedFunctions/NakedFunctions.Services/Clock.cs
@@ -9,8 +9,8 @@

 namespace NakedFunctions.Services {
     public class Clock : IClock {
-        public DateTime Now() => DateTime.Now;
+        public DateTime Now() => DateTime.UtcNow;

-        public DateTime Today() => DateTime.Today;
+        public DateTime Today() => DateTime.UtcNow.Date;
     }
 }


Rename SetChildClients() to SetChildsClients() in GitDatabaseClientTests

--- Octokit.Tests/Clients/GitDatabaseClientTests.cs
+++ Octokit.Tests/Clients/GitDatabaseClientTests.cs
@@ -14,7 +14,7 @@
         }

         [Fact]
-        public void SetChildClients()
+        public void SetChildsClients()
         {
             var apiConnection = Substitute.For<IApiConnection>();
             var gitDatabaseClient = new GitDatabaseClient(apiConnection);


Updating tests

Updating tests

--- src/Text/test/CtlLexerTests.cs
+++ src/Text/test/CtlLexerTests.cs
@@ -23,9 +23,9 @@
         }

         [TestMethod]
-        public void FailNul()
+        public void FailAlpha()
         {
-            var text = "\0";
+            var text = "A";
             using (var reader = new StringReader(text))
             using (var scanner = new TextScanner(reader))
             {


Remove nuget.csx

Remove nuget.csx

--- nuget.csx
+++ nuget.csx
@@ -1,12 +0,0 @@
-#load "Common/scripts/build.csx"
-
-BuildTestPublishPreRelease(
-    projects: new []
-    {
-        "src/Nine.Formatting.Abstractions",
-        "src/Nine.Formatting",
-    },
-    testProjects: new []
-    {
-        "test/Nine.Formatting.Test",
-    });


Wait less time in debug mode for diary to update

--- src/ViewModel/MainViewModel.cs
+++ src/ViewModel/MainViewModel.cs
@@ -1,7 +1,9 @@
 using System;
+using System.Diagnostics;
 using System.Linq;
 using System.Threading.Tasks;
 using System.Windows.Input;
+using Windows.ApplicationModel;
 using Windows.UI.Xaml;
 using GalaSoft.MvvmLight;
 using GalaSoft.MvvmLight.Command;
@@ -26,7 +28,13 @@
     public class MainViewModel : ViewModelBase
     {
         private static readonly TimeSpan OneSecond = new TimeSpan(0, 0, 1);
+
+        // While debugging we want 10 seconds to last 10 times as short
+#if DEBUG
+        private static readonly TimeSpan TenSeconds = new TimeSpan(0, 0, 1);
+#else
         private static readonly TimeSpan TenSeconds = new TimeSpan(0, 0, 10);
+#endif
         private static readonly TimeSpan FiveMinutes = new TimeSpan(0, 5, 0);
         private static readonly TimeSpan TenMinutes = new TimeSpan(0, 10, 0);
         private static readonly TimeSpan TimeToSitReady = TenSeconds;


updated the price calculator language

updated the price calculator language

--- Purchasing.Web/Views/OrderMockup/Request.cshtml
+++ Purchasing.Web/Views/OrderMockup/Request.cshtml
@@ -676,7 +676,7 @@

Extended Total:

<input id="calculator-total" type="text" placeholder="Total" title="Extended Total is the total price of all items on this line" />

-

Extended Total:

+

Price:

<input id="calculator-price" disabled="disabled" type="text" placeholder="Price" title="The price of one unit" />


Another failure.

Another failure.

--- SIMDPrototyping/Trees/SingleArray/Tree_Refit.cs
+++ SIMDPrototyping/Trees/SingleArray/Tree_Refit.cs
@@ -38,6 +38,24 @@
             }
         }

+        unsafe void Refit2(int nodeIndex, out BoundingBox boundingBox)
+        {
+            var node = nodes + nodeIndex;
+            //All non-root nodes are guaranteed to have at least 2 children, so it's safe to access the first one.
+            Debug.Assert(node->ChildCount >= 2);
+
+            if (node->ChildA >= 0)
+            {
+                Refit(node->ChildA, out node->A);
+            }
+            if (node->ChildB >= 0)
+            {
+                Refit(node->ChildB, out node->B);
+            }
+            BoundingBox.Merge(ref node->A, ref node->B, out boundingBox);
+
+        }
+
         unsafe void RefitCached(int nodeIndex, out BoundingBox boundingBox)
         {
             var node = nodes + nodeIndex;
@@ -212,7 +230,11 @@
             {
                 if (rootChildren[i] >= 0)
                 {
+#if NODE2
+                    Refit2(rootChildren[i], out rootBounds[i]);
+#else
                     Refit(rootChildren[i], out rootBounds[i]);
+#endif
                 }
             }
         }
@@ -239,12 +261,13 @@
             BoundingBox standin;
             stack[0].NodeIndex = 0;
             stack[0].ParentBounds = &standin;
+
             while (count > 0)
             {
                 var endOfStack = count - 1;
                 var stackElement = stack + endOfStack;

-
+
                 if (stackElement->NodeIndex >= 0)
                 {
                     var node = nodes + stackElement->NodeIndex;


Didn't mean to add caching to this controller. Removed from previous commit

--- Sdl.Web.Mvc/Controllers/NavigationController.cs
+++ Sdl.Web.Mvc/Controllers/NavigationController.cs
@@ -7,7 +7,6 @@
 using Sdl.Web.Common.Models;
 using Sdl.Web.Common.Models.Navigation;
 using Sdl.Web.Mvc.Configuration;
-using Sdl.Web.Mvc.OutputCache;

 namespace Sdl.Web.Mvc.Controllers
 {
@@ -21,7 +20,6 @@
         /// <param name="containerSize">The size (in grid units) of the container the navigation element is in</param>
         /// <returns></returns>
         [HandleSectionError(View = "SectionError")]
-        [DxaOutputCache]
         public virtual ActionResult Navigation(EntityModel entity, string navType, int containerSize = 0)
         {
             using (new Tracer(entity, navType, containerSize))


fix LightEntityLineHelper FillToString

fix LightEntityLineHelper FillToString

--- Signum.Web/LineHelpers/LightEntityLineHelper.cs
+++ Signum.Web/LineHelpers/LightEntityLineHelper.cs
@@ -20,7 +20,7 @@
             if (lite == null)
                 return MvcHtmlString.Empty;

-            if (string.IsNullOrEmpty(lite.ToString()))
+            if (lite.ToString() == null)
                 Database.FillToString(lite);

             MvcHtmlString result = Navigator.IsNavigable(lite.EntityType, null, isSearchEntity) ?


added ParseQueryString method

added ParseQueryString method

--- SlovakAnalyzer/SlovakAnalyzer/SlovakAnalyzer.cs
+++ SlovakAnalyzer/SlovakAnalyzer/SlovakAnalyzer.cs
@@ -4,6 +4,8 @@
 using Version = Lucene.Net.Util.Version;
 using Lucene.Net.Analysis.Hunspell;
 using System.Text;
+using System.Collections.Generic;
+using Lucene.Net.Analysis.Tokenattributes;

 namespace SlovakAnalyzer
 {
@@ -30,6 +32,25 @@
             return stream;
         }

+        public string ParseQueryString(string queryString)
+        {
+            List<string> tokens = new List<string>();
+            var tokenStream = TokenStream(null, new StringReader(queryString));
+            var offsetAttribute = (OffsetAttribute)tokenStream.GetAttribute(typeof(OffsetAttribute));
+            var termAttribute = (TermAttribute)tokenStream.GetAttribute(typeof(TermAttribute));
+
+            tokenStream.Reset();
+            while (tokenStream.IncrementToken())
+            {
+                int startOffset = offsetAttribute.StartOffset();
+                int endOffset = offsetAttribute.EndOffset();
+                string term = termAttribute.Term();
+                tokens.Add(term);
+            }
+
+            return string.Join(" ", tokens);
+        }
+
         private static Stream GenerateStreamFromString(string s)
         {
             MemoryStream stream = new MemoryStream();


Update PartialOutputRaster.cs

Update PartialOutputRaster.cs

--- src/api/PartialOutputRaster.cs
+++ src/api/PartialOutputRaster.cs
@@ -1,13 +1,5 @@
 // Copyright 2005-2006 University of Wisconsin
 // All rights reserved.
-//
-// The copyright holders license this file under the New (3-clause) BSD
-// License (the "License").  You may not use this file except in
-// compliance with the License.  A copy of the License is available at
-//
-//   http://www.opensource.org/licenses/BSD-3-Clause
-//
-// and is included in the NOTICE.txt file distributed with this work.
 //
 // Contributors:
 //   James Domingo, UW-Madison, Forest Landscape Ecology Lab


後台: 參數過濾, 變更密碼與忘記密碼頁也要完全檢查;

後台: 參數過濾, 變更密碼與忘記密碼頁也要完全檢查;

--- Source/Management/App_Code/ParamFilterClient.cs
+++ Source/Management/App_Code/ParamFilterClient.cs
@@ -256,17 +256,14 @@
         bool useSimplifedChain = true;
         string lowerFileName = execFilePath.ToLower();

-        for (int i = 0; i < 10000; i++)
-        {
-            if (lowerFileName == "login.aspx"
-                || lowerFileName == "psw-change.aspx"
-                || lowerFileName == "psw-require.aspx"
-                || lowerFileName == "captcha.ashx"
-                || lowerFileName == "errorpage.aspx"
-                )
-            {
-                useSimplifedChain = false;
-            }
+        if (lowerFileName == "login.aspx"
+            || lowerFileName == "psw-change.aspx"
+            || lowerFileName == "psw-require.aspx"
+            || lowerFileName == "captcha.ashx"
+            || lowerFileName == "errorpage.aspx"
+            )
+        {
+            useSimplifedChain = false;
         }

         //規則表達式黑名單過濾


Type safety of CCActionManager - forgot to save source

--- cocos2d/actions/CCActionManager.cs
+++ cocos2d/actions/CCActionManager.cs
@@ -6,7 +6,7 @@
 {
     public class CCActionManager : SelectorProtocol
     {
-        private static object[] m_pTmpKeysArray = new object[128];
+        private static CCNode[] m_pTmpKeysArray = new CCNode[128];
         private bool m_bCurrentTargetSalvaged;
         private HashElement m_pCurrentTarget;
         private readonly Dictionary<object, HashElement> m_pTargets = new Dictionary<object, HashElement>();
@@ -18,7 +18,7 @@
             int count = m_pTargets.Keys.Count;
             while (m_pTmpKeysArray.Length < count)
             {
-                m_pTmpKeysArray = new object[m_pTmpKeysArray.Length * 2];
+                m_pTmpKeysArray = new CCNode[m_pTmpKeysArray.Length * 2];
             }

             m_pTargets.Keys.CopyTo(m_pTmpKeysArray, 0);
@@ -205,14 +205,14 @@
             int count = m_pTargets.Keys.Count;
             if (m_pTmpKeysArray.Length < count)
             {
-                m_pTmpKeysArray = new object[m_pTmpKeysArray.Length * 2];
+                m_pTmpKeysArray = new CCNode[m_pTmpKeysArray.Length * 2];
             }

             m_pTargets.Keys.CopyTo(m_pTmpKeysArray, 0);

             for (int i = 0; i < count; i++)
             {
-                RemoveAllActionsFromTarget((CCNode)m_pTmpKeysArray[i]);
+                RemoveAllActionsFromTarget(m_pTmpKeysArray[i]);
             }
         }


Reorder methods

Reorder methods

--- APAnimatorComponent/APAnimatorSettings.cs
+++ APAnimatorComponent/APAnimatorSettings.cs
@@ -153,6 +153,15 @@
         #endregion
         #region GIZMO FIELDS

+        [SerializeField]
+        private string currentRotationPointGizmoIcon = "rec_16x16-yellow";
+
+        [SerializeField]
+        private float floatPrecision = 0.001f;
+
+        [SerializeField]
+        private string forwardPointIcon = "target_22x22-pink";
+
         /// <summary>
         ///     Color of the gizmo curve.
         /// </summary>
@@ -160,20 +169,10 @@
         private Color gizmoCurveColor = Color.yellow;

         [SerializeField]
+        private int gizmoCurveSamplingFrequency = 40;
+
+        [SerializeField]
         private Color rotationCurveColor = Color.gray;
-
-        [SerializeField]
-        private string currentRotationPointGizmoIcon = "rec_16x16-yellow";
-
-        [SerializeField]
-        private float floatPrecision = 0.001f;
-
-        [SerializeField]
-        private string forwardPointIcon = "target_22x22-pink";
-
-        [SerializeField]
-        private int gizmoCurveSamplingFrequency = 40;
-
         [SerializeField]
         private int rotationCurveSampling = 40;

@@ -233,60 +232,6 @@

         #endregion
         #region ANIMATOR FIELDS
-        private string gizmosSubfolder = "ATP/";
-
-        /// <summary>
-        /// Holds references to icons that will be copied to Assets/Gizmos folder.
-        /// </summary>
-        [SerializeField]
-        private Texture[] gizmoIcons;
-
-        [SerializeField]
-        private bool autoPlay = true;
-
-        [SerializeField]
-        private bool enableControlsInPlayMode = true;
-
-        [SerializeField]
-        private int exportSamplingFrequency = 5;
-        /// <summary>
-        ///     How much look forward point should be positioned away from the
-        ///     animated object.
-        /// </summary>
-        /// <remarks>Value is a time in range from 0 to 1.</remarks>
-        [SerializeField]
-        private float forwardPointOffset = 0.05f;
-
-        [SerializeField]
-        private HandleMode handleMode =
-            HandleMode.None;
-
-        [SerializeField]
-        private float maxAnimationSpeed = 0.3f;
-
-        [SerializeField]
-        private float positionLerpSpeed = 1;
-
-        [SerializeField]
-        private RotationMode rotationMode =
-            RotationMode.Forward;
-
-        [SerializeField]
-        private float rotationSlerpSpeed = 999.0f;
-
-        [SerializeField]
-        private TangentMode tangentMode =
-            TangentMode.Smooth;
-
-        [SerializeField]
-        private bool updateAllMode;
-
-        [SerializeField]
-        private AnimatorWrapMode wrapMode = global::AnimatorWrapMode.Clamp;
-
-        [SerializeField]
-        private int countdownToStopFramesNo = 10;
-
         [SerializeField]
         private string assetsNotLoadedInfoText =
             "Required assets were not found.\n"
@@ -294,51 +239,84 @@
             + "folder content to its default state.";

         [SerializeField]
+        private bool autoPlay = true;
+
+        [SerializeField]
+        private int countdownToStopFramesNo = 10;
+
+        [SerializeField]
+        private bool enableControlsInPlayMode = true;
+
+        [SerializeField]
+        private int exportSamplingFrequency = 5;
+
+        /// <summary>
+        ///     How much look forward point should be positioned away from the
+        ///     animated object.
+        /// </summary>
+        /// <remarks>Value is a time in range from 0 to 1.</remarks>
+        [SerializeField]
+        private float forwardPointOffset = 0.05f;
+
+        [SerializeField]
         private float forwardPointOffsetMinValue = 0.001f;

+        /// <summary>
+        /// Holds references to icons that will be copied to Assets/Gizmos folder.
+        /// </summary>
+        [SerializeField]
+        private Texture[] gizmoIcons;
+
+        private string gizmosSubfolder = "ATP/";
+        [SerializeField]
+        private HandleMode handleMode =
+            HandleMode.None;
+
+        [SerializeField]
+        private float maxAnimationSpeed = 0.3f;
+
         [SerializeField]
         private string pathDataAssetDefaultName = "Path";

+        [SerializeField]
+        private float positionLerpSpeed = 1;
+
+        [SerializeField]
+        private RotationMode rotationMode =
+            RotationMode.Forward;
+
+        [SerializeField]
+        private float rotationSlerpSpeed = 999.0f;
+
+        [SerializeField]
+        private TangentMode tangentMode =
+            TangentMode.Smooth;
+
+        [SerializeField]
+        private bool updateAllMode;
+
+        [SerializeField]
+        private AnimatorWrapMode wrapMode = AnimatorWrapMode.Clamp;
         #endregion
         #region ANIMATOR PROPERTIES
-        public float MaxAnimationSpeed {
-            get { return maxAnimationSpeed; }
-            set { maxAnimationSpeed = value; }
-        }
-
-        public string PathDataAssetDefaultName {
-            get { return pathDataAssetDefaultName; }
-            set { pathDataAssetDefaultName = value; }
-        }
-
-        public float ForwardPointOffsetMinValue {
-            get { return forwardPointOffsetMinValue; }
-            set { forwardPointOffsetMinValue = value; }
-        }
-
         public string AssetsNotLoadedInfoText {
             get { return assetsNotLoadedInfoText; }
             set { assetsNotLoadedInfoText = value; }
         }

+        public bool AutoPlay {
+            get { return autoPlay; }
+            set { autoPlay = value; }
+        }
+
         public int CountdownToStopFramesNo {
             get { return countdownToStopFramesNo; }
             set { countdownToStopFramesNo = value; }
         }

-        public string GizmosSubfolder {
-            get { return gizmosSubfolder; }
-            set { gizmosSubfolder = value; }
-        }
-
-        public Texture[] GizmoIcons {
-            get { return gizmoIcons; }
-            set { gizmoIcons = value; }
-        }
-
-        public bool AutoPlay {
-            get { return autoPlay; }
-            set { autoPlay = value; }
+        public bool EnableControlsInPlayMode {
+            get { return enableControlsInPlayMode; }
+            set { enableControlsInPlayMode = value; }
         }

         public int ExportSamplingFrequency {
@@ -356,10 +334,35 @@
             set { forwardPointOffset = value; }
         }

+        public float ForwardPointOffsetMinValue {
+            get { return forwardPointOffsetMinValue; }
+            set { forwardPointOffsetMinValue = value; }
+        }
+
+        public Texture[] GizmoIcons {
+            get { return gizmoIcons; }
+            set { gizmoIcons = value; }
+        }
+
+        public string GizmosSubfolder {
+            get { return gizmosSubfolder; }
+            set { gizmosSubfolder = value; }
+        }
+
         public HandleMode HandleMode {
             get { return handleMode; }
             set { handleMode = value; }
         }
+
+        public float MaxAnimationSpeed {
+            get { return maxAnimationSpeed; }
+            set { maxAnimationSpeed = value; }
+        }
+
+        public string PathDataAssetDefaultName {
+            get { return pathDataAssetDefaultName; }
+            set { pathDataAssetDefaultName = value; }
+        }
         public float PositionLerpSpeed {
             get { return positionLerpSpeed; }
             set { positionLerpSpeed = value; }
@@ -384,12 +387,6 @@
             get { return updateAllMode; }
             set { updateAllMode = value; }
         }
-
-        public bool EnableControlsInPlayMode {
-            get { return enableControlsInPlayMode; }
-            set { enableControlsInPlayMode = value; }
-        }
-
         public AnimatorWrapMode WrapMode {
             get { return wrapMode; }
             set { wrapMode = value; }
@@ -404,41 +401,36 @@
         [SerializeField]
         private float arcHandleRadius = 0.6f;

+        [SerializeField]
+        private int arcValueMultiplierNumerator = 360;
+
+        [SerializeField]
+        private int defaultLabelHeight = 10;
+
+        [SerializeField]
+        private int defaultLabelWidth = 30;
+
+        private int easeValueLabelOffsetX = -20;
+        private int easeValueLabelOffsetY = -25;
         private float initialArcValue = 15f;
-
-        [SerializeField]
-        private int defaultLabelHeight = 10;
-
-        [SerializeField]
-        private int defaultLabelWidth = 30;
-
-        private int easeValueLabelOffsetY = -25;
-
         [SerializeField]
         private float movementHandleSize = 0.12f;

         [SerializeField]
         private int removeButtonH = 44;
-        private int easeValueLabelOffsetX = -20;
-
         [SerializeField]
         private int removeButtonV = 10;

+        [SerializeField]
+        private Color rotationHandleColor = Color.magenta;
+
+        private float rotationHandleSize = 0.26f;
+        [SerializeField]
+        private float scaleHandleSize = 1.5f;
+
+        private int updateAllLabelOffsetX = 10;
+        private int updateAllLabelOffsetY = -25;
         private string updateAllLabelText = "A";
-
-        private int updateAllLabelOffsetY = -25;
-        private int updateAllLabelOffsetX = 10;
-        [SerializeField]
-        private float scaleHandleSize = 1.5f;
-
-        [SerializeField]
-        private Color rotationHandleColor = Color.magenta;
-
-        [SerializeField]
-        private int arcValueMultiplierNumerator = 360;
-
-        private float rotationHandleSize = 0.26f;
-
         #endregion
         #region HANDLES PROPERTIES
         public int AddButtonOffsetH {
@@ -456,6 +448,11 @@
             set { arcHandleRadius = value; }
         }

+        public int ArcValueMultiplierNumerator {
+            get { return arcValueMultiplierNumerator; }
+            set { arcValueMultiplierNumerator = value; }
+        }
+
         public int DefaultLabelHeight {
             get { return defaultLabelHeight; }
             set { defaultLabelHeight = value; }
@@ -501,6 +498,11 @@
             set { removeButtonV = value; }
         }

+        public Color RotationHandleColor {
+            get { return rotationHandleColor; }
+            set { rotationHandleColor = value; }
+        }
+
         public float RotationHandleSize {
             get { return rotationHandleSize; }
             set { rotationHandleSize = value; }
@@ -522,16 +524,6 @@
             get { return updateAllLabelText; }
             set { updateAllLabelText = value; }
         }
-
-        public Color RotationHandleColor {
-            get { return rotationHandleColor; }
-            set { rotationHandleColor = value; }
-        }
-
-        public int ArcValueMultiplierNumerator {
-            get { return arcValueMultiplierNumerator; }
-            set { arcValueMultiplierNumerator = value; }
-        }
         #endregion
     }


fix: playing remote url instead of local copy

--- AerialForWindows/Services/MovieManager.cs
+++ AerialForWindows/Services/MovieManager.cs
@@ -11,10 +11,10 @@
 namespace AerialForWindows.Services {
     public class MovieManager {
         private static readonly ILogger _logger = LogManager.GetCurrentClassLogger();
+
+        private static readonly string MoviesPath = Path.Combine(AppEnvironment.DataFolder, "movies.json");
         private readonly List<Movie> _movies = new List<Movie>();
         private readonly Random _random = new Random();
-
-        private static readonly string MoviesPath = Path.Combine(AppEnvironment.DataFolder, "movies.json");

         public MovieManager() {
             Initialization = InitMoviesAsync();
@@ -31,7 +31,8 @@
                     }
                     JsonConvert.PopulateObject(fileData, _movies);
                     _logger.Debug("Movies loaded");
-                } catch (Exception ex) {
+                }
+                catch (Exception ex) {
                     _logger.Error(ex, "Loading movies failed");
                 }
             }
@@ -53,7 +54,15 @@
             }

             if (Settings.Instance.ShouldCacheMovies) {
-                DownloadMovies();
+                foreach (var movie in _movies.Where(m => string.IsNullOrEmpty(m.LocalPath))) {
+                    var localPath = GetLocalPathForMovie(movie);
+                    if (File.Exists(localPath)) {
+                        movie.LocalPath = localPath;
+                        changed = true;
+                    }
+                }
+
+                changed |= DownloadMovies();
             }

             if (changed) {
@@ -61,12 +70,12 @@
             }
         }

-        private void DownloadMovies() {
+        private bool DownloadMovies() {
             using (var bitsManager = new BitsManager()) {
                 bitsManager.OnInterfaceError += (sender, args) => _logger.Error("BITS error: {0}\n{1}", args.Message, args.Description);

                 if (CheckRunningJob(bitsManager)) {
-                    return;
+                    return false;
                 }

                 var moviesToDownload = _movies
@@ -77,11 +86,11 @@
                 if (moviesToDownload.Any()) {
                     var job = bitsManager.CreateJob("AerialForWindows", JobType.Download);
                     job.Priority = JobPriority.Low;
-                    job.MinimumRetryDelay = 5*60; // 5 minutes
-                    job.NoProgressTimeout = 30*60; // 30 minutes
+                    job.MinimumRetryDelay = 5 * 60; // 5 minutes
+                    job.NoProgressTimeout = 30 * 60; // 30 minutes

                     foreach (var movie in moviesToDownload) {
-                        var localPath = Path.Combine(Settings.Instance.CachePath, Path.GetFileName(movie.DownloadUrl));
+                        var localPath = GetLocalPathForMovie(movie);
                         movie.LocalPath = localPath;
                         job.AddFile(movie.DownloadUrl, localPath);
                     }
@@ -91,7 +100,10 @@
                     Settings.Instance.Save();

                     _logger.Debug($"Startet download of {moviesToDownload.Count} files");
+
+                    return true;
                 }
+                return false;
             }
         }

@@ -147,7 +159,8 @@
                     textWriter.WriteLine(JsonConvert.SerializeObject(_movies, Formatting.Indented));
                 }
                 _logger.Debug("Movies saved");
-            } catch (Exception ex) {
+            }
+            catch (Exception ex) {
                 _logger.Error(ex, "Saving movies failed.");
             }
         }
@@ -161,7 +174,7 @@

             var movies = _movies.ToArray();
             if (Settings.Instance.UseTimeOfDay) {
-                var timeOfDay = (DateTime.Now.Hour > 7 && DateTime.Now.Hour < 19) ? TimeOfDay.Day : TimeOfDay.Night;
+                var timeOfDay = DateTime.Now.Hour > 7 && DateTime.Now.Hour < 19 ? TimeOfDay.Day : TimeOfDay.Night;
                 movies = movies.Where(asset => asset.TimeOfDay == timeOfDay).ToArray();
             }

@@ -170,6 +183,8 @@
                 ? movie.LocalPath
                 : movie.DownloadUrl;
         }
+
+        private string GetLocalPathForMovie(Movie movie) => Path.Combine(Settings.Instance.CachePath, Path.GetFileName(movie.DownloadUrl));
     }

     public class Movie {


master-patch_01 Fix query parameters for Wallet and Products transactions fetching logic

--- AfricasTalkingCS/AfricasTalkingGateway.cs
+++ AfricasTalkingCS/AfricasTalkingGateway.cs
@@ -1180,9 +1180,7 @@
             {
                 throw new AfricasTalkingGatewayException(response);
             }
-
-            dynamic json = JObject.Parse(response);
-            return json;
+            return response;
         }

         /// <summary>
@@ -1192,21 +1190,21 @@
             string response;
             string requestBody = $"?username={this._username}&productName={productName}&pageNumber={pageNumber}&count={count}";
             if(startDate != null)
-                requestBody += $"startDate={startDate}";
+                requestBody += $"&startDate={startDate}";
             if(endDate != null)
-                requestBody += $"endDate={endDate}";
+                requestBody += $"&endDate={endDate}";
             if(category != null)
-                requestBody += $"category={category}";
+                requestBody += $"&category={category}";
             if(provider != null)
-                requestBody += $"provider={provider}";
+                requestBody += $"&provider={provider}";
             if(status != null)
-                requestBody += $"status={status}";
+                requestBody += $"&status={status}";
             if(source != null)
-                requestBody += $"source={source}";
+                requestBody += $"&source={source}";
             if(destination != null)
-                requestBody += $"destination={destination}";
+                requestBody += $"&destination={destination}";
             if(providerChannel != null)
-                requestBody += $"providerChannel={providerChannel}";
+                requestBody += $"&providerChannel={providerChannel}";

             var url = this.FetchProductTransactionsUrl + requestBody;
             response = this.SendGetRequest(url);
@@ -1215,8 +1213,7 @@
             {
                 throw new AfricasTalkingGatewayException(response);
             }
-            dynamic json = JObject.Parse(response);
-            return json;
+            return response;
         }

         public string FetchProductTransactions(string productName, string pageNumber, string count, string startDate, string endDate) => FetchProductTransactions(productName, pageNumber, count, startDate, endDate, null, null, null, null, null, null);
@@ -1228,14 +1225,14 @@
         /// <summary>
         /// Fetch Wallet Transactions
         /// </summary>
-        public string FetchWalletTransactions(string productName, string pageNumber, string count, string startDate=null, string endDate=null, string[] categories=null){
-            string requestBody = $"?username={this._username}&productName={productName}&pageNumber={pageNumber}&count={count}";
+        public string FetchWalletTransactions(string pageNumber, string count, string startDate=null, string endDate=null, string[] categories=null){
+            string requestBody = $"?username={this._username}&pageNumber={pageNumber}&count={count}";
             if(startDate != null)
-                requestBody += $"startDate={startDate}";
+                requestBody += $"&startDate={startDate}";
             if(endDate != null)
-                requestBody += $"endDate={endDate}";
+                requestBody += $"&endDate={endDate}";
             if(categories != null)
-                requestBody += $"category={categories}";
+                requestBody += $"&category={categories}";

             var url = this.FetchWalletDetailsUrl + requestBody;
             var response = this.SendGetRequest(url);
@@ -1243,13 +1240,12 @@
             {
                 throw new AfricasTalkingGatewayException(response);
             }
-            dynamic json = JObject.Parse(response);
-            return json;
-        }
-
-        public string FetchWalletTransactions(string productName, string pageNumber, string count) => FetchWalletTransactions(productName, pageNumber, count, null, null, null);
+            return response;
+        }
+
+        public string FetchWalletTransactions(string pageNumber, string count) => FetchWalletTransactions(pageNumber, count, null, null, null);

-        public string FetchWalletTransactions(string productName, string pageNumber, string count, string startDate, string endDate) => FetchWalletTransactions(productName, pageNumber, count, startDate, endDate, null);
+        public string FetchWalletTransactions(string pageNumber, string count, string startDate, string endDate) => FetchWalletTransactions(pageNumber, count, startDate, endDate, null);

         /// <summary>
         /// Fetches wallet Balance
@@ -1264,8 +1260,7 @@
             {
                 throw new AfricasTalkingGatewayException(response);
             }
-            dynamic json = JObject.Parse(response);
-            return json;
+            return response;
         }

         // http://docs.africastalking.com/bank/checkout


Using the right comparison for NextRevision

--- Aggregator.Core/Facade/WorkItemWrapper.cs
+++ Aggregator.Core/Facade/WorkItemWrapper.cs
@@ -199,7 +199,7 @@
             {
                 int targetRevision = this.workItem.Revision + 1;

-                if (targetRevision <= this.workItem.Revisions.Count + 1)
+                if (targetRevision >= this.workItem.Revisions.Count + 1)
                 {
                     targetRevision = this.workItem.Revisions.Count - 1;
                 }


Made the dictionary case insensitive

Made the dictionary case insensitive

--- AngleSharp/Foundation/Constants/Colors.cs
+++ AngleSharp/Foundation/Constants/Colors.cs
@@ -13,7 +13,7 @@
     {
         #region Fields

-        static Dictionary<String, Color> _colors;
+        static readonly Dictionary<String, Color> _colors = new Dictionary<String, Color>(StringComparer.OrdinalIgnoreCase);
         public static readonly IBitmap Invert = new InvertColor();

         #endregion
@@ -22,8 +22,6 @@

         static Colors()
         {
-            _colors = new Dictionary<String, Color>();
-
             Add("aliceblue", 240, 248, 255);
             Add("antiquewhite", 250, 235, 215);
             Add("aqua", 0, 255, 255);
@@ -187,7 +185,7 @@
         {
             Color color;

-            if (_colors.TryGetValue(name.ToLower(), out color))
+            if (_colors.TryGetValue(name, out color))
                 return color;

             return null;


More useful display values

More useful display values

--- Anlab.Mvc/Views/Order/Confirmation.cshtml
+++ Anlab.Mvc/Views/Order/Confirmation.cshtml
@@ -35,7 +35,7 @@

         Analysis
         Code
-        Fee
+        Fee (* Qty @Model.OrderDetails.Quantity)
         SetupCost
         Sample Total

@@ -49,7 +49,7 @@

             @test.Analysis
             @test.Code
-            @(String.Format("{0:C}", testFee))
+            @(String.Format("{0:C}", testFee * Model.OrderDetails.Quantity))
             @(String.Format("{0:C}", test.SetupCost))
             @(String.Format("{0:C}", totalForTest))


Fix example

Fix example

--- ApiExamples/CSharp/ApiExamples/ExField.cs
+++ ApiExamples/CSharp/ApiExamples/ExField.cs
@@ -650,7 +650,7 @@

             builder.Write("This text is in a custom position.");

-            doc.Save(MyDir + "Field.Advance.docx");
+            doc.Save(MyDir + @"\Artifacts\Field.Advance.docx");
             //ExEnd
         }
     }


FindReplaceOptions.Direction

FindReplaceOptions.Direction

--- ApiExamples/CSharp/ApiExamples/ExRange.cs
+++ ApiExamples/CSharp/ApiExamples/ExRange.cs
@@ -182,6 +182,7 @@

         //ExStart
         //ExFor:FindReplaceOptions.ApplyFont
+        //ExFor:FindReplaceOptions.Direction
         //ExFor:FindReplaceOptions.ReplacingCallback
         //ExSummary:Shows how to apply a different font to new content via FindReplaceOptions.
         [Test] //ExSkip
@@ -199,6 +200,7 @@
             // Highlight newly inserted content.
             options.ApplyFont.HighlightColor = Color.DarkOrange;
             options.ReplacingCallback = new NumberHexer();
+            Assert.AreEqual(FindReplaceDirection.Forward, options.Direction);

             int count = doc.Range.Replace(new Regex("[0-9]+"), "", options);
         }


Fixed a tiny selecting shader bug.

Fixed a tiny selecting shader bug.

--- Assets/App/ChainVoxelModule/ChainVoxel.cs
+++ Assets/App/ChainVoxelModule/ChainVoxel.cs
@@ -707,7 +707,7 @@
 								"\", \"textureType\":\"" + textureType.ToString() + "\"}"
 							);
 							op.setTimestamp(0L);
-							this.apply(op, ChainVoxel.LOCAL_OPERATION);
+							this.apply(op, ChainVoxel.REMOTE_OPERATION);
 						}
 						else {
 							posIDs.Add(posID);
@@ -730,7 +730,7 @@

 						for(int i = 0; i < ops.Length; i++) {
 							ops[i].setTimestamp(1L + i); //0LだとStrucutureTableの条件分岐でバグる
-							this.apply(ops[i], ChainVoxel.LOCAL_OPERATION);
+							this.apply(ops[i], ChainVoxel.REMOTE_OPERATION);
 						}

 						gid = "";


support for backspace deleting selected text rather than standard functionality of deleting one character at cursor position

--- Assets/HoloToolkit/UI/Scripts/Keyboard.cs
+++ Assets/HoloToolkit/UI/Scripts/Keyboard.cs
@@ -630,13 +630,34 @@
         /// </summary>
         public void Backspace()
         {
-            m_CaretPosition = m_InputField.caretPosition;
-
-            if (m_CaretPosition > 0)
-            {
-                --m_CaretPosition;
-                m_InputField.text = m_InputField.text.Remove(m_CaretPosition, 1);
-                UpdateCaratPosition(m_CaretPosition);
+            // check if text is selected
+            if (m_InputField.selectionFocusPosition != m_InputField.caretPosition || m_InputField.selectionAnchorPosition != m_InputField.caretPosition)
+            {
+                if (m_InputField.selectionAnchorPosition > m_InputField.selectionFocusPosition) // right to left
+                {
+                    m_InputField.text = m_InputField.text.Substring(0, m_InputField.selectionFocusPosition) + m_InputField.text.Substring(m_InputField.selectionAnchorPosition);
+                    m_InputField.caretPosition = m_InputField.selectionFocusPosition;
+                }
+                else // left to right
+                {
+                    m_InputField.text = m_InputField.text.Substring(0, m_InputField.selectionAnchorPosition) + m_InputField.text.Substring(m_InputField.selectionFocusPosition);
+                    m_InputField.caretPosition = m_InputField.selectionAnchorPosition;
+                }
+
+                m_CaretPosition = m_InputField.caretPosition;
+                m_InputField.selectionAnchorPosition = m_CaretPosition;
+                m_InputField.selectionFocusPosition = m_CaretPosition;
+            }
+            else
+            {
+                m_CaretPosition = m_InputField.caretPosition;
+
+                if (m_CaretPosition > 0)
+                {
+                    --m_CaretPosition;
+                    m_InputField.text = m_InputField.text.Remove(m_CaretPosition, 1);
+                    UpdateCaratPosition(m_CaretPosition);
+                }
             }
         }


Refactor

Refactor

--- Assets/Scripts/BackgroundPatternTracer.cs
+++ Assets/Scripts/BackgroundPatternTracer.cs
@@ -32,8 +32,7 @@
 			var traceStream = Observable.Interval (TimeSpan.FromMilliseconds (100))
 				.Zip(pattern.ToObservable(), (_, i) => tiles[i]);

-			traceStream
-				.Do(tile => tileEffectEmitters[pattern.Peek() % 2](tile))
+			traceStream.Do(tileEffectEmitters[pattern.Peek() % 2])
 				.Zip(traceStream.Skip(1), (prev, current) => new { prev, current })
 				.Subscribe(tile => tile.current.DrawLine(tile.prev.gameObject.transform.position))
 				.AddTo(gameObject);


Refactor BackgroundPatternTracer

Refactor BackgroundPatternTracer

--- Assets/Scripts/BackgroundPatternTracer.cs
+++ Assets/Scripts/BackgroundPatternTracer.cs
@@ -29,13 +29,12 @@
 		Observable.Interval (TimeSpan.FromMilliseconds (700))
 			.Zip(patterns.ToObservable(), (_, p) => p).Repeat().Subscribe(pattern => {

-			var traceStream = Observable.Interval (TimeSpan.FromMilliseconds (100))
-				.Zip(pattern.ToObservable(), (_, i) => tiles[i]);
-
-			traceStream.Do(tileEffectEmitters[pattern.Peek() % 2])
-				.Zip(traceStream.Skip(1), (prev, current) => new { prev, current })
-				.Subscribe(tile => tile.current.DrawLine(tile.prev.gameObject.transform.position))
-				.AddTo(gameObject);
+			Observable.Interval (TimeSpan.FromMilliseconds (100))
+				.Zip(pattern.ToObservable(), (_, i) => tiles[i])
+				.Do(tileEffectEmitters[pattern.Peek() % 2])
+				.Buffer(2, 1).Where(b => b.Count > 1)
+					.Subscribe(b => b[0].DrawLine(b[1].gameObject.transform.position))
+					.AddTo(gameObject);

 		}).AddTo(gameObject);
 	}


feat(Pointer): options to reorient and rescale the pointer cursor

Add to VRTK_SimplePointer an option to rotate the pointer cursor to
match the normal of the target surface (pointerCursorMatchTargetNormal).

Add to VRTK_SimplePointer an option to scale the pointer cursor
proportionally to the distance from this game object if this is true
(pointerCursorRescaledAlongDistance).

Both these options are useful when using the simple pointer as a gaze
pointer with a custom pointer without a spherical symmetry.

--- Assets/VRTK/Scripts/VRTK_SimplePointer.cs
+++ Assets/VRTK/Scripts/VRTK_SimplePointer.cs
@@ -26,11 +26,16 @@
         [Header("Custom Appearance Settings", order = 4)]
         [Tooltip("A custom Game Object can be applied here to use instead of the default sphere for the pointer cursor.")]
         public GameObject customPointerCursor;
+        [Tooltip("Rotate the pointer cursor to match the normal of the target surface (or the pointer direction if no target was hit).")]
+        public bool pointerCursorMatchTargetNormal = false;
+        [Tooltip("Rescale the pointer cursor proportionally to the distance from this game object (useful when used as a gaze pointer).")]
+        public bool pointerCursorRescaledAlongDistance = false;

         private GameObject pointerHolder;
         private GameObject pointer;
         private GameObject pointerTip;
         private Vector3 pointerTipScale = new Vector3(0.05f, 0.05f, 0.05f);
+        private Vector3 pointerCursorOriginalScale = Vector3.one;

         protected override void OnEnable()
         {
@@ -57,6 +62,25 @@
                 var rayHit = Physics.Raycast(pointerRaycast, out pointerCollidedWith, pointerLength, ~layersToIgnore);
                 var pointerBeamLength = GetPointerBeamLength(rayHit, pointerCollidedWith);
                 SetPointerTransform(pointerBeamLength, pointerThickness);
+                if (rayHit)
+                {
+                    if (pointerCursorMatchTargetNormal)
+                    {
+                        pointerTip.transform.forward = -pointerCollidedWith.normal;
+                    }
+                    if (pointerCursorRescaledAlongDistance)
+                    {
+                        float collisionDistance = Vector3.Distance(pointerCollidedWith.point, transform.position);
+                        pointerTip.transform.localScale = pointerCursorOriginalScale * collisionDistance;
+                    }
+                }
+                else
+                {
+                    if (pointerCursorMatchTargetNormal)
+                    {
+                        pointerTip.transform.forward = transform.forward;
+                    }
+                }
             }
         }

@@ -96,6 +120,7 @@
                 pointerTipRenderer.material = pointerMaterial;
             }

+            pointerCursorOriginalScale = pointerTip.transform.localScale;
             pointerTip.transform.name = string.Format("[{0}]WorldPointer_SimplePointer_PointerTip", gameObject.name);
             pointerTip.transform.parent = pointerHolder.transform;
             pointerTip.GetComponent<Collider>().isTrigger = true;


Prepare release 1.1.0.12

Prepare release 1.1.0.12

--- BarcodePrinter/Properties/AssemblyInfo.cs
+++ BarcodePrinter/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0.11")]
-[assembly: AssemblyFileVersion("1.1.0.11")]
+[assembly: AssemblyVersion("1.1.0.12")]
+[assembly: AssemblyFileVersion("1.1.0.12")]


Update BankAccount.cs

Update BankAccount.cs

--- BitFlyer.Apis/ResponseData/BankAccount.cs
+++ BitFlyer.Apis/ResponseData/BankAccount.cs
@@ -1,35 +1,35 @@
-using System.Runtime.Serialization;
+using System.Runtime.Serialization;
 using System.Text;
 using Utf8Json;

-namespace BitFlyer.Apis
-{
-    public class BankAccount
-    {
-        [DataMember(Name = "id")]
-        public long Id { get; set; }
-
-        [DataMember(Name = "is_verified")]
-        public bool IsVerified { get; set; }
-
-        [DataMember(Name = "bank_name")]
-        public string BankName { get; set; }
-
-        [DataMember(Name = "branch_name")]
-        public string BranchName { get; set; }
-
-        [DataMember(Name = "account_type")]
-        public string AccountType { get; set; }
-
-        [DataMember(Name = "account_number")]
-        public string AccountNumber { get; set; }
-
-        [DataMember(Name = "account_name")]
-        public string AccountName { get; set; }
-
-        public override string ToString()
-        {
-            return Encoding.UTF8.GetString(JsonSerializer.Serialize(this));
-        }
-    }
-}
+namespace BitFlyer.Apis
+{
+    public class BankAccount
+    {
+        [DataMember(Name = "id")]
+        public long Id { get; set; }
+
+        [DataMember(Name = "is_verified")]
+        public bool IsVerified { get; set; }
+
+        [DataMember(Name = "bank_name")]
+        public string BankName { get; set; }
+
+        [DataMember(Name = "branch_name")]
+        public string BranchName { get; set; }
+
+        [DataMember(Name = "account_type")]
+        public string AccountType { get; set; }
+
+        [DataMember(Name = "account_number")]
+        public string AccountNumber { get; set; }
+
+        [DataMember(Name = "account_name")]
+        public string AccountName { get; set; }
+
+        public override string ToString()
+        {
+            return Encoding.UTF8.GetString(JsonSerializer.Serialize(this));
+        }
+    }
+}


实现C++14简单评测

实现C++14简单评测

评测姬可以工作了
TODO:
后端重构

--- judge/XMatrix.Judge/JudgeProcess.cs
+++ judge/XMatrix.Judge/JudgeProcess.cs
@@ -16,11 +16,12 @@
   public class JudgeProcess {
     ProblemCase problem_case;
     JudgeCase judge_case;
+    IMongoCollection<JudgeCase> judge_collection;

     public JudgeProcess(string _id) {
       var client = new MongoClient(Config.MongoLink);
       var db = client.GetDatabase(Config.DataBase);
-      var judge_collection = db.GetCollection<JudgeCase>("judge");
+      judge_collection = db.GetCollection<JudgeCase>("judge");
       judge_case = judge_collection.Find(Builders<JudgeCase>.Filter.Eq("_id", new ObjectId(_id))).FirstOrDefault();
       var problem_collection = db.GetCollection<ProblemCase>("problem");
       problem_case = problem_collection.Find(Builders<ProblemCase>.Filter.Eq("pid", judge_case.pid)).FirstOrDefault();
@@ -31,8 +32,11 @@
         case "C++14":
           JudgeCPP14();
           break;
+        case "C11":
+          JudgeC11();
+          break;
       }
-
+      judge_collection.ReplaceOne(Builders<JudgeCase>.Filter.Eq("_id", judge_case._id), judge_case);
       return true;
     }

@@ -40,7 +44,7 @@
       var bash = new Bash();
       string cmd = $"g++ {Config.CodePath}{judge_case.jid}.cpp -std=c++14 -Wall -o {Config.SandboxPath}{judge_case.jid}.out";
       var result = bash.Command(cmd);
-      judge_case.details = new BsonDocument[4];
+      judge_case.details = new BsonDocument[2];
       if (result.ExitCode != 0) {
         judge_case.details[0] = new BsonDocument {
           { "name", "compile"},
@@ -62,19 +66,25 @@
         for (int i = 0; i < standard_test.GetValue("num"); i++) {
           cmd = $"{Config.SandboxPath}{judge_case.jid}.out < {Config.IOPath}{judge_case.pid}/in{i}.txt > {Config.SandboxPath}out{i}.txt";
           bash.Command(cmd);
-          var compare = new Compare($"{Config.IOPath}{judge_case.pid}/in{i}.txt", $"{Config.IOPath}{judge_case.pid}/out{i}.txt", $"{Config.SandboxPath}out{i}.txt");
+          var compare = new Compare($"{Config.IOPath}{judge_case.pid}/in{i}.txt", $"{Config.IOPath}{judge_case.pid}/std{i}.txt", $"{Config.SandboxPath}out{i}.txt");
           if (compare.FileStringCompare()) {
             grade++;
           } else {
-            judge_case.details[1].Add(new BsonElement("io", new BsonDocument{
+            /*judge_case.details[1].Add(new BsonElement("io", new BsonDocument{
               { "input", compare.std_input },
               { "output", compare.std_output },
               { "your-output", compare.your_output }
-            }));
+            }));*/
           }
         }
-        judge_case.details[1].Add(new BsonElement("grade", grade / standard_test.GetValue("num").ToInt32()));
+        judge_case.details[1].Add(new BsonElement("grade", Array.Find(problem_case.test, x => x.GetValue("name") == "standard-test").GetValue("val").ToInt32() * grade / standard_test.GetValue("num").ToInt32()));
       }
+      judge_case.grade = judge_case.details[0].GetValue("grade").ToInt32() + judge_case.details[1].GetValue("grade").ToInt32();
+      judge_case.judging = false;
+    }
+
+    private void JudgeC11() {
+      return;
     }
   }
 }


ParseRST() parse R S T in matrix.

ParseRST() parse R S T in matrix.

--- CSharpGL/BasicDataStructures/GLSL/mat4.cs
+++ CSharpGL/BasicDataStructures/GLSL/mat4.cs
@@ -370,5 +370,78 @@
         }

         #endregion Multiplication
+
+        // https://blog.csdn.net/hunter_wwq/article/details/21473519
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="worldPosition"></param>
+        /// <param name="scale"></param>
+        /// <param name="rotation"></param>
+        public void ParseRST(out vec3 worldPosition, out vec3 scale, out vec4 rotation)
+        {
+            worldPosition = new vec3(this.col3.x, this.col3.y, this.col3.z);
+
+            float l0 = this.col0.length();
+            float l1 = this.col1.length();
+            float l2 = this.col2.length();
+            scale = new vec3(l0, l1, l2);
+
+            vec3 col0 = new vec3(this.col0.x / l0, this.col0.y / l0, this.col0.z / l0);
+            vec3 col1 = new vec3(this.col0.x / l1, this.col0.y / l1, this.col0.z / l1);
+            vec3 col2 = new vec3(this.col0.x / l2, this.col0.y / l2, this.col0.z / l2);
+            /*
+            col0 is vec3(1 - 2 * (yy + zz), 2 * (xy - zw), 2 * (xz + yw));
+            col1 is vec3(2 * (xy + zw), 1 - 2 * (xx + zz), 2 * (yz - xw));
+            col2 is vec3(2 * (xz - yw), 2 * (yz + xw), 1 - 2 * (xx + yy));
+             */
+            float w, x, y, z;
+            //+col0.x + col1.y + col2.z = 4ww - 1
+            w = (float)(Math.Sqrt(+col0.x + col1.y + col2.z + 1) / 2.0);
+            //+col0.x - col1.y - col2.z = 4xx - 1
+            x = (float)(Math.Sqrt(+col0.x - col1.y - col2.z + 1) / 2.0);
+            //-col0.x + col1.y - col2.z = 4yy - 1
+            y = (float)(Math.Sqrt(-col0.x + col1.y - col2.z + 1) / 2.0);
+            //-col0.x - col1.y + col2.z = 4zz - 1
+            z = (float)(Math.Sqrt(-col0.x - col1.y + col2.z + 1) / 2.0);
+            int maxIndex = GetMaxIndex(w, x, y, z);
+            switch (maxIndex)
+            {
+            case 0: // based on w
+                x = (col1.z - col2.y) * 0.25f / w;
+                y = (col2.x - col0.z) * 0.25f / w;
+                z = (col0.y - col1.x) * 0.25f / w;
+                break;
+            case 1: // based on x
+                w = (col1.z - col2.y) * 0.25f / x;
+                y = (col0.y + col1.x) * 0.25f / x;
+                z = (col2.x + col0.z) * 0.25f / x;
+                break;
+            case 2: // based on y
+                w = (col2.x - col0.z) * 0.25f / y;
+                x = (col0.y + col1.x) * 0.25f / y;
+                z = (col1.z + col2.y) * 0.25f / y;
+                break;
+            case 3: // based on z
+                w = (col0.y - col1.x) * 0.25f / z;
+                x = (col2.x + col0.z) * 0.25f / z;
+                y = (col1.z + col2.y) * 0.25f / z;
+                break;
+            }
+            var quaternion = new Quaternion(w, x, y, z);
+            float angle; vec3 axis;
+            quaternion.Parse(out angle, out axis);
+            rotation = new vec4(axis, angle);
+        }
+
+        private int GetMaxIndex(float w, float x, float y, float z)
+        {
+            float max = w; int maxIndex = 0;
+            if (max < x) { max = x; maxIndex = 1; }
+            if (max < y) { max = y; maxIndex = 2; }
+            if (max < z) { max = z; maxIndex = 3; }
+
+            return maxIndex;
+        }
     }
 }