CORS not working with route
I have an issue with an endpoint on my web api. I have a POST method that is not working due to: > Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' ...
- Modified
- 15 Jun at 23:21
^=, -= and += symbols in Python
I am quite experienced with Python, but recently, when I was looking at the solutions for the [codility](https://www.codility.com/) sample tests I encountered the operators `-=`, `+=`, `^=` and I am u...
How query by global secondary index with DynamoDBContext
i have this class with this attributes: 1. ContactId -> HashKey 2. Email -> Global Seconday Index Hash Key 3. CreatedAt -> Property Actually, i have this method, but throw me an exception because...
- Modified
- 15 Jun at 21:13
Unit test an Entity Framework generic repository using Moq
I am not able to get a passing test because the class `this.dbSet = context.Set<T>();` is always `null`. As you can see in the code below, I have mocked up the `DbSet` and the context. I have also...
- Modified
- 8 May at 02:1
WebApi 2 POST with single string parameter not working
I have the following controller: ``` public class ValuesController : ApiController { // POST api/values public IHttpActionResult Post(string filterName) { return new JsonResult<s...
- Modified
- 4 May at 12:23
java.lang.IllegalArgumentException: No converter found for return value of type
With this code ``` @RequestMapping(value = "/bar/foo", method = RequestMethod.GET) public ResponseEntity<foo> foo() { Foo model; ... return ResponseEntity.ok(model); }...
- Modified
- 18 Aug at 15:40
C# - Get Second to Last Item in a List
I have some code written in C#. In this code, I have a `List<KeyValuePair<int, string>> items`. I am trying to get the second-to-last item in the list. I'm having problems doing it though. Originally...
- Modified
- 9 Oct at 13:56
ShouldSerialize*() vs *Specified Conditional Serialization Pattern
I am aware of both of the ShouldSerialize* pattern and the *Specified pattern and how they work, but is there any difference between the two? Are there any "gotchas" using one method vs the other w...
- Modified
- 15 Jun at 15:38
Python class input argument
I am new to OOP. My idea was to implement the following class: ``` class name(object, name): def __init__(self, name): print name ``` Then the idea was to create two instances of that c...
How can I specify the function type in my type hints?
How can I specify the type hint of a variable as a ? There is no `typing.Function`, and I could not find anything in the relevant PEP, [PEP 483](https://www.python.org/dev/peps/pep-0483/).
- Modified
- 14 Sep at 10:39
Format DateTime in Xamarin Forms to Device Format string
How can I format a `DateTime`object to a string in the device default datetime format when running a PCL Xamarin.Forms project and my deployement targets include iOS, Android and Windows. The `DateT...
- Modified
- 23 May at 11:54
VSTests - Could not find diagnostic data adapter 'Code Coverage'
I'm new to VS Code Coverage, and I'm trying to use the VSTests tool from the command line (in windows). But i get this error. ``` Warning: Diagnostic data adapter message: Could not find diagnosti...
- Modified
- 15 Jun at 11:31
How can I make sure a dataflow block only creates threads on a on-demand basis?
I've written a small pipeline using the TPL Dataflow API which receives data from multiple threads and performs handling on them. ### Setup 1 When I configure it to use `MaxDegreeOfParallelism =...
- Modified
- 23 May at 11:46
SignalR .NET Core camelCase JSON Contract Resolver
Using .NET Core RC2. Got SignalR working, but trying to get it returning camelCase properties in JSON. For APIs I'm using... ``` services.AddMvc().AddJsonOptions(o => { o.SerializerSettings.Con...
- Modified
- 15 Jun at 10:0
How can I COUNT(DISTINCT) in ServiceStack Ormlite?
I'm writing a paged query in ServiceStack's OrmLite, selecting the total records and the ids of records in the page range. Assuming `query` is some arbitrary SqlExpression selecting a bunch of records...
- Modified
- 15 Jun at 10:42
Gradient text color
Is there a generator , or an easy way to generate text like [this](http://patorjk.com/text-color-fader/) but without having to define letter So something like this: ``` .rainbow { background-imag...
- Modified
- 15 Jun at 11:12
Cookie set in ajax is not posted on get http call
SPA app, the specific requirements are: 1. Client calls api through ajax. Server responds with cookie header, among other things such as body. Set-Cookie: Auth=79c6fdfe12754560a2b5a62600df3215:INq8D...
- Modified
- 15 Jun at 10:58
Servicestack MultiTenancy
I have ServiceStack v4.0.60 installed and am looking to ChangeDb in AppHost configuration as per the following: ``` container.Register<IDbConnectionFactory>(c => new OrmLiteConnectionFactory(def...
- Modified
- 15 Jun at 07:45
Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style
When using eslint in the gulp project i have encountered a problem with error like this `Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style` and I am using Windows environment for the run...
- Modified
- 15 Jun at 16:32
upload files to Azure file storage from web app using rest api
I have a web app that is currently using webforms, not MVC, which is going to be hosted on the Azure platform. The main function of this web app is to upload user files to Azure File Storage. The file...
- Modified
- 18 Jan at 19:44
.NET Core use Configuration to bind to Options with Array
Using the .NET Core `Microsoft.Extensions.Configuration` `ConfigurationBinder` has a method [BindArray](https://github.com/aspnet/Configuration/blob/dev/src/Microsoft.Extensions.Configuration.Binder...
- Modified
- 15 Jun at 02:26
How to remove underline below EditText indicator?
Recently I had to change the EditText indicator color and, after doing that, a weird line started to appear below the indicator. How can I remove that? Code for what I've done is below. [](https://i....
- Modified
- 15 Jun at 02:36
Cannot find runtime 'node' on PATH - Visual Studio Code and Node.js
With a downloaded and installed version of Visual Studio Code 1.2.1, and a 64bit version of node.exe msi placed in my working directory (I am assuming that is correct), how do we add node and npm comm...
- Modified
- 20 Mar at 15:19
SAP Sybase SQL Anywhere NullReference Exception when openening and closing many connections in a service
Currently I've the problem that SAP Sybase SQL Anywhere randomly throws `NullReferenceException`s in a service which executes a lot of sql queries. The connections are always created in a `using` bloc...
- Modified
- 11 Apr at 20:10
EntityFramework Multiple Where
I am wondering, if I use multiple `Where(...)` methods one after the other, is EntityFramework smart enough to combine it in a resulting query. Let's say I have: ``` context.Items .Where(item => ...
- Modified
- 14 Jun at 20:24