super minor 'refractoring'

super minor 'refractoring'

--- Q2/00_/Program.cs
+++ Q2/00_/Program.cs
@@ -41,15 +41,14 @@
                 string[] bcst = inet.Split(' ')[7].Split('.');

                 byte[] ydoh = new byte[4];
-                byte[] mnsk = new byte[4];
-                byte[] cbst = new byte[4];
-
                 for (int i = 0; i < idoh.Length; i++)
                     ydoh[i] = Convert.ToByte(Convert.ToInt16(idoh[i]));

+                byte[] mnsk = new byte[4];
                 for (int i = 0; i < nmsk.Length; i++)
                     mnsk[i] = Convert.ToByte(Convert.ToInt16(nmsk[i]));

+                byte[] cbst = new byte[4];
                 for (int i = 0; i < bcst.Length; i++)
                     cbst[i] = Convert.ToByte(Convert.ToInt16(bcst[i]));

@@ -93,4 +92,4 @@

 Netwerk: 192 168 1 0

- */+ */


Fix AppAdded

Fix AppAdded

--- EarTrumpet.Actions/DataModel/Processing/AudioTriggerManager.cs
+++ EarTrumpet.Actions/DataModel/Processing/AudioTriggerManager.cs
@@ -113,7 +113,7 @@
                     if ((trigger.Device?.Id == null && device == _playbackManager.DeviceManager.Default) ||
                          trigger.Device?.Id == device.Id)
                     {
-                        if (trigger.App.Id == app.Id)
+                        if (trigger.App.Id == app.AppId)
                         {
                             Triggered?.Invoke(trigger);
                         }


Newly-created states now set their values to match the default value of the matching variable.

--- FRBDK/Glue/OfficialPlugins/Compiler/Managers/RefreshManager.cs
+++ FRBDK/Glue/OfficialPlugins/Compiler/Managers/RefreshManager.cs
@@ -345,7 +345,26 @@
                 var container = ObjectFinder.Self.GetElementContaining(category);

                 var dto = new CreateNewStateDto();
-                dto.StateSave = state;
+                var stateCopy = state.Clone();
+
+                // cateorized states always set a value. That value will either
+                // be explicitly set on the state, or it will be inherited from the
+                // default value on the object.
+                foreach(var variable in container.CustomVariables)
+                {
+                    if(category.ExcludedVariables.Contains(variable.Name))
+                    {
+                        continue;
+                    }
+
+                    stateCopy.InstructionSaves.Add(new FlatRedBall.Content.Instructions.InstructionSave
+                    {
+                        Member = variable.Name,
+                        Type = variable.Type,
+                        Value = variable.DefaultValue
+                    });
+                }
+                dto.StateSave = stateCopy;
                 dto.CategoryName = category?.Name;
                 dto.ElementNameGame = GetGameTypeFor(container);


some error handling

some error handling

--- Famoser.MassPass.Business/Repositories/CollectionRepository.cs
+++ Famoser.MassPass.Business/Repositories/CollectionRepository.cs
@@ -119,7 +119,6 @@
                 await Task.WhenAll(tasks);
                 tasks.Clear();

-
                 // 2. refresh all changed ones
                 var remotelyChangedStack = await SyncHelper.GetRemotelyChangedStack(_dataService, requestHelper);
                 for (int i = 0; i < workerConfig.IntValue && i < userConfig.ReleationIds.Count; i++)
@@ -163,9 +162,9 @@
                 {
                     changedContent.SaveDisabled = true;
                     var req = await _dataService.UpdateAsync(requestHelper.UpdateRequest(
-                        changedContent.ApiInformations.ServerId,
+                        changedContent.ApiInformations.ServerId,
                         changedContent.ApiInformations.ServerRelationId,
-                        changedContent.ApiInformations.VersionId,
+                        changedContent.ApiInformations.VersionId,
                         changedContent));

                     if (req.IsSuccessfull)
@@ -175,7 +174,15 @@
                         changedContent.ApiInformations.ServerRelationId = req.ServerRelationId;
                         changedContent.LocalStatus = LocalStatus.UpToDate;
                     }
-                    //todo: error reporting
+                    else if (req.ApiError == ApiError.InvalidVersionId)
+                    {
+                        //todo: error reporting
+                        changedContent.LocalStatus = LocalStatus.Conflict;
+                    }
+                    else
+                    {
+                        //todo: error reporting
+                    }
                 }
             }
             catch (Exception ex)
@@ -211,7 +218,7 @@
                 LogHelper.Instance.LogException(ex);
             }
         }
