profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/HugoRoss/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Christoph Hafner HugoRoss Switzerland

HugoRoss/AlphaFS 2

AlphaFS is a .NET library providing more complete Win32 file system functionality to the .NET platform than the standard System.IO classes.

HugoRoss/corefx 0

This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.

HugoRoss/cs-script 0

C# scripting platform

HugoRoss/csharp 0

Exercism exercises in C#.

HugoRoss/dotnet-api-docs 0

.NET API reference documentation (.NET Framework, .NET Core, .NET Standard and Xamarin)

HugoRoss/mwinapi 0

Managed Windows API (http://mwinapi.sourceforge.net/)

HugoRoss/Quarks 0

A collection of code snippets packaged as NuGet source code packages

HugoRoss/Stringier 0

Extensions to make Strings better... stringier

HugoRoss/StyleCopAnalyzers 0

An implementation of StyleCop rules using the .NET Compiler Platform

HugoRoss/xaml-docs 0

Public Documentation for Telerik UI for WPF and Silverlight

issue openedexercism/vbnet

Unit tests for "all-your-base" too strict in exception handling

All unit tests of exercise "all-your-base" that expect an ArgumentException should expect it with Assert.ThrowsAny(Of ArgumentException) instead of Assert.Throws(Of ArgumentException) which then would allow more accurate sub-exceptions like ArgumentOutOfRangeException to be thrown.

created time in 6 days

issue openedexercism/csharp

The lucians-luscious-lasagna has room for improvement?

In my humble opinion the lasagne example has room for improvement, is kind of unstructured and unrealistic although I like the general idea.

I suggest the following changes:

public class Lasagne {

    /// <summary>
    /// Creates a new instance of <see cref="Lasagne"/> and measures the point-in-time when it was started.
    /// </summary>
    /// <param name="timeProvider">The time provider returns the current point in time (which is simulated in unit tests).</param>
    /// <param name="saucePrepareDuration">The amount of time it takes to prepare the two sauces (total time for both sauces).</param>
    /// <param name="layeringDurationPerLayer">The amount of time it takes to layer a single layer.</param>
    /// <param name="bakingDuration">The amount of time it takes to bake an average lasagne with 5 layers. If nothing is specified, 40 minutes should be assumed.</param>
    public Lasagne(ITimeProvider timeProvider, TimeSpan saucePrepareDuration, TimeSpan layeringDurationPerLayer, TimeSpan? bakingDuration = null) {
        //To be implemented by you.
    }

    /// <summary>
    /// Takes the current time from the time provider and returns the time difference to the expected time when the lasagna should go/should have gone into the oven.
    /// </summary>
    /// <param name="numberOfLayers">The effectively made number of layers in the range of 1 to 10.</param>
    /// <returns>The time difference to the expected point in time (negative durations mean we have been faster than expected, positive durations that we have been slower).</returns>
    /// <exception cref="ArgumentOutOfRangeException">An ArgumentOutOfRangeException is thrown if the <paramref name="numberOfLayers"/> is less than 1 or greater than 10.</exception>
    public TimeSpan LasagnePutIntoOver(int numberOfLayers) {
        throw new NotImplementedException("To be implemented by you.");
    }

    /// <summary>
    /// Retrieves the finish time of the lasagne. If <see cref="LasagnePutIntoOver(int)"/> was not called yet, the estimated finish
    /// time for an average lasagne with 5 layers is returned, otherwise the time when the lasagne was put into the oven plus the
    /// layer-corrected baking duration (less than 5 layers reduce the baking duration by 10% per layer, more increase it by 10% per
    /// layer, e.g. 8 layers increase the duration by 30%).
    /// </summary>
    /// <returns></returns>
    public DateTimeOffset? FinishTime{
        get {
            throw new NotImplementedException("To be implemented by you.");
        }
    }

}

/// <summary>
/// The time provider has a single method <see cref="GetNow"/> to return the current point in time.
/// </summary>
public interface ITimeProvider {

    /// <summary>
    /// Retrieves the current point in time (which is simulated in unit tests).
    /// </summary>
    DateTimeOffset GetNow();

}

This shows a bit how one could work with times, introduces class DateTimeOffset to the ones that are only used to DateTimes, needs some adaptive logic for property FinishTime that first returns an estimated time based on 5 layers and later the effective time based on the time the lasagne went into the oven and the effective number of layers.

It also specifies the to implemented logic as XML documentation comments how it is often done in professional code.

What do you think?

created time in 6 days

issue openedexercism/vbnet

Class PhoneNumber has incorrect end tag

is:

Public Class PhoneNumber
    ...
End Module

should be:

Public Class PhoneNumber
    ...
End Class

created time in 8 days

issue openedexercism/vbnet

Add build option tags to project files

I suggest to add the following tags to all project files (*.vbproj) to have consistent build settings for local builds and the test runner build as the test runner otherwise has no clue what my default options have been when writing the code of the submitted solution.

<OptionStrict>On</OptionStrict>
<OptionExplicit>On</OptionExplicit>
<OptionInfer>On</OptionInfer>
<OptionCompare>Binary</OptionCompare>

created time in 8 days

issue commentexercism/csharp

Add "<LangVersion>Latest</LangVersion>" to all projects

Yes, can do.

Am Do., 19. Aug. 2021 um 08:42 Uhr schrieb Erik Schierboom < ***@***.***>:

From the official website https://docs.microsoft.com/nl-nl/dotnet/csharp/language-reference/configure-language-version#c-language-version-reference :

The compiler accepts syntax from the latest released version of the compiler (including minor version).

Reading that, there is also no harm in adding the property I think. @HugoRoss https://github.com/HugoRoss Would you be willing to submit a PR to add this property to all exercises?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/exercism/csharp/issues/1561#issuecomment-901652162, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSMD7ZTBYY5IE6MED36QYTT5SRVHANCNFSM5BUSM6PA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

HugoRoss

comment created time in 22 days

issue commentexercism/csharp

Add "<LangVersion>Latest</LangVersion>" to all projects

I agree, if the exercises have been upgraded to .NET 5.0 and are released in a few days we should not bother to change that in the old repo, but it would still make sense to add it to the new projects as it guarantees that the most recent language version is always supported (even in the future when .NET 5.0 produces obsolete warnings and - reading tea leaves - .NET 7.2 / C# 12 are state of the art).

Am Di., 17. Aug. 2021 um 09:01 Uhr schrieb Erik Schierboom < ***@***.***>:

@HugoRoss https://github.com/HugoRoss @xtqqczze https://github.com/xtqqczze You are both right :)

For the current exercises, the C# 9 features can't be used because they target .NET Core 3.1. However, all exercises in this repo have been updated to .NET 5 and when v3 launches, all solutions will be updated to the latest version.

I've just checked that adding an if (statement is not null) statement to an exercise works, and it does. So I think we can close this issue. Students will be able to use the C# 9 features once v3 launches in 2 weeks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/exercism/csharp/issues/1561#issuecomment-900045731, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSMD774U6SDH7NPVWZQLPTT5ICMDANCNFSM5BUSM6PA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

HugoRoss

comment created time in a month

issue commentexercism/csharp

Add "<LangVersion>Latest</LangVersion>" to all projects

[image: image.png]

Am Do., 12. Aug. 2021 um 14:24 Uhr schrieb xtqqczze < ***@***.***>:

Negated not patterns were included in C# 9.0.

@HugoRoss https://github.com/HugoRoss What compiler version are you using? Perhaps you could report the result of putting #error version in exercises\concept\land-grab-in-space\LandGrabInSpaceTests.cs:

[image: image] https://user-images.githubusercontent.com/45661989/129195663-2d731ceb-bba3-4b13-b279-fa3dda1b8b5e.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/exercism/csharp/issues/1561#issuecomment-897595890, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSMD74ISYPC3RZLBKRDFYLT4O4RLANCNFSM5BUSM6PA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

HugoRoss

comment created time in a month

issue commentexercism/csharp

Add "<LangVersion>Latest</LangVersion>" to all projects

Try it out if you don't believe me. Use a simple "if (someParameter is not null) {}". It does not work without "<LangVersion>Latest</LangVersion>

On Wed, 11 Aug 2021, 22:14 Christoph Hafner, ***@***.***> wrote:

Of course it is necessary, otherwise I would not have opened an issue.

On Tue, 10 Aug 2021, 01:46 xtqqczze, ***@***.***> wrote:

This shouldn't be necessary, the compiler determines a default language version according to the .NET version, see:

https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/exercism/csharp/issues/1561#issuecomment-895624618, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSMD73TPP6BV7B4AMQHNWDT4BSDZANCNFSM5BUSM6PA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

HugoRoss

comment created time in a month

issue commentexercism/csharp

Add "<LangVersion>Latest</LangVersion>" to all projects

Of course it is necessary, otherwise I would not have opened an issue.

On Tue, 10 Aug 2021, 01:46 xtqqczze, ***@***.***> wrote:

This shouldn't be necessary, the compiler determines a default language version according to the .NET version, see:

https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/exercism/csharp/issues/1561#issuecomment-895624618, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSMD73TPP6BV7B4AMQHNWDT4BSDZANCNFSM5BUSM6PA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

HugoRoss

comment created time in a month

issue openedexercism/csharp

Sieve, test "No_primes_under_two" is incorrect

There should not be an ArgumentOutOfRangeException expected in unit test "No_primes_under_two" of exercise "Sieve". In my opinion the question "Give me all primes up to the number of 1" is absolutely okay and should return an empty array instead of throwing an Exception.

An ArgumentOutOfRangeException may be thrown for negative numbers if they are not supported.

created time in a month

PR opened exercism/csharp

Fix for Issue #1562

Changed to keeping a reference of each created Robot in unit test "Robot_names_are_unique".

+6 -2

0 comment

1 changed file

pr created time in a month

create barnchHugoRoss/csharp

branch : Issue-1562

created branch time in a month

issue openedexercism/csharp

Test "Robot_names_are_unique" incorrect

From the wording of the exercise we learn that only all existing robots must be unique: "Your solution must ensure that every existing robot has a unique name." But the test does not keep a reference to the created robots, allowing them to be garbage collected instantly, resulting in an incorrect fail of the test if the ID is reused.

Suggested solution: Create a List<Robot> and add each created robot to it.

created time in a month

issue openedexercism/csharp

Add "<LangVersion>Latest</LangVersion>" to all projects

Currently, the current C# versions are not supported, one has to use legacy syntax.

Add <LangVersion>Latest</LangVersion> to a <PropertyGroup> of every project (*.csproj).

created time in a month