Questions

How to mock ServiceStackController Cache property?

Giving the following ServiceStack controller ``` public class MyController : ServiceStackController { public ActionResult Index() { return View(Cache.GetAllKeys()); } } ``` and...

Identify type of exception in ExceptionHandler of Servicestack

The ExceptionHandler(set inside the overridden Configure method of AppHostBase) of servicestack has the 'exception' parameter of generic Exception type in the lambda. ``` this.ExceptionHandler = (ht...

15 Jun at 07:16

Change properties to camelCase when serializing to XML in C#

I have multiple DTO classes that are (de)serialized from and to XML. I want to use the C# convention of PascalCase for properties, but I want them to appear as camelCase in the XML. Example: ``` [Xm...

14 Jun at 11:17

How to hide the Google Invisible reCAPTCHA badge

When implementing the new Google Invisible reCATPTCHA, by default you get a little "protected by reCAPTCHA" badge in the bottom right of the screen that pops out when you roll over it. [](https://i.s...

14 Jun at 11:19

How to read Azure web site app settings values

I am trying to configure some key/value pairs for my Azure web application using app settings section on Windows Azure preview portal. [](https://i.stack.imgur.com/nyABu.png) Now I am trying to rea...

What is the difference between Component, Behaviour and MonoBehaviour? And why these are separated?

`MonoBehaviour` extends `Behaviour` and `Behaviour` extends `Component`. I want to know why these classes are separated and the semantic meanings of these classes. Is there any purpose to separate the...

27 Dec at 04:16

Stopping a task without a CancellationToken

I am using an external library that has `async` methods, but not `CancellationToken` overloads. Now currently I am using an extension method from another StackOverflow question to add a `Cancellation...

14 Jun at 09:5

ASP.NET Core form POST results in a HTTP 415 Unsupported Media Type response

Sending a form POST HTTP request (`Content-Type: application/x-www-form-urlencoded`) to the below controller results into a response. ``` public class MyController : Controller { [HttpPost] p...

7 Jun at 13:38

C# Memory Mapped File doesn't take up physical memory space

I'm trying to cache a large amount of data in physical memory and share them for the other processes in the local environment. So I came up with MMF and read [Microsoft MMF document](https://learn.mic...

15 Jun at 01:12

Angular ngClass and click event for toggling class

In Angular, I would like to use `ngClass` and click event to toggle class. I looked through online but some are angular1 and there isn't any clear instruction or example. Any help will be much appreci...

16 Sep at 06:45

Service Stack SSE Javascript Client - Uncaught TypeError

I'm working on a simple SSE javascript client and reviewing the various examples the following should work: ``` var source = new EventSource( '/event-stream?channel=siteevent&t=' + new Date()...

14 Jun at 03:55

How to assign more memory to docker container

As the title reads, I'm trying to assign more memory to my container. I'm using an image from docker hub called "aallam/tomcat-mysql" in case that's relevant. When I start it normally without any spe...

4 Oct at 03:58

switch with var/null strange behavior

Given the following code: ``` string someString = null; switch (someString) { case string s: Console.WriteLine("string s"); break; case var o: Console.WriteLine("var o...

23 Jun at 15:31

Python: ufunc 'add' did not contain a loop with signature matching types dtype('S21') dtype('S21') dtype('S21')

I have two dataframes, which both have an `Order ID` and a `date`. I wanted to add a flag into the first dataframe `df1`: if a record with the same `order id` and `date` is in dataframe `df2`, then ...

Can't open lib 'ODBC Driver 13 for SQL Server'? Sym linking issue?

When I try to connect to a sql server database with pyodbc (on mac): ``` import pyodbc server = '####' database = '####' username = '####@####' password = '#####' driver='{ODBC Driver 13 for SQL Ser...

21 Jan at 17:45

Global Angular CLI version greater than local version

When running `ng serve` I get this warning about my global CLI version being greater than my local version. I don't notice any issues from this warning, but I was wondering if the two versions should ...

23 Dec at 19:25

ServiceStack Ormlite caching entries aren't deleted after expiry

We are using serviceStack caching with OrmLite Provider (MySql). We noticed that when we create caching keys with expiry dates, the keys don’t get deleted after the expiry date comes. Instead, they ge...

.Net Core Dependency Injection inject out of constructor

I need to inject out of constructor, everything I declared in Setup. Ho can I do it ? How can I inject services out of constructor ? Something like Injector service in Angular 2. something like t...

Using caching with a strongly typed service implementation in ServiceStack

I have my service definitions, which use strongly typed return DTOs via the IReturn interface ``` [Route ("/items/{id}", "GET")] public class FindItems : IReturn<FindItemResponse> { public int Id...

13 Jun at 10:8

'router-outlet' is not a known element

I have a mvc 5 project with a angular frontend . I wanted to add routing as described in this tutorial [https://angular.io/guide/router](https://angular.io/guide/router). So in my `_Layout.cshtml` I a...

'Conda' is not recognized as internal or external command

I installed Anaconda3 4.4.0 (32 bit) on my Windows 7 Professional machine and imported NumPy and Pandas on Jupyter notebook so I assume Python was installed correctly. But when I type `conda list` and...

13 Jun at 14:21

HTTP Basic: Access denied fatal: Authentication failed

I use GitLab Community Edition 9.1.3 2e4e522 on Windows 10 Pro x64. With Git client. Error ``` Cloning into 'project_name'... remote: HTTP Basic: Access denied fatal: Authentication failed for 'http...

13 Jun at 07:17

Error on MongoDB Authentication

I am getting this error when connecting to Mongodb. I not really sure what is this error. > A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = ReadPreferenc...

13 Jun at 08:33

Pandas create empty DataFrame with only column names

I have a dynamic DataFrame which works fine, but when there are no data to be added into the DataFrame I get an error. And therefore I need a solution to create an empty DataFrame with only the column...

28 Jan at 21:56

Javascript in a View Component

I have a View Component that contains some jQuery in the Razor (.cshtml) file. The script itself is quite specific to the view (deals with some some configuration of third-party libraries), so I would...