C Sharp

1567 readers
1 users here now

A community about the C# programming language

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

founded 2 years ago
MODERATORS
76
77
78
79
80
 
 

I came across this video and it's been a great watch with lots of practical examples. As someone who had worked with java, I am in awe with the powerful concepts c# has. Hopefully, someone will find this course useful as well.

81
 
 

I feel like I'm missing something with ML.NET.

As a POC before investing serious computer time. I tried creating a CSV file, 2 columns with 1000s of rows:

Greeting,Reply
My name is Jimmy,Hi Jimmy! How are you today?
My name is Sally,Hi Sally! How are you today?
My name is Mike,Hi Mike! How are you today?

The Model Builder has classification models (I don't believe this is a classification model because I want the thing to be able to predict something new so when it received "My name is Poutine" it will say "Hi Poutine! How are you today?"

I tried anyway and kept getting 0% success on the model.

I came up with another idea, to convert the words to numeric values and then return an array of numeric values.

Doesn't seem like ML.NET can return arrays very easily. I kept getting errors about invalid schema expecting single Key returns rather than arrays.

When I followed up with Bing AI on this it suggested:

Unfortunately, ML.NET does not currently have built-in support for text generation or sequence-to-sequence models. You may want to consider using a different machine learning framework that supports these capabilities, such as TensorFlow or PyTorch.

Am I getting accurate info from the AI? Should I be looking outside of the MicrosoftSphere for this stuff?

Anything you'd recommend?

82
 
 

I have a repo with a bunch of C# projects in it, probably a couple dozen. These projects are shared between maybe seven applications.

I'm looking for a tool that can map out these projects, starting with the application startup projects and draw connections between them showing which projects are referenced and used by what other projects.

Does something like that exist?

83
 
 

How do you all go about validating that there's nothing malicious in your nuget packages?

Is there a best practice for this?

It's easy if the package is from a known source like Microsoft but I'm curious what you do for lesser know people?

I will usually see how many others are using it, probably scan the code in the GITHUB repo. Sometimes if it's a lesser known dev I'll just pull from GITHub rather than using NuGet.

Today however, I was looking at a package and the nuget package itself looks fine but it contains some C++ code that is compiled elsewhere...fine I'll go get that and see. But that code requires CMake and some other 3rd party add-ons which I also have to review.

I'm not aware of any audits on NuGet that would prevent bad people from uploading code. What do you all do to protect the integrity of your software?

84
85
14
submitted 2 years ago by Spyros to c/csharp
86
 
 

Hello everyone,

I'm excited to announce the official launch of XAML for Blazor, a tool that allows you to leverage your XAML expertise within Blazor WebAssembly applications!

Key Benefits:

  • Seamlessly integrate your XAML skills in Blazor WebAssembly apps
  • Revitalize legacy XAML-based apps such as WPF, Silverlight, UWP, or WinUI
  • Boost your web applications with powerful XAML controls like DataGrid and DataForm
  • You can mix and match XAML and Razor within the same Blazor WebAssembly project, pass objects seamlessly between XAML UIElements and Razor Components, use familiar XAML features like MVVM, Binding, Styling, Templating, Panels, and Custom Controls, and access powerful features like RIA Services, WCF SOAP, PRISM, MEF, and more.

Our goal with XAML for Blazor is to solve the challenges developers face in integrating existing XAML-based applications with web applications, and helping to bridge the gap between desktop and web development.

If you're interested, you can dive right in with these links:

Full disclosure, I'm part of the team behind this project, so I'm happy to answer any questions or feedback you may have!

Thanks, Giovanni Albani CEO @ Userware

87
88
 
 

I've been teaching myself C# for the last 2 years or so. I've got a reasonable handle on a lot of the language/ programming in general. However I feel like I'm massively missing the mark when it comes to debugging.

I deal with a lot of multithreaded and real-time applications that interact with physical hardware. I can set breakpoints and inspect variable values at the breakpoint, step into, step over, etc. But the "autos" and "locals" windows are something I don't understand.

Are there any decent courses/resources that teach me some intermediate debugging skills. Particularly interested in resources that focus on Visual Studio tools (extra points for resources that include tips on VS Enterprises debugging tools, like step backwards, etc.).

Appreciate anyone pointing me in the right direction! I've learnt by feel up to this point, but I've hit a wall and could use some structured docs or courses.

89
90
5
submitted 2 years ago by Ghgore to c/csharp
 
 

I'm looking for a Linear Algebra library to perform calculations for circuit analysis, which ones would you recommend?

91
10
submitted 2 years ago* (last edited 2 years ago) by starman to c/csharp
 
 

Link to GitHub issue: https://github.com/dotnet/csharplang/issues/7009

Link to video explaing it: https://youtu.be/91xir2oUQPg

92
6
submitted 2 years ago by Fractal to c/csharp
 
 

Hi all! Trying to work with small pet project for myself. So I use few asp net core apps + db in docker and docker compose. And I little confuse about storing configuration (like for logging or db connection etc). Where is best place to store it? Continue use app.json or move .env files (enviroments variables)

I guess .env files more easy to configure f.e. on CI\CD So whatis a better?

93
 
 

There are many YouTube channels that specializes on C#, but not all of them are created equal. So, I thought, it would be good to share the ones that we think is worth taking a look at.

94
 
 

Hey guys,

I'm looking for a complete guide to C#. If it covers basic programming paradigms as well that would be a plus as I have coded a bunch of stuff but am lacking in theoretical knowledge.

I'm definitely open to spending money for a book or something like that. A full course would be outside of my price range though.

Maybe someone has any good suggestions! I obviously tried googling and had a look at microsofts learning resources but without having some feedback as to how good they are it is difficult to choose something.

95
 
 

I want to learn C# but I can't find time for it (even if I have entire days available)

96
 
 

With regards to null conditional operators, calling properties and methods will work fine, e.g.:

HttpContext.Current?.Response.Clear();

But I'm wondering if assignment is possible? I get this error when trying to do this:

HttpContext.Current?.Response.ContentType = "text/json";

The docs say:

The null-conditional operators are short-circuiting. That is, if one operation in a chain of conditional member or element access operations returns null, the rest of the chain doesn't execute.

So wondering if it's possible and I'm doing it wrong, or am I taking "does not execute" too literally? :)

