Cykotech
Cykotech
Explore posts from servers
CC#
Created by Cykotech on 10/11/2024 in #help
Convert from MSSql to MySql
I'm trying to convert this MSDoc tutorial project from a local instance of MSSql to a MySql server. I'm fairly certain I've gotten all the configuration correct, except the syntax differences of MSSql to MySql. (i.e nvarchar) I pushed it to GitHub if someone is able to take a peek at it. Thanks in advance. https://github.com/Cykotech/RazorPagesMovie
7 replies
CC#
Created by Cykotech on 10/10/2024 in #help
✅ Razor page not updating properly
No description
2 replies
CC#
Created by Cykotech on 6/9/2024 in #help
Truncating 1 and 0 and returning as a double
I'm having trouble with the Cars, Assemble exercise on the C# path on Exercism. I'm calculating the success rate based on the speed parameter and no matter how I round or truncate, whenever I try to return 0 or 1, my code only returns 0.9000000000002.
public static double SuccessRate(int speed)
{
double rate = Math.Round(0.0);

if (speed >=1 || speed <= 4)
{
rate = Math.Round(1.0, 0);
}
if (speed >=5 || speed <=8)
{
rate = Math.Round(0.9, 1);
}
if (speed == 9)
{
rate = Math.Round(0.8, 1);
}
if (speed == 10)
{
rate = Math.Round(0.77, 2);
}

return rate;
}
public static double SuccessRate(int speed)
{
double rate = Math.Round(0.0);

if (speed >=1 || speed <= 4)
{
rate = Math.Round(1.0, 0);
}
if (speed >=5 || speed <=8)
{
rate = Math.Round(0.9, 1);
}
if (speed == 9)
{
rate = Math.Round(0.8, 1);
}
if (speed == 10)
{
rate = Math.Round(0.77, 2);
}

return rate;
}
27 replies
CC#
Created by Cykotech on 6/6/2024 in #help
Extension Methods
I need help understanding extension methods
8 replies