Questions

Get Value From Select Option in Angular 4

How do I get the value from the select option in Angular 4? I want to assign it to a new variable in the component.ts file. I've tried this but outputs nothing. Can you also do it using [(ngModel)]?...

Android 8.0: java.lang.IllegalStateException: Not allowed to start service Intent

On application launch, app starts the service that should to do some network task. After targeting API level 26, my application fails to start service on Android 8.0 on background. > Caused by: java...

Setting environment variables in .NET Core 2.0

I am trying to setting up multiple environments in my .NET Core 2.0 application. See my code below. ### Configuration file (Launch.JSON) ``` "configurations": [ { "name": ".NET Core L...

29 Feb at 04:17

Google Authenticator One-time Password Algorithm in C#

I would like to calculate the OTP password generated via Google Authenticator or similar app in C#. I have found some Javascript implementations and Python but not for C#: [http://blog.tinisles.com/20...

7 Oct at 08:14

One-to-Zero relationship with Entity Framework Core 2.0

I'm migrating a Entity Framework 6.1.3 Code First library to Entity Framework Core with C# and .NET Framework 4.7. I've been searching about Entity Framework Core with Google but I haven't found many...

ServiceStack global request redirect

I'm trying to get a redirect to work to use /docs instead of /swagger-ui. I implemented the handler (basically copied from [OpenApiFeature.cs](https://github.com/ServiceStack/ServiceStack/blob/master...

27 Sep at 00:11

IFormFile always null (ASP.NET Core with MVC/Razor)

I have an ASP.NET Core MVC app attempting to upload an IFormFile. However, the IFormFile is always null. None of the other solutions I've found have solved this issue. What am I doing wrong? Model `...

26 Sep at 23:45

Postgres SELECT where the WHERE is UUID or string

I have the following simplified table in Postgres: - - - - I would like a query that can find the user on either its UUID `id` or its text `uid`. ``` SELECT * FROM user WHERE id = 'jsdfhiureeirh' ...

17 Jul at 16:49

Pandas - dataframe groupby - how to get sum of multiple columns

This should be an easy one, but somehow I couldn't find a solution that works. I have a pandas dataframe which looks like this: ``` index col1 col2 col3 col4 col5 0 a c 1 2 ...

Cannot be opened because it is version 852. this server supports version 782 and earlier

I am using Visual Studio 2017 and SQL Server 2014. While attaching a database file to Visual Studio, I get this error: "[](https://i.stack.imgur.com/VRLjS.png)" After upgrading the file I used this ...

.NET Core 2 - EF Core Error handling Save changes

I'm used to Entity Framework 6 and my repository Save() looks like this: ``` public void Save() { try { Context.SaveChanges(); } catch (DbEntityValidationException ex) { ...

How to clear or clean specific pod from the local cocoapods cache

# How to delete or clear a specific pod from cocoapods cache? Tried deleting the entire cache directly, it takes lot of time to get back all pods. How to view and remove specific pod from cache? Fo...

20 Jun at 09:12

Return type of a file for Swagger documentation with dotnet core

I'm using [Swagger for dotnet core](https://learn.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger?tabs=visual-studio) to document my dotnet core Web API. I've read the doc...

ASP.NET Core Attribute routing

I am migrating a project to asp net core, but I could not configure these routes, i am using attributes to map actions. Code for ASP .NET WebAPI: Code for ASP.Net Core: In the file *Startup.cs* is set...

C# ValueTuple with disposable members

Let's say I have a method `foo` which returns a `ValueTuple` where one of it's members is disposable, for example `(IDisposable, int)`. What is the best way to make sure the returned disposable objec...

26 Sep at 12:21

How to count unique ID after groupBy in pyspark

I'm using the following code to agregate students per year. The purpose is to know the total number of student for each year. ``` from pyspark.sql.functions import col import pyspark.sql.functions as ...

17 Feb at 16:44

Owned type mapping EF Core fails when saving

I want to make TableSplitting using Owned Types. I have the following model: ``` public class Account { public GUID Id { get; set; } public string Email { get; set; } public StreetAddress Addr...

26 Sep at 12:42

Using C# 7.1 with MSBuild

To use the new [C# 7.1 language features](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7-1) with Visual Studio 2017, you add the setting `<LangVersion>latest</LangVersion>` to your...

27 Jan at 13:49

What will happen to evicted pods in kubernetes?

I just saw some of my pods got evicted by kubernetes. What will happen to them? just hanging around like that or I have to delete them manually?

26 Sep at 06:21

Downgrade npm to an older version

I tried updating `npm` to see if it would solve some dependency problems we were having, and now I want to downgrade to the version the rest of the development team is using. How can I install an olde...

12 Aug at 14:9

.NET Core 2.0 RSA PlatformNotSupportedException

I am trying to use this code to generate a public and private key, I am using .NET Core 2 on Windows 10 So far I had no success in running this code, it compiles just fine but when I get to the rsa.T...

Deserialize JSON Dictionary with StringComparer

I'm trying to serialize/deserialize a dictionary, the problem is that I create the dictionary with a `StringComparer.OrdinalIgnoreCase` comparer. Here is a code snippet of the problem I'm experienci...

How should I manage DbContext Lifetime in MVC Core?

From the [Documentation](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection) > Entity Framework contexts be added to the services container using the `Scoped` lifetime...

Get current playing track info from Microsoft Groove Music app

I would like to get track info of the current playing track in the Microsoft Groove app in my own app. I'm talking about the Groove APP and not the REST Api. My first approach was to try and get the...

10 Oct at 05:43

ServiceStack Redis does not run on AWS Lambda

I am trying to leverage AWS Elasticache (Redis) from my Lambda function using the ServiceStack .Redis.Core library (version 1.0.44). When running the lambda from my local machine (mac osx) everything ...