97
 
 

Recently an idea came across my mind, and that is with all the fuss around Lemmy and fediverse in general, that i could spend my nights working on something instead of watching random YouTube stuff. So I've decided i could start building some kind of Android app, which will just be my time killer for the time being.

Just for some background info - I'm by no means considering myself a programmer, but I do write a lot of scripts/extensions/forms for software we use at work, which is mainly Microsoft stuff associated with .NET, so when it comes to programming I'm most familiar with C# and the whole .NET ecosystem. Lately I've also got into JS/TS with React as I wanted to create my own website.

Because I like C# as a language, i was looking into building this project in some kind of cross platform framework. I researched and found out about MAUI, Avalonia UI and such. As I was researching I found a lot of opinions on those frameworks, some of which were positive and some of which were negative. The negative ones outweigh the positive ones (bugs, broken basic features, messy workarounds, outdated underlying platform APIs) and such. I do know that such framework cannot be perfect because there is a lot of going on, and I would like to hear some more opinions.

So guys what are your experiences with those .NET frameworks? How is the XAML holding up? And do you think I would be better learning Flutter/Dart or straight up Kotlin, as the only platform I'm willing to develop for is Android?

Thanks!

98
99
 
 

New features for those who haven't seen them:

// Primary constructors
public class NamedItem(string name)
{
    public string Name => name;
}

// Default lambda params
var IncrementBy = 
    (int source, int increment = 1) => 
        source + increment;

Console.WriteLine(IncrementBy(5)); // 6
Console.WriteLine(IncrementBy(5, 2)); // 7

// Type aliases
using Point = (int x, int y);
100
 
 

Found this while researching how this fediverse thing works. ActivityStreams provide the vocabulary for interacting with Activitypub, which is the protocol the fediverse uses.

Here's more on ActivityPub, for the interested

view more: ‹ prev next ›