Faker
Faker
Explore posts from servers
KPCKevin Powell - Community
Created by Faker on 4/18/2025 in #help
Arduino vs Raspberry pi
Hello guys, sorry to disturb you all... is there any expert in arduino or raspberry pi here please. I want to get started with IoT (internet of things), I want to have my own server (I saw someone on youtube creating his own server using only his rasbperry pi).... I don't really know what's the difference between an arduino or a rasbperry pi... would really appreciate if someone can just give me an overview and if someone can recommend me what to have to build my own server and just get started with IoT, will really appreciate :c
107 replies
CC#
Created by Faker on 4/16/2025 in #help
Program is running in rider but I kept having the red line on my file names
No description
4 replies
KPCKevin Powell - Community
Created by Faker on 4/15/2025 in #help
Choosing appropriate database based on type of data
Hello guys, was just reading a bit about structured and unstructured data. I read that normally, social media posts unstructured data. Basically, in order to store unstructured data, we use databases like MongoDB (a kind of NoSQL database I think). My question is, I remember that I was doing a small project on a social networking site and I read in a post somewhere that it's better to use a relational database like Postgress rather than mongodb. Can someone elaborate why please. Because here we have both structured and unstructured data, so which kind of database/types of database would be the most appropriate.... is it possible to use a combination of both?
35 replies
KPCKevin Powell - Community
Created by Faker on 4/14/2025 in #help
Learning AI, ML and LLMs stuffs
Hello guys, I want to learn about ML and AI, how LLMs work and stuff like that, can someone recommend any good resource/books that englobe AI and its entirety please.
1 replies
CC#
Created by Faker on 4/13/2025 in #help
Trying to log database operations into file and insert values into db using ef core at same time
Processing failed: The process cannot access the file 'C:\Users\user\RiderProjects\TestMigrations\driving-school-booking-system\MainProject\MainProject\Logs\logs.txt' because it is being used by another process.
Processing failed: The process cannot access the file 'C:\Users\user\RiderProjects\TestMigrations\driving-school-booking-system\MainProject\MainProject\Logs\logs.txt' because it is being used by another process.
Hello guys, I'm trying to read from a file and inserting into my database, which I was able to do. The problem is since database is already in used, I'm not being able to log the operations in my log file. So I was wondering what is the issue here, is it some kind of threading issue where same thread can't access database more than once and we can resolve it using some kind of multi-threading ?
12 replies
CC#
Created by Faker on 4/12/2025 in #help
Reading CSV file in C#
Hello guys, quick question. I need to read a csv file. Is there any recommended way of doing it or I just stick with the classic way of reading the file line by line and spliting them by the common delimiter? I read that their are in-built libraries for CSV, should I use them ?
24 replies
CC#
Created by Faker on 4/12/2025 in #help
✅ namespace and using keyword in C#
Hello guys, I have a quick question. I don't understand, when do we use the using keyword and the namespace keyword... can they be used interchangeably ? (don't remember if I once saw a namespace along with a library name... is that even allowed?) . Now, the namespace, sometimes I saw something like that: namespace {...}like we have the curly braces but sometimes we don't. My IDE always do the heavy lifting but I wanted to understand what the syntax is :c. Do we use the keyword using when we need to use certain libraries? While the keyword namespace is used to related to certain folders/cs files? I'm a bit confused here :c... what about the namespace {...} syntax please
C#
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore.Diagnostics;

namespace MainProject.Context;
C#
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore.Diagnostics;

namespace MainProject.Context;
11 replies
CC#
Created by Faker on 4/10/2025 in #help
How to interpret IDE suggestions like method signatures
No description
9 replies
CC#
Created by Faker on 4/10/2025 in #help
Rider suddenly can't run source code, SDK issue
You must install or update .NET to run this application.

App: C:\Users\Test\RiderProjects\driving-school-booking-system\MainProject\MainProject\bin\Debug\net8.0\MainProject.exe
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.0' (x64)
.NET location: C:\Users\Test\.dotnet

The following frameworks were found:
9.0.0 at [C:\Users\Test\.dotnet\shared\Microsoft.NETCore.App]
You must install or update .NET to run this application.

