Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:54
    omajid synchronize #43104
  • May 25 22:40
    alexrvjgh starred dotnet/corefx
  • May 25 21:44
    meu2021 starred dotnet/corefx
  • May 25 15:10
    KevinValmo starred dotnet/corefx
  • May 25 10:04
    LazarovP starred dotnet/corefx
  • May 24 20:50
  • May 23 23:40
  • May 23 10:25
    stephentoub commented #9052
  • May 23 10:25
    stephentoub commented #9052
  • May 23 09:45
    RehanSaeed commented #9052
  • May 23 09:34
    RehanSaeed commented #9052
  • May 23 09:32
    RehanSaeed commented #9052
  • May 21 19:01
    moloean starred dotnet/corefx
  • May 21 18:03
    dnfadmin commented #43138
  • May 21 09:32
    majyo starred dotnet/corefx
  • May 17 21:39
  • May 17 18:01

    carlossanlop on 3.1

    [release/3.1] Add RID for Aplin… (compare)

  • May 17 18:01
    carlossanlop closed #43145
  • May 17 17:17
    carlossanlop edited #43145
  • May 17 17:08
    rbhanda commented #43145
masonwheeler
@masonwheeler
It's an old joke, but it's a joke that exists for a reason.
Joseph Musser
@jnm2
I used regex today, feels like it ended with zero problems.
Igor Velikorossov
@RussKie
You need to use non-greedy search
Joseph Musser
@jnm2
If possible, use [^)] rather than .. Regex is not good at handling distinctions in level of nesting though IIRC.
So e.g. AA\([^)]*\)
@RussKie It looks like they are already using non-greedy search because of the .+?
@alealpha2000 Is maybe part of the problem if you want to match a zero length that you are using + instead of *?
alealpha2000
@alealpha2000

So e.g. AA\([^)]*\)

that seems to work. thanks!

John Moreno
@jrmoreno1
@stephentoub : is new guid really not cryptographically secure in .net core?
CyrusNajmabadi
@CyrusNajmabadi
Guid is not cryptographically secure afaict
It may be on some platforms, but i don't believe there is any guarantee of that
masonwheeler
@masonwheeler
Guid's intent is right there in its name: it's meant to be globally unique, not cryptographically anything.
Isobel Cullen
@isobel-cullen
are completed Tasks immutable?
CyrusNajmabadi
@CyrusNajmabadi
they shoudl be.
Isobel Cullen
@isobel-cullen
excellent, thanks
Stephen A. Imhoff
@Clockwork-Muse

@isobel-cullen - If they're not, you have a pretty dangerous race condition.

ValueTask is mutable, more or less, but callers aren't supposed to muck with it (and are supposed to ignore it after successfully awaiting it, so don't have to deal with other modifications anyways).

Isobel Cullen
@isobel-cullen
yes that was my thoughts, but just wanted to confirm before I accidentally introduced weird race conditions into the code
CyrusNajmabadi
@CyrusNajmabadi
be very careful with ValueTask
Isobel Cullen
@isobel-cullen
I wasn't planning on using it, small number of tasks in Blazor, just need to share the results for simultaneous requests to the same resource
Paul M Cohen
@paul1956
Is there a chart component for .Net Core for Winforms? I need to dray a line graph I see one for framework.
Paul M Cohen
@paul1956
@RussKie thanks
Will the framework controls not be ported?
Igor Velikorossov
@RussKie
Can you rephrase the quesiton?
Paul M Cohen
@paul1956
Will the framework data visualization controls be included in .net 6?
Or is above the long term solution?
Igor Velikorossov
@RussKie
Paul M Cohen
@paul1956
Thanks
Mohammad Hamdy Ghanem
@VBAndCs
@paul1956 Scientific Basic has advanced graphical capabilities as I see on the samples of the remade file. You may use whatever lib they are using for that:
https://github.com/xieguigang/sciBASIC
Paul M Cohen
@paul1956
@VBAndCs very nice but I hope to start with something simpler.
Urban
@Jinjinov
Hi! Does anyone know when .NET 6 Preview 4 comes out?
Igor Velikorossov
@RussKie
IIUIC it should release with the #Build
Valentyn Bondarenko
@bond-id
Hello. What would your recommend me to learn first -- WinForms or WPF? I just start off with C# and .NET. WinForms is much easier, but WPF is more flexible and yet much more complex. At this point, I tend to believe, WinForms would teach me faster this basic understanding of what a C# framework looks like, and how it can be used.
Igor Velikorossov
@RussKie
This question is very similar to the question "tabs vs spaces" ;)
Both frameworks have their pros and cons. They are both supported, maintained and innovated.
Like you said - Winfows Forms had is easier to start with, but may not very be suitable for graphics heavy or themed apps. WPF has a significantly steeper learning curve, but provides vector graphics support, theming, better databinding. And XAML for better or worse.
So pick your poison ;)
Igor Velikorossov
@RussKie
If you're starting - you can start with Windows Forms, play with it, then move on to WPF, and play with it too :)
Igor Velikorossov
@RussKie
If you have issues with zeinfoes
If you have issues with Windows Forms raise those in github.com/dotnet/winforms
Paul M Cohen
@paul1956
@RussKie I just realized its not a bug but a bug that was fixed between Framework and Core and I actually love the new behavior now that I understand it.
Eugene
@JohnyL

