Why do I get Cannot read property 'toString' of undefined

I use [this](https://github.com/dodo/node-slug) package. I've added these `console.log`'s at the beginning of the slug function. ``` function slug(string, opts) { console.log('log 1: -------'); ...

3 Jan at 10:2

Azure B2C: How do I get "group" claim in JWT token

In the Azure B2C, I used to be able to get a "groups" claim in my JWT tokens by following [Retrieving Azure AD Group information with JWT](https://stackoverflow.com/questions/26846446/retrieving-azure...

1 Feb at 14:39

Expression of type T cannot be handled by a pattern of type X

I have upgraded my project to target C# 7 and used Visual Studio 2017 RC to implement pattern matching across my solution. After doing this some errors were introduced relating to pattern matching wit...

Why would I want to use an ExpressionVisitor?

I know from the MSDN's article about [How to: Modify Expression Trees](https://msdn.microsoft.com/en-us/library/mt654266.aspx) what an `ExpressionVisitor` is supposed to do. It should modify expressio...

How to decrease prod bundle size?

I have a simple app, initialized by `angular-cli`. It display some pages relative to 3 routes. I have 3 components. On one of this page I use `lodash` and Angular 2 HTTP modules to get some data (usi...

22 Aug at 14:23

How to convert FormData (HTML5 object) to JSON

How do I convert the entries from a HTML5 `FormData` object to JSON? The solution should not use jQuery. Also, it should not simply serialize the entire `FormData` object, but only its key/value entri...

31 Dec at 13:36

Update Entity from ViewModel in MVC using AutoMapper

I have a `Supplier.cs` Entity and its ViewModel `SupplierVm.cs`. I am attempting to update an existing Supplier, but I am getting the Yellow Screen of Death (YSOD) with the error message: > The operat...

ServiceStack client compression

I want to compress the request sent from a client. I've found the Q/A: [ServiceStack - How To Compress Requests From Client](https://stackoverflow.com/questions/34211036/servicestack-how-to-compress-...

23 May at 12:8

group by using anonymous type in Linq

Let say I have an Employee class, and GetAllEmployees() return a list of employee instance. I want to group employees by Department and Gender, so the answer I have is ``` var employeeGroup = Employ...

2 Jan at 13:51

C# serialize and deserialize json to txt file

I'm using [NewtonSoft][1] for handling json in my wpf application. I've got a customer that can be saved to a txt file (no database involved). I'm doing that like this: The result looks like this: The...

7 May at 06:1

Task.WhenAny - What happens with remaining running tasks?

I have the following code: ``` List<Task<bool>> tasks = tasksQuery.ToList(); while (tasks.Any()) { Task<bool> completedTask = await Task.WhenAny(tasks); if (await completedTask) return...

Vue.JS - how to use localStorage with Vue.JS

I am working on Markdown editor with Vue.JS, and I tried to use localStorage with it to save data but I don't know how to save new value to data variables in Vue.JS whenever the user types!

9 Jan at 08:2

Suggest data structure suitable for key range lookup

I am looking for data structure similar to SCG.Dictionary but having number ranges as keys. Main operation where the most of performance is required would be lookup for keys overlapping with the spec...

2 Jan at 09:5

How does Facebook Graph API Pagination works and how to iterate facebook user feed with it?

I have a facebook Graph API call to get a facebook users feed: ``` dynamic myFeed = await fb.GetTaskAsync( ("me/feed?fields=id,from {{id, name, picture{{url}} }},story,picture,lin...

Application and User Authentication using ASP.NET Core

Can anyone point me to some good documentation or provide good information on the best way to implement authentication and authorisation for an ASP.NET Core REST API.I need to authenticating and autho...

RestSharp get full URL of a request

Is there a way to get the full url of a RestSharp request including its resource and querystring parameters? I.E for this request: ``` RestClient client = new RestClient("http://www.some_domain.com"...

1 Jan at 14:55

How to list all versions of an npm module?

In order to see all the versions of a node module [webpack], I have executed below command in windows command prompt ``` npm view webpack versions ``` This command only displays first 100 versions ...

4 Dec at 16:44

ImportError: No module named 'tensorflow.python'

here i wanna run this code for try neural network with python : ``` from __future__ import print_function from keras.datasets import mnist from keras.models import Sequential from keras.layers imp...

Get random items with fixed length of different types

I have a `List<Fruit>`, ``` public class Fruit { public string Name { get; set; } public string Type { get; set; } } ``` and the list above contains 30 Fruit objects of two types: `Apple` a...

1 Jan at 21:18

How to get Microsoft.Extensions.Logging<T> in console application using Serilog and AutoFac?

We have common BL classes in a ASP.NET Core application that get in the ctor: `Microsoft.Extensions.Logging.ILogger<Foo>` In ASP.NET Core, the internal infrastructure of ASP.NET handles getting the ...

Does bootstrap 4 have a built in horizontal divider?

Does bootstrap 4 have a built in horizontal divider? I can do this, ``` <style type="text/css"> .h-divider{ margin-top:5px; margin-bottom:5px; height:1px; width:100%; border-top:1px solid gray; ...

Startup.cs in a self-hosted .NET Core Console Application

I have a self-hosted . The web shows examples for but I do not have a web server. Just a simple command line application. Is it possible to do something like this for console applications? ``` public...

7 Jun at 04:22

Why is tail call optimization not occurring here?

We are using recursion to find factors and are receiving a StackOverflow exception. We've read that [the C# compiler on x64 computers performs tail call optimizations](https://github.com/dotnet/roslyn...

Can't enable migrations for Entity Framework on VS 2017 .NET Core

I just installed VS 2017 and created a new Core project. Inside it, I added: - - I also created a folder called Models with a class in it. Then, I went to the Package Manager Console and executed ...

Mock HttpContext for unit testing a .NET core MVC controller?

I have a function in a controller that I am unit testing that expects values in the header of the http request. I can't initialize the HttpContext because it is readonly. My controller function expe...