T3CH
T3CH
CC#
Created by T3CH on 10/26/2023 in #help
❔ c# post request http body
how do i input the content type and the http body
13 replies
CC#
Created by T3CH on 10/26/2023 in #help
❔ c# post request http body
im stuck where i would go from here
public static string requestToken()
{
string token_url = "https://accounts.spotify.com/api/token";
Client.PostAsync(token_url, );
}
public static string requestToken()
{
string token_url = "https://accounts.spotify.com/api/token";
Client.PostAsync(token_url, );
}
13 replies
CC#
Created by T3CH on 10/26/2023 in #help
❔ c# post request http body
i'll check that out
13 replies
CC#
Created by T3CH on 10/26/2023 in #help
❔ c# post request http body
im pretty new to c# whats await
13 replies
CC#
Created by T3CH on 2/3/2023 in #help
❔ circular primes
using System;

namespace CircularPrimes
{
class Program
{
static void Main(string[] args)
{
int circPrimes = 0;
for (int i = 2; i <= 1000000; i++)
{
if (IsCircularPrime(i)) //checks if circular prime number
{
circPrimes++;
}
}
Console.WriteLine(circPrimes);
}

public static bool IsCircularPrime(int input)
{
int digits = Digits(input);
int temp = input;
while (IsPrime(temp))
{
temp = Rotate(temp, digits);

if (temp == input)
{
return true;
}
}
return false;
}

public static bool IsPrime(int input)
{
if (input <= 1)
{
return false;
}

if (input == 2 || input == 3)
{
return true;
}

if (input % 2 == 0 || input % 3 == 0)
{
return false;
}

for (int i = 5; i < Math.Sqrt(input); i++)
{
if (input % i == 0 || input % (i + 2) == 0)
{
return false;
}
}
return true;
}

public static int Rotate(int i, int index)
{
int digits = Digits(i);
int rotated = (int)((i % Math.Pow(10, (digits - index))) * Math.Pow(10, index) + (i / Math.Pow(10, (digits - index))));
return rotated;
}

public static int Digits(long i)
{
int digits = 0;
while (i != 0)
{
i /= 10;
++digits;
}
return digits;
}
}
}
using System;

namespace CircularPrimes
{
class Program
{
static void Main(string[] args)
{
int circPrimes = 0;
for (int i = 2; i <= 1000000; i++)
{
if (IsCircularPrime(i)) //checks if circular prime number
{
circPrimes++;
}
}
Console.WriteLine(circPrimes);
}

public static bool IsCircularPrime(int input)
{
int digits = Digits(input);
int temp = input;
while (IsPrime(temp))
{
temp = Rotate(temp, digits);

if (temp == input)
{
return true;
}
}
return false;
}

public static bool IsPrime(int input)
{
if (input <= 1)
{
return false;
}

if (input == 2 || input == 3)
{
return true;
}

if (input % 2 == 0 || input % 3 == 0)
{
return false;
}

for (int i = 5; i < Math.Sqrt(input); i++)
{
if (input % i == 0 || input % (i + 2) == 0)
{
return false;
}
}
return true;
}

public static int Rotate(int i, int index)
{
int digits = Digits(i);
int rotated = (int)((i % Math.Pow(10, (digits - index))) * Math.Pow(10, index) + (i / Math.Pow(10, (digits - index))));
return rotated;
}

public static int Digits(long i)
{
int digits = 0;
while (i != 0)
{
i /= 10;
++digits;
}
return digits;
}
}
}
11 replies
CC#
Created by T3CH on 2/3/2023 in #help
❔ circular primes
im confused where am i going wrong here
11 replies
CC#
Created by T3CH on 2/3/2023 in #help
❔ circular primes
ive tested it, the circular prime method works, its just counting wrong
11 replies
CC#
Created by T3CH on 2/3/2023 in #help
❔ circular primes
its returning 355112
11 replies
CC#
Created by T3CH on 2/3/2023 in #help
❔ circular primes
im pretty sure everything works up until it counts how many
11 replies
CC#
Created by T3CH on 2/3/2023 in #help
❔ circular primes
using System;