-
+
         private async Task ReadCollectionWorker(ConcurrentStack<Guid> stack, RequestHelper requestHelper, ConcurrentStack<CollectionEntryEntity> missingStack)
         {
             try
@@ -245,7 +252,7 @@
                 CollectionEntryEntity entry;
                 if (stack.TryPop(out entry))
                 {
-                    var response = await _dataService.ReadAsync(requestHelper.ContentEntityRequest(entry.ServerId, entry.RelationId ,entry.VersionId));
+                    var response = await _dataService.ReadAsync(requestHelper.ContentEntityRequest(entry.ServerId, entry.RelationId, entry.VersionId));
                     if (response.IsSuccessfull)
                     {
                         var newModel = new ContentModel();


Call entry point instead of falling through so ret works.

--- ArkeOS.Tools.KohlCompiler/Emit/Emitter.cs
+++ ArkeOS.Tools.KohlCompiler/Emit/Emitter.cs
@@ -28,6 +28,8 @@

             this.Emit(InstructionDefinition.SET, Parameter.CreateRegister(Register.RSP), Parameter.CreateLiteral((ulong)entry.Symbol.LocalVariables.Count + 0x1_0000));
             this.Emit(InstructionDefinition.SET, Parameter.CreateRegister(Register.RBP), Parameter.CreateLiteral(0x1_0000));
+            this.Emit(InstructionDefinition.CALL, Parameter.CreateLiteral(3, ParameterFlags.RelativeToRIP));
+            this.Emit(InstructionDefinition.HLT);

             var current = (ulong)this.instructions.Sum(i => i.Length);


only send if SendNotifications = "true"

only send if SendNotifications = "true"

if SendNotifications key doesn't exist, you will get null, which != true so this default to false, which is expected

--- Purchasing.Web/App_Start/CreateJobs.cs
+++ Purchasing.Web/App_Start/CreateJobs.cs
@@ -67,7 +67,7 @@
         private static void CreateEmailJob()
         {
             //only create the email job if not running locally (i.e., if we are running on the server) AND we explicitly set sendNotifications
-            if (HttpContext.Current.Request.IsLocal == false && WebConfigurationManager.AppSettings["SendNotifications"] != "true")
+            if (HttpContext.Current.Request.IsLocal == false && WebConfigurationManager.AppSettings["SendNotifications"] == "true")
             {
                 var job = JobBuilder.Create<EmailJob>().Build();
                 var dailyjob = JobBuilder.Create<DailyEmailJob>().Build();


Made RequestID argument optional.

Made RequestID argument optional.

--- QDMS/Requests/HistoricalDataRequest.cs
+++ QDMS/Requests/HistoricalDataRequest.cs
@@ -100,7 +100,7 @@
         {
         }

-        public HistoricalDataRequest(Instrument instrument, BarSize frequency, DateTime startingDate, DateTime endingDate, int requestID, bool forceFreshData = false, bool localStorageOnly = false, bool saveToLocalStorage = true, bool rthOnly = false)
+        public HistoricalDataRequest(Instrument instrument, BarSize frequency, DateTime startingDate, DateTime endingDate, bool forceFreshData = false, bool localStorageOnly = false, bool saveToLocalStorage = true, bool rthOnly = false, int requestID = 0)
         {
             Frequency = frequency;
             Instrument = instrument;
@@ -121,7 +121,7 @@
         /// </returns>
         public object Clone()
         {
-            var clone = new HistoricalDataRequest(Instrument, Frequency, StartingDate, EndingDate, RequestID, ForceFreshData, LocalStorageOnly, SaveDataToStorage, RTHOnly);
+            var clone = new HistoricalDataRequest(Instrument, Frequency, StartingDate, EndingDate, ForceFreshData, LocalStorageOnly, SaveDataToStorage, RTHOnly, RequestID);
             clone.AssignedID = AssignedID;
             return clone;
         }


Increase polling timeout to 5 minutes (#299)

* Increase polling timeout to 5 minutes

--- JustSaying.AwsTools/MessageHandling/SqsNotificationListener.cs
+++ JustSaying.AwsTools/MessageHandling/SqsNotificationListener.cs
@@ -12,8 +12,8 @@
 using JustSaying.Messaging.MessageSerialisation;
 using JustSaying.Messaging.Monitoring;
 using Microsoft.Extensions.Logging;
-using Message = JustSaying.Models.Message;
-
+using Message = JustSaying.Models.Message;
+
 namespace JustSaying.AwsTools.MessageHandling
 {
     public class SqsNotificationListener : INotificationSubscriber
@@ -199,7 +199,7 @@
                 WaitTimeSeconds = 20
             };

-            var receiveTimeout = new CancellationTokenSource(TimeSpan.FromSeconds(30));
+            var receiveTimeout = new CancellationTokenSource(TimeSpan.FromSeconds(300));
             ReceiveMessageResponse sqsMessageResponse;

             try


Add Agility As A Modifier For Movement Speed

Movement speed is determined by moveSpeed * agility. Agility should be small fraction or should be changed to addition instead of multiplication.

--- Assets/Scripts/Mechanics/Player/Player.cs
+++ Assets/Scripts/Mechanics/Player/Player.cs
@@ -201,8 +201,8 @@
     private void ReadyMove(Vector2 input)
     {
         velocity.y += gravity * Time.deltaTime;
-        float targetVelocityX = input.x * horizontalMoveSpeed;
-        float targetVelocityZ = input.y * verticalMoveSpeed;
+        float targetVelocityX = input.x * horizontalMoveSpeed * Agility;
+        float targetVelocityZ = input.y * verticalMoveSpeed * Agility;
         velocity.x = Mathf.SmoothDamp(velocity.x, targetVelocityX, ref velocityXSmoothing, (controller.collisions.below) ? accelerationTimeGrounded : accelerationTimeAirborne);
         velocity.z = Mathf.SmoothDamp(velocity.z, targetVelocityZ, ref velocityZSmoothing, (controller.collisions.below) ? accelerationTimeGrounded : accelerationTimeAirborne);
         controller.Move(velocity * Time.deltaTime, input);
@@ -251,21 +251,21 @@

     private void UseSkill1()
     {
-        Skills[0].UseSkill(this.gameObject);
+        Skills[0].UseSkill(gameObject);
     }

     private void UseSkill2()
     {
-        Skills[1].UseSkill(this.gameObject);
+        Skills[1].UseSkill(gameObject);
     }

     private void UseSkill3()
     {
-        Skills[2].UseSkill(this.gameObject);
+        Skills[2].UseSkill(gameObject);
     }

     private void UseSkill4()
     {
-        Skills[3].UseSkill(this.gameObject);
+        Skills[3].UseSkill(gameObject);
     }
 }


Improved code-completion logic

Improved code-completion logic

--- Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs
+++ Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs
@@ -726,9 +726,11 @@
 			if (string.IsNullOrEmpty (expr))
 				return null;

-			if (expr[expr.Length - 1] == '.') {
+			int dot = expr.LastIndexOf ('.');
+
+			if (dot != -1) {
 				try {
-					var vr = ctx.Evaluator.Evaluate (ctx, expr.Substring (0, expr.Length - 1), null);
+					var vr = ctx.Evaluator.Evaluate (ctx, expr.Substring (0, dot), null);
 					if (vr != null)
 						return GetMemberCompletionData (ctx, vr);


同じ内容のエラーを複数回出さないように修正

同じ内容のエラーを複数回出さないように修正

--- Ragnarok.Forms.Shogi/GLUtil/Texture.cs
+++ Ragnarok.Forms.Shogi/GLUtil/Texture.cs
@@ -125,6 +125,8 @@
             GC.SuppressFinalize(this);
         }

+        private static bool isOutError;
+
         /// <summary>
         /// テクスチャの削除を行います。
         /// </summary>
@@ -144,8 +146,9 @@
                 }
                 else
                 {
-                    if (TextureName != 0)
+                    if (TextureName != 0 && !isOutError)
                     {
+                        isOutError = true;
                         Log.Error(
                             "削除できないテクスチャが残りました。");
                     }


Use more descriptive name.

Use more descriptive name.

--- ReClass.NET/Nodes/BaseContainerNode.cs
+++ ReClass.NET/Nodes/BaseContainerNode.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.Diagnostics.Contracts;

@@ -137,8 +137,8 @@
 		/// <summary>Replaces the old node with the new node.</summary>
 		/// <param name="oldNode">The old node to replacce.</param>
 		/// <param name="newNode">The new node.</param>
-		/// <param name="insertedNodes">[out] A list with additional created nodes (see <see cref="ShouldCompensateSizeChanges"/>).</param>
-		public void ReplaceChildNode(BaseNode oldNode, BaseNode newNode, ref List<BaseNode> insertedNodes)
+		/// <param name="additionalCreatedNodes">[out] A list for additional created nodes (see <see cref="ShouldCompensateSizeChanges"/>) or null if not needed.</param>
+		public void ReplaceChildNode(BaseNode oldNode, BaseNode newNode, ref List<BaseNode> additionalCreatedNodes)
 		{
 			Contract.Requires(oldNode != null);
 			Contract.Requires(newNode != null);
@@ -159,14 +159,12 @@

 			if (ShouldCompensateSizeChanges)
 			{
-				insertedNodes?.Add(newNode);
-
 				var oldSize = oldNode.MemorySize;
 				var newSize = newNode.MemorySize;

 				if (newSize < oldSize)
 				{
-					InsertBytes(index + 1, oldSize - newSize, ref insertedNodes);
+					InsertBytes(index + 1, oldSize - newSize, ref additionalCreatedNodes);
 				}
 				/*else if (newSize > oldSize)
 				{


Added all properties to RemainingTime Model

--- NextHolliday/NextHolliday/NextHolliday/Models/RemainingTime.cs
+++ NextHolliday/NextHolliday/NextHolliday/Models/RemainingTime.cs
@@ -1,12 +1,33 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using MvvmHelpers;

 namespace NextHolliday.Models
 {
-    public class RemainingTime
+    public class RemainingTime : ObservableObject
     {
+
+        private int _hours;
+
+        public int Hours
+        {
+            get { return _hours; }
+            set { _hours = value; OnPropertyChanged(); }
+        }
+
+        private int _minutes;
+
+        public int Minutes
+        {
+            get { return _minutes; }
+            set { _minutes = value; OnPropertyChanged(); }
+        }
+
+        private int _seconds;
+
+        public int Seconds
+        {
+            get { return _seconds; }
+            set { _seconds = value; OnPropertyChanged(); }
+        }
+
     }
 }


Add additional time helpers for ROS ==> DateTime/TimeSpan conversion

--- ROS_Comm/_Init.cs
+++ ROS_Comm/_Init.cs
@@ -184,7 +184,47 @@
         /// <returns> containing secs, nanosecs since 1/1/1970 </returns>
         public static m.Time GetTime(DateTime time)
         {
-            return GetTime(time.Subtract(new DateTime(1970, 1, 1, 0, 0, 0)));
+            return GetTime<m.Time>(time.Subtract(new DateTime(1970, 1, 1, 0, 0, 0)));
+        }
+
+        #region time helpers
+        internal static long ticksFromData(TimeData data)
+        {
+            return data.sec * TimeSpan.TicksPerSecond + (uint)Math.Floor(data.nsec / 100.0);
+        }
+
+        internal static TimeData ticksToData(long ticks)
+        {
+            uint seconds = (((uint)Math.Floor(ticks / (1.0 * TimeSpan.TicksPerSecond))));
+            uint nanoseconds = ((uint)Math.Floor((double)(ticks - (seconds * TimeSpan.TicksPerSecond))) * 100);
+            return new TimeData(seconds, nanoseconds);
+        }
+        #endregion
+
+        /// <summary>
+        ///     Turns a std_msgs.Time into a DateTime
+        /// </summary>
+        /// <param name="time"> std_msgs.Time to convert </param>
+        /// <returns> a DateTime </returns>
+        public static DateTime GetTime(m.Time time)
+        {
+            return new DateTime(1970, 1, 1, 0, 0, 0).Add(new TimeSpan(ticksFromData(time.data)));
+        }
+
+        /// <summary>
+        ///     Turns a std_msgs.Duration into a TimeSpan
+        /// </summary>
+        /// <param name="time"> std_msgs.Duration to convert </param>
+        /// <returns> a TimeSpan </returns>
+        public static TimeSpan GetTime(m.Duration duration)
+        {
+            return new TimeSpan(ticksFromData(duration.data));
+        }
+
+        public static T GetTime<T>(TimeSpan ts) where T : IRosMessage, new()
+        {
+            T test = Activator.CreateInstance(typeof(T), GetTime(ts)) as T;
+            return test;
         }

         /// <summary>
@@ -192,16 +232,13 @@
         /// </summary>
         /// <param name="timestamp"> The timespan to convert to seconds/nanoseconds </param>
         /// <returns> a time struct </returns>
-        public static m.Time GetTime(TimeSpan timestamp)
+        public static TimeData GetTime(TimeSpan timestamp)
         {
             if (lastSimTimeReceived != default(TimeSpan))
             {
                 timestamp = timestamp.Subtract(lastSimTimeReceived).Add(lastSimTime);
             }
-            uint seconds = (((uint) Math.Floor(timestamp.TotalSeconds) & 0xFFFFFFFF));
-            uint nanoseconds = ((uint) Math.Floor(((timestamp.TotalSeconds - seconds)*1000000000)));
-            m.Time stamp = new m.Time(new TimeData(seconds, nanoseconds));
-            return stamp;
+            return ticksToData(timestamp.Ticks);
         }

         /// <summary>


Fix errors with comments

Fix errors with comments

--- RSCode/Program.cs
+++ RSCode/Program.cs
@@ -166,7 +166,6 @@
                     syn_error = 1;        // set flag if non-zero syndrome => error
                 s[i] = index_of[s[i]];
             }
-            ;

             if (syn_error != 0) {       // if errors, try and correct
                 /* compute the error location polynomial via the Berlekamp iterative algorithm,
@@ -199,7 +198,8 @@
                             elp[u + 1, i] = elp[u, i];
                             elp[u, i] = index_of[elp[u, i]];
                         }
-                    } else {// search for words with greatest u_lu[q] for which d[q]!=0q = u-1 ;
+                    } else {// search for words with greatest u_lu[q] for which d[q]!=0
+                        q = u-1 ;
                         while ((d[q]==-1) && (q>0))
                             q--;
                         // have found first non-zero d[q]
@@ -263,7 +263,8 @@
                                 reg[j] = (reg[j] + j) % nn;
                                 q ^= alpha_to[reg[j]];
                             }
-                        if (0 == q) {        // store root and error location number indicesroot[count] = i;
+                        if (0 == q) {        // store root and error location number indices
+                            root[count] = i;
                             loc[count] = nn - i;
                             count++;
                         }


Improve codes, force clients teleport when start

--- Scripts/GameApi/LiteNetLibTransform.cs
+++ Scripts/GameApi/LiteNetLibTransform.cs
@@ -39,8 +39,6 @@
         public SyncOptions syncRotationY;
         public SyncOptions syncRotationZ;

-        private LiteNetLibFunction<NetFieldVector3, NetFieldQuaternion> netFuncTeleport;
-
         #region Cache components
         public Transform CacheTransform { get; private set; }
         public NavMeshAgent CacheNavMeshAgent { get; private set; }
@@ -72,8 +70,6 @@
                     CacheRigidbody2D = GetComponent<Rigidbody2D>();
                 }
             }
-
-            RegisterNetFunction("ClientSendResult", new LiteNetLibFunction<TransformResultNetField>(ClientSendResultCallback));
         }

         private void Start()
@@ -84,16 +80,33 @@
             currentInterpResult.timestamp = Time.realtimeSinceStartup;
             syncResult = currentInterpResult;
             endInterpResult = currentInterpResult;
+            if (IsServer)
+                Teleport(CacheTransform.position, CacheTransform.rotation);
         }

         public override void OnSetup()
         {
             base.OnSetup();
-            netFuncTeleport = new LiteNetLibFunction<NetFieldVector3, NetFieldQuaternion>(NetFuncTeleportCallback);
-            RegisterNetFunction("Teleport", netFuncTeleport);
-        }
-
-        private void NetFuncTeleportCallback(NetFieldVector3 position, NetFieldQuaternion rotation)
+            RegisterNetFunction("ClientSendResult", new LiteNetLibFunction<TransformResultNetField>(ClientSendResultCallback));
+            RegisterNetFunction("Teleport", new LiteNetLibFunction<NetFieldVector3, NetFieldQuaternion>(TeleportCallback));
+        }
+
+        private void ClientSendResultCallback(TransformResultNetField resultParam)
+        {
+            // Don't update transform follow client's request if not set "canClientSendResult" to TRUE or it's the server
+            if (!ownerClientCanSendTransform || IsOwnerClient)
+                return;
+            var result = resultParam.Value;
+            // Discard out of order results
+            if (result.timestamp <= lastClientTimestamp)
+                return;
+            lastClientTimestamp = result.timestamp;
+            // Adding results to the results list so they can be used in interpolation process
+            result.timestamp = Time.realtimeSinceStartup;
+            endInterpResult = result;
+        }
+
+        private void TeleportCallback(NetFieldVector3 position, NetFieldQuaternion rotation)
         {
             currentInterpResult = new TransformResult();
             currentInterpResult.position = position;
@@ -112,19 +125,10 @@
             CallNetFunction("ClientSendResult", FunctionReceivers.Server, result);
         }

-        private void ClientSendResultCallback(TransformResultNetField resultParam)
-        {
-            // Don't update transform follow client's request if not set "canClientSendResult" to TRUE or it's the server
-            if (!ownerClientCanSendTransform || IsOwnerClient)
-                return;
-            var result = resultParam.Value;
-            // Discard out of order results
-            if (result.timestamp <= lastClientTimestamp)
-                return;
-            lastClientTimestamp = result.timestamp;
-            // Adding results to the results list so they can be used in interpolation process
-            result.timestamp = Time.realtimeSinceStartup;
-            endInterpResult = result;
+        public void Teleport(Vector3 position, Quaternion rotation)
+        {
+            if (IsServer || (ownerClientCanSendTransform && IsOwnerClient))
+                CallNetFunction("Teleport", FunctionReceivers.All, position, rotation);
         }

         public override bool ShouldSyncBehaviour()
@@ -351,11 +355,5 @@
                 CacheTransform.rotation = rotation;
             }
         }
-
-        public void Teleport(Vector3 position, Quaternion rotation)
-        {
-            if (IsServer || (ownerClientCanSendTransform && IsOwnerClient))
-                CallNetFunction("Teleport", FunctionReceivers.All, position, rotation);
-        }
     }
 }


Removed slash between url scheme and url authority

--- SeoPack/Helpers/UrlHelperExtensions.cs
+++ SeoPack/Helpers/UrlHelperExtensions.cs
@@ -117,7 +117,7 @@
         private static string ToAbsoluteUrl(string route)
         {
             var requestUrl = HttpContext.Current.Request.Url;
-            return string.Format("{0}://{1}/{2}",
+            return string.Format("{0}://{1}{2}",
                                                   requestUrl.Scheme,
                                                   requestUrl.Authority,
                                                   route);


HETS-1297

--- Server/HetsReport/OwnerVerification.cs
+++ Server/HetsReport/OwnerVerification.cs
@@ -342,8 +342,8 @@

                 GridColumn gc1 = new GridColumn { Width = col1Width };
                 tableRow1.AppendChild(gc1);
-                tableRow1.AppendChild(SetupHeaderCell("Still own/ Re-register?", col1Width, true));
-
+                tableRow1.AppendChild(SetupHeaderCell(new string[] { "Still own /", "Re-register?" }, col1Width, true));
+
                 GridColumn gc2 = new GridColumn { Width = col2Width };
                 tableRow1.AppendChild(gc2);
                 tableRow1.AppendChild(SetupHeaderCell("Local Area", col2Width, true));
@@ -419,6 +419,11 @@

         private static TableCell SetupHeaderCell(string text, string width, bool center = false)
         {
+            return SetupHeaderCell(new string[] { text }, width, center);
+        }
+
+        private static TableCell SetupHeaderCell(string[] texts, string width, bool center = false)
+        {
             try
             {
                 TableCell tableCell = new TableCell();
@@ -455,28 +460,12 @@

                 tableCell.AppendChild(tableCellProperties);

-                // add text (with specific formatting)
-                Paragraph paragraph = new Paragraph() { RsidParagraphAddition = "00607D74", RsidRunAdditionDefault = "00607D74", ParagraphId = "6ED85602", TextId = "77777777" };
-
-                ParagraphProperties paragraphProperties = new ParagraphProperties();
-                ParagraphMarkRunProperties paragraphMarkRunProperties = new ParagraphMarkRunProperties();
-
-                paragraphMarkRunProperties.AppendChild(new Color { Val = "000000" });
-                paragraphMarkRunProperties.AppendChild(new RunFonts { Ascii = "Arial" });
-                paragraphMarkRunProperties.AppendChild(new FontSize() { Val = "7pt" });
-                paragraphMarkRunProperties.AppendChild(new Bold());
-
-                Justification justification = new Justification() { Val = JustificationValues.Left };
-                if (center) justification.Val = JustificationValues.Center;
-
-                paragraphProperties.AppendChild(paragraphMarkRunProperties);
-                paragraphProperties.AppendChild(justification);
-                paragraph.AppendChild(paragraphProperties);
-
-                paragraph.AppendChild(new Text(text));
-
-                // add to table cell
-                tableCell.AppendChild(paragraph);
+                foreach(var text in texts)
+                {
+                    var paragraph = CreateParagraph(text, center);
+                    // add to table cell
+                    tableCell.AppendChild(paragraph);
+                }

                 return tableCell;
             }
@@ -485,6 +474,30 @@
                 Console.WriteLine(e);
                 throw;
             }
+        }
+
+        private static Paragraph CreateParagraph(string text, bool center)
+        {
+            Paragraph paragraph = new Paragraph() { RsidParagraphAddition = "00607D74", RsidRunAdditionDefault = "00607D74", ParagraphId = "6ED85602", TextId = "77777777" };
+
+            ParagraphProperties paragraphProperties = new ParagraphProperties();
+            ParagraphMarkRunProperties paragraphMarkRunProperties = new ParagraphMarkRunProperties();
+
+            paragraphMarkRunProperties.AppendChild(new Color { Val = "000000" });
+            paragraphMarkRunProperties.AppendChild(new RunFonts { Ascii = "Arial" });
+            paragraphMarkRunProperties.AppendChild(new FontSize() { Val = "7pt" });
+            paragraphMarkRunProperties.AppendChild(new Bold());
+
+            Justification justification = new Justification() { Val = JustificationValues.Left };
+            if (center) justification.Val = JustificationValues.Center;
+
+            paragraphProperties.AppendChild(paragraphMarkRunProperties);
+            paragraphProperties.AppendChild(justification);
+            paragraph.AppendChild(paragraphProperties);
+
+            paragraph.AppendChild(new Text(text));
+
+            return paragraph;
         }

         private static TableCell SetupCell(string text, string width, bool center = false)


Moved the redeem buttons for T7

Moved the redeem buttons for T7

--- SetupWizard/AndroidSetupOptionsPage.cs
+++ SetupWizard/AndroidSetupOptionsPage.cs
@@ -49,55 +49,11 @@

 			contentRow.AddChild(new SetupPrinterView(this.textImageButtonFactory) { WizardPage = this });
 			contentRow.AddChild(new SetupAccountView(this.textImageButtonFactory));
-			contentRow.AddChild(new EnterCodesView(this.textImageButtonFactory));

 			footerRow.AddChild(new HorizontalSpacer());
 			footerRow.AddChild(cancelButton);

 			cancelButton.Text = "Back".Localize();
-		}
-	}
-
-	public class EnterCodesView : SetupViewBase
-	{
-		public static EventHandler RedeemDesignCode;
-		public static EventHandler EnterShareCode;
-
-		public EnterCodesView(TextImageButtonFactory textImageButtonFactory) : base("")
-		{
-			this.textImageButtonFactory = textImageButtonFactory;
-			FlowLayoutWidget buttonContainer = new FlowLayoutWidget()
-			{
-				HAnchor = HAnchor.ParentLeftRight,
-				Margin = new BorderDouble(0, 14)
-			};
-			mainContainer.AddChild(buttonContainer);
-
-			if (UserSettings.Instance.IsTouchScreen)
-			{
-				// the redeem design code button
-				Button redeemPurchaseButton = textImageButtonFactory.Generate("Redeem Purchase".Localize());
-				redeemPurchaseButton.Enabled = true; // The library selector (the first library selected) is protected so we can't add to it.
-				redeemPurchaseButton.Name = "Redeem Code Button";
-				redeemPurchaseButton.Margin = new BorderDouble(0, 0, 10, 0);
-				redeemPurchaseButton.Click += (sender, e) =>
-				{
-					RedeemDesignCode?.Invoke(this, null);
-				};
-				buttonContainer.AddChild(redeemPurchaseButton);
-
-				// the redeem a share code button
-				Button redeemShareButton = textImageButtonFactory.Generate("Enter Share Code".Localize());
-				redeemShareButton.Enabled = true; // The library selector (the first library selected) is protected so we can't add to it.
-				redeemShareButton.Name = "Enter Share Code";
-				redeemShareButton.Margin = new BorderDouble(0, 0, 3, 0);
-				redeemShareButton.Click += (sender, e) =>
-				{
-					EnterShareCode?.Invoke(this, null);
-				};
-
-				buttonContainer.AddChild(redeemShareButton);
-			}
 		}
 	}

@@ -175,6 +131,9 @@

 	public class SetupAccountView : SetupViewBase
 	{
+		public static EventHandler RedeemDesignCode;
+		public static EventHandler EnterShareCode;
+
 		private event EventHandler unregisterEvents;
 		private Button signInButton;
 		private Button signOutButton;
@@ -210,7 +169,7 @@

 			connectionStatus = new TextWidget(AuthenticationString, pointSize: 8, textColor: ActiveTheme.Instance.SecondaryTextColor)
 			{
-				Margin = new BorderDouble(5,0,0,0),
+				Margin = new BorderDouble(5, 0, 0, 0),
 				AutoExpandBoundsToText = true,
 			};

@@ -231,13 +190,13 @@
 			signInButton.Margin = new BorderDouble(left: 0);
 			signInButton.VAnchor = VAnchor.ParentCenter;
 			signInButton.Visible = !signedIn;
-			signInButton.Click +=  (s, e) => UiThread.RunOnIdle(() =>
-			{
-				signInButton.Visible = false;
-				signOutButton.Visible = false;
-				statusMessage.Visible = true;
-				ApplicationController.Instance.StartSignIn();
-			});
+			signInButton.Click += (s, e) => UiThread.RunOnIdle(() =>
+		   {
+			   signInButton.Visible = false;
+			   signOutButton.Visible = false;
+			   statusMessage.Visible = true;
+			   ApplicationController.Instance.StartSignIn();
+		   });
 			buttonContainer.AddChild(signInButton);

 			signOutButton = textImageButtonFactory.Generate("Sign Out");
@@ -253,6 +212,37 @@
 			});
 			buttonContainer.AddChild(signOutButton);

+			buttonContainer.AddChild(new HorizontalSpacer());
+
+			// the redeem design code button
+			Button redeemPurchaseButton = textImageButtonFactory.Generate("Redeem Purchase".Localize());
+			redeemPurchaseButton.Enabled = true; // The library selector (the first library selected) is protected so we can't add to it.
+			redeemPurchaseButton.Name = "Redeem Code Button";
+			redeemPurchaseButton.Margin = new BorderDouble(0, 0, 10, 0);
+			redeemPurchaseButton.Click += (sender, e) =>
+			{
+				RedeemDesignCode?.Invoke(this, null);
+			};
+			buttonContainer.AddChild(redeemPurchaseButton);
+
+			// the redeem a share code button
+			Button redeemShareButton = textImageButtonFactory.Generate("Enter Share Code".Localize());
+			redeemShareButton.Enabled = true; // The library selector (the first library selected) is protected so we can't add to it.
+			redeemShareButton.Name = "Enter Share Code";
+			redeemShareButton.Margin = new BorderDouble(0, 0, 10, 0);
+			redeemShareButton.Click += (sender, e) =>
+			{
+				EnterShareCode?.Invoke(this, null);
+			};
+
+			if (!signedIn)
+			{
+				redeemPurchaseButton.Enabled = false;
+				redeemShareButton.Enabled = false;
+			}
+
+			buttonContainer.AddChild(redeemShareButton);
+
 			statusMessage = new TextWidget("Please wait...", pointSize: 12, textColor: ActiveTheme.Instance.SecondaryAccentColor);
 			statusMessage.Visible = false;
 			buttonContainer.AddChild(statusMessage);


Fix region name and comments

Fix region name and comments

--- SlackUI/Handlers/BrowserMenuHandler.cs
+++ SlackUI/Handlers/BrowserMenuHandler.cs
@@ -12,10 +12,10 @@

     internal class BrowserMenuHandler : IMenuHandler {

-        #region Internal Methods
+        #region Public Methods

         /*
-         * Handler for the browser context menu.
+         * Handler for the browser on before context menu event.
          */
         public bool OnBeforeContextMenu(IWebBrowser browser) {
             // Disable the context menu


Log Constructor Fixes #FIX: Removed pre-refactoring lines from Log constructor that didn't have any effect anymore.

--- Source/Core/Duality/Utility/Log/Log.cs
+++ Source/Core/Duality/Utility/Log/Log.cs
@@ -64,8 +64,6 @@
 			this.name = name ?? string.Empty;
 			this.id = id ?? string.Empty;
 			this.customInfo = customInfo;
-			this.output.AddRange(output);
-			this.syncOutput = this.output.ToArray();
 		}

 		/// <summary>


[Sharpdx.WIC] Fixed creation of a WIC Bitmap from a System.Drawing.Bitmap without a palette (issue #342).

--- Source/SharpDX.Direct2D1/WIC/Bitmap.cs
+++ Source/SharpDX.Direct2D1/WIC/Bitmap.cs
@@ -188,6 +188,10 @@

         private static IntPtr ConvertToHPALETTE(ColorPalette colorPalette)
         {
+            // no palette is specified
+            if(colorPalette.Entries.Length == 0)
+                return IntPtr.Zero;
+
             IntPtr ptr = Marshal.AllocHGlobal((int) (4 * (2 + colorPalette.Entries.Length)));
             Marshal.WriteInt32(ptr, 0, colorPalette.Flags);
             Marshal.WriteInt32((IntPtr) (((long) ptr) + 4L), 0, colorPalette.Entries.Length);


Change Deck.AllCards to IReadOnlyList in order to not allow the players to change the cards in the deck

--- Source/TexasHoldem.Logic/Cards/Deck.cs
+++ Source/TexasHoldem.Logic/Cards/Deck.cs
@@ -7,7 +7,7 @@

     public class Deck : IDeck
     {
-        public static readonly IList<Card> AllCards = new List<Card>();
+        public static readonly IReadOnlyList<Card> AllCards;

         private static readonly IEnumerable<CardType> AllCardTypes = new List<CardType>
                                                                          {
@@ -40,13 +40,16 @@

         static Deck()
         {
+            var cards = new List<Card>();
             foreach (var cardSuit in AllCardSuits)
             {
                 foreach (var cardType in AllCardTypes)
                 {
-                    AllCards.Add(new Card(cardSuit, cardType));
+                    cards.Add(new Card(cardSuit, cardType));
                 }
             }
+
+            AllCards = cards.AsReadOnly();
         }

         public Deck()


more work to simulator math

more work to simulator math

--- TWToolKit/TWToolKit/VillageDesigner.cs
+++ TWToolKit/TWToolKit/VillageDesigner.cs
@@ -31,19 +31,23 @@
         public Form1.VillageBuildings VillageBuild_Defense = new Form1.VillageBuildings();

         public class TroopCount {
-            public int Spearman = -1;
-            public int Swordsman = -1;
-            public int Axeman = -1;
-            public int Archer = -1;
-            public int Scout = -1;
-            public int Light_Cavalry = -1;
-            public int Mounted_Archer = -1;
-            public int Heavy_Cavalry = -1;
-            public int Ram = -1;
-            public int Catapult = -1;
-            public int Paladin = -1;
-            public int Noble = -1;
-            public int Militia = -1;
+            public double Spearman = -1;
+            public double Swordsman = -1;
+            public double Axeman = -1;
+            public double Archer = -1;
+            public double Scout = -1;
+            public double Light_Cavalry = -1;
+            public double Mounted_Archer = -1;
+            public double Heavy_Cavalry = -1;
+            public double Ram = -1;
+            public double Catapult = -1;
+            public double Paladin = -1;
+            public double Noble = -1;
+            public double Militia = -1;
+
+            public TroopCount ShallowCopy() {
+                return (TroopCount)this.MemberwiseClone();
+            }
         }

         public VillageDesigner()
@@ -229,202 +233,146 @@
                 Archer_Loss_Ratio = Math.Pow((Offensive_Archer_Strength / Defensive_Archer_Strength), 0.5) / (Defensive_Archer_Strength / Offensive_Archer_Strength);
             }

-            double Winning_Spear = 0;
-            double Winning_Sword = 0;
-            double Winning_Axe = 0;
-            double Winning_Ram = 0;
-            double Winning_Cata = 0;
-            double Winning_Paladin = 0;
-            double Winning_Noble = 0;
-            double Winning_LC = 0;
-            double Winning_HC = 0;
-            double Winning_Archer = 0;
-            double Winning_MA = 0;
-
-            double Loosing_Spear = 0;
-            double Loosing_Sword = 0;
-            double Loosing_Axe = 0;
-            double Loosing_Ram = 0;
-            double Loosing_Cata = 0;
-            double Loosing_Paladin = 0;
-            double Loosing_Noble = 0;
-            double Loosing_LC = 0;
-            double Loosing_HC = 0;
-            double Loosing_Archer = 0;
-            double Loosing_MA = 0;
+            TroopCount tmp_Offense = new TroopCount();
+            TroopCount tmp_Defense = new TroopCount();
+
+            tmp_Offense = TroopCount_Offense.ShallowCopy();
+            tmp_Defense = TroopCount_Defense.ShallowCopy();

             if (General_Winner == "Offense") {
-                Winning_Spear = TroopCount_Offense.Spearman;
-                Winning_Sword = TroopCount_Offense.Swordsman;
-                Winning_Axe = TroopCount_Offense.Axeman;
-                Winning_Ram = TroopCount_Offense.Ram;
-                Winning_Cata = TroopCount_Offense.Catapult;
-                Winning_Paladin = TroopCount_Offense.Paladin;
-                Winning_Noble = TroopCount_Offense.Noble;
-
-                Loosing_Spear = TroopCount_Defense.Spearman;
-                Loosing_Sword = TroopCount_Defense.Swordsman;
-                Loosing_Axe = TroopCount_Defense.Axeman;
-                Loosing_Ram = TroopCount_Defense.Ram;
-                Loosing_Cata = TroopCount_Defense.Catapult;
-                Loosing_Paladin = TroopCount_Defense.Paladin;
-                Loosing_Noble = TroopCount_Defense.Noble;
-            } else {
-                Winning_Spear = TroopCount_Defense.Spearman;
-                Winning_Sword = TroopCount_Defense.Swordsman;
-                Winning_Axe = TroopCount_Defense.Axeman;
-                Winning_Ram = TroopCount_Defense.Ram;
-                Winning_Cata = TroopCount_Defense.Catapult;
-                Winning_Paladin = TroopCount_Defense.Paladin;
-                Winning_Noble = TroopCount_Defense.Noble;
-
-                Loosing_Spear = TroopCount_Offense.Spearman;
-                Loosing_Sword = TroopCount_Offense.Swordsman;
-                Loosing_Axe = TroopCount_Offense.Axeman;
-                Loosing_Ram = TroopCount_Offense.Ram;
-                Loosing_Cata = TroopCount_Offense.Catapult;
-                Loosing_Paladin = TroopCount_Offense.Paladin;
-                Loosing_Noble = TroopCount_Offense.Noble;
+                tmp_Offense.Spearman -= TroopCount_Offense.Spearman * General_Loss_Ratio;
+                tmp_Offense.Swordsman -= TroopCount_Offense.Swordsman * General_Loss_Ratio;
+                tmp_Offense.Axeman -= TroopCount_Offense.Axeman * General_Loss_Ratio;
+                tmp_Offense.Ram -= TroopCount_Offense.Ram * General_Loss_Ratio;
+                tmp_Offense.Catapult -= TroopCount_Offense.Catapult * General_Loss_Ratio;
+                tmp_Offense.Paladin -= TroopCount_Offense.Paladin * General_Loss_Ratio;
+
+                tmp_Defense.Spearman -= TroopCount_Defense.Spearman * Offensive_General_Ratio;
+                tmp_Defense.Swordsman -= TroopCount_Defense.Swordsman * Offensive_General_Ratio;
+                tmp_Defense.Axeman -= TroopCount_Defense.Axeman * Offensive_General_Ratio;
+                tmp_Defense.Ram -= TroopCount_Defense.Ram * Offensive_General_Ratio;
+                tmp_Defense.Catapult -= TroopCount_Defense.Catapult * Offensive_General_Ratio;
+                tmp_Defense.Paladin -= TroopCount_Defense.Paladin * Offensive_General_Ratio;
+                tmp_Defense.Noble -= TroopCount_Defense.Noble * Offensive_General_Ratio;
+                tmp_Defense.Archer -= TroopCount_Defense.Archer * Offensive_General_Ratio;
+                tmp_Defense.Mounted_Archer -= TroopCount_Defense.Mounted_Archer * Offensive_General_Ratio;
+                tmp_Defense.Light_Cavalry -= TroopCount_Defense.Light_Cavalry * Offensive_General_Ratio;
+                tmp_Defense.Heavy_Cavalry -= TroopCount_Defense.Heavy_Cavalry * Offensive_General_Ratio;
+            } else {
+                tmp_Offense.Spearman = 0;
+                tmp_Offense.Swordsman = 0;
+                tmp_Offense.Axeman = 0;
+                tmp_Offense.Ram = 0;
+                tmp_Offense.Catapult = 0;
+                tmp_Offense.Paladin = 0;
+
+                tmp_Defense.Spearman -= TroopCount_Defense.Spearman * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Swordsman -= TroopCount_Defense.Swordsman * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Axeman -= TroopCount_Defense.Axeman * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Ram -= TroopCount_Defense.Ram * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Catapult -= TroopCount_Defense.Catapult * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Paladin -= TroopCount_Defense.Paladin * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Noble -= TroopCount_Defense.Noble * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Archer -= TroopCount_Defense.Archer * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Mounted_Archer -= TroopCount_Defense.Mounted_Archer * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Light_Cavalry -= TroopCount_Defense.Light_Cavalry * Offensive_General_Ratio * General_Loss_Ratio;
+                tmp_Defense.Heavy_Cavalry -= TroopCount_Defense.Heavy_Cavalry * Offensive_General_Ratio * General_Loss_Ratio;
             }

             if (Cavalry_Winner == "Offense") {
-                Winning_LC = TroopCount_Offense.Light_Cavalry;
-                Winning_HC = TroopCount_Offense.Heavy_Cavalry;
-
-                Loosing_LC = TroopCount_Defense.Light_Cavalry;
-                Loosing_HC = TroopCount_Defense.Heavy_Cavalry;
-            } else {
-                Winning_LC = TroopCount_Defense.Light_Cavalry;
-                Winning_HC = TroopCount_Defense.Heavy_Cavalry;
-
-                Loosing_LC = TroopCount_Offense.Light_Cavalry;
-                Loosing_HC = TroopCount_Offense.Heavy_Cavalry;
+                tmp_Offense.Light_Cavalry -= TroopCount_Offense.Light_Cavalry * Cavalry_Loss_Ratio;
+                tmp_Offense.Heavy_Cavalry -= TroopCount_Offense.Heavy_Cavalry * Cavalry_Loss_Ratio;
+
+                tmp_Defense.Spearman -= TroopCount_Defense.Spearman * Offensive_Cavalry_Ratio;
+                tmp_Defense.Swordsman -= TroopCount_Defense.Swordsman * Offensive_Cavalry_Ratio;
+                tmp_Defense.Axeman -= TroopCount_Defense.Axeman * Offensive_Cavalry_Ratio;
+                tmp_Defense.Ram -= TroopCount_Defense.Ram * Offensive_Cavalry_Ratio;
+                tmp_Defense.Catapult -= TroopCount_Defense.Catapult * Offensive_Cavalry_Ratio;
+                tmp_Defense.Paladin -= TroopCount_Defense.Paladin * Offensive_Cavalry_Ratio;
+                tmp_Defense.Noble -= TroopCount_Defense.Noble * Offensive_Cavalry_Ratio;
+                tmp_Defense.Archer -= TroopCount_Defense.Archer * Offensive_Cavalry_Ratio;
+                tmp_Defense.Mounted_Archer -= TroopCount_Defense.Mounted_Archer * Offensive_Cavalry_Ratio;
+                tmp_Defense.Light_Cavalry -= TroopCount_Defense.Light_Cavalry * Offensive_Cavalry_Ratio;
+                tmp_Defense.Heavy_Cavalry -= TroopCount_Defense.Heavy_Cavalry * Offensive_Cavalry_Ratio;
+            } else {
+                tmp_Offense.Light_Cavalry = 0;
+                tmp_Offense.Heavy_Cavalry = 0;
+
+                tmp_Defense.Spearman -= TroopCount_Defense.Spearman * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Swordsman -= TroopCount_Defense.Swordsman * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Axeman -= TroopCount_Defense.Axeman * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Ram -= TroopCount_Defense.Ram * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Catapult -= TroopCount_Defense.Catapult * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Paladin -= TroopCount_Defense.Paladin * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Noble -= TroopCount_Defense.Noble * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Archer -= TroopCount_Defense.Archer * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Mounted_Archer -= TroopCount_Defense.Mounted_Archer * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Light_Cavalry -= TroopCount_Defense.Light_Cavalry * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
+                tmp_Defense.Heavy_Cavalry -= TroopCount_Defense.Heavy_Cavalry * Offensive_Cavalry_Ratio * Cavalry_Loss_Ratio;
             }

             if (Archer_Winner == "Offense") {
-                Winning_Archer = TroopCount_Offense.Archer;
-                Winning_MA = TroopCount_Offense.Mounted_Archer;
-
-                Loosing_Archer = TroopCount_Defense.Archer;
-                Loosing_MA = TroopCount_Defense.Mounted_Archer;
-            } else {
-                Winning_Archer = TroopCount_Defense.Archer;
-                Winning_MA = TroopCount_Defense.Mounted_Archer;
-
-                Loosing_Archer = TroopCount_Offense.Archer;
-                Loosing_MA = TroopCount_Offense.Mounted_Archer;
-            }
-
-            //General Phase
-            Winning_Spear -= TroopCount_Offense.Spearman * General_Loss_Ratio;
-            Winning_Sword -= TroopCount_Offense.Swordsman * General_Loss_Ratio;
-            Winning_Axe -= TroopCount_Offense.Axeman * General_Loss_Ratio;
-            Winning_Ram -= TroopCount_Offense.Ram * General_Loss_Ratio;
-            Winning_Cata -= TroopCount_Offense.Catapult * General_Loss_Ratio;
-            Winning_Paladin -= TroopCount_Offense.Paladin * General_Loss_Ratio;
-            Winning_Noble -= TroopCount_Offense.Noble * General_Loss_Ratio;
-
-            Loosing_Spear -= TroopCount_Defense.Spearman * Offensive_General_Ratio;
-            Loosing_Sword -= TroopCount_Defense.Swordsman * Offensive_General_Ratio;
-            Loosing_Axe -= TroopCount_Defense.Axeman * Offensive_General_Ratio;
-            Loosing_Ram -= TroopCount_Defense.Ram * Offensive_General_Ratio;
-            Loosing_Cata -= TroopCount_Defense.Catapult * Offensive_General_Ratio;
-            Loosing_Paladin -= TroopCount_Defense.Paladin * Offensive_General_Ratio;
-            Loosing_Noble -= TroopCount_Defense.Noble * Offensive_General_Ratio;
-            Loosing_Archer -= TroopCount_Defense.Archer * Offensive_General_Ratio;
-            Loosing_MA -= TroopCount_Defense.Mounted_Archer * Offensive_General_Ratio;
-            Loosing_LC -= TroopCount_Defense.Light_Cavalry * Offensive_General_Ratio;
-            Loosing_HC -= TroopCount_Defense.Heavy_Cavalry * Offensive_General_Ratio;
-
-            //Cavalry Phase
-            Winning_LC -= TroopCount_Offense.Light_Cavalry * Cavalry_Loss_Ratio;
-            Winning_HC -= TroopCount_Offense.Heavy_Cavalry * Cavalry_Loss_Ratio;
-
-            Loosing_Spear -= TroopCount_Defense.Spearman * Offensive_Cavalry_Ratio;
-            Loosing_Sword -= TroopCount_Defense.Swordsman * Offensive_Cavalry_Ratio;
-            Loosing_Axe -= TroopCount_Defense.Axeman * Offensive_Cavalry_Ratio;
-            Loosing_Ram -= TroopCount_Defense.Ram * Offensive_Cavalry_Ratio;
-            Loosing_Cata -= TroopCount_Defense.Catapult * Offensive_Cavalry_Ratio;
-            Loosing_Paladin -= TroopCount_Defense.Paladin * Offensive_Cavalry_Ratio;
-            Loosing_Noble -= TroopCount_Defense.Noble * Offensive_Cavalry_Ratio;
-            Loosing_Archer -= TroopCount_Defense.Archer * Offensive_Cavalry_Ratio;
-            Loosing_MA -= TroopCount_Defense.Mounted_Archer * Offensive_Cavalry_Ratio;
-            Loosing_LC -= TroopCount_Defense.Light_Cavalry * Offensive_Cavalry_Ratio;
-            Loosing_HC -= TroopCount_Defense.Heavy_Cavalry * Offensive_Cavalry_Ratio;
-
-            //Archer Phase
-            Winning_Archer -= TroopCount_Offense.Archer * Archer_Loss_Ratio;
-            Winning_MA -= TroopCount_Offense.Mounted_Archer * Archer_Loss_Ratio;
-
-            Loosing_Spear -= TroopCount_Defense.Spearman * Offensive_Archer_Ratio;
-            Loosing_Sword -= TroopCount_Defense.Swordsman * Offensive_Archer_Ratio;
-            Loosing_Axe -= TroopCount_Defense.Axeman * Offensive_Archer_Ratio;
-            Loosing_Ram -= TroopCount_Defense.Ram * Offensive_Archer_Ratio;
-            Loosing_Cata -= TroopCount_Defense.Catapult * Offensive_Archer_Ratio;
-            Loosing_Paladin -= TroopCount_Defense.Paladin * Offensive_Archer_Ratio;
-            Loosing_Noble -= TroopCount_Defense.Noble * Offensive_Archer_Ratio;
-            Loosing_Archer -= TroopCount_Defense.Archer * Offensive_Archer_Ratio;
-            Loosing_MA -= TroopCount_Defense.Mounted_Archer * Offensive_Archer_Ratio;
-            Loosing_LC -= TroopCount_Defense.Light_Cavalry * Offensive_Archer_Ratio;
-            Loosing_HC -= TroopCount_Defense.Heavy_Cavalry * Offensive_Archer_Ratio;
-
-            //done
-            TroopCount_Offense.Spearman = (int)Math.Round(Winning_Spear);
-            TroopCount_Offense.Swordsman = (int)Math.Round(Winning_Sword);
-            TroopCount_Offense.Axeman = (int)Math.Round(Winning_Axe);
-            TroopCount_Offense.Ram = (int)Math.Round(Winning_Ram);
-            TroopCount_Offense.Catapult = (int)Math.Round(Winning_Cata);
-            TroopCount_Offense.Paladin = (int)Math.Round(Winning_Paladin);
-            TroopCount_Offense.Noble = (int)Math.Round(Winning_Noble);
-            TroopCount_Offense.Archer = (int)Math.Round(Winning_Archer);
-            TroopCount_Offense.Mounted_Archer = (int)Math.Round(Winning_MA);
-            TroopCount_Offense.Light_Cavalry = (int)Math.Round(Winning_LC);
-            TroopCount_Offense.Heavy_Cavalry = (int)Math.Round(Winning_HC);
-
-            TroopCount_Defense.Spearman = (int)Math.Round(Loosing_Spear);
-            TroopCount_Defense.Swordsman = (int)Math.Round(Loosing_Sword);
-            TroopCount_Defense.Axeman = (int)Math.Round(Loosing_Axe);
-            TroopCount_Defense.Ram = (int)Math.Round(Loosing_Ram);
-            TroopCount_Defense.Catapult = (int)Math.Round(Loosing_Cata);
-            TroopCount_Defense.Paladin = (int)Math.Round(Loosing_Paladin);
-            TroopCount_Defense.Noble = (int)Math.Round(Loosing_Noble);
-            TroopCount_Defense.Archer = (int)Math.Round(Loosing_Archer);
-            TroopCount_Defense.Mounted_Archer = (int)Math.Round(Loosing_MA);
-            TroopCount_Defense.Light_Cavalry = (int)Math.Round(Loosing_LC);
-            TroopCount_Defense.Heavy_Cavalry = (int)Math.Round(Loosing_HC);
-
+                tmp_Offense.Archer -= TroopCount_Offense.Archer * Archer_Loss_Ratio;
+                tmp_Offense.Mounted_Archer -= TroopCount_Offense.Mounted_Archer * Archer_Loss_Ratio;
+
+
+                tmp_Defense.Spearman -= TroopCount_Defense.Spearman * Offensive_Archer_Ratio;
+                tmp_Defense.Swordsman -= TroopCount_Defense.Swordsman * Offensive_Archer_Ratio;
+                tmp_Defense.Axeman -= TroopCount_Defense.Axeman * Offensive_Archer_Ratio;
+                tmp_Defense.Ram -= TroopCount_Defense.Ram * Offensive_Archer_Ratio;
+                tmp_Defense.Catapult -= TroopCount_Defense.Catapult * Offensive_Archer_Ratio;
+                tmp_Defense.Paladin -= TroopCount_Defense.Paladin * Offensive_Archer_Ratio;
+                tmp_Defense.Noble -= TroopCount_Defense.Noble * Offensive_Archer_Ratio;
+                tmp_Defense.Archer -= TroopCount_Defense.Archer * Offensive_Archer_Ratio;
+                tmp_Defense.Mounted_Archer -= TroopCount_Defense.Mounted_Archer * Offensive_Archer_Ratio;
+                tmp_Defense.Light_Cavalry -= TroopCount_Defense.Light_Cavalry * Offensive_Archer_Ratio;
+                tmp_Defense.Heavy_Cavalry -= TroopCount_Defense.Heavy_Cavalry * Offensive_Archer_Ratio;
+            } else {
+                tmp_Offense.Archer = 0;
+                tmp_Offense.Mounted_Archer = 0;
+
+                tmp_Defense.Spearman -= TroopCount_Defense.Spearman * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Swordsman -= TroopCount_Defense.Swordsman * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Axeman -= TroopCount_Defense.Axeman * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Ram -= TroopCount_Defense.Ram * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Catapult -= TroopCount_Defense.Catapult * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Paladin -= TroopCount_Defense.Paladin * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Noble -= TroopCount_Defense.Noble * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Archer -= TroopCount_Defense.Archer * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Mounted_Archer -= TroopCount_Defense.Mounted_Archer * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Light_Cavalry -= TroopCount_Defense.Light_Cavalry * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+                tmp_Defense.Heavy_Cavalry -= TroopCount_Defense.Heavy_Cavalry * Offensive_Cavalry_Ratio * Archer_Loss_Ratio;
+            }

             TroopCount Lost_TroopCount_Offense = new TroopCount();
             TroopCount Lost_TroopCount_Defense = new TroopCount();

-            Lost_TroopCount_Offense.Spearman = Int32.Parse(txtSpear.Text) - TroopCount_Offense.Spearman;
-            Lost_TroopCount_Offense.Swordsman = Int32.Parse(txtSword.Text) - TroopCount_Offense.Swordsman;
-            Lost_TroopCount_Offense.Axeman = Int32.Parse(txtAxe.Text) - TroopCount_Offense.Axeman;
-            Lost_TroopCount_Offense.Archer = Int32.Parse(txtArcher.Text) - TroopCount_Offense.Archer;
-            Lost_TroopCount_Offense.Scout = Int32.Parse(txtScout.Text) - TroopCount_Offense.Scout;
-            Lost_TroopCount_Offense.Light_Cavalry = Int32.Parse(txtLC.Text) - TroopCount_Offense.Light_Cavalry;
-            Lost_TroopCount_Offense.Mounted_Archer = Int32.Parse(txtMA.Text) - TroopCount_Offense.Mounted_Archer;
-            Lost_TroopCount_Offense.Heavy_Cavalry = Int32.Parse(txtHC.Text) - TroopCount_Offense.Heavy_Cavalry;
-            Lost_TroopCount_Offense.Ram = Int32.Parse(txtRam.Text) - TroopCount_Offense.Ram;
-            Lost_TroopCount_Offense.Catapult = Int32.Parse(txtCat.Text) - TroopCount_Offense.Catapult;
-            Lost_TroopCount_Offense.Paladin = Int32.Parse(txtPaladin.Text) - TroopCount_Offense.Paladin;
-            Lost_TroopCount_Offense.Noble = Int32.Parse(txtNoble.Text) - TroopCount_Offense.Noble;
-
-            Lost_TroopCount_Defense.Spearman = Int32.Parse(txtSpearDefense.Text) - TroopCount_Defense.Spearman;
-            Lost_TroopCount_Defense.Swordsman = Int32.Parse(txtSwordDefense.Text) - TroopCount_Defense.Swordsman;
-            Lost_TroopCount_Defense.Axeman = Int32.Parse(txtAxeDefense.Text) - TroopCount_Defense.Axeman;
-            Lost_TroopCount_Defense.Archer = Int32.Parse(txtArcherDefense.Text) - TroopCount_Defense.Archer;
-            Lost_TroopCount_Defense.Scout = Int32.Parse(txtScoutDefense.Text) - TroopCount_Defense.Scout;
-            Lost_TroopCount_Defense.Light_Cavalry = Int32.Parse(txtLCDefense.Text) - TroopCount_Defense.Light_Cavalry;
-            Lost_TroopCount_Defense.Mounted_Archer = Int32.Parse(txtMADefense.Text) - TroopCount_Defense.Mounted_Archer;
-            Lost_TroopCount_Defense.Heavy_Cavalry = Int32.Parse(txtHCDefense.Text) - TroopCount_Defense.Heavy_Cavalry;
-            Lost_TroopCount_Defense.Ram = Int32.Parse(txtRamDefense.Text) - TroopCount_Defense.Ram;
-            Lost_TroopCount_Defense.Catapult = Int32.Parse(txtCatDefense.Text) - TroopCount_Defense.Catapult;
-            Lost_TroopCount_Defense.Paladin = Int32.Parse(txtPaladinDefense.Text) - TroopCount_Defense.Paladin;
-            Lost_TroopCount_Defense.Noble = Int32.Parse(txtNobleDefense.Text) - TroopCount_Defense.Noble;
-            Lost_TroopCount_Defense.Militia = Int32.Parse(txtMilitia.Text) - TroopCount_Defense.Militia;
-
-
+            Lost_TroopCount_Offense.Spearman = Math.Round(TroopCount_Offense.Spearman - tmp_Offense.Spearman);
+            Lost_TroopCount_Offense.Swordsman = Math.Round(TroopCount_Offense.Swordsman - tmp_Offense.Swordsman);
+            Lost_TroopCount_Offense.Axeman = Math.Round(TroopCount_Offense.Axeman - tmp_Offense.Axeman);
+            Lost_TroopCount_Offense.Archer = Math.Round(TroopCount_Offense.Archer - tmp_Offense.Archer);
+            Lost_TroopCount_Offense.Scout = Math.Round(TroopCount_Offense.Scout - tmp_Offense.Scout);
+            Lost_TroopCount_Offense.Light_Cavalry = Math.Round(TroopCount_Offense.Light_Cavalry - tmp_Offense.Light_Cavalry);
+            Lost_TroopCount_Offense.Mounted_Archer = Math.Round(TroopCount_Offense.Mounted_Archer - tmp_Offense.Mounted_Archer);
+            Lost_TroopCount_Offense.Heavy_Cavalry = Math.Round(TroopCount_Offense.Heavy_Cavalry - tmp_Offense.Heavy_Cavalry);
+            Lost_TroopCount_Offense.Ram = Math.Round(TroopCount_Offense.Ram - tmp_Offense.Ram);
+            Lost_TroopCount_Offense.Catapult = Math.Round(TroopCount_Offense.Catapult - tmp_Offense.Catapult);
+            Lost_TroopCount_Offense.Paladin = Math.Round(TroopCount_Offense.Paladin - tmp_Offense.Paladin);
+            Lost_TroopCount_Offense.Noble = Math.Round(TroopCount_Offense.Noble - tmp_Offense.Noble);
+
+            Lost_TroopCount_Defense.Spearman = Math.Round(TroopCount_Defense.Spearman - tmp_Defense.Spearman);
+            Lost_TroopCount_Defense.Swordsman = Math.Round(TroopCount_Defense.Swordsman - tmp_Defense.Swordsman);
+            Lost_TroopCount_Defense.Axeman = Math.Round(TroopCount_Defense.Axeman - tmp_Defense.Axeman);
+            Lost_TroopCount_Defense.Archer = Math.Round(TroopCount_Defense.Archer - tmp_Defense.Archer);
+            Lost_TroopCount_Defense.Scout = Math.Round(TroopCount_Defense.Scout - tmp_Defense.Scout);
+            Lost_TroopCount_Defense.Light_Cavalry = Math.Round(TroopCount_Defense.Light_Cavalry - tmp_Defense.Light_Cavalry);
+            Lost_TroopCount_Defense.Mounted_Archer = Math.Round(TroopCount_Defense.Mounted_Archer - tmp_Defense.Mounted_Archer);
+            Lost_TroopCount_Defense.Heavy_Cavalry = Math.Round(TroopCount_Defense.Heavy_Cavalry - tmp_Defense.Heavy_Cavalry);
+            Lost_TroopCount_Defense.Ram = Math.Round(TroopCount_Defense.Ram - tmp_Defense.Ram);
+            Lost_TroopCount_Defense.Catapult = Math.Round(TroopCount_Defense.Catapult - tmp_Defense.Catapult);
+            Lost_TroopCount_Defense.Paladin = Math.Round(TroopCount_Defense.Paladin - tmp_Defense.Paladin);
+            Lost_TroopCount_Defense.Noble = Math.Round(TroopCount_Defense.Noble - tmp_Defense.Noble);
+            Lost_TroopCount_Defense.Militia = Math.Round(TroopCount_Defense.Militia - tmp_Defense.Militia);

             //TroopCount_Offense


Added benchmark for TALES expressions with TAL

--- Test.Parser/Tal/TalIntegrationTests.cs
+++ Test.Parser/Tal/TalIntegrationTests.cs
@@ -148,6 +148,158 @@
 			Assert.AreEqual(5, node.ChildNodes.Count, "Correct number of child nodes - TAL document");
 		}

+		[Test]
+		[Category("Benchmark")]
+		[Category("Integration")]
+		[Explicit("This test runs a few hundred iterations for benchmarking purposes")]
+		public void TestBenchmarkTalDocument()
+		{
+			string
+				directoryName = Path.Combine(ConfigurationManager.AppSettings["test-data-path"], "input"),
+				output = null;
+			FileInfo inputFile = new FileInfo(Path.Combine(directoryName, "testTalDocumentWithMockObject.xhtml"));
+			TalDocument document;
+			StringBuilder renderingBuilder;
+			MockObject mock = new MockObject(true);
+
+			int startTicks, endTicks, duration, iterations = 50;
+
+			if(!inputFile.Exists)
+			{
+				throw new FileNotFoundException("The test file does not exist.");
+			}
+
+			startTicks = Environment.TickCount;
+
+			for(int i = 0; i < iterations; i++)
+			{
+				// Load the input document and also the expected output
+				document = new TalDocument();
+				document.Load(inputFile.FullName);
+
+				// Configure the mock object
+				document.TalesContext.AddDefinition("mock", mock);
+				mock["first"] = "First test";
+				mock["second"] = "Second test";
+				mock["third"] = "Third test";
+				mock["fourth"] = "Fourth test";
+				mock.BooleanValue = false;
+
+				try
+				{
+					renderingBuilder = new StringBuilder();
+
+					using(TextWriter writer = new StringWriter(renderingBuilder))
+					{
+						using(XmlWriter xmlWriter = new XmlTextWriter(writer))
+						{
+							xmlWriter.Settings.Indent = true;
+							xmlWriter.Settings.IndentChars = "  ";
+							xmlWriter.Settings.NewLineChars = "\n";
+
+							document.Render(xmlWriter);
+						}
+					}
+
+					output = renderingBuilder.ToString();
+				}
+				catch(Exception ex)
+				{
+					Console.WriteLine (ex.ToString());
+
+					if(ex is PathInvalidException)
+					{
+						Console.WriteLine (((PathInvalidException) ex).RawPath);
+					}
+
+					Assert.Fail(String.Format("Encountered an exception whilst rendering file '{0}'.", inputFile.FullName));
+				}
+			}
+
+			endTicks = Environment.TickCount;
+
+			duration = endTicks - startTicks;
+
+			Console.WriteLine (output);
+			Console.WriteLine ("Benchmark took {0} ticks for {1} iterations", duration, iterations);
+		}
+
+		[Test]
+		[Category("Benchmark")]
+		[Category("Integration")]
+		[Explicit("This test runs a few hundred iterations for benchmarking purposes")]
+		public void TestBenchmarkTalDocumentWithOnlyStringExpressions()
+		{
+			string
+				directoryName = Path.Combine(ConfigurationManager.AppSettings["test-data-path"], "input"),
+				output = null;
+			FileInfo inputFile = new FileInfo(Path.Combine(directoryName, "test03a.html"));
+			TalDocument document;
+			StringBuilder renderingBuilder;
+			MockObject mock = new MockObject(true);
+
+			int startTicks, endTicks, duration, iterations = 50;
+
+			if(!inputFile.Exists)
+			{
+				throw new FileNotFoundException("The test file does not exist.");
+			}
+
+			startTicks = Environment.TickCount;
+
+			for(int i = 0; i < iterations; i++)
+			{
+				// Load the input document and also the expected output
+				document = new TalDocument();
+				document.Load(inputFile.FullName);
+
+				// Configure the mock object
+				document.TalesContext.AddDefinition("mock", mock);
+				mock["first"] = "First test";
+				mock["second"] = "Second test";
+				mock["third"] = "Third test";
+				mock["fourth"] = "Fourth test";
+				mock.BooleanValue = false;
+
+				try
+				{
+					renderingBuilder = new StringBuilder();
+
+					using(TextWriter writer = new StringWriter(renderingBuilder))
+					{
+						using(XmlWriter xmlWriter = new XmlTextWriter(writer))
+						{
+							xmlWriter.Settings.Indent = true;
+							xmlWriter.Settings.IndentChars = "  ";
+							xmlWriter.Settings.NewLineChars = "\n";
+
+							document.Render(xmlWriter);
+						}
+					}
+
+					output = renderingBuilder.ToString();
+				}
+				catch(Exception ex)
+				{
+					Console.WriteLine (ex.ToString());
+
+					if(ex is PathInvalidException)
+					{
+						Console.WriteLine (((PathInvalidException) ex).RawPath);
+					}
+
+					Assert.Fail(String.Format("Encountered an exception whilst rendering file '{0}'.", inputFile.FullName));
+				}
+			}
+
+			endTicks = Environment.TickCount;
+
+			duration = endTicks - startTicks;
+
+			Console.WriteLine (output);
+			Console.WriteLine ("Benchmark took {0} ticks for {1} iterations", duration, iterations);
+		}
+
 		#region supporting methods

 		/// <summary>


ship rotation buttonst now shows default rotation

--- Battlezeppelins/Views/Shared/Game2.cshtml
+++ Battlezeppelins/Views/Shared/Game2.cshtml
@@ -50,7 +50,7 @@
         </div>
         <div class="btn-group" style="padding-top:10px">
           <button type="button" class="btn btn-default" id="rotation1" value="Up" onclick="rotation = 1">Up</button>
-          <button type="button" class="btn btn-default" id="rotation2" value="Down" onclick="rotation = 2">Down</button>
+          <button type="button" class="btn btn-default btn-success" id="rotation2" value="Down" onclick="rotation = 2">Down</button>
 					<button type="button" class="btn btn-default" id="rotation3" value="Left" onclick="rotation = 3">Left</button>
           <button type="button" class="btn btn-default" id="rotation4" value="Right" onclick="rotation = 4">Right</button>
         </div>


Admin Final e começo de Serviços

Admin Final e começo de Serviços

--- BesyProject/BesyProject/Models/Servico.cs
+++ BesyProject/BesyProject/Models/Servico.cs
@@ -10,4 +10,5 @@
         public long ServicoId { get; set; }
         public string Descricao { get; set; }
     }
+
 }


Missing override for hashcode.

Missing override for hashcode.

--- BetterDefaultBrowserLib/Filters/Filter.cs
+++ BetterDefaultBrowserLib/Filters/Filter.cs
@@ -198,5 +198,10 @@
             }
             return ID == (obj as Filter).ID;
         }
+
+        public override int GetHashCode()
+        {
+            return ID.GetHashCode();
+        }
     }
 }


handled generation of generic lambda from expression types

--- TheWeel.Lambda/ReflectionExpression.cs
+++ TheWeel.Lambda/ReflectionExpression.cs
@@ -41,8 +41,8 @@
             if (source == null)
                 return new T[] { item };
             var result = new T[source.Length + 1];
-            source.CopyTo(result, 1);
-            result[0] = item;
+            source.CopyTo(result, 0);
+            result[source.Length] = item;
             return result;
         }

@@ -468,8 +468,21 @@
             return Expression.Constant(expression.ToLambda().Compile().DynamicInvoke());
         }

+        public static MethodInfo Lambda(Type type)
+        {
+            return (MethodInfo)typeof(ReflectionExpression).GetMethods(BindingFlags.Static | BindingFlags.Public).Single(mi => mi.Name == "Lambda" && mi.GetParameters().Length == 0).MakeGenericMethod(type).Invoke(null, null);
+        }
+
+        public static MethodInfo Lambda<T>()
+        {
+            return new Func<Expression, ParameterExpression[], Expression<T>>(Expression.Lambda<T>).Method;
+        }
+
         public static LambdaExpression ToLambda(this Expression body, params ParameterExpression[] parameters)
         {
+            if (parameters == null)
+                return (LambdaExpression)Lambda(body.Type.AsFuncResult()).Invoke(body, parameters);
+            return (LambdaExpression)Lambda(body.Type.AsFuncResult(parameters.Select(p => p.Type).ToArray())).Invoke(body, parameters);
             return Expression.Lambda(body, parameters);
         }

@@ -583,5 +596,49 @@
                         (selector, binding) => Expression.Bind(binding.Member, ParameterReplacerVisitor.Process(binding.Expression, selector.Parameters[0], param))))
                 .ToLambda<Func<TSource, TDestination>>(param);
         }
+
+        public static Type AsFuncResult(this Type resultType, params Type[] typeParameters)
+        {
+            var types = typeParameters.Union(resultType);
+            switch (types.Length)
+            {
+                case 1:
+                    return typeof(Func<>).MakeGenericType(types);
+                case 2:
+                    return typeof(Func<,>).MakeGenericType(types);
+                case 3:
+                    return typeof(Func<,,>).MakeGenericType(types);
+                case 4:
+                    return typeof(Func<,,,>).MakeGenericType(types);
+                case 5:
+                    return typeof(Func<,,,,>).MakeGenericType(types);
+                case 6:
+                    return typeof(Func<,,,,,>).MakeGenericType(types);
+                case 7:
+                    return typeof(Func<,,,,,,>).MakeGenericType(types);
+                case 8:
+                    return typeof(Func<,,,,,,,>).MakeGenericType(types);
+                case 9:
+                    return typeof(Func<,,,,,,,,>).MakeGenericType(types);
+                case 10:
+                    return typeof(Func<,,,,,,,,,>).MakeGenericType(types);
+                case 11:
+                    return typeof(Func<,,,,,,,,,,>).MakeGenericType(types);
+                case 12:
+                    return typeof(Func<,,,,,,,,,,,>).MakeGenericType(types);
+                case 13:
+                    return typeof(Func<,,,,,,,,,,,,>).MakeGenericType(types);
+                case 14:
+                    return typeof(Func<,,,,,,,,,,,,,>).MakeGenericType(types);
+                case 15:
+                    return typeof(Func<,,,,,,,,,,,,,,>).MakeGenericType(types);
+                case 16:
+                    return typeof(Func<,,,,,,,,,,,,,,,>).MakeGenericType(types);
+                case 17:
+                    return typeof(Func<,,,,,,,,,,,,,,,,>).MakeGenericType(types);
+                default:
+                    throw new NotSupportedException();
+            }
+        }
     }
 }


