Hotz
Hotz
CC#
Created by Hotz on 4/30/2023 in #help
❔ Help building note interpreter
Hey everyone. I want to have my Google Keep notes on my phone being analyzed and extract data from them. Each note represents a gym session, including the exercise name, amount of sets, amount of reps, weight, etc. They all have a similar written structure, so an interpreter should be a viable option. I have tried Sprache, but it is hard to understand. Is this a good lib to use or are there better tools? Cheers.
3 replies
CC#
Created by Hotz on 9/26/2022 in #help
Native method that returns multiple random values
Essentially, I am looking for a cleaner version of the following:
var foo = new float[] { rnd.Next(35), rnd.Next(35), rnd.Next(35) };
var foo = new float[] { rnd.Next(35), rnd.Next(35), rnd.Next(35) };
9 replies
CC#
Created by Hotz on 9/15/2022 in #help
Trying to use Google auth in Web API
builder.Services
.AddAuthentication(opt =>
{
opt.DefaultAuthenticateScheme = GoogleDefaults.AuthenticationScheme;
opt.DefaultChallengeScheme = GoogleDefaults.AuthenticationScheme;
})
.AddGoogle(opt =>
{
opt.ClientId = builder.Configuration["Authentication:Google:ClientId"];
opt.ClientSecret = builder.Configuration["Authentication:Google:ClientSecret"];
});
builder.Services
.AddAuthentication(opt =>
{
opt.DefaultAuthenticateScheme = GoogleDefaults.AuthenticationScheme;
opt.DefaultChallengeScheme = GoogleDefaults.AuthenticationScheme;
})
.AddGoogle(opt =>
{
opt.ClientId = builder.Configuration["Authentication:Google:ClientId"];
opt.ClientSecret = builder.Configuration["Authentication:Google:ClientSecret"];
});
Whenever I try to make a request to any endpoint, I get a huge wall of errors and the app crashes after a few seconds. Errors (shorter version than what actually shows up): https://pastebin.com/fgZ79206
31 replies
CC#
Created by Hotz on 9/15/2022 in #help
[SOLVED] What is happening in this snippet?
My guess is: since AppDbContext inherits from DbContext, it also inherits the ctor and all the parameters that the ctor takes. This way, AppDbContext's ctor is being overwritten so that it only has the options parameter from its parent class. Is this correct?
public class AppDbContext : DbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
{

}
}
public class AppDbContext : DbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
{

}
}
4 replies