namespace CircularPrimes
{
class Program
{
static void Main(string[] args)
{
int circPrimes = 0;
for (int i = 2; i <= 1000000; i++)
{
int digits = Digits(i);
if (IsCircularPrime(i, digits)) //checks if circular prime number
{
circPrimes++;
}
}
Console.WriteLine(circPrimes);
}

public static bool IsCircularPrime(int input, int digits)
{
int temp = input;
for (int i = 0; i < digits; i++)
{
temp = Rotate(temp, 1);
if (IsPrime(temp))
{
return true;
}
}
return false;
}

public static bool IsPrime(int input)
{
if (input <= 1)
{
return false;
}

if (input == 2 || input == 3)
{
return true;
}

if (input % 2 == 0 || input % 3 == 0)
{
return false;
}

for (int i = 5; i < Math.Sqrt(input); i++)
{
if (input % i == 0 || input % (i + 2) == 0)
{
return false;
}
}
return true;
}

public static int Rotate(int i, int index)
{
int digits = Digits(i);
int rotated = (int)((i % Math.Pow(10, (digits - index))) * Math.Pow(10, index) + (i / Math.Pow(10, (digits - index))));
return rotated;
}

public static int Digits(long i)
{
int digits = 0;
while (i != 0)
{
i /= 10;
++digits;
}
return digits;
}
}
}
using System;

namespace CircularPrimes
{
class Program
{
static void Main(string[] args)
{
int circPrimes = 0;
for (int i = 2; i <= 1000000; i++)
{
int digits = Digits(i);
if (IsCircularPrime(i, digits)) //checks if circular prime number
{
circPrimes++;
}
}
Console.WriteLine(circPrimes);
}

public static bool IsCircularPrime(int input, int digits)
{
int temp = input;
for (int i = 0; i < digits; i++)
{
temp = Rotate(temp, 1);
if (IsPrime(temp))
{
return true;
}
}
return false;
}

public static bool IsPrime(int input)
{
if (input <= 1)
{
return false;
}

if (input == 2 || input == 3)
{
return true;
}

if (input % 2 == 0 || input % 3 == 0)
{
return false;
}

for (int i = 5; i < Math.Sqrt(input); i++)
{
if (input % i == 0 || input % (i + 2) == 0)
{
return false;
}
}
return true;
}

public static int Rotate(int i, int index)
{
int digits = Digits(i);
int rotated = (int)((i % Math.Pow(10, (digits - index))) * Math.Pow(10, index) + (i / Math.Pow(10, (digits - index))));
return rotated;
}

public static int Digits(long i)
{
int digits = 0;
while (i != 0)
{
i /= 10;
++digits;
}
return digits;
}
}
}
11 replies
CC#
Created by T3CH on 11/17/2022 in #help
❔ API URL
this is my first time using an api lol
30 replies
CC#
Created by T3CH on 11/17/2022 in #help
❔ API URL
i want it to show me just that
30 replies
CC#
Created by T3CH on 11/17/2022 in #help
❔ API URL
when i click the url
30 replies
CC#
Created by T3CH on 11/17/2022 in #help
❔ API URL
"JPY": {
"15m": 2326413.63,
"last": 2326413.63,
"buy": 2326413.63,
"sell": 2326413.63,
"symbol": "JPY"
}
"JPY": {
"15m": 2326413.63,
"last": 2326413.63,
"buy": 2326413.63,
"sell": 2326413.63,
"symbol": "JPY"
}
I want the url to only show me the
"last": 2326413.63,
"last": 2326413.63,
30 replies
CC#
Created by T3CH on 11/15/2022 in #help
Modulus division returning 1 less than it should [Answered]
alr lol
19 replies
CC#
Created by T3CH on 11/15/2022 in #help
Modulus division returning 1 less than it should [Answered]
yuhh
19 replies
CC#
Created by T3CH on 11/15/2022 in #help
Modulus division returning 1 less than it should [Answered]
so like
19 replies
CC#
Created by T3CH on 11/15/2022 in #help
Modulus division returning 1 less than it should [Answered]
and it works
19 replies
CC#
Created by T3CH on 11/15/2022 in #help
Modulus division returning 1 less than it should [Answered]
so like
Math.Round(double pennies = change % 5 % 1 % 0.25 % 0.1 % 0.05 / 0.01;)
Math.Round(double pennies = change % 5 % 1 % 0.25 % 0.1 % 0.05 / 0.01;)
19 replies
CC#
Created by T3CH on 11/15/2022 in #help
Modulus division returning 1 less than it should [Answered]
i just did math.round so im gonna assume this works lol
19 replies