Javascript Map Array Last Item
I have this: ``` map = ranks.map((row, r) => ( row.map((rank, i) => { return [element(r, i, state, rank, toggled, onClick)]; }) )); ``` It maps through a 2-dimentional array. After each row...
- Modified
- 19 Nov at 21:34
Servicestack RedisClient staying connected after being disposed
I am using servicestack for my redisclient in my class. I have one redis client as the following: ``` public class MySuperClass{ .... RedisClient client = new RedisClient("localhost",...
- Modified
- 4 Jul at 02:46
Angular 2 Date Input not binding to date value
trying to get a form set up but for some reason, the Date input in my html is not binding to the object's date value, despite using [(ngModel)] html: ``` <input type='date' #myDate [(ngModel)]='demo...
- Modified
- 14 Feb at 07:40
The program '[13492] dotnet.exe' has exited with code -2147450749
When trying to build and run a hello world dotnetcore console app the app closes without any exceptions. On the debug output I see the following. > The program '[13492] dotnet.exe' has exited with co...
Injecting Service in Middleware in ASP.NET Core
I want to inject a service based on the HTTP header value. So I have 2 classes - DbDataProvider and InMemDataProvider, both are implemented from IDataProvider. Whenever an API call is made, a header i...
- Modified
- 6 May at 06:16
Group dataframe and get sum AND count?
I have a dataframe that looks like this: ``` Company Name Organisation Name Amount 10118 Vifor Pharma UK Ltd Welsh Assoc for Gastro & Endo 2700.00 10119 Vifor Pharma UK Ltd Welsh ...
- Modified
- 20 Dec at 07:41
"No ESLint configuration found" error
Recently, we've upgraded to [ESLint 3.0.0](http://eslint.org/blog/2016/07/eslint-v3.0.0-released) and started to receive the following message running the `grunt eslint` task: ``` > $ grunt eslint Ru...
- Modified
- 3 Jul at 19:3
How to select specific columns in laravel eloquent
lets say I have 7 columns in table, and I want to select only two of them, something like this ``` SELECT `name`,`surname` FROM `table` WHERE `id` = '1'; ``` In laravel eloquent model it may looks ...
static property in c# 6
I'm writing a small code to more understand about `property` and `static property`. Like these: ``` class UserIdentity { public static IDictionary<string, DateTime> OnlineUsers { get; set; } ...
HttpContext.Current is null when unit test
I have following web Api controller method. When I run this code through web, `HttpContext.Current` is `never null` and give desired value. ``` public override void Post([FromBody]TestDTO model) { ...
- Modified
- 3 Jul at 14:26
Cross-platform file name handling in .NET Core
How to handle file name in `System.IO` classes in a cross-platform manner to make it work on Windows and Linux? For example, I write this code that works perfectly on Windows, however it doesn't crea...
C# bool is atomic, why is volatile valid
In , we know that a `bool` is atomic - then why is it valid to mark it as `volatile`? what is the difference and what is a good (or even practical) use-case for one versus the other? ``` bool _isPend...
- Modified
- 23 May at 10:32
C#: ASP.NET WebApi default route to index.html
I am trying to create an Asp.net WebApi / Single Page Application. I would like my server to dispense index.html if no route is given. I would like it to use a controller when one is specified in the ...
- Modified
- 16 May at 18:42
Python regex match space only
In python3, how do I match exactly whitespace character and not newline \n or tab \t? I've seen the `\s+[^\n]` answer from [Regex match space not \n](https://stackoverflow.com/questions/14190038/re...
ASP.NET Core EF Add-Migration command not working
Following this [Microsoft Tutorial](https://docs.efproject.net/en/latest/platforms/aspnetcore/new-db.html#create-your-database) when I run the `PM> Add-Migration MyFirstMigration` command in VS2015 pr...
- Modified
- 27 Apr at 02:0
one of the parameters of a binary operator must be the containing type c#
``` public static int[,] operator *(int[,] arr1, int[,] arr2) { int sum; int[,] res = new int[arr1.GetLength(0), arr2.GetLength(1)]; for (int i = 0; i < arr1.GetLength(0); ...
- Modified
- 2 Jul at 09:43
What is the purpose of casting into "object" type?
I have found code on a website which is as follows. ``` string a = "xx"; string b = "xx"; string c = "x"; string d = String.Intern(c + c); Console.WriteLine((object)a == (object)b); // True Con...
- Modified
- 2 Jul at 20:7
How to set the content-type of request header when using Fetch APi
I am using npm 'isomorphic-fetch' to send requests. The problem I am experiencing is I am unable to set the content-type of the request header. I set a content type of application/json , however the ...
- Modified
- 29 Jul at 15:40
StatusStrip label not visible when text too long
I have a `StatusStrip` docked to the bottom of a C# Form, it contains a label, the text in it displays fine, except when there is longer length of text then it does not display at all, and I have to w...
How do I move my ServiceStack API from HTTP to HTTPS selectively
I followed the tutorial [deploy and run Service Stack application on Ubuntu Linux](https://github.com/ServiceStackApps/mono-server-config) and I got my API quickly up and running. So far it's all tho...
- Modified
- 1 Jul at 18:43
UWP update UI from Task
I have application, which is checking network ranges (for running http service) in local network. So it means, that I am checking f.e. from 10.0.0.1 to 10.0.0.255. And here is the problem, when runni...
- Modified
- 1 Jul at 18:34
Stored procedure with default parameters
I am trying to create a stored procedure based on a query I wrote with parameters that are predefined. When restructuring to a create stored procedure and I execute the stored procedure it states that...
- Modified
- 21 Dec at 04:55
How do I reference a .NET Framework project in a .NET Core project?
I'd really like to start using .NET Core and slowly migrate applications and libraries to it. However, I can't realistically upgrade my entire code base to use .NET Core and then go through the proce...
- Modified
- 20 Jun at 09:12
Shell script to open a URL
How do I write a simple shell script (say script.sh), so that I can pass a URL as an argument while executing? I want a browser to start with the page opened on that URL. I want to write the command ...
CSS: Workaround to backdrop-filter?
`backdrop-filter` is a recent CSS feature, that is not yet available in modern browsers (at least as of July 1, 2016). - `backdrop-filter`- `-webkit-`- Being in such an unusable state, I would lik...