Fixed Shell32 tests for API changes

Fixed Shell32 tests for API changes

--- UnitTests/PInvoke/Shell32/IconTests.cs
+++ UnitTests/PInvoke/Shell32/IconTests.cs
@@ -29,14 +29,12 @@
 			string icoFile = TestCaseSources.WordDoc;
 			var sb = new StringBuilder(icoFile, MAX_PATH);
 			ushort iidx = 0, iid = 0;
-			using (var hIcon = ExtractAssociatedIconEx(HINSTANCE.NULL, sb, ref iidx, ref iid))
-			{
-				Assert.That(hIcon.IsInvalid, Is.False);
-				TestContext.WriteLine($"{sb}:{iidx}:{iid}");
+			using var hIcon = ExtractAssociatedIconEx(HINSTANCE.NULL, sb, ref iidx, ref iid);
+			Assert.That(hIcon.IsInvalid, Is.False);
+			TestContext.WriteLine($"{sb}:{iidx}:{iid}");

-				using (var hDupIcon = DuplicateIcon(HINSTANCE.NULL, hIcon))
-					Assert.That(hDupIcon.IsInvalid, Is.False);
-			}
+			using var hDupIcon = DuplicateIcon(HINSTANCE.NULL, hIcon);
+			Assert.That(hDupIcon.IsInvalid, Is.False);
 		}

 		[Test]