App: C:\Users\Test\RiderProjects\driving-school-booking-system\MainProject\MainProject\bin\Debug\net8.0\MainProject.exe
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.0' (x64)
.NET location: C:\Users\Test\.dotnet

The following frameworks were found:
9.0.0 at [C:\Users\Test\.dotnet\shared\Microsoft.NETCore.App]
Hello guys, I don't understand, code was working and running fine yesterday. When I try to run it this morning, this error occured. In my sdk folde, ,in the dotnet folder, I have both sdk 8 and 9 but code doesn't run
6 replies
CC#
Created by Faker on 4/6/2025 in #help
Implementing IEnumerable<> for a custom hash table data structure to be able to use LINQ
Hello guys, I needed to create a hash table from scratch. Now, I want to use that hash table with LINQ. I read that we need to implement the IEnumerable<>. That done, my IDE yell at me to use the follwing methods:
C#
public IEnumerator<V> GetEnumerator()
{
throw new NotImplementedException();
}

IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
C#
public IEnumerator<V> GetEnumerator()
{
throw new NotImplementedException();
}

IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
I believed it's mandatory to implement them since they are part of the interface. My question is, what is theur usage, why do we need them? The implementation given is what my IDE gave me, do I need to add more logic to it?
45 replies
KPCKevin Powell - Community
Created by Faker on 4/5/2025 in #help
Virtual Machine (VM) vs Docker
Hello guys, sorry to disturb you all... I just have a quick question about one of the tools used in DevOps. I was reading that Docker is one of the tool used. I've read a bit about it and from what I've understood, it's just a package/container that contains standardized units (runtime, dependencies, code, etc...) that can be run anywhere (when we say anywhere, this means on any OS and machine independent ?). My question is, why do we need to use docker... I've never used it but I know it's extensively used. I know when we need to "deploy" an app, we would use docker, but why ? When we say "deploy" an app using docker, where is it deploy? Last question, how is a docker different to a virtual machine and when is one better than the other? I read that VMs have specific resource allocated to them while they are running, while dockers share resources.
14 replies
KPCKevin Powell - Community
Created by Faker on 4/3/2025 in #help
Proxy vs Reverse Proxy
Hello guys, I was just reading a bit about proxy and reverse proxy. Can someone confirm whether my understand is correct please: 1. In proxy (forward proxy), the proxy hides the ip of the clients, so we don't know who request what. 2. In contrast, for reverse proxy, the ip of the servers are hidden. We don't know how sent what. Can someone explain why proxy and reverse proxy are important please. I read that reverse proxy is used for load balancing because when we send a request, the reverse proxy can decide which server to use in contrast with forward proxy (does forward proxy only has one server?).
17 replies
CC#
Created by Faker on 3/31/2025 in #help
Resource to learn making GUI in C#
Hello guys, is there any recommended resource to start making GUI from scratch in C# please
37 replies
CC#
Created by Faker on 3/26/2025 in #help
✅ Is there a difference when we use { get; init; } vs { get; } ?
C#
public record Person
{
public required string FirstName { get; init; }
public required string LastName { get; init; }
};
C#
public record Person
{
public required string FirstName { get; init; }
public required string LastName { get; init; }
};
Hello guys, if I omit the init keyword here, would it make a difference? From what I've understood with or without the init keyword, we would still be able to "modify" the object during instantiation, no?
19 replies
CC#
Created by Faker on 3/26/2025 in #help
✅ What is a primary constructor in C#
Hello guys, was just reading a bit about primary constructors. My question is, primary constructors is just a "fancy" way to write less code instead of declaring a whole constructor? Or are there any reasons why we would use primary constructors?
25 replies
CC#
Created by Faker on 3/25/2025 in #help
✅ Is it possible to override ToString method for Anonymous type in C#? (Not using overriden one)
Hello guys, just wondering if it was possible to use another implementation of the ToString method for anonymous type. I was just using LINQ to perform the following:
C#
var lessons = context.Lessons.Select(lessons => new
{
StudentFirstName = lessons.Student.FirstName,
StudentLastName = lessons.Student.LastName,
StudentEmail = lessons.Student.Email,
InstructorFirstName = lessons.Instructor.FirstName,
InstructorLastName = lessons.Instructor.LastName,
InstructorEmail = lessons.Instructor.Email,
CarTransmission = lessons.Car.Transmission,
LessonDate = lessons.Date
});
C#
var lessons = context.Lessons.Select(lessons => new
{
StudentFirstName = lessons.Student.FirstName,
StudentLastName = lessons.Student.LastName,
StudentEmail = lessons.Student.Email,
InstructorFirstName = lessons.Instructor.FirstName,
InstructorLastName = lessons.Instructor.LastName,
InstructorEmail = lessons.Instructor.Email,
CarTransmission = lessons.Car.Transmission,
LessonDate = lessons.Date
});
When I use a foreach and output each lesson, I have the overriden format of the ToString method. I manage to change part of it using the following:
C#
Console.WriteLine(lesson.ToString().Replace("{","").Replace("}","").TrimStart());
C#
Console.WriteLine(lesson.ToString().Replace("{","").Replace("}","").TrimStart());
But just wanted to know if it's actually possible to change the ToString format again
6 replies
CC#
Created by Faker on 3/24/2025 in #help
✅ Problem updating rider
Hello guys, I tried to update to the latest version of rider but the thing is I didn't have enough disc space and so the update was cancelled. Now that I made enough space, when I try to update it again, it seems that nothing is happening, I had the "update" button but when it finish updating, the IDE remains as it is and it seems that when I click on certain buttons, like settings or plugins, nothing happens. Is there any solution to tackle this issue please... I even try to invalidate caches but nothing happens
36 replies
CC#
Created by Faker on 3/23/2025 in #help
✅ How does explicit loading differs from lazy loading when using EF Core
Hello guys, I was reading about the methods used to load data in EF Core. I came across eager loading, explicit loading and lazy loading. I understood that eager loading is loading data directly with the query, while lazy loading is loading the data as we go, like in a for-each loop. But I didn't understand the explicit loading can someone explain please. If explicit loading is loading data when we need, isn't it the same thing as lazy loading?
35 replies
CC#
Created by Faker on 3/23/2025 in #help
✅ Dispose method to "dispose" file resource when using LogTo method
Hello guys, I'm trying to implement some simple logging in my DbContext. I want to write the logs in a file; when done, I need to dispose/close the file. I read that we can't use the using keyword because this would mean that our file stream will be closed and we won't be able to open it again (I thing, can someone please confirm please) and so we need to use the Dispose method.
C#
public override void Dispose()
{
base.Dispose();
_logStream.Dispose();
}
C#
public override void Dispose()
{
base.Dispose();
_logStream.Dispose();
}
Here is what is written in the docs, but I have the warning CA1816. I didn't understand what exactly I need to do, I can just add this line: GC.SuppressFinalize(this); ?
19 replies
CC#
Created by Faker on 3/23/2025 in #help
✅ StreamWriter not writing to file
Hello guys, I changed my file properties to "Copy if newer" (I didn't understand why we need to do that, would really appreciate if someone can explain) .... I was able to read a file but when it comes to write to it, it seems that nothing is being written and no exception is being thrown (I added the .close method).
C#
// How to read and write to file in C#
string filePath = Path.GetFullPath("sample.txt");

try
{
var sr = new StreamReader(filePath);
var line = sr.ReadLine();
Console.WriteLine(line);
sr.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}

try
{
using (var sw = new StreamWriter(filePath, true, Encoding.Unicode))
{
sw.WriteLine("Just a new line");
sw.WriteLine("Just a new line 2");
}

}
catch (Exception e)
{
Console.WriteLine($"Processing failed: {e.Message}");
}
finally
{
Console.WriteLine("Finally block executed");
}
C#
// How to read and write to file in C#
string filePath = Path.GetFullPath("sample.txt");

try
{
var sr = new StreamReader(filePath);
var line = sr.ReadLine();
Console.WriteLine(line);
sr.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}

try
{
using (var sw = new StreamWriter(filePath, true, Encoding.Unicode))
{
sw.WriteLine("Just a new line");
sw.WriteLine("Just a new line 2");
}

}
catch (Exception e)
{
Console.WriteLine($"Processing failed: {e.Message}");
}
finally
{
Console.WriteLine("Finally block executed");
}
64 replies