Questions

Memory usage issue in WPF application with C++ DLL

I have a C++ dll which reads the certain file format. If I use this dll using WPF application it consumes 1Gb of memory but if I use the same dll using MFC application it uses 200Mb of data. My init...

3 Nov at 11:5

Change / override log event level in Serilog

Is there a way to change the log level of certain events dynamically? (maybe by namespace or a predicate) I'm looking for something like `.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)` b...

31 Oct at 13:26

Accessing IOptions<T> object .NET Core

I am new to .NET Core and so apologies if this is a newbie question. I created a Web API project in .NET Core 2 using VS 2017. For me, I have `appsettings.json` file with some connection settings. ...

28 Nov at 08:27

Scaffolding Db Context and automatically remove the OnConfiguring method

For our ASP.NET Core project we scaffold the existing database using the Scaffold-DbContext in the Package Manger console. Every time we do the scaffolding, a context class is generated together wi...

31 Oct at 06:50

JsonConvert.SerializeObject: Unexpected result when Serializing null value

In the line of code below, my `string x` ends up being an actual string "null" when `clInitializer.AVOptions = null` value: ``` string x = JsonConvert.SerializeObject(clInitializer.AVOptions, new Jso...

31 Oct at 03:22

Role Claims in ASP.NET Core Identity compared to Role Permissions in custom auth

Lets step away from ASP.NET Identity for a sec and lets say we are building a custom authentication/authorization system for our application. Users Roles Permissions UserRoles RolePermissions Wit...

Reboot/Restart an UWP app

I have an UWP app (published in Windows/Microsoft Store), and I am working in a new update, and I use Template10 in my app, that has dark and light theme, and in Windows 10 Mobile but for the change t...

30 Oct at 20:2

Qt: Could not initialize OLE (error 80010106) - (libwkhtmltox.dll) on C#

im using this libwkhtmltox.dll to convert my html to pdf. Im using c# .netCore. Usage: ``` private static string CreatePdf(string content, string fileName) { var fullPath = $"{_projectSe...

30 Oct at 17:34

Bulk register IEntityTypeConfiguration<> entity framework core

Ok, so i am using entity framework with dot net core and code first migrations. This isn't a problem as such, i just wondered if anyone had come across a better way of doing this. Currently i have ma...

30 Oct at 11:18

ServiceStack SelfHost SSL Support

i am trying to find a way to enable SSL on SelfHost ServiceStack, as this requires administrative rights today for using "Net SH", as well as the fact this is "Not Clean" as i need to maintain the Po...

29 Oct at 18:35

Web API2 NinjectWebCommon.cs do not appear

I am doing an `Empty Web API in Visual Studio 2013` Framework 4.5. Obviously `NinjectWebCommon.cs` do not appear. I installed via Nuget, - Ninject,- Ninject.Web.Common,- Ninject.MVC5,- Ninject.Web.Com...

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0. Could not resolve com.android.support:appcompat-v7:26.1.0. Required by: pro...

Getting mouse position in unity

I'm trying to move a object to the mouse position. But it's giving me large x value like 300 but at that place the pre placed object's x position is -4. ``` rigidBody.velocity = new Vector3(Input.mo...

29 Oct at 08:30

Using C# 7.1 default literal in nullable optional argument causes unexpected behavior

C# 7.1 introduces a new feature called "Default Literals" that allows new `default` expressions. ``` // instead of writing Foo x = default(Foo); // we can just write Foo x = default; ``` For `Null...

How to enable Application Logs in Azure for Net Core 2 App?

I am trying to enable application logs in azure. I have a dummy Net Core 2 App running in an appService in azure. and basically my goal is to see the trace messages in the log stream and in the appli...

29 Oct at 03:59

How to round a numpy array?

I have a numpy array, something like below: ``` data = np.array([ 1.60130719e-01, 9.93827160e-01, 3.63108206e-04]) ``` and I want to round each element to two decimal places. How can I do so?...

7 May at 11:50

How to import JSON File into a TypeScript file?

I am building a map application using Angular Maps and want to import a JSON file as a list of markers defining locations. I'm hoping to use this JSON file as marker[] array inside the app.component.t...

Using state in react with TypeScript

I am new to TypeScript. I've got a problem with displaying `this.state.something` inside the render method or assigning it to a variable inside a function. Have a look at the most important piece of c...

16 Aug at 08:0

Import data into Google Colaboratory

What are the common ways to import private data into Google Colaboratory notebooks? Is it possible to import a non-public Google sheet? You can't read from system files. The introductory docs link to ...

28 Oct at 05:53

How to change PHP version used by composer

I want to use another php version on my machine than the one already installed using WAMP `(2 PHP version installed)`. - `PHP 5.6`- `PHP7.0` Whenever I choose PHP 7 from the control panel of WAMP a...

16 Feb at 00:1

Change button text color in disabled button (Xamarin.Forms)

I need to change the text color of a button when it is disabled, I have created a custom renderer for iOS and one for Android. The iOS worked perfectly, since the android does not change the color, I ...

Use IEntityTypeConfiguration with a base entity

In EF Core 2.0, we have the ability to derive from `IEntityTypeConfiguration` for cleaner Fluent API mappings ([source](https://learn.microsoft.com/en-us/ef/core/what-is-new/#self-contained-type-confi...

Overriding a property value in custom JSON.net contract resolver

I am attempting to implement a custom JSON.net IContractResolver that will replace all null property values with a specified string. I'm aware that this functionality is available via attributes on me...

27 Oct at 15:4

ServiceStack + Razor + Auth + Fluent Validation

I am building a very simple `ServiceStack` website using the built-in SS Razor, Auth, and Fluent validation. I've set up a simple login page, but if there is any sort of failure, I'm shown the SS `Sn...

27 Oct at 14:39

Why is ReadAsStringAsync async?

So, in the following snippet, why is ReadAsStringAsync an async method? ``` var response = await _client.SendAsync(request); var body = await response.Content.ReadAsStringAsync(); ``` Originally I ...

27 Oct at 14:20