@@ -46,8 +44,8 @@
 				Assert.That(ico1.IsInvalid, Is.False);
 			using (var ico2 = ExtractIcon(HINSTANCE.NULL, "notepad.exe", -2))
 				Assert.That(ico2.IsInvalid, Is.False);
-			using (var icoCnt = ExtractIcon(HINSTANCE.NULL, "notepad.exe", -1))
-				Assert.That(icoCnt.DangerousGetHandle().ToInt32(), Is.EqualTo(1));
+			using var icoCnt = ExtractIcon(HINSTANCE.NULL, "notepad.exe", -1);
+			Assert.That(icoCnt.DangerousGetHandle().ToInt32(), Is.EqualTo(1));
 		}

 		[Test]
@@ -74,12 +72,12 @@
 		[Test]
 		public void ExtractIconExTest2()
 		{
-			var ico1 = ExtractIconEx("notepad.exe", 0, 1, out var lgIco, out var smIco);
+			var ico1 = ExtractIconEx("notepad.exe", 0, 1, out var lgIco, out _);
 			Assert.That(ico1, Is.EqualTo(2));
 			Assert.That(lgIco, Is.Not.Null.And.Length.EqualTo(1));
-			var ico2 = ExtractIconEx("notepad.exe", -2, 1, out lgIco, out smIco);
+			var ico2 = ExtractIconEx("notepad.exe", -2, 1, out _, out _);
 			Assert.That(ico2, Is.EqualTo(2));
-			var icoCnt = ExtractIconEx("notepad.exe", -1, 0, out lgIco, out smIco);
+			var icoCnt = ExtractIconEx("notepad.exe", -1, 0, out lgIco, out _);
 			Assert.That(icoCnt, Is.EqualTo(1));
 			Assert.That(lgIco, Is.Null);
 		}
