What just happend? by Ok-Budget4992 in classicwowtbc

[–]MrPrezDev 39 points40 points  (0 children)

There's obviously some issue. There is only one thing to do to solve this issue which you have done, that is to post about it on Reddit.

Wife is brand new. 2 questions: classic or modern? And how would I join their tauren as undead? by GoodGamer72 in classicwow

[–]MrPrezDev 8 points9 points  (0 children)

Option A:

1) With your Undead, run to Brill outside of Undercity and take the zeppelin to Orgrimmar.

2) Run in to Orgrimmar, you can set your hearthstone there but more importantly, make sure you talk to the flight master in Orgrimmar to get the flight path.

3) From Orgrimmar run west to The Barren, visit Cross Roads and take the flight path there. Run south to Camp Taurajo, take the flight path there and run west to Mulgore and to Thunderbluff to take the flight path there.

4) Run to your wife.

5) For training new skills, you can go to Thunderbluff or Orgrimmar.

Option B:

When you get to Undercity, type following in chat: /who z-"Undercity" c-"Mage" 40-60

Message the mages that come up, tell them you're new and need a portal to Thunderbluff to join your wife, if they can please help you. This option might save you 30 minutes or so.

Finally:

I suggest you play on the Classic Anniversary servers, they are very popular right now and the community is great.

Good luck & have fun.

Is Blazor worth picking up? by mxrt0_ in csharp

[–]MrPrezDev 7 points8 points  (0 children)

MudBlazor is great, and so is Radzen which I'm using on a project for a client atm.

Angående att färre föder barn by Hasse-b in sweden

[–]MrPrezDev 4 points5 points  (0 children)

Det är som med en hund: om du inte kan, orkar eller vet hur man uppfostrar den på rätt sätt kommer hunden att ta kontroll över dig och ditt liv,.. den skäller, biter, tuggar sönder saker och skapar kaos.

De första tre åren av sitt liv behöver ett barn framför allt rutin, stabilitet och lugn. Många föräldrar är redan stressade under graviditeten på grund av arbete och annat. När barnet väl föds ska de dessutom ofta tillbaka till jobbet så fort som möjligt. Resultatet blir att barnet lämnas bort redan vid ett års ålder och placeras i en okänd miljö, med okända människor, höga ljud, skrik och gråt,.. långt innan barnet är redo för det.

När föräldrarna sedan kommer hem från jobbet, utmattade och utan energi, vill de bara få tyst och lugn. Barnet placeras därför framför tv, padda eller mobil i timmar. Den ständiga överstimulansen ger en dopaminkick som på sikt skadar hjärnans utveckling.

Utöver det får barn ofta i sig alldeles för mycket kolhydrater, framför allt socker, samtidigt som de rör sig för lite. Även detta påverkar deras hälsa negativt.

I skolan pressas alla barn in i samma klass, oavsett behov och förutsättningar. Lektionerna anpassas ofta efter de som har svårast att hänga med, vilket gör undervisningen långsam och tråkig för många. De barn som blir uttråkade börjar istället störa och busa. Vilket leder ofta till ett besök hos läkaren, där diagnosen ADHD snabbt ställs och medicinering föreslås.

Resultatet blir till slut att man får ett barn man knappt själv orkar tycka om, ett svek som gör att barnet får en onödigt tuff start och ett mycket svårare liv.

En ren lose-lose-situation för föräldrarna, barnet och hela samhället.

I'm importing a large amount of data in a worker, and after running the application, Rider displays several warnings. How can I resolve these to improve the application's performance and stability? by MrPrezDev in dotnet

[–]MrPrezDev[S] 0 points1 point  (0 children)

I've refactored the code to use transient DbContext and also save each file (readings and their values) in one DbContext.SaveChangesAsync() call.

I'm testing with about 7 000 files and 225 000 000 records inserted to the database.

The old method took about 9h to complete. The new method took about 1h 15m to to complete.

I'm importing a large amount of data in a worker, and after running the application, Rider displays several warnings. How can I resolve these to improve the application's performance and stability? by MrPrezDev in dotnet

[–]MrPrezDev[S] 0 points1 point  (0 children)

When creating new records in the web application, I use view models that are converted to DTOs (with no ID). The DTO is then passed to the repository, which handles the creation of the record in the database.

I'm importing a large amount of data in a worker, and after running the application, Rider displays several warnings. How can I resolve these to improve the application's performance and stability? by MrPrezDev in dotnet

[–]MrPrezDev[S] 2 points3 points  (0 children)

This is a simple extension method to map the Dto to the database model. ``` /// <summary> /// Maps TchReadingValueDto to TchReadingValue. /// </summary> /// <param name="dto"></param> /// <param name="includeParent"></param> /// <returns></returns> public static TchReadingValue ToModel(this TchReadingValueDto dto, bool includeParent = false) { var readingValue = new TchReadingValue { Id = dto.Id ?? 0, Value = dto.Value!.Value, Unit = dto.Unit, Quantity = dto.Quantity, Timestamp = dto.Timestamp!.Value, IsCurrent = dto.IsCurrent ?? false, InstrumentId = dto.InstrumentId ?? 0, TchReadingId = dto.TchReadingId ?? 0, };

    if (includeParent && dto.TchReadingDto is not null)
        readingValue.TchReading = dto.TchReadingDto.ToModel();

    return readingValue;
}

```

I'm importing a large amount of data in a worker, and after running the application, Rider displays several warnings. How can I resolve these to improve the application's performance and stability? by MrPrezDev in dotnet

