❤RieBi&❤
❤RieBi&❤
CC#
Created by Joshman1412 on 11/17/2024 in #help
does anyone know why my program cant find my cpu temps or my motherboard 12v rail readings
$code
34 replies
CC#
Created by Sher on 11/11/2024 in #help
Restoring packages takes way too long
What OS is it?
12 replies
CC#
Created by SWEETPONY on 11/10/2024 in #help
✅ I don't undertand the error: capacity was less than the current size
Yeah so when multiple threads call the Add() at the same time, it would be essentially the same as doing it without parallel, but with parallel you also get overhead of syncing threads. So I decided to do it myself:
using System.Diagnostics;


var max = 100_000_000;
int[] array = Enumerable.Range(0, max).ToArray();
var lst = new List<double>();

var arr = new double[max];

var stopWatch = new Stopwatch();
stopWatch.Start();

for (int i = 0; i < array.Length; i++)
{
var result = Math.Pow(i, 100000000000);
arr[i] = result;
}

stopWatch.Stop();
Console.WriteLine(stopWatch.Elapsed);

var arr2 = new double[max];
stopWatch.Restart();

Parallel.For(0, array.Length, i =>
{
var result = Math.Pow(i, 100000000000);
arr2[i] = result;
});

stopWatch.Stop();
Console.WriteLine(stopWatch.Elapsed);
using System.Diagnostics;


var max = 100_000_000;
int[] array = Enumerable.Range(0, max).ToArray();
var lst = new List<double>();

var arr = new double[max];

var stopWatch = new Stopwatch();
stopWatch.Start();

for (int i = 0; i < array.Length; i++)
{
var result = Math.Pow(i, 100000000000);
arr[i] = result;
}

stopWatch.Stop();
Console.WriteLine(stopWatch.Elapsed);

var arr2 = new double[max];
stopWatch.Restart();

Parallel.For(0, array.Length, i =>
{
var result = Math.Pow(i, 100000000000);
arr2[i] = result;
});

stopWatch.Stop();
Console.WriteLine(stopWatch.Elapsed);
The second one runs almost 2x as fast as the former one. But I've got a shitty machine, so it might be even faster on your one. The key here is that every thread operates on their own indices, and yep it's faster
17 replies
CC#
Created by SWEETPONY on 11/10/2024 in #help
✅ I don't undertand the error: capacity was less than the current size
Nothing unexpected tbf
17 replies
CC#
Created by SWEETPONY on 11/10/2024 in #help
✅ I don't undertand the error: capacity was less than the current size
With concurrent bag and same code?
17 replies
CC#
Created by SWEETPONY on 11/10/2024 in #help
✅ I don't undertand the error: capacity was less than the current size
Look into that
17 replies
CC#
Created by SWEETPONY on 11/10/2024 in #help
✅ I don't undertand the error: capacity was less than the current size
It's very dangerous
17 replies
CC#
Created by SWEETPONY on 11/10/2024 in #help
✅ I don't undertand the error: capacity was less than the current size
Your code is not thread safe
17 replies
CC#
Created by SWEETPONY on 11/10/2024 in #help
✅ I don't undertand the error: capacity was less than the current size
You can't just use regular list in multiple threads and appends elements to it on different threads
17 replies
CC#
Created by Mike B on 11/10/2024 in #help
Insert into Access Database
Also, don't use Access for database
22 replies
CC#
Created by Mike B on 11/10/2024 in #help
Insert into Access Database
$details
22 replies
CC#
Created by L150X on 11/10/2024 in #help
Overlapping sounds with mediaplayer?
Nugget package maybe
25 replies
CC#
Created by L150X on 11/10/2024 in #help
Overlapping sounds with mediaplayer?
Documentation? Check Microsoft website
25 replies
CC#
Created by L150X on 11/10/2024 in #help
Overlapping sounds with mediaplayer?
Sorry if it sounded rude. I meant to say that you should try it instead
25 replies
CC#
Created by L150X on 11/10/2024 in #help
Overlapping sounds with mediaplayer?
Why don't you use MediaPlayer class instead? It should work
25 replies
CC#
Created by hutoanhill on 7/29/2024 in #help
Identity 2FA wont enable
Sad, no one helped you
4 replies
CC#
Created by Masher. on 8/1/2024 in #help
Ensure that the records stay saved for the database
So what is your code as of now?
95 replies
CC#
Created by ! ! 𓆩ᴍL𓆪 »꧁༺ 𝓈ςᵖ 166 ༻꧂ «༈ 🐺 on 11/6/2023 in #help
❔ How do i set-up VS CODE!!! C# wont RUN IN IT
Have you checked the "DEBUG CONSOLE" and "OUTPUT" tabs?
67 replies
CC#
Created by d3adin. on 11/5/2023 in #help
❔ Console.ReadLine != null
Yep, the Console.ReadLine() should return an empty string in that case
13 replies