@@ -104,9 +102,11 @@
 		public void SHCreateFileExtractIconWTest()
 		{
 			const string icoFile = @"notepad.exe";
-			Assert.That(SHCreateFileExtractIconW(icoFile, FileFlagsAndAttributes.FILE_ATTRIBUTE_NORMAL, typeof(IExtractIconW).GUID, out var ppv), Is.EqualTo((HRESULT)0));
+			Assert.That(SHCreateFileExtractIconW(icoFile, FileFlagsAndAttributes.FILE_ATTRIBUTE_NORMAL, typeof(IExtractIconW).GUID, out var ppv), ResultIs.Successful);
 			Assert.That(ppv, Is.Not.Null);
-			((IExtractIconW)ppv).Extract(icoFile, 0, out var lg, out var sm, Macros.MAKELONG(48, 16)).ThrowIfFailed();
+			((IExtractIconW)ppv).Extract(icoFile, 0, 48, out var lg, 16, out var sm).ThrowIfFailed();
+			Assert.That(lg.IsInvalid, Is.False);
+			Assert.That(lg.ToIcon().Height, Is.EqualTo(48));
 			Assert.That(sm.IsInvalid, Is.False);
 			Assert.That(sm.ToIcon().Height, Is.EqualTo(16));
 			Marshal.FinalReleaseComObject(ppv);
@@ -116,7 +116,7 @@
 		public void SHDefExtractIconTest()
 		{
 			const string icoFile = @"notepad.exe";
-			Assert.That(SHDefExtractIcon(icoFile, -2, 0, out var lg, out var sm, Macros.MAKELONG(48, 16)), Is.EqualTo((HRESULT)0));
+			Assert.That(SHDefExtractIcon(icoFile, -2, 0, out _, out var sm, Macros.MAKELONG(48, 16)), Is.EqualTo((HRESULT)0));
 			Assert.That(sm.IsInvalid, Is.False);
 			Assert.That(sm.ToIcon().Height, Is.EqualTo(16));
 		}


Refactor - promote StringBuilderResult to class member variable

--- VasysRomanNumeralsKata/RomanNumeral.cs
+++ VasysRomanNumeralsKata/RomanNumeral.cs
@@ -7,7 +7,8 @@
     public class RomanNumeral
     {
         private int? _baseTenRepresentation = null;
-        private int remainder;
+        private int remainder = 0;
+        private StringBuilder romanNumeralResult = new StringBuilder();

         public RomanNumeral(int baseTenNumber)
         {
@@ -22,27 +23,22 @@
             //if (_baseTenRepresentation < 1 || _baseTenRepresentation >= 4000)
             //    throw new ArgumentOutOfRangeException("Value cannot be represented with the given set of roman numeral values");

-            StringBuilder romanNumeralBuilder = new StringBuilder();
-
             // 400 to 3000
-            var thousandsResult = GenerateNumeralsForGivenRepeatableNumeral(1000, romanNumeralBuilder);
-            romanNumeralBuilder = thousandsResult;
+            CalculateNumeralsForGivenRepeatableNumeral(1000);

             // 40 to 300
-            var hundredsResult = GenerateNumeralsForGivenRepeatableNumeral(100, romanNumeralBuilder);
-            romanNumeralBuilder = hundredsResult;
+            CalculateNumeralsForGivenRepeatableNumeral(100);

             // 4 to 30
-            var tensResult = GenerateNumeralsForGivenRepeatableNumeral(10, romanNumeralBuilder);
-            romanNumeralBuilder = tensResult;
+            CalculateNumeralsForGivenRepeatableNumeral(10);

             while (remainder / 1 > 0)
             {
-                romanNumeralBuilder.Append("I");
+                romanNumeralResult.Append("I");
                 remainder -= 1;
             }
-            return romanNumeralBuilder.ToString();
+            return romanNumeralResult.ToString();
         }

         private static readonly Dictionary<int, char> numeralLookup = new Dictionary<int, char>()
@@ -60,25 +56,21 @@
         private static readonly int factorDifferenceBetweenRepeatableNumeralAndComplementaryDecrement = 10;
         private static readonly int factorDifferenceBetweenRepeatableNumeralAndPartialStep = 2;

-        private StringBuilder GenerateNumeralsForGivenRepeatableNumeral(int repeatableValue, StringBuilder romanNumeralBuilder)
+        private void CalculateNumeralsForGivenRepeatableNumeral(int repeatableValue)
         {
             int decrementNumeralValue = repeatableValue / factorDifferenceBetweenRepeatableNumeralAndComplementaryDecrement;
-            var repeatableNumeralResult = GenerateNumeralsForGivenNumeral(repeatableValue, decrementNumeralValue, romanNumeralBuilder);
-            romanNumeralBuilder = repeatableNumeralResult;
+            CalculateNumeralsForGivenNumeral(repeatableValue, decrementNumeralValue);

             int partialStepNumeralValue = repeatableValue / factorDifferenceBetweenRepeatableNumeralAndPartialStep;
-            var partialStepNumeralResult = GenerateNumeralsForGivenNumeral(partialStepNumeralValue, decrementNumeralValue, romanNumeralBuilder);
-            romanNumeralBuilder = partialStepNumeralResult;
-
-            return romanNumeralBuilder;
+            CalculateNumeralsForGivenNumeral(partialStepNumeralValue, decrementNumeralValue);
         }

-        private StringBuilder GenerateNumeralsForGivenNumeral(int numeralValue, int decrementNumeralValue, StringBuilder romanNumeralBuilder)
+        private void CalculateNumeralsForGivenNumeral(int numeralValue, int decrementNumeralValue)
         {
             char numeralCharacter = numeralLookup[numeralValue];
             while (remainder >= numeralValue)
             {
-                romanNumeralBuilder.Append(numeralCharacter);
+                romanNumeralResult.Append(numeralCharacter);
                 remainder -= numeralValue;
             }

@@ -86,12 +78,10 @@
             int numeralValueMinusDecrement = numeralValue - decrementNumeralValue;
             if (remainder >= numeralValueMinusDecrement)
             {
-                romanNumeralBuilder.Append(decrementNumeralCharacter);
-                romanNumeralBuilder.Append(numeralCharacter);
+                romanNumeralResult.Append(decrementNumeralCharacter);
+                romanNumeralResult.Append(numeralCharacter);
                 remainder -= numeralValueMinusDecrement;
             }
-
-            return romanNumeralBuilder;
         }
     }
 }


