Questions

MongoDB what are the default user and password?

I am using the same connection string on local and production. When the connection string is `mongodb://localhost/mydb` What is the username and password? Is it secure to keep it this way?

31 Jul at 22:50

ServiceStack using interface as template in IReturn<T>

I have a question about IReturn. I found out that > "Interfaces are most definitely not a perfect valid way to define service interfaces". But what if despite of that there is a need or idea of doi...

12 Aug at 13:23

Do an action only if a condition is met in all iterations of a loop

Is there a way to only trigger an action when a condition is met in iterations of a `for` loop? Example: ``` if ((i % 1 == 0) && (i % 2 == 0) && (...) && (i % 20 == 0)) { Do action x } ``` Th...

13 Aug at 13:4

Pass async Callback to Timer constructor

I have async callback, which is passed into Timer(from System.Threading) constructor : ``` private async Task HandleTimerCallback(object state) { if (timer == null) return; if (asynTaskCallb...

Using c# ClientWebSocket with streams

I am currently looking into using websockets to communicate between a client/agent and a server, and decided to look at C# for this purpose. Although I have worked with Websockets before and C# before...

12 Aug at 11:40

How to use resource dictionary in WPF

I'm new to WPF and I don't understand well how resource dictionary works. I have Icons.xaml that looks like: ``` <ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ...

12 Aug at 11:7

Make the size of a heatmap bigger with seaborn

I create a heatmap with seaborn ``` df1.index = pd.to_datetime(df1.index) df1 = df1.set_index('TIMESTAMP') df1 = df1.resample('30min').mean() ax = sns.heatmap(df1.iloc[:, 1:6:], annot=True, linewid...

12 Aug at 14:6

Why does NuGetPack respond with "Cannot create a package that has no dependencies nor content"

I am trying to use the following Cake script: ``` Task("Create-NuGet-Packages") .IsDependentOn("Build") .WithCriteria(() =>DirectoryExists(parameters.Paths.Directories.NugetNuspecDirectory)) ...

12 Aug at 06:40

C# Convert decimal to string with specify format

I need to convert decimal number a to string b folowing: - `'.'`- - - How can I do that with 1 command? - - - - (Same question with 1)

12 Aug at 07:11

Alter output of ServiceStack.Text JSON Deserializer

I'm currently using the `Newtonsoft.json` nuget package but I'd like to find a faster alternative. `ServiceStack.Text` seems to parse it, but it's returning the JSON in a different format that I'm ex...

12 Aug at 17:38

Show image from URL with Xamarin.Forms

I am using this code to show image from an URL ### .xaml ``` <?xml version="1.0" encoding="UTF-8"?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/...

4 Jul at 00:53

Set grid column or grid row in C# code behind

I have set `ColumnDefinitions` in XAML like: In the code behind I'm adding a `StackPanel` as children in the `MainGrid` like: How to put this stackPanel in the First Column in Code behind like we do ...

Remove Action Node mustUnderstand from WCF soap request using IClientMessageInspector

I am hitting a WCF service using a WSDL I don't have access to and cannot modify. For one of the requests the remote service is dying because we are sending the: ``` <Action s:mustUnderstand="1".......

12 Aug at 04:30

Value cannot be null. Parameter name: request

I'm creating a unit test using nunit and all of this code works fine in runtime. I have this protected `HttpResponseMessage` code below that is being called by my controller when it returns. However...

Delete table from EF CodeFirst migration

In EF Code first, I want to drop one column from one table & then delete another table. After removing one column from class file, automatically one migration file generated. But how to delete tabl...

How can I assign a color to a font in EPPlus?

I can set the background color of a cell or range of cells like so: ``` rowRngprogramParamsRange.Style.Fill.PatternType = ExcelFillStyle.Solid; rowRngprogramParamsRange.Style.Fill.BackgroundColor.Set...

RestSharp with JWT-authentication doesn't work

This is the page where I "learned" how to do it: [https://stormpath.com/blog/token-authentication-asp-net-core](https://stormpath.com/blog/token-authentication-asp-net-core) But for me this is not wo...

Integrate a C# console application with a GUI

I've been developing using C# from scratch for less than 3 months and what I got at present is a console application made with Visual Studio 2015. This application consumes a web service, the XML is d...

Error while creating app package with "fullTrustProcess" pointing to a executable

I am trying to deploy the sample application for bridging AppServices with a UWP application. The sample runs and builds just fine but when I try to follow the guide to package the whole thing it give...

C# Linq All & Any working differently on blank array

Consider following linq example with blank array: When `Any()` returns `false` as there is no number greater than zero how can `All()` return `true` conveying all numbers greater than zero ? ``...

11 Aug at 14:49

ServiceStack Custom Credentials Auth with DB Stored Api Keys

Right now, we're authenticating our users with this: ``` public class WindowsAuthProvider : CredentialsAuthProvider { public override bool TryAuthenticate(IServiceBase authService, string userNam...

ASP.Net Core Content-Disposition attachment/inline

I am returning a file from a WebAPI controller. The Content-Disposition header value is automatically set to "attachment". For example: > Disposition: attachment; filename="30956.pdf"; filename*=UTF-...

8 Nov at 15:0

TensorFlow not found using pip

I'm trying to install TensorFlow using pip: ``` $ pip install tensorflow --user Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching ...

30 Jan at 02:51

How to get current model in action filter

I have a generic action filter, and i want to get current model in the `OnActionExecuting` method. My current implementation is like below: ``` public class CommandFilter<T> : IActionFilter where T :...

10 May at 17:6

How to resolve the conflict between 2 mscorlib versions in Visual Studio and Xamarin Studio?

For more than 2 days I have been trying to fix this error, but I have not succeeded. This is the error : > No way to resolve conflict between "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKe...