ServiceStack.Redis: "Unable to Connect: sPort: 0" and Unable to cast object of type 'System.Byte[]' to type 'System.Object[]'
I have a test harness that repeatedly gets and sets DateTime objects so we can test fail-over of our new Redis Sentinel deployment. I have added my license key to the static constructor of the calli...
- Modified
- 18 Jul at 10:30
Why is EF generating SQL queries with unnecessary null-checks?
I came across an issue with EF creating terrible queries when searching on a string field. Its produced a query in the style of lazy programmers to encompass null checking which forces the whole index...
- Modified
- 18 Jul at 12:20
Why does upcasting IDictionary<TKey, TValue> to IEnumerable<object> fail?
See the following code snippet: ``` (IEnumerable<object>)new Dictionary<string, string>() ``` The above cast will throw an invalid cast exception. Actually, `IDictionary<TKey, TValue>` also indire...
Toggle switch control in Windows Forms
I am designing a control using `CheckBox`, but currently my control only draws a circle. How can I draw round shapes like the below image and how can I change the location of the circle based on the ...
- Modified
- 7 Jan at 23:35
How to retrieve a single value from the database using Dapper
I'm using Dapper and trying to retrieve a short from the database and would like to do this without grabbing it from a collection. I've got the following code, which doesn't work because `QueryAsync<...
- Modified
- 18 Jul at 07:3
Difference between forward slash (/) and backslash (\) in file path
I was wondering about the difference between `\` and `/` in file paths. I have noticed that sometimes a path contains `/`and sometimes it is with `\`. It would be great if anyone can explain when to ...
Setting selected option in laravel form
I need to give selected value like this html: ``` <select name="myselect" id="myselect"> <option value="1">Item 1</option> <option value="2" selected='selected'>Item 2</option> ``` how can I ac...
React - Component Full Screen (with height 100%)
I'm stuck with displaying a React component named "home" that take 100% of the height of my screen. Whatever I use CSS or React inline style it doesn't work. In the example below, , and are set to ...
How to measure Code Coverage in ASP.NET Core projects in Visual Studio?
I want to measure the Code Coverage of my XUnit-Tests in an ASP.NET Core application. The Tooling for .NET Core in Visual Studio 2015 is preview 2 and code coverage does not work so far. The blog po...
- Modified
- 20 Sep at 08:25
What is the difference between Task.Run() and Task.Factory.StartNew()
I have Method : ``` private static void Method() { Console.WriteLine("Method() started"); for (var i = 0; i < 20; i++) { Console.WriteLine("Method() Counter = " + i); Th...
- Modified
- 12 Jul at 19:53
Syntax for an If statement using a boolean
I just recently joined the python3 HypeTrain. However I just wondered how you can use an if statement onto a boolean. Example: ``` RandomBool = True # and now how can I check this in an if statemen...
- Modified
- 27 May at 18:4
List of apps/products using ServiceStack?
ServiceStack authors/community: you have done impressive job! Outside of SO, I was wondering if there is an up to date list of products/apps using ServiceStack? Or maybe ServiceStack app/architect...
- Modified
- 17 Jul at 13:29
Visual Studio code(using C#): While putting debugger point then showing me "No Symbol loaded for this document"
I am using `Visual studio Code` (Stable Version) with `.Net Core 1.0 RTM`. I also Installed `C#` extension for Visual studio Code & .Net Core . Now I am developing `Web api` and application running f...
- Modified
- 2 May at 10:18
Catching FULL exception message
Consider: ``` Invoke-WebRequest $sumoApiURL -Headers @{"Content-Type"= "application/json"} -Credential $cred -WebSession $webRequestSession -Method post -Body $sumojson -ErrorAction Stop ``` This t...
- Modified
- 6 Nov at 20:2
React Native fetch() Network Request Failed
When I create a brand new project using `react-native init` (RN version 0.29.1) and put a fetch in the render method to the public facebook demo movie API, it throws a `Network Request Failed`. There ...
- Modified
- 20 Aug at 23:39
C# Update bitmap in picturebox
I'm working on a screen sharing project ,and i recieve a small blocks of image from a `Socket` constantly and need to update them on a certain initial dekstop bitmap i have. Basically i constantly re...
- Modified
- 31 Jul at 09:40
Produces Data Annotation
I've been learning about Web API recently, and making plans to increase the scalability of my MVC apps, using it. When I finally got into creating a Web API controller, though, I discovered a `[Produc...
- Modified
- 16 Jul at 19:29
HttpContext and TelemetryInitializer
I want to attach the user's "client_id" claim as a property to every request sent to Application Insights. From what I've read, I should be implementing `ITelemetryInitializer` but I need the `HttpCo...
- Modified
- 6 Aug at 14:7
anaconda/conda - install a specific package version
I want to install the 'rope' package in my current active environment using conda. Currently, the following 'rope' versions are available: ``` (data_downloader)user@user-ThinkPad ~/code/data_download...
Compare two objects using serialization C#
Why it is not a good practice to compare two objects by serializing them and then compare the strings like in the following example? ``` public class Obj { public int Prop1 { get; set; } publ...
- Modified
- 10 Jan at 22:54
Could not load file or assembly "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
I've copied my project to a clean Windows 10 machine with only Visual Studio 2015 Community and SQL Server 2016 Express installed. There are no other framework versions installed apart from those inst...
- Modified
- 22 Jul at 21:33
How to get list of all timezones in javascript
I am developing an application with react/redux, and I started using library [react-intl](https://github.com/yahoo/react-intl) for formatting messages and dates. I have already been able to show in a...
- Modified
- 23 Oct at 13:47
How do I declare a model class in my Angular 2 component using TypeScript?
I am new to Angular 2 and TypeScript and I'm trying to follow best practices. Instead of using a simple JavaScript model ({ }), I'm attempting to create a TypeScript class. However, Angular 2 doesn'...
- Modified
- 15 Jul at 15:52
Access from class library to appsetting.json in Asp.net-core
I am trying to access `appsetting.json` file from a class library. So far the solution that I found is to create a configuration class implementing interface `IConfiguration` from `Microsoft.Extensio...
- Modified
- 12 Nov at 16:18
Get JSON key name
I have the following JSON data: `{"success":"You are welcome"}` that I have named `json` in my JavaScript code. When I want to alert `You are welcome` I do `json.success`. So now the problem I am fac...
- Modified
- 15 Jul at 13:57