Refactoring.

Refactoring.

--- VasysRomanNumeralsKata/RomanNumeral.cs
+++ VasysRomanNumeralsKata/RomanNumeral.cs
@@ -21,32 +21,17 @@
             int remainder = (int)_baseTenRepresentation;

             // 400 to 3000
-            RepeatableNumeralSet thousandsNumeralSet = new RepeatableNumeralSet();
-            thousandsNumeralSet.RepeatableNumeral = new NumeralValuePair() { Numeral = 'M', Value = 1000 };
-            thousandsNumeralSet.HalfRepeatableNumeral = new NumeralValuePair() { Numeral = 'D', Value = 500 };
-            thousandsNumeralSet.NextLowestRepeatableNumeral = new NumeralValuePair() { Numeral = 'C', Value = 100 };
-
-            var thousandsResult = GenerateNumeralsForGivenRepeatableNumeral(thousandsNumeralSet, romanNumeralBuilder, remainder);
+            var thousandsResult = GenerateNumeralsForGivenRepeatableNumeral(1000, romanNumeralBuilder, remainder);
             romanNumeralBuilder = thousandsResult.Item1;
             remainder = thousandsResult.Item2;

             // 40 to 300
-            RepeatableNumeralSet hundredsNumeralSet = new RepeatableNumeralSet();
-            hundredsNumeralSet.RepeatableNumeral = new NumeralValuePair() { Numeral = 'C', Value = 100 };
-            hundredsNumeralSet.HalfRepeatableNumeral = new NumeralValuePair() { Numeral = 'L', Value = 50 };
-            hundredsNumeralSet.NextLowestRepeatableNumeral = new NumeralValuePair() { Numeral = 'X', Value = 10 };
-
-            var hundredsResult = GenerateNumeralsForGivenRepeatableNumeral(hundredsNumeralSet, romanNumeralBuilder, remainder);
+            var hundredsResult = GenerateNumeralsForGivenRepeatableNumeral(100, romanNumeralBuilder, remainder);
             romanNumeralBuilder = hundredsResult.Item1;
             remainder = hundredsResult.Item2;

             // 4 to 30