hey, guys! can't figure it out how to create and obtain the value of object property in new writable JSON:

Person person = new() { Age = 22, Name = "Linda" };
JsonObject json = new()
{
  ["person"] = JsonValue.Create(person)
};
WriteLine((int)json["person"]["Age"]);

however, I get the error:

Unhandled exception. System.InvalidOperationException: The node must be of type 'JsonObject'.
at System.Text.Json.Node.JsonNode.AsObject() in System.Text.Json.dll:token 0x60005bb+0x20
at System.Text.Json.Node.JsonNode.get_Item(String propertyName) in System.Text.Json.dll:token 0x60005c5+0x0
at ConsoleApp.Program.TestJsonNodes() in E:\Projects\ConsoleApp\Program.cs:line 121
at ConsoleApp.Program.Main(String[] args) in E:\Projects\ConsoleApp\Program.cs:line 81

Mohammad Hamdy Ghanem
@VBAndCs
I am using this function to get hash code to use in a test method. It is supposed to give the same hash for the same source string every time. That is true as long as I run on my win 7 32 bit machine, but when I ran the test on a win 7 64 bit machine it failed because the Hash function returned another hash for the same source string!
Why? Does the DM5 depend on the machine, the OS or the 32/64 bit architecture? Ir this is related to the ASCII encoding or ToString("X2")?
    Function GetHash(sourceStr As String) As String
        Dim b = ASCIIEncoding.ASCII.GetBytes(sourceStr)
        Dim hash = New MD5CryptoServiceProvider().ComputeHash(b)
        Dim sb As New StringBuilder(hash.Length)
        For i = 0 To hash.Length - 1
            sb.Append(hash(i).ToString("X2"))
        Next
        Return sb.ToString()
    End Function
Steve Harter
@steveharter

@Eugene was your intent to use an already-instantiated POCO?

If not, create the JsonObject directly

JsonObject jObject = new()
{
    ["person"] = new JsonObject()
    {
        ["Age"] = 22,
        ["Name"] = "Linda"
    }
};

If the intent was to use the POCO instance and not modify it as a JsonObject you can treat the POCO as a JsonValue:

Person person = new() { Age = 22, Name = "Linda" };
JsonObject jObject = new()
{
    ["person"] = JsonValue.Create(person)
};

If the intent was to use the POCO instance + treat it as a modifiable JsonObject, you'll need to serialize+deserialize:

Person person = new() { Age = 22, Name = "Linda" };
JsonObject jObject = new()
{
    ["person"] = JsonNode.Parse(JsonSerializer.Serialize(person)).AsObject()
};

Note that a new "CreateFromObject" helper could be added to JsonObject to make this easier for the latter sample:

Person person = new() { Age = 22, Name = "Linda" };
JsonObject jObject = new()
{
    ["person"] = JsonObject.CreateFromObject(person)
};
Mohammad Hamdy Ghanem
@VBAndCs
I am using this function to get hash code to use in a test method. It is supposed to give the same hash for the same source string every time. That is true as long as I run on my win 7 32 bit machine, but when I ran the test on a win 7 64 bit machine it failed because the Hash function returned another hash for the same source string!
Why? Does the DM5 depend on the machine, the OS or the 32/64 bit architecture? Ir this is related to the ASCII encoding or ToString("X2")?
There is nothing wring in the Hash function :)
The issue is caused by github :)
I downloaded the source on win 7 x64 bit, and its tests failed, because github normalized the line terminatorof a multiline string to vblf while the test expected vbcrlf.