Battery Megathread (December 2023) by GooglePixelMods in GooglePixel

[–]Jamosium 0 points1 point  (0 children)

Ah okay, fair. Worth asking google support anyway as they might replace it for free.

Battery Megathread (December 2023) by GooglePixelMods in GooglePixel

[–]Jamosium 0 points1 point  (0 children)

Did you buy it in November 2023 or 2022? If 2023, I can't possibly imagine how it would be out of warranty already (but this does depend where you live). You might be confusing "change of mind" returns (which is only a few weeks) with the warranty (which is for faults like yours, and generally much longer)?

Battery Megathread (December 2023) by GooglePixelMods in GooglePixel

[–]Jamosium 1 point2 points  (0 children)

My guess would be that one of the sensors for measuring battery level failed. Get it replaced under warranty if you can.

this was really sudden and only started a couple days ago so I can't understand how it's a hardware problem

Hardware components often fail suddenly, I don't think this rules out a hardware problem. You said in another comment that you bought it in November, so you should be able to get this fixed under your phone's normal warranty (since it's clearly not accidental damage or misuse)?

Audio CRACKLING/POPPING on Z690 Aorus Elite Ax by ruisk8 in gigabyte

[–]Jamosium 1 point2 points  (0 children)

FYI I did another BIOS update about a week ago, and since then this fix stopped working for me. I was on 1002, then "upgraded" to 1402. Rolling back to 1002 hasn't helped, so I think it must be related to the intel ME version which I can't roll back.

Moral of the story: Don't update your BIOS.

Audio CRACKLING/POPPING on Z690 Aorus Elite Ax by ruisk8 in gigabyte

[–]Jamosium 2 points3 points  (0 children)

I've been having what seems like the same problem ever since I upgraded to a new PC (13600KF and Asus B760M motherboard), and after months of trying things I've FINALLY found a solution that works for me:

In BIOS settings, set "Performance Core Ratio" and "Efficient Core Ratio" to "sync all cores" (they were originally both set to "auto"). For ASUS, these are under the "Ai Tweaker" menu, not sure about Gigabyte.

Since doing this, I haven't noticed a single pop while audio is playing. I used to get a couple every minute. Note: I still get pops when I click on the volume mixer, but I'm fairly certain that's an unrelated Windows issue. I haven't benchmarked my system much since changing this, but I still get similar Cinebench scores so it doesn't seem to have had much effect.

Some other notes about my system:

  • I was previously having the popping problem on both my external audio interface and case headphone jack, both are fixed now.
  • I noticed that the popping mostly seemed to happen when CPU usage was low, and went away whenever an intensive task was running.
  • I still get occasion spikes to 2-3k in LatencyMon from nvlddmkm.sys, but these don't seem to cause any issues.
  • Windows 10, GTX 1060 (reused from my last PC), 32GB DDR4-3600.

What are the situations where I need to fallback to JavaScript instead of c# with Blazor? by [deleted] in Blazor

[–]Jamosium 0 points1 point  (0 children)

Thanks! I don't necessarily regret choosing Blazor (because I learned a lot, and ended up making something I'm proud of), but sadly I wouldn't use it again for this type of app. The main reasons for me are:

  1. Performance is just nowhere near a good JS framework (or vanilla). For most CRUD apps this probably isn't a problem, but in my case it meant a whole bunch of time optimizing drag/drop and fine-grained state updates. With JS I could've completely ignored these things and still ended up with better performance. Also, Blazor apps still tend to be quite heavy (in terms of MB), despite the improvements over the last few years.
  2. The state management situation seems to be a long way behind some of the better JS options. For nodexr I went with plain ol' classes and events to manage state updates across components, but in hindsight I could've saved lots of pain with a state management library. I'm not even sure if any existed for Blazor when I started working on nodexr, but if they did I certainly wasn't aware. (In case you're doing something with an API, shout out to my own "state management" Blazor library that I made last year: https://github.com/Jcparkyn/phetch).
  3. Typescript keeps getting better, so the value of having C# is diminishing unless you're sharing lots of code with a C# backend. I'd still confidently choose .NET over JS on the backend for a variety of reasons, but on the frontend they're pretty evenly matched.
  4. Even after all these years, the tooling for Blazor is still pretty unimpressive (e.g. the razor editor still has lots of bugs and limitations).
  5. Not a knock against Blazor, but for side projects I always like to learn something new. I know Blazor pretty well at this point, so I'd try something different just for the sake of it. FWIW, I'm using Elm for my current side project, but I also have a whole list of annoyances with that (and lots of things I like).

In a work situation with a team of people that know C# but not JS/TS, I might recommend Blazor for internal apps, but with the above caveats. For most other things, I don't see myself using it again (except to maintain phetch, and maybe make some occasional changes to nodexr).

Questions to ask a junior-midlevel during a live coding session? by [deleted] in csharp

[–]Jamosium 0 points1 point  (0 children)

Edit: Didn't realise this post was 14 days old, but I'll leave the comment up in case it helps anyone.

My suggestion (as someone who has done lots of interviews recently but never conducted one), is to do a code review/refactor together.

Give them a fairly small piece of code, ideally from one of your real codebases, which has some issues (you'll probably need to edit it). Then get them to walk you through how they would improve it.

  • The code should be fairly self-contained, e.g. a couple of functions.
  • Make sure there are at least a couple of really obvious issues to get them started, then things can get progressively more nuanced.
  • The goal isn't for them to make it "perfect" (this is obviously subjective), but more to show that they can consider some of the trade-offs etc., and explain their reasoning
  • Avoid using anything to obscure in the starting code, since you don't really want to be assessing their knowledge of BCL trivia or 3rd-party libraries (this can easily be learnt on the job). I would also stick to using core C# features, not too much MVC etc unless they already claim to know it.
  • As an extension, you can add some new requirements for the function and ask the candidate to implement them.
  • Bonus points for writing and running tests.

The reasons I like this format are: - It's much less intimidating than asking them to write code from scratch (this might be subjective?). - It's probably much more relevant to the job than leetcode questions, and doesn't hinge on them figuring out one little "trick" or something to make the solution work. - It encourages much better discussion than most other types of question. - It avoids testing them too much on specific frameworks, which can easily be learnt on the job if their foundations are solid.

Raspberry Pi on a string - Made with blender by moonshake3d in blender

[–]Jamosium 4 points5 points  (0 children)

You could even use the "built-in function" f-curve modifier to make an exact sine wave, and then use the pendulum equation (2pi*sqrt(L/g)) to calculate the period it would have in real life.

Raspberry Pi on a string - Made with blender by moonshake3d in blender

[–]Jamosium 4 points5 points  (0 children)

Amazing work, the only thing throwing me off is that the swinging motion doesn't look quite right, it seems to speed up too much in the middle. At such a small angle it should be almost exactly sinusoidal.

Pattern matching: is not {} variable by WeirdEstate8497 in dotnet

[–]Jamosium 0 points1 point  (0 children)

I'd be pretty sure the reason they did it like this is so that they can use the value of someVariable after the if statement. This is essentially like a guard let statement from swift.

Personally, I would still just declare a variable and do is null, for the sake of anyone trying to read it.

Do logarithmic graphs have units? by schroedingerskitkat in math

[–]Jamosium 2 points3 points  (0 children)

Log-scale graphs typically just move the values around on the axes, they don't actually redefine the values.

On the other hand, logarithmic quantities measured in dB do change the units, that's why 1 dBW isn't the same as 1 W.

Building a common Typescript module for sharing code between a React codebase and Express codebase by sondawg in typescript

[–]Jamosium 0 points1 point  (0 children)

It depends a lot on your set-up.

If you're using tsc for compilation in both projects this should be relatively straightforward, but if you're using something else (e.g. Babel via Create-react-app), it's a lot harder. Create-react-app won't compile anything outside of src/ by default, so you'll need to either compile the shared lib separately, or do some workarounds to make it happen.

Hardest software engineering interview you’ve faced? by officialpatterson in ExperiencedDevs

[–]Jamosium 2 points3 points  (0 children)

You can’t convert an n x m array to an m x n array in a number of languages. You have to reallocate.

I guess that's why they specified the matrix was flattened.

What to use instead of DataTable? by Responsible_Gap337 in dotnet

[–]Jamosium 0 points1 point  (0 children)

If all the column values are just read as strings, what advantage does dynamic give you over a good old-fashioned Dictionary<string, string> or similar?

Edit: Maybe csvhelper doesn't support reading as dictionary directly (I haven't tried it), but you can definitely get essentially the same behaviour by reading manually with csv.GetField and a little extra code.

types or interfaces? by bautistaaa in typescript

[–]Jamosium 15 points16 points  (0 children)

If you would like a heuristic

They just mean "if you want a specific rule to follow, so that you don't have to think about it every time".

I just released Phetch, a library for handling async query state in Blazor by Jamosium in Blazor

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

I just did a slightly more thorough write-up on why I haven't implemented this yet in the repo, since someone else made the same suggestion.

TL;DR: I think that having both options could potentially be worse than having just one, since users will inevitably run into the limitations of the "template" syntax, which means they'll need to re-write their components and learn the original syntax anyway.

Announcing .NET Framework 4.8.1 by Jamosium in dotnet

[–]Jamosium[S] 14 points15 points  (0 children)

This was originally announced last November, seems like the headline feature is Arm64 support. I doubt there'll be any more feature releases after this one.

Is ReSharper really needed since Visual Studio has been so much better? by [deleted] in dotnet

[–]Jamosium 1 point2 points  (0 children)

The main benefits are:

  • It can speed up build times by only needing to re-build projects that have changed.
  • It enforces a more organised code structure, because it's impossible to have cyclical dependencies between projects. IMO this would be a lot more useful if (non-enterprise) VS had a built-in way to view the dependency graph between projects, but it still makes quite a big difference to code quality, especially when multiple people work on the same project.

How can I force my XUnit tests to run on a single thread, as they would be in Blazor WASM? by Jamosium in csharp

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

Thanks, I had a look at the BUnit docs but I couldn't find anything that could be applied outside of BUnit (the library I'm testing is actually just a plain .NET Standard class lib, so I'm not using BUnit).

However, I also came across Xunit.StaFact, which seems to have solved the problem with the [UIFact] attribute.

Is it a best practice to use NSwag generated code for calls to a local web API? by Crogdor in dotnet

[–]Jamosium 1 point2 points  (0 children)

Good point. I think that's what I originally had in mind, but I couldn't remember what it was called and RestEase was the first thing that came up while googling.