Can the C# compiler distinguish between I/O bound and computational tasks?

Consider a snippet of code such as this: ``` public async Task<Bitmap> DownloadDataAndRenderImageAsync( CancellationToken cancellationToken) { var imageData = await DownloadImageDataAsync(can...

25 Apr at 16:28

Persistent hashcode for strings

I want to generate an integer hashcode for strings, that will stay constant forever; i.e. the same string should always result in the same hashcode. The hash does not have to be cryptographically sec...

25 Apr at 15:53

Deserialize CSV with ServiceStack.Text

I'm trying to use ServiceStack.Text for deserializing a csv file containing ";" as the seperator. The test csv contains this data ``` --------------- | Col1 | Col2 | --------------- | Val1 | Val2 |...

Howto get domainname from UserPrincipal or PrincipalSearcher

I have the following code which returns me a UserPrincipal but loginname never includes the domainname. There is also no property "Domainname" or similar. How can i get from a UserPrincipal or Princi...

25 Apr at 14:35

Array<Type> VS Type[] in Typescript

As far as I know a property's type can be defined in two ways when it's an Array. ``` property_name: type ``` where type can be either ``` Array<string>, Array<MyType>, etc. (e.g. let prop1: Array...

12 Apr at 14:53

ERROR Android emulator gets killed in Android Studio

After updating to Android Studio 2 when I try to run my application and choose an emulator, I wait for the emulator to start and it suddenly gets killed. I can see the emulator process for some minute...

How to pass data from asp.NET MVC to Angular2

What is the best way to pass data from an ASP.NET MVC controller to an Angular 2.0 component? For example, we use the ASP.NET MVC Model and would like to send a JSON version of it to Angular to use it...

21 May at 20:2

Getting OutOfMemoryException in Xamarin

> java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing 'java.exe' I am getting out of memory exception in my visualstudio Xa...

'pip' is not recognized

I tried to install `PySide` but I got error from the powershell as follows: ``` pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the s...

7 Jan at 03:15

How do I pass data to Angular routed components?

In one of my Angular 2 routes's templates () I have a button ``` <div class="button" click="routeWithData()">Pass data and route</div> ``` My is to achieve: > Button click -> route to another c...

5 Dec at 14:24

PredicateBuilder issue with ServiceStack OrmLite

I am using ServiceStack OrmLite PredicateBuilder to build a WHERE statement dynamically: ``` var q = PredicateBuilder.True<ItemList>(); if (!filter.Keyword.IsNullOrWhiteSpace()) { q =...

26 Apr at 05:0

Compiling an application for use in highly radioactive environments

We are compiling an embedded C++ application that is deployed in a shielded device in an environment bombarded with [ionizing radiation](https://en.wikipedia.org/wiki/Ionizing_radiation). We are using...

24 Nov at 14:7

What are the pros and cons of parquet format compared to other formats?

Characteristics of Apache Parquet are : - - - In comparison to Avro, Sequence Files, RC File etc. I want an overview of the formats. I have already read : [How Impala Works with Hadoop File Formats...

18 Apr at 10:30

Read-Only Property in C# 6.0

Microsoft introduce a new syntax in C#6 that let you set your property to read-only as below: ``` public class Animal { public string MostDangerous { get; } = "Mosquito"; } ``` I am wondering w...

24 Apr at 07:0

Issue With Spring: There was an unexpected error (type=Not Found, status=404)

I am going through this book on restful web services with spring. I decided to move away from what they were doing and use java configuration files. For some reason, after switching over to the Java c...

15 Mar at 22:29

Register Container Itself Using Autofac

I was wondering is there's any side effect to registering the container within itself ``` IContainer container; ContainerBuilder builder = new ContainerBuilder(); container = builder.Build(); builde...

How do I call an Angular 2 pipe with multiple arguments?

I know I can call a pipe like this: ``` {{ myData | date:'fullDate' }} ``` Here the date pipe takes only one argument. What is the syntax to call a pipe with more parameters, from component's templ...

21 Dec at 19:44

Is it safe to create and use a disposable object inline?

I have seen so many times developers using a disposable object inline, [here](https://stackoverflow.com/a/18796518/6170636) for instance. By inline I mean: ``` var result = new DataTable().Compute("1...

23 May at 12:16

Dynamically change connection string in Asp.Net Core

I want to change sql connection string in controller, not in ApplicationDbContext. I'm using Asp.Net Core and Entity Framework Core. For example: ``` public class MyController : Controller { pri...

Passing/exposing T on a ServiceStack request filter

I've got a request attribute that I'm decorating some services, but I need to pass a generic type into it because of some logic happening inside of it. It looks like so: ``` [SomeAttribute(typeof(MyC...

C# HashSet<T> read-only workaround

Here is this sample code: ``` static class Store { private static List<String> strList = new List<string>(); private static HashSet<String> strHashSet = new HashSet<string>(); public sta...

WinForms app changes its scaling after opening WPF window from form

At first I would like to give some context of problem: We have large legacy WinForms application, which we decided to move to WPF. But its impossible (for many reasons, including business) to complete...

23 Apr at 19:7

Visual Studio Code - Convert spaces to tabs

I have both TypeScript and HTML files in my project, in both files tabs are converted to spaces. I want to turn the auto-conversion off and make sure that my project has only tabs. Edit: With this set...

9 Sep at 08:31

Connection refused on docker container

I'm new to Docker and trying to make a demo Rails app. I made a dockerfile that looks like this: ``` FROM ruby:2.2 MAINTAINER marko@codeship.com # Install apt based dependencies required to run Rai...

23 Apr at 16:52

How to display only files from aws s3 ls command?

I am using AWS CLI to list the files in an AWS S3 bucket using the following command ([aws s3 ls](http://docs.aws.amazon.com/cli/latest/reference/s3/ls.html)): ``` aws s3 ls s3://mybucket --recursive ...