Accessing AspNetRequest
I have a global filters which adds a token to the request.Items collection which subsequent filters can also access. The problem I am having is when trying to get a hold of the request.Items when I a...
- Modified
- 12 Aug at 16:37
Value cannot be null. Parameter name: items (in Dropdown List) ASP.NET MVC5
I have problem in my code. I'm using the registration form which comes with MVC5 , I added a field "Role" as a Dropdownlist to assign a role to the user while creating a new user. like in the below im...
- Modified
- 1 Jul at 18:34
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?
- Modified
- 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...
- Modified
- 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...
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...
- Modified
- 9 Jan at 17:22
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...
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" ...
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...
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)) ...
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)
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...
- Modified
- 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/...
- Modified
- 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 ...
- Modified
- 23 May at 12:32
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".......
- Modified
- 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...
- Modified
- 17 Jan at 19:50
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...
- Modified
- 14 Aug at 05:46
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...
- Modified
- 11 Aug at 22:39
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...
- Modified
- 16 Aug at 07:14
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...
- Modified
- 11 Aug at 17:57
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...
- Modified
- 28 Sep at 12:46
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 ? ``...
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...
- Modified
- 11 Aug at 14:32
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-...
- Modified
- 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 ...
- Modified
- 30 Jan at 02:51