Questions

Why use decimal(int [ ]) constructor?

I am maintaining a C# desktop application, on windows 7, using Visual Studio 2013. And somewhere in the code there is the following line, that tries to create a 0.01 decimal value, using a Decimal(Int...

15 Apr at 14:14

ServiceStack Serviceless for CQRS

I would like to be able to leverage ServiceStacks routing and built in documentation functionality to expose service operations based on the message type annotation with route and verb. A generic Serv...

15 Apr at 13:39

How can moment.js be imported with typescript?

I'm trying to learn Typescript. While I don't think it's relevant, I'm using VSCode for this demo. I have a `package.json` that has these pieces in it: ``` { "devDependencies": { "gulp": "^3.9...

15 Apr at 13:15

What is the purpose of MemoryCache in MVC?

I'm a bit confused on the proper usage of MemoryCache. Should/can it be used to load static information to save on repeated calls? Should/can it be used to persist data on a view across several actio...

15 Apr at 12:13

How to convert a plain object into an ES6 Map?

For some reason I can't find this simple thing in the [MDN docs](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) (maybe I'm just missing it). I expected this to wor...

15 Apr at 10:18

Shortcut key for commenting out lines of Python code in Spyder

I recently changed from the Enthought Canopy Python distribution to Anaconda, which includes the Spyder IDE. In Canopy's code editor, it was possible to comment and uncomment lines of code by pressin...

15 Apr at 10:3

How to get current user in asp.net core

I want to get the current user, so I can access fields like their email address. But I can't do that in asp.net core. This is my code: `HttpContext` almost is null in of controller. It's not good to ...

18 May at 13:46

How to copy text from a div to clipboard

Here is my code for when the user clicks on this button: ``` <button id="button1">Click to copy</button> ``` How do I copy the text inside this div? ``` <div id="div1">Text To Copy</div> ```

26 Sep at 03:54

angular2 manually firing click event on particular element

I am trying to fire click event (or any other event) on element programatically , In other word I want to know the similar features as offered by jQuery .trigger() method in angular2. Is there any ...

15 Apr at 06:13

EPPlus - Read Excel Table

Using EPPlus, I want to read an excel table, then store all the contents from each column into its corresponding `List`. I want it to recognize the table's heading and categorize the contents based on...

15 Apr at 03:52

Transactions with ASP.NET Identity UserManager

I'm trying to update a user. ``` AppUserManager appUserManager = HttpContext.GetOwinContext().GetUserManager<AppUserManager>(); AppUser member = await appUserManager.FindByIdAsync(User.Identity.Get...

SQL query to find a list of city names that dont start with vowels

I'm trying to query the list of CITY names from table - STATION that do not start with vowels with results that cannot contain duplicates. The table just has id, city, population This is the query th...

14 Apr at 21:59

List of swagger UI alternatives

Is there any Swagger UI alternatives ? I already know: - [http://swaggerui.herokuapp.com/#!/pet/addPet](http://swaggerui.herokuapp.com/#!/pet/addPet)- [http://public.redfroggy.fr/swagger2](http://pub...

14 Apr at 21:24

Running Node.Js on Android

So I know this has been questioned quite a lot. To be exact for example in these questions: 1. Run NodeJs server in Android 2. How to run my node.js project on android? and 3. NodeJS on IOS/Androi...

Errors/Warnings show up on "Error List" but then disappear for website project

I have inherited a solution with multiple projects. One of the projects is a website project... or at least I'm pretty sure that's what this icon means (It looks pretty different in VS 2010 vs 2013,...

23 May at 11:54

Returning HTML With fetch()

I'm trying to fetch a file and return it's HTML. However it's not as simple as I'd have imagined. ``` fetch('/path/to/file') .then(function (response) { return response.body; }) .th...

21 Aug at 13:54

How to get current location or move to current location in Xamarin.Forms.Map

Since the Map already shows the user location (with IsShowingUser) I just want to zoom to this location. Is this easily possible or do I need to get the location on every platform, since I don't find ...

14 Apr at 17:54

How can I start PostgreSQL on Windows?

I have installed Postgresql on my Windows 10 PC. I have used the pgAdmin II tool to create a database called company, and now I want to start the database server running. I cannot figure out how to do...

29 Jan at 17:30

ValidateAntiForgeryToken in Ajax request with AspNet Core MVC

I have been trying to recreate an Ajax version of the ValidateAntiForgeryToken - there are many blog posts on how to do this for previous versions of MVC, but with the latest MVC 6, none of the code i...

SQL query to check if a name begins and ends with a vowel

I want to query the list of `CITY` names from the table `STATION(id, city, longitude, latitude)` which have vowels as both their first and last characters. The result cannot contain duplicates. For t...

10 Apr at 20:54

How do I pass an object to HttpClient.PostAsync and serialize as a JSON body?

I'm using `System.Net.Http`, I found several examples on the web. I managed to create this code for make a `POST` request: ``` public static string POST(string resource, string token) { using (va...

21 Nov at 04:10

Is there a nameof() operator for MVC controllers in C#?

The newly introduced [nameof](https://msdn.microsoft.com/en-us/library/dn986596.aspx) operator is useful in making my code my "typed". Instead of ``` return RedirectToAction("Edit"); ``` we can w...

4 Sep at 16:20

Property initialization using "by lazy" vs. "lateinit"

In Kotlin, if you don't want to initialize a class property inside the constructor or in the top of the class body, you have basically these two options (from the language reference): 1. Lazy Initial...

3 Oct at 10:44

How to ensure that ServiceStack always returns JSON?

We have decided to only allow requests with a Content-Type header "application/json". So, whenever we receive a request with an alternative or missing Content-Type header, we throw an HttpError. This ...

14 Apr at 12:9

Why WorkflowInvoker exception is not returning filename and line number in stacktrace

I am using the WorkflowInvoker in my application. if any exception occurred, in StackTrace i am not getting the proper file name and line number.`do i need to include any logic? ``` try { ...