async await: is the main thread suspended?

I was reading about `async/await` keywords and I've read that: > When the flow of logic reaches the await token, the calling thread is > suspended until the call completes. Well, I've created a simple...

6 May at 01:3

ServiceStack: How do I use custom OAuthProvider to get access to Azure resources

1. Created custom provider that implements: OAuthProvider, IAuthWithRequest. 2. Created AuthenticateAttribute that calls PreAuthenticate() method of the provider. 3. Configured CorsFeature: Plugins.A...

6 Jun at 18:52

Laravel migration default value

I didn't understand what is the effect of the `default` option in the migrations. I can see that the column in the database is defined with default value, but the models are ignore it completely. Say...

24 Dec at 11:52

python mpl_toolkits installation issue

After command `pip install mpl_toolkits` I receive next error: > Could not find a version that satisfies the requirement mpl_toolkits (from versions: )No matching distribution found for mpl_toolkits ...

28 Dec at 02:24

Can I configure an interceptor in EntityFramework Core?

In the old (pre .net core) era's entity framework 6 as shown in this [blog post](https://romiller.com/2016/02/11/ef6-x-correlating-poor-performing-sql-to-application-code/) there is a way to configure...

how to have 2 data binding fields in one Xamarin forms label?

I'm working on an app in xamarin froms that gets data from a service. What I'm trying to do is make the first name and last name fields display in the same label however it currently displays first n...

5 Oct at 01:47

HTML to PDF - page break with HtmlRenderer

I try to convert HTML to PDF using HtmlRenderer. This is part of code: ``` private byte[] CreateHtmlContent() { string htmlContent = File.ReadAllText(@"htmlExample.txt"); using (MemoryStream ...

5 Sep at 15:8

Define global variable with webpack

Is it possible to define a global variable with webpack to result something like this: ``` var myvar = {}; ``` All of the examples I saw were using external file `require("imports?$=jquery!./file....

How to send some additional data while sending push notifications using OneSignal?

I am developing an Android application as well as writing writing a C# Web Api for it. Now i can send push notifications using the code below. But i have to send a json object which will contain a url...

19 Sep at 07:14

How can I parse through local JSON file in React js?

How can I parse through a JSON file retrieving all its data and using it in my code? I've tried importing the file and just tried console logging it, but all it does is print Object {}: ``` import j...

6 Jun at 04:46

How to add bootstrap to an angular-cli project

We want to use bootstrap 4 (4.0.0-alpha.2) in our app generated with angular-cli 1.0.0-beta.5 (w/ node v6.1.0). After getting bootstrap and its dependencies with npm, our first approach consisted in ...

Static image src in Vue.js template

My Vue component contains some images. I want to do lazy-loading later, so I need to set the src of the images to a small image, first. ``` <template> <div v-for="item in portfolioItems"> ...

21 Feb at 14:41

Correct path for img on React.js

I have some problem with my images on my react project. Indeed I always thought that relative path into src attribute was built on the files architecture Here my files architecture: ``` components ...

23 Jul at 11:46

Is DateTime.Now an I/O bound operation?

What happens when you call `DateTime.Now`? I followed the property code in Reflector and it appears to add the time zone offset of the current locale to `UtcNow`. Following `UTCNow` led me, turn by ...

23 May at 12:8

Adb install failure: INSTALL_CANCELED_BY_USER

I try to install app via adb and get a error: ``` $ ./adb -d install /Users/dimon/Projects/one-place/myprogram/platforms/android/build/outputs/apk/android-debug.apk -r -g 3704 KB/s (4595985 bytes in ...

6 Jun at 08:22

Validating numeric input while formatting numeric input

In an asp.net-mvc project using C#. I use a function to format larger numbers with commas such as `1,000,000`, thanks to [this post](https://stackoverflow.com/a/27761572/3956566): ``` function numbe...

Using event.target with React components

I am having some trouble with my project. Can anyone explain to me why I can't use the `e.target` to access anything other than `className`? Below is the code from my entry point: ``` import React f...

28 Jul at 04:22

Is there any way to make base view component ASP.NET Core?

In rc1 you can make BaseViewComponent and then inherit it and use it without any problems like baseController, but after migrating my project to rc2 I recieve that error Could: not find an 'Invoke' or...

21 Jun at 19:12

What is the question mark for in a Typescript parameter name

``` export class Thread { id: string; lastMessage: Message; name: string; avatarSrc: string; constructor(id?: string, name?: string, avatarSrc?: string) { th...

25 Mar at 14:0

Removing column from database in Laravel 5+

I've a blog for which the `articles` table `Schema` is defined like this: ``` public function up() { Schema::create('articles', function (Blueprint $table) { $table->increments('id'); ...

11 May at 11:26

Run-time type vs compile-time type in C#

What is the difference between a run-time type and a compile-time type in C# and what implications exist regarding virtual method invocation?

4 Jun at 13:47

AngularJS With Asp.net Web API: $http post returning XMLHttpRequest cannot load: Response for preflight has invalid HTTP status code 405

When trying to POST json to Asp.net web API server using `$http` it's returning the following error ``` XMLHttpRequest cannot load http://localhost:62158/api/video/add. Response for preflight has inv...

Instantiating an IFormFile from a physical file

I have a physical file and I want to pass it to my controller method that requires an `IFormFile` type (for unit testing). I can't find any classes that instantiate the `IFormFile` interface which me...

23 May at 10:56

How to get feature importance in xgboost?

I'm using xgboost to build a model, and try to find the importance of each feature using `get_fscore()`, but it returns `{}` and my train code is: ``` dtrain = xgb.DMatrix(X, label=Y) watchlist = [(...

4 Jun at 08:5

C# .net MVC, set path to Google Application Credentials JSON file

I've just got this Google Sample Project to work on my VS2015, However, after I published to "IIS" and host it, when I opened the link, the web page kept showing this message as the picture showed !...

4 Jun at 06:17