Questions

Running NPM scripts sequentially

Let's say I have ``` "scripts": { "pre-build": "echo \"Welcome\" && exit 1", "build_logic": "start cmd.exe @cmd /k \"yo esri-appbuilder-js:widget && exit 1\"", "post_build": "start C:\\...

29 Nov at 16:16

How check if type is class?

In .Net we have `Type.IsClass` to check if a type is a class using `System.Reflection`. But in no. So, how can I check?

26 Aug at 19:46

Shuffling a string so that no two adjacent letters are the same

I've been trying to solve this interview problem which asks to shuffle a string so that no two adjacent letters are identical For example, ABCC -> ACBC The approach I'm thinking of is to > 1) It...

23 May at 12:19

How to use C struct with 2D array in C# Unity

So I have a C API with the following struct ``` typedef struct mat4f_ { float m[4][4]; } mat4f; ``` It gets passed as a parameter to one of my API functions: ``` void myFunction(const mat4f matr...

26 Aug at 17:30

How to extract a list from appsettings.json in .net core

I have an appsettings.json file which looks like this: ``` { "someSetting": { "subSettings": [ "one", "two", "three" ] } } ``` When I bu...

8 Aug at 09:21

Only sources that implement IAsyncEnumerable can be used for Entity Framework asynchronous operations

I'm implementing a Model using EF 6.1.3 and .NET Framework 4.6.1. This model is used by an ASPNET app and by an ASPNET CORE app, for that reason it uses System.Data.Entity and it is located in a sepa...

26 Aug at 16:20

IsGenericType & IsValueType missing from .Net Core?

I have this code in .Net 4.6.2 and now trying to convert into .Net core however I am getting error > Error CS1061 'Type' does not contain a definition for 'IsGenericType' and no extension method '...

22 Sep at 08:18

Use ItExpr.IsNull<TValue> rather than a null argument value, as it prevents proper method lookup

I am trying to write a unit test where I need to set up a protected method. I am using Moq for this setup. ``` _innerHandler.Protected() .Setup<Task<HttpResponseMessage>>("SendAsync", It...

26 Aug at 14:50

Debugging, Source Not Found, AsyncExtensions.cs not found

I am trying to debug a webjob on azure and I get the following error: Source Not Found, AsyncExtensions.cs not found. I am working on VS 2015 and the webjob is part of an ASP.NET MVC solution deploye...

ServiceStack CustomRegistrationFeature

I'm new in ServiceStack library. I want to write my CustomRegistrationFeature with custom field and add it to ServiceStack as a Plugin. How can I do that?

How to read webapi responses with HttpClient in C#

I have developed a small webapi which has a few actions and returns my custom class called `Response`. The `Response` class ``` public class Response { bool IsSuccess=false; string Message; ...

14 Apr at 13:57

HttpContext.Current.Session unclear behaviour boolean

I'm having a weird behaviour trying to get the value of a boolean property stored at [HttpContext.Current.Session](https://msdn.microsoft.com/en-us/library/system.web.httpcontext.session(v=vs.110).asp...

Application_BeginRequest Usage

we are trying some login operations in our ASP.NET MVC project. Our goal is : ". We wrote some code but we are inside a loop. # GLOBAL.ASAX ``` protected void Application_BeginRequest(object sen...

26 Aug at 07:1

@viewChild not working - cannot read property nativeElement of undefined

I'm trying to access a native element in order to focus on it when another element is clicked (much like the html attribute "for" - for cannot be used on elements of this type. However I get the erro...

15 May at 01:39

The configuration file 'appsettings.json' was not found and is not optional

The Azure error is: > .Net Core: Application startup exception: System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional. So this is a bit vag...

How to enable TLS 1.2 in Java 7

I am trying to enable TLS 1.2 in my web app which uses JBoss 6.4 and Java 1.7. I have `-Dhttp.protocols = TLSv1.2` in my application environment but it doesn't seem to work for me. Is there anything...

6 Oct at 05:57

Is AddOrUpdate thread safe in ConcurrentDictionary?

I tried to use AddOrUpdate method in ConcurrentDictionary. From the "Remarks" section on this page [https://msdn.microsoft.com/en-us/library/dd287191(v=vs.110).aspx](https://msdn.microsoft.com/en-us...

26 Aug at 00:43

How to run .NET Core console application from the command line

I have a .NET Core console application and have run `dotnet publish`. However, I can't figure out how to run the application from the command line. Any hints?

How can I use "e" (Euler's number) and power operation?

How can I write `1-e^(-value1^2/2*value2^2)` in Python? I don't know how to use power operator and `e`.

16 Nov at 15:2

How to do POST in FORM Submit using reactjs and pass the object value into REST service?

I have created a login page using reactjs, when I send my user input/password through a post method rest api call to authenticate I am receiving an error. Can somebody help me on whats going wrong her...

ServiceStack ormlite with sql server: how to get a where clause with wildcards

How do we get servicestack's ormlite to generate SQL that does a WHERE clause like this : ``` WHERE FirstName like '%joe%' OR lastname like '%joe%' ``` Currently if I do this : ``` db.Select<Perso...

How to add json to RestSharp POST request

I have the following JSON string that is passed into my c# code as a string parameter - AddLocation(string locationJSON): ``` {"accountId":"57abb4d6aad4","address":{"city":"TEST","country":"TEST","po...

25 Aug at 19:23

Consider marking event handler as 'passive' to make the page more responsive

I am using hammer for dragging and it is getting choppy when loading other stuff, as this warning message is telling me. > Handling of 'touchstart' input event was delayed for X ms due to main thre...

Why am I seeing a 404 (Not Found) error failed to load favicon.ico when not using this?

After creating a simple HTML template for testing purpose, with no favicon.ico, I receive an error in the console "Failed to load resource: the server responded with a status of 404 (Not Found)" | "...

15 Oct at 17:34

When can I get an Application Insights operation id?

I have a AspNetCore web app that writes to EventHub and a webjob that reads from it. I'd like the telemetry from both parts of this transaction to have the same operation id in Application Insights. ...