-            RepeatableNumeralSet tensNumeralSet = new RepeatableNumeralSet();
-            tensNumeralSet.RepeatableNumeral = new NumeralValuePair() { Numeral = 'X', Value = 10 };
-            tensNumeralSet.HalfRepeatableNumeral = new NumeralValuePair() { Numeral = 'V', Value = 5 };
-            tensNumeralSet.NextLowestRepeatableNumeral = new NumeralValuePair() { Numeral = 'I', Value = 1 };
-
-            var tensResult = GenerateNumeralsForGivenRepeatableNumeral(tensNumeralSet, romanNumeralBuilder, remainder);
+            var tensResult = GenerateNumeralsForGivenRepeatableNumeral(10, romanNumeralBuilder, remainder);
             romanNumeralBuilder = tensResult.Item1;
             remainder = tensResult.Item2;

@@ -59,52 +44,49 @@
             return romanNumeralBuilder.ToString();
         }

-        private struct NumeralValuePair
+        private static Dictionary<int, char> numeralLookup = new Dictionary<int, char>()
         {
-            public char Numeral { get; set; }
-            public int Value { get; set; }
-        }
+            {1000, 'M'},
+            {500, 'D'},
+            {100, 'C'},
+            {50, 'L'},
+            {10, 'X'},
+            {5, 'V'},
+            {1, 'I'}
+        };

