TizzyT
TizzyT
CC#
Created by obi on 10/10/2024 in #help
Simple yolo webcam throwing System.InvalidOperationException: 'The calling thread cannot access this
are you sure its on the same thread?
6 replies
CC#
Created by obi on 10/10/2024 in #help
Simple yolo webcam throwing System.InvalidOperationException: 'The calling thread cannot access this
await _dispatcher.InvokeAsync(() => WebCamImage.Source = bitmapSource);
await _dispatcher.InvokeAsync(() => WebCamImage.Source = bitmapSource);
What is WebCamImage?
6 replies
CC#
Created by Samy on 10/7/2024 in #help
I can't find the problem with this bot
while I know what you meant from the image shared, I just want to point out for others that nested methods are a thing.
48 replies
CC#
Created by unluqy on 10/8/2024 in #help
c# beginner
in terms of programming language, cant go wrong id say with learning python. Personally dont like the language but everywhere ive worked uses it so theres that going for it.
109 replies
CC#
Created by Lucid-Jarne on 10/9/2024 in #help
✅ How to write this as a one liner?
but this isnt the place so meh
50 replies
CC#
Created by Lucid-Jarne on 10/9/2024 in #help
✅ How to write this as a one liner?
I disagree
50 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
lol
38 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
gotcha
38 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
so the db is online
38 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
isnt that the same if the db is hosted on the same computer?
38 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
is that not allowed?
38 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
then why not just move the images to a specific location and just store the path to it?
38 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
store as bytes or blob, etc
38 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
i said if all else fails
38 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
yup
38 replies
CC#
Created by Luna on 10/9/2024 in #help
Save an image to a mysql
can base64 encode it if all else fails
38 replies
CC#
Created by ٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴ on 9/26/2024 in #help
Help
because I made it simple originally
27 replies
CC#
Created by ٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴ on 9/26/2024 in #help
Help
int even = RequestNumber("Enter an Even number:", i => i % 2 == 0, "Input not Even!");
int odd = RequestNumber("Enter an Odd number:", i => i % 2 == 0, "Input not Odd!");

Console.WriteLine(even + odd);

static int RequestNumber(string message, Func<int, bool>? constraint = null, string? constraint_message = null)
{
while (true)
{
Console.WriteLine(message);
string? input = Console.ReadLine();
if (int.TryParse(input, out int result))
{
if (constraint is null || constraint(result))
{
return result;
}
else if (constraint_message is not null)
{
Console.WriteLine(constraint_message);
continue;
}
}
Console.WriteLine("Invalid input.");
}
}
int even = RequestNumber("Enter an Even number:", i => i % 2 == 0, "Input not Even!");
int odd = RequestNumber("Enter an Odd number:", i => i % 2 == 0, "Input not Odd!");

Console.WriteLine(even + odd);

static int RequestNumber(string message, Func<int, bool>? constraint = null, string? constraint_message = null)
{
while (true)
{
Console.WriteLine(message);
string? input = Console.ReadLine();
if (int.TryParse(input, out int result))
{
if (constraint is null || constraint(result))
{
return result;
}
else if (constraint_message is not null)
{
Console.WriteLine(constraint_message);
continue;
}
}
Console.WriteLine("Invalid input.");
}
}
27 replies
CC#
Created by ٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴ on 9/26/2024 in #help
Help
Console.WriteLine("Enter one even number and one odd number.");

int even = int.Parse(Console.ReadLine());
int odd = int.Parse(Console.ReadLine());

if (even % 2 == 0)
if (odd % 2 == 1)
Console.WriteLine(even + odd);
Console.WriteLine("Enter one even number and one odd number.");

int even = int.Parse(Console.ReadLine());
int odd = int.Parse(Console.ReadLine());

if (even % 2 == 0)
if (odd % 2 == 1)
Console.WriteLine(even + odd);
27 replies
CC#
Created by Vortex on 9/26/2024 in #help
Visual Studio button not appearing (Obv C#)
if you are using winforms, and manualy (in code) adding the button. Make sure the parent control adds the button to its Controls list. if the parent control is a form you can do:
Controls.Add(button); // where button is your button
Controls.Add(button); // where button is your button
7 replies