Cast Generic<Derived> to Generic<Base>
I have a base WPF UserControl that handles some common functionality for derived UserControls. In the code-behind of any derived UserControl I call an event ``` private void SomeClick(object sender, ...
- Modified
- 18 Apr at 21:49
AWS Lambda:The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2
Today I have a new AWS Lambda question, and can't find anywhere in Google. I new a Lambda function, there is no question. But when I input any code in this function[eg. console.log();] and click "Sa...
- Modified
- 4 Nov at 11:44
How make mapping in serviceStack.ormlite or Dapper dependent on column type?
how I can do mapping in serviceStack.ormlite or Dapper dependent on column type? For example I have next classes: ``` //table A abstract Class A { public ulong? id {get; set} public string Name ...
- Modified
- 16 Dec at 01:11
How to suppress or capture the output of subprocess.run()?
From the examples in docs on [subprocess.run()](https://docs.python.org/3.5/library/subprocess.html#subprocess.run) it seems like there shouldn't be any output from ``` subprocess.run(["ls", "-l"]) #...
- Modified
- 10 Jul at 22:53
What is the Task equivalent to Promise.then()?
With the addition of async / await to TypeScript using Promise(s) can look very syntactically close to Task(s). Example: Promise (TS) ``` public async myAsyncFun(): Promise<T> { let value: T = ...
- Modified
- 14 Mar at 03:14
How do I get the connection string from the SqlServerDBContextOptionsExtensions in ASP.Net Core
I am building up an ASP.Net Core API and I have not been able to find a way to get the connection string from the DBContextOptions. I have the DBContext in my startup.cs as shown below; ``` public v...
- Modified
- 23 May at 11:59
$http.get(...).success is not a function
i have this code: ``` app.controller('MainCtrl', function ($scope, $http){ $http.get('api/url-api') .success(function (data, status, headers, config){ } } ``` In my local enviroment, wor...
- Modified
- 7 Jun at 10:23
Python - How to convert JSON File to Dataframe
How can I convert a JSON File as such into a dataframe to do some transformations. For Example if the JSON file reads: ``` {"FirstName":"John", "LastName":"Mark", "MiddleName":"Lewis", "usernam...
MVC Increase Max JSON Length in POST Request
I am sending a POST request to an MVC controller with a large amount of JSON data in the body and it is throwing the following: > ArgumentException: Error during serialization or deserialization using...
- Modified
- 6 May at 01:0
Laravel eloquent get relation count
I use Laravel 5.3. I have 2 tables : ``` Articles --------- id cat_id title ``` And ``` Category --------- id parent_id title ``` I have defined my relations in my models : ``` // Article mo...
CngKey.Import on azure
``` var rawData = Convert.FromBase64String(_signingKey); var cng = CngKey.Import(rawData, CngKeyBlobFormat.Pkcs8PrivateBlob); ``` I use this code to extract key, from embedded `base64` string. It wo...
- Modified
- 16 Dec at 18:55
C# 7.0 ValueTuples vs Anonymous Types
Looking at the new C# 7.0 ValueTuples, I am wondering if they will completely replace `Anonymous Types`. I understand that `ValueTuples` are structs and therefore behave a bit differently than `Anonym...
- Modified
- 12 Apr at 07:47
How to run a project in Jetbrain's Rider IDE?
I've started to learn c# recently and I really like the Jetbrains IDEs, so I decided to pick up Rider in it's early developement phase. Since it's a brand new environment I could barely find any infor...
IntelliSense in custom COM classes in VBA
Is there a way to get IntelliSense in own built COM classes in VBA? E.g. in the example below I would like to get "Number" showing up, whenever I press on the dot (or ctrl+space for shortcut): [](htt...
- Modified
- 12 Jul at 12:32
C# - Make WCF Accept any Soap message prefixes
This is the situation, there is an existing client, I need to build a server the client will be consuming. I don't own the client and am in no position to change it. The client soap message can be fol...
How to send HTML message via Mimekit/Mailkit
``` BodyBuilder bodyBuilder = new BodyBuilder(); messageContent.Body = "<b>This is a test mail</b>"; bodyBuilder.HtmlBody = messageContent.Body; ``` I tried to embed my body to a bodybuilder but whe...
Reflect AbstractValidator rules in ServiceStack's metadata page
Imagine you have the following simplified CustomerRequest class: ``` public class CustomerRequest : IReturn<CustomerResponse> { public string OrgNumber { get; set; } } ``` For this request, you...
- Modified
- 15 Dec at 09:5
How to disable password request for a Jupyter notebook session?
I have been launching Jupyter Notebook for years using the following command: ``` jupyter-notebook --port=7000 --no-browser --no-mathjax ``` When I try to open the jupyter on the browser it ask me fo...
- Modified
- 20 Jun at 09:12
This async method lacks 'await' operators and will run synchronously
my program has 3 warnings of the following statement: > This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, ...
- Modified
- 15 Dec at 06:3
Asp.Net Core: Program does not contain a static 'Main' method suitable for an entry point
I am trying to port my Asp.Net WebApi project, based on the Onion Architecture design approach, over to Asp.Net Core. However, when I build my class libraries, the compiler is looking for the static M...
- Modified
- 15 Dec at 04:56
How to resize UIImageView based on UIImage's size/ratio in Swift 3?
I have a `UIImageView` and the user is able to download `UIImages` in various formats. The issue is that I need the `UIImageView` to resize based on the given Image's ratio. Currently, I'm using `Asp...
How do you declare a Func with an anonymous return type?
I need to be able to do this: ``` var getHed = () => { // do stuff return new { Property1 = value, Property2 = value2, etc...}; }; var anonymousClass = getHed(); ``` But I get an error wh...
- Modified
- 14 Dec at 20:41
IOptions Injection
It seems to me that it's a bad idea to have a domain service require an instance of `IOptions<T>` to pass it configuration. Now I've got to pull additional (unnecessary?) dependencies into the libra...
- Modified
- 3 May at 03:19
Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 2
I tried to find the solution for the below problem, but none of them worked for me. I am developing application using . Please guide whats going wrong here. ``` org.springframework.beans.factory.Bea...
- Modified
- 14 Jan at 15:42
Do nothing when "other side" of ternary operator is reached?
[a](https://stackoverflow.com/questions/30856260/do-nothing-using-ternary-operator)[b](https://stackoverflow.com/questions/20947215/how-to-do-nothing-in-the-else-part-of-ternary-operator)[c](https://s...
- Modified
- 23 May at 12:16