-        private struct RepeatableNumeralSet
+        private Tuple<StringBuilder, int> GenerateNumeralsForGivenRepeatableNumeral(int repeatableValue, StringBuilder romanNumeralBuilder, int remainder)
         {
-            public NumeralValuePair RepeatableNumeral { get; set; }
-            public NumeralValuePair HalfRepeatableNumeral { get; set; }
-            public NumeralValuePair NextLowestRepeatableNumeral { get; set; }
-        }
-
-        private Tuple<StringBuilder, int> GenerateNumeralsForGivenRepeatableNumeral(RepeatableNumeralSet repeatableNumeralSet, StringBuilder romanNumeralBuilder, int remainder)
-        {
-            int repeatableNumeralValue = repeatableNumeralSet.RepeatableNumeral.Value;
-            char repeatableNumeralChar = repeatableNumeralSet.RepeatableNumeral.Numeral;
-            while (remainder / repeatableNumeralValue > 0)
+            char repeatableNumeral = numeralLookup[repeatableValue];
+            while (remainder / repeatableValue > 0)
             {
-                romanNumeralBuilder.Append(repeatableNumeralChar);
-                remainder -= repeatableNumeralValue;
+                romanNumeralBuilder.Append(repeatableNumeral);
+                remainder -= repeatableValue;
             }

-            int nextLowestRepeatableNumeralValue = repeatableNumeralSet.NextLowestRepeatableNumeral.Value;
-            char nextLowestRepeatableNumeralChar = repeatableNumeralSet.NextLowestRepeatableNumeral.Numeral;
-            int repeatableMinusDecrement = repeatableNumeralValue - nextLowestRepeatableNumeralValue;
-            if (remainder >= repeatableMinusDecrement)
+            int decrementValue = repeatableValue / 10;
+            char decrementNumeral = numeralLookup[decrementValue];
+            int repeatableValueMinusDecrement = repeatableValue - decrementValue;
+            if (remainder >= repeatableValueMinusDecrement)
             {
-                romanNumeralBuilder.Append(nextLowestRepeatableNumeralChar);
-                romanNumeralBuilder.Append(repeatableNumeralChar);
-                remainder -= repeatableMinusDecrement;
+                romanNumeralBuilder.Append(decrementNumeral);
+                romanNumeralBuilder.Append(repeatableNumeral);
+                remainder -= repeatableValueMinusDecrement;
             }

-            int halfRepeatableNumeralValue = repeatableNumeralSet.HalfRepeatableNumeral.Value;
-            char halfRepeatableNumeralChar = repeatableNumeralSet.HalfRepeatableNumeral.Numeral;
-            if (remainder >= halfRepeatableNumeralValue)
+            int halfRepeatableValue = repeatableValue / 2;
+            char halfRepeatableNumeral = numeralLookup[halfRepeatableValue];
+            if (remainder >= halfRepeatableValue)
             {
-                romanNumeralBuilder.Append(halfRepeatableNumeralChar);
-                remainder -= halfRepeatableNumeralValue;
+                romanNumeralBuilder.Append(halfRepeatableNumeral);
+                remainder -= halfRepeatableValue;
             }

-            int halfRepeatableMinusDecrement = halfRepeatableNumeralValue - nextLowestRepeatableNumeralValue;
+            int halfRepeatableMinusDecrement = halfRepeatableValue - decrementValue;
             if (remainder >= halfRepeatableMinusDecrement)
             {
-                romanNumeralBuilder.Append(nextLowestRepeatableNumeralChar);
-                romanNumeralBuilder.Append(halfRepeatableNumeralChar);
+                romanNumeralBuilder.Append(decrementNumeral);
+                romanNumeralBuilder.Append(halfRepeatableNumeral);
                 remainder -= halfRepeatableMinusDecrement;
             }


Cleaning up interfaces

Cleaning up interfaces

--- example_project/Assets/MonsterLove/StateMachine/StateMachine.cs
+++ example_project/Assets/MonsterLove/StateMachine/StateMachine.cs
@@ -400,14 +400,9 @@

 		public TDriver Driver
 		{
-			get { return (TDriver) CurrentStateMap.driver; }
+			get { return (TDriver) currentState.driver; }
 		}

-		public StateMapping<TDriver> CurrentStateMap
-		{
-			get { return currentState; }
-		}
-
 		public MonoBehaviour Component
 		{
 			get { return component; }


Update routes

Update routes

--- Web/App_Start/RouteConfig.cs
+++ Web/App_Start/RouteConfig.cs
@@ -1,62 +1,51 @@
 using System.Web.Mvc;
 using System.Web.Routing;
 using Compilify.Web.EndPoints;
-using Compilify.Web.Infrastructure.Extensions;
 using SignalR;

 namespace Compilify.Web
 {
     public static class RouteConfig
     {
+        private const string ProjectIdentifier = @"[a-z0-9]{32}";
+
         public static void RegisterRoutes(RouteCollection routes)
         {
             routes.LowercaseUrls = true;

             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

+            routes.MapConnection<ExecuteEndPoint>("execute", "execute/{*operation}");
+
+
             routes.MapRoute(
                 "Root",
                 string.Empty,
-                defaults: new { controller = "Home", action = "Index" },
-                constraints: new { httpMethod = new HttpMethodConstraint("GET") });
+                new { controller = "Home", action = "Index" },
+                new { httpMethod = new HttpMethodConstraint("GET") });

             routes.MapRoute(
-                name: "About",
-                url: "about",
-                defaults: new { controller = "Home", action = "About" },
-                constraints: new { httpMethod = new HttpMethodConstraint("GET") });
+                "About",
+                "about",
+                new { controller = "Home", action = "About" });
+
+            //routes.MapRoute(
+            //    name: "validate",
+            //    url: "validate",
+            //    defaults: new { controller = "Home", action = "Validate" },
+            //    constraints: new { httpMethod = new HttpMethodConstraint("POST") });

             routes.MapRoute(
-                name: "validate",
-                url: "validate",
-                defaults: new { controller = "Home", action = "Validate" },
-                constraints: new { httpMethod = new HttpMethodConstraint("POST") });
-
-            routes.MapConnection<ExecuteEndPoint>("execute", "execute/{*operation}");
+                "Update",
+                "{id}",
+                new { controller = "Home", action = "Save" },
+                new { httpMethod = new HttpMethodConstraint("POST"), id = ProjectIdentifier });

             routes.MapRoute(
-                name: "Update",
-                url: "{slug}/{version}",
-                defaults: new { controller = "Home", action = "Save", version = UrlParameter.Optional },
-                constraints: new { httpMethod = new HttpMethodConstraint("POST"), slug = @"[a-z0-9]*", });
-
-            routes.MapRoute(
-                name: "Save",
-                url: "{slug}",
-                defaults: new { controller = "Home", action = "Save", slug = UrlParameter.Optional },
-                constraints: new { httpMethod = new HttpMethodConstraint("POST"), slug = @"[a-z0-9]*" });
-
-            routes.MapRoute(
-                name: "Show",
-                url: "{slug}/{version}",
-                defaults: new { controller = "Home", action = "Show", version = UrlParameter.Optional },
-                constraints: new { httpMethod = new HttpMethodConstraint("GET"), slug = @"[a-z0-9]+", version = @"\d*" });
-
-            routes.MapRoute(
-                name: "Latest",
-                url: "{slug}/latest",
-                defaults: new { controller = "Home", action = "Latest" },
-                constraints: new { httpMethod = new HttpMethodConstraint("GET"), slug = @"[a-z0-9]+" });
+                "Show",
+                "{id}",
+                new { controller = "Home", action = "Show" },
+                new { httpMethod = new HttpMethodConstraint("GET"), id = ProjectIdentifier });

             routes.MapRoute(
                 "Error",
@@ -65,7 +54,9 @@

             // 404s
             routes.MapRoute(
-                "404", "{*url}", new { controller = "Error", action = "Index", status = 404 });
+                "404",
+                "{*url}",
+                new { controller = "Error", action = "Index", status = 404 });
         }
     }
 }


* Completed reading of inventory in Manager. (still needs to be hooked up via interfaces, but easy to do.)

--- OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
+++ OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
@@ -290,14 +290,50 @@
             {
                 try
                 {
-                    InventoryFolderBase retval = new InventoryFolderBase();
-
-                    retval.agentID = new libsecondlife.LLUUID((string)reader["agentID"]);
-                    retval.parentID = new libsecondlife.LLUUID((string)reader["parentFolderID"]);
-                    retval.folderID = new libsecondlife.LLUUID((string)reader["folderID"]);
-                    retval.name = (string)reader["folderName"];
-
-                    rows.Add(retval);
+                    InventoryFolderBase folder = new InventoryFolderBase();
+
+                    folder.agentID = new libsecondlife.LLUUID((string)reader["agentID"]);
+                    folder.parentID = new libsecondlife.LLUUID((string)reader["parentFolderID"]);
+                    folder.folderID = new libsecondlife.LLUUID((string)reader["folderID"]);
+                    folder.name = (string)reader["folderName"];
+
+                    rows.Add(folder);
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e.ToString());
+                }
+            }
+
+            return rows;
+        }
+
+        /// <summary>
+        /// Reads a collection of items from an SQL result
+        /// </summary>
+        /// <param name="reader">The SQL Result</param>
+        /// <returns>A List containing Inventory Items</returns>
+        public List<InventoryItemBase> readInventoryItems(IDataReader reader)
+        {
+            List<InventoryItemBase> rows = new List<InventoryItemBase>();
+
+            while (reader.Read())
+            {
+                try
+                {
+                    InventoryItemBase item = new InventoryItemBase();
+
+                    item.assetID = new libsecondlife.LLUUID((string)reader["assetID"]);
+                    item.avatarID = new libsecondlife.LLUUID((string)reader["avatarID"]);
+                    item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"].ToString());
+                    item.inventoryDescription = (string)reader["inventoryDescription"];
+                    item.inventoryID = new libsecondlife.LLUUID((string)reader["inventoryID"]);
+                    item.inventoryName = (string)reader["inventoryName"];
+                    item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"].ToString());
+                    item.parentFolderID = new libsecondlife.LLUUID((string)reader["parentFolderID"]);
+                    item.type = Convert.ToInt32(reader["type"].ToString());
+
+                    rows.Add(item);
                 }
                 catch (Exception e)
                 {


corrected names for character table

corrected names for character table

--- OpenKh.Tools.Kh2BattleEditor/Services/CharacterNameProvider.cs
+++ OpenKh.Tools.Kh2BattleEditor/Services/CharacterNameProvider.cs
@@ -13,9 +13,9 @@
             [0x05] = "Auron",
             [0x06] = "Mulan",
             [0x07] = "Aladdin",
-            [0x08] = "Jack",
+            [0x08] = "Jack Sparrow",
             [0x09] = "Beast",
-            [0x0A] = "Jack (Christmas?)",
+            [0x0A] = "Jack",
             [0x0B] = "Simba",
             [0x0C] = "Tron",
             [0x0D] = "Riku",


Convert the image resolution with the given unit (#167)

--- OpenXMLSDK.Engine/Word/ReportEngine/Renders/ImageExtensions.cs
+++ OpenXMLSDK.Engine/Word/ReportEngine/Renders/ImageExtensions.cs
@@ -6,7 +6,7 @@
 using A = DocumentFormat.OpenXml.Drawing;
 using DW = DocumentFormat.OpenXml.Drawing.Wordprocessing;
 using PIC = DocumentFormat.OpenXml.Drawing.Pictures;
-using SixLabors.ImageSharp.Processing;
+using SixLabors.ImageSharp.MetaData;

 namespace OpenXMLSDK.Engine.Word.ReportEngine.Renders
 {
@@ -120,11 +120,23 @@
                     bmHeight = (long)(bmHeight * (ratio / 100D));
                 }

-                image.Mutate(x => x
-                    .Resize((int)bmWidth, (int)bmHeight));
-
-                imageWidth = bmWidth * (long)(914400 / image.MetaData.HorizontalResolution);
-                imageHeight = bmHeight * (long)(914400 / image.MetaData.VerticalResolution);
+                var xResolution = image.MetaData.HorizontalResolution;
+                var yResolution = image.MetaData.VerticalResolution;
+
+                // The resolution may come in differents units, convert it to pixels per inch
+                if (image.MetaData.ResolutionUnits == PixelResolutionUnit.PixelsPerMeter)
+                {
+                    xResolution *= 0.0254;
+                    yResolution *= 0.0254;
+                }
+                else if (image.MetaData.ResolutionUnits == PixelResolutionUnit.PixelsPerCentimeter)
+                {
+                    xResolution *= 2.54;
+                    yResolution *= 2.54;
+                }
+
+                imageWidth = bmWidth * (long)(914400 / xResolution);
+                imageHeight = bmHeight * (long)(914400 / yResolution);
             }

             var result = new Run();


Register interfaces in FreshIOC

Register interfaces in FreshIOC


Fix some missing return statements in the int.MinValue cases.

--- src/NodaTime/Format/FormatUtils.cs
+++ src/NodaTime/Format/FormatUtils.cs
@@ -57,6 +57,7 @@
                         builder.Append('0');
                     }
                     builder.Append(-(long)int.MinValue);
+                    return;
                 }
             }

@@ -117,6 +118,7 @@
                 else
                 {
                     builder.Append(-(long) int.MinValue);
+                    return;
                 }
             }

@@ -160,6 +162,7 @@
                 else
                 {
                     writer.Write(-(long) int.MinValue);
+                    return;
                 }
             }

@@ -209,6 +212,7 @@
                         writer.Write('0');
                     }
                     writer.Write(-(long)int.MinValue);
+                    return;
                 }
             }


Scott's

Scott's

--- CRP.Mvc/Views/Shared/_PublicLayout.cshtml
+++ CRP.Mvc/Views/Shared/_PublicLayout.cshtml
@@ -26,7 +26,7 @@
     </script>

     <title>UC Davis Registration</title>
-    <meta name="description" content="Online Registration developed by the College of Agriculture and Environmental Sciences UC Davis">
+    <meta name="description" content="Online Registration for UC Davis events developed by the College of Agriculture and Environmental Sciences at UC Davis">

     <!-- le Apple -->
     <link rel="apple-touch-icon" href="@Url.Content("~/Images/Media/thumbnail.jpg")">


update

update

--- CSharpGL/0Foundations/Maths/glm_camera.cs
+++ CSharpGL/0Foundations/Maths/glm_camera.cs
@@ -243,8 +243,8 @@
         /// <returns></returns>
         public static mat4 rotate(mat4 m, float angleDegree, vec3 v)
         {
-            float c = cos((float)(angleDegree * Math.PI / 180.0));
-            float s = sin((float)(angleDegree * Math.PI / 180.0));
+            float c = (float)Math.Cos(angleDegree * Math.PI / 180.0);
+            float s = (float)Math.Sin(angleDegree * Math.PI / 180.0);

             vec3 axis = v.normalize();
             vec3 temp = (1.0f - c) * axis;