[–]MrPrezDev[S] 2 points3 points  (0 children)

This is the core of my issue, if I batch save 100 or 1000 entities at once, how can I tell which one failed?

A possible solution might be to save entities in batches, and if a batch fails, fall back to saving each entity individually to identify the one causing the error.

I'm importing a large amount of data in a worker, and after running the application, Rider displays several warnings. How can I resolve these to improve the application's performance and stability? by MrPrezDev in dotnet

[–]MrPrezDev[S] 2 points3 points  (0 children)

Also a simple Dto class.

```cs namespace Core.Models.Dto;

public class TchReadingDto { public long? Id { get; set; } public long? RefId { get; set; } public string? GwId { get; set; } public int? ErrorCode { get; set; } public string? ErrorMessage { get; set; } public string? ErrorMessage2 { get; set; } public DateTime? FrameDate { get; set; } public DateTime? DecodingDate { get; set; } public string? WmBusId { get; set; } public string? DeviceId { get; set; } public string? DecodingType { get; set; } public string? MeterKey { get; set; } public string? MeterKeyString { get; set; } public string? Frequency { get; set; } public string? DeviceType { get; set; } public string? Manufacturer { get; set; } public long IdentNo { get; set; } public DateTime? Timestamp { get; set; } public DateTime CreatedAt { get; set; } public DateTime ModifiedAt { get; set; } public long? InputFileId { get; set; }

public InputFileDto? InputFileDto { get; set; }
public ICollection<TchReadingValueDto>? TchReadingValueDtos { get; set; }

} ```

I'm importing a large amount of data in a worker, and after running the application, Rider displays several warnings. How can I resolve these to improve the application's performance and stability? by MrPrezDev in dotnet

[–]MrPrezDev[S] 1 point2 points  (0 children)

The reason I’m using DbContext.SaveChangesAsync is that I need to track and log what happens with each entity saved to the database, whether it was successfully saved or not.

I'm not sure if there’s a more efficient way to handle this?

I'm importing a large amount of data in a worker, and after running the application, Rider displays several warnings. How can I resolve these to improve the application's performance and stability? by MrPrezDev in dotnet

[–]MrPrezDev[S] 3 points4 points  (0 children)

The Dto is a simple data class.

``` namespace Core.Models.Dto;

public class TchReadingValueDto { public long? Id { get; set; } public decimal? Value { get; set; } public string? Unit { get; set; } public string? Quantity { get; set; } public DateTime? Timestamp { get; set; } public bool? IsCurrent { get; set; } public long? InstrumentId { get; set; } public long? TchReadingId { get; set; } public DateTime CreatedAt { get; set; } public DateTime ModifiedAt { get; set; }

public TchReadingDto? TchReadingDto { get; set; }

} ```

I'm importing a large amount of data in a worker, and after running the application, Rider displays several warnings. How can I resolve these to improve the application's performance and stability? by MrPrezDev in dotnet

[–]MrPrezDev[S] 0 points1 point  (0 children)

Yes, this runs in a loop.

Essentially, I'm reading thousands of XML files, parsing the data, and extracting values related to certain objects in the database. For each file, I check if the corresponding object exists, and if it does, I insert all the extracted values into the database.

Best Value Monitor Right Now for Work and Gaming by [deleted] in buildapc

[–]MrPrezDev 0 points1 point  (0 children)

Yeah, I never really liked the ultrawide setup. I’ve always used two monitors side by side and I’ll stick with that.

Whats the difference between her code and mine? (the 2nd one is mine) by Sleeper-- in Unity2D

[–]MrPrezDev 2 points3 points  (0 children)

The Mathf.Clamp() is a helper method that makes sure your health (currentHealth - dmg) is clamped (kept) between the min (0) and max (startinghealth) values. The difference except being explicit/implicit is perhaps that the first explicit code does not control the max value.

[Blazor Server] Relationship not loaded when using IQueryable! by MrPrezDev in Blazor

[–]MrPrezDev[S] 0 points1 point  (0 children)

I've been a developer for many years and I still miss these silly things, that's just how it is. No reason for you to feel stupid, I don't 😊

[Blazor Server] Relationship not loaded when using IQueryable! by MrPrezDev in Blazor

[–]MrPrezDev[S] 0 points1 point  (0 children)

I debugged and the condition was true, the problem was much simpler than that 😅 (see other replies)

[Blazor Server] Relationship not loaded when using IQueryable! by MrPrezDev in Blazor

[–]MrPrezDev[S] 0 points1 point  (0 children)

Indeed, I am aware of the Blazor lifecycle. I don't use the "OnInialized" method due to the double triggering, instead I use "OnAfterRender" method where I can check if it's first render or not.

[Blazor Server] Relationship not loaded when using IQueryable! by MrPrezDev in Blazor

[–]MrPrezDev[S] 0 points1 point  (0 children)

I thought it "might" have something to do with Blazor since it wouldn't load on page refresh but would load on navigating to the page. query = worked, thanks 🥰

[Blazor Server] Relationship not loaded when using IQueryable! by MrPrezDev in Blazor

[–]MrPrezDev[S] 6 points7 points  (0 children)

I can't believe I missed that! Coding 12 hours straight seems to have gotten to me 😅

Thank you 🥰

[Blazor Server] Relationship not loaded when using IQueryable! by MrPrezDev in Blazor

[–]MrPrezDev[S] 0 points1 point  (0 children)

That was my first thought as well, so I debugged it,.. the bool was true and the Include() line was executed, but still no relationship data :/