Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Joseph Musser
    @jnm2
    Hey, do I still need nuget.config with <add key="disableSourceControlIntegration" value="true" /> for every solution?
    With v3? Since packages are not stored in the source control path anyway?
    Oren Novotny
    @onovotny
    I don't think you need that disable bit, especially with git
    the hintpath rewrite shouldn't be needed at all with project.json
    Joseph Musser
    @jnm2
    We are on TFS where I work. Would love to change that but y'know. All my personal stuff is git.
    Good to know. Makes sense.
    Lol I even use git to sync my documents between my computers. It's awesome
    Joseph Musser
    @jnm2
    I'm very surprised project.json isn't more front and center in Visual Studio, since it's such a clean and first-class experience. Why does it still default to new projects using packages.config? Is there a way to change that?
    Oren Novotny
    @onovotny
    your pain will go away soon dotnet/corefx#5955
    the packages will be upgradeable
    Joseph Musser
    @jnm2
    Saw that. We'll have to stop recommending that people not use latest version resolution.
    Is netstandard also going to be released in 3.4?
    Oren Novotny
    @onovotny
    yes
    in general, it's the opinion of hte NuGet team that using latest is usually cause for trouble
    NPM is an example of that
    only updtae what you need to
    Joseph Musser
    @jnm2
    NCrunch assumes that if project.json exists, it needs to run using DNX. I don't think there is a way to run a Winforms or WPF project in DNX, is there?
    Joseph Musser
    @jnm2
    Also, something is weird with a portable class library in one of my projects. It builds and runs fine with .NETPortable,Version=v4.5,Profile=Profile111 but the NuGet packages do not show up under references and Intellisense is filling the error log with messages as though the packages were not referenced.
    No helpful error message (or error message of any kind) saying I need to switch the target framework.
    Tried every profile in my C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile folder
    Joseph Musser
    @jnm2
    And lo and behold, as I give up on it and am five minutes into writing code, package restore happens and now the PCL is happy.
    Joseph Musser
    @jnm2
    I think I might have hit Ctrl+S while typing code, right as it happened; I have a habit of doing that.
    Joseph Musser
    @jnm2
    Fyi NCrunch released a build (link) fixing the project.json issue. Amazing turnaround time.
    Oren Novotny
    @onovotny
    cool
    Joseph Musser
    @jnm2
    @onovotny I use Humanizer in a lot of projects. Ran into another issue with project.json. Switched an ASP.NET MVC 5 csproj to project.json instead of packages.config and when I reinstalled the NuGet packages, none of the \Content or \Scripts were reinstalled. Your blog post mentions copying manually, but where is the source to copy from?
    Seems to mean that as of December 18th, project.json and ASP.NET 4 are not a good idea. Which means that project.json is not in fact supported for all project types. Which brings us back to Humanizer being ridiculous on NuGet v2. Hopefully this isn't the case?
    Or, is it just as easy to start using Bower for existing ASP.NET 4 csprojs without losing bundling etc? If that's a thing, a link to a guide for that in your project.json blog post would be nice.
    chadsowald
    @chadsowald
    Hi. Wondering if anyone could suggest how to use Humanizer to try to flip the pluralization of a word when you don't know whether it starts out singular or plural?
    Joseph Musser
    @jnm2
    @chadsowald Doesn't it do that by default?
    Or do you mean you want to toggle the pluralization to the opposite of whatever it is?
    chadsowald
    @chadsowald
    @jnm2 Yes, to your second option. I want to toggle to the opposite without knowing what it starts as.
    or at least try to
    chadsowald
    @chadsowald
    Thank you. I'm used to the .NET PluralizationService that offers both an IsPlural(word) and IsSingular(word) method to check.
    It looks like passing inputIsKnownToBePlural = false might do the trick.
    Joseph Musser
    @jnm2
    The way it deals with not knowing is to try to both pluralize and singularize. I'm really not sure what the logic is behind that if statement though. You could do something similar:
    var tryPlural = word.Pluralize();
    var wordWithToggledPlurality = tryPlural == word ? word.Singularize() : tryPlural;
    Joseph Musser
    @jnm2
    Tbh IsPlural and IsSingular give the illusion that a word can't be both. It can.
    if (word == word.Pluralize())
    {
        return word == word.Singularize() ? Plurality.Ambiguous : Plurality.Plural;
    }
    else
    {
        return word == word.Singularize() ? Plurality.Singular : Plurality.Ambiguous;
    }
    chadsowald
    @chadsowald
    Thank you and sorry for the delay writing back. It might be nice if something like this got into the Humanizer library rather than maintaining it myself. The reason being that it's odd to have to pick .Pluralize or .Singularize to start with. It would worry me that I should perhaps be calling the other method first. How am I to know if it matters?
    Joseph Musser
    @jnm2
    @chadsowald not a problem, it's chat. I agree that it would be nice to know whether a word is strictly singular, strictly plural, or ambiguous (ask here), but I can't imagine a case where I personally would use it.

    How am I to know if it matters?

    Every time I have used Humanizer, I know the word(s) at compile time. Or I'm humanizing a type name (always singular) and sending it through. I think that's the typical use case. I can't speak for the Humanizer team but my perception was that this library isn't intended to be used for advanced linguistics, just to make computer-human interactions a bit more polished.

    chadsowald
    @chadsowald

    Yeah, that makes sense. We currently use the .NET PluraizationService to help with name suggestion. We're trying to "spin" various names based on whatever a user inputs and, of course, we don't know if they enter singular or plural word(s).

    I'm also interested in finding, if possible, a dictionary of words and their plurals to test the .NET implementation vs. Humanizer or other libraries to see if I should prefer one over the other.

    After finding the library, I do intend to use it for other things, such as those you mentioned rather than just these more advanced linguistic tasks.

    Joseph Musser
    @jnm2
    The reason why it doesn't matter if you try .Pluralize() or .Singularize() first is that either way if the word changes, you know it toggled and return it. Otherwise, you try the other one and return it. If neither operation changed it, it's ambiguous.
    It's just a bit strange because simply toggling the plurality without caring about the plurality of the result is a very odd thing to do. I think.
    chadsowald
    @chadsowald
    True, but what if Pluralize incorrectly pluralizes a word (so it changes), but Singularize might have actually been the right thing to do first (and would have worked properly)?
    Joseph Musser
    @jnm2
    Ah, that's why you use the parameter indicating that you don't know the plurality.
    If you try to pluralize children and the pluralizer incorrectly generates childrens (I don't know if this happens or not), the inputIsKnownToBeSingular parameter causes Humanizer to check itself.
    chadsowald
    @chadsowald
    I see.