Questions

Difference between ApiController and Controller in ASP.NET MVC

I've been playing around with ASP.NET MVC 4 beta and I see two types of controllers now: `ApiController` and `Controller`. I'm little confused at what situations I can choose a particular controller...

29 Feb at 07:16

load and execute order of scripts

There are so many different ways to include JavaScript in a html page. I know about the following options: - - [1](https://stackoverflow.com/questions/1213281/does-javascript-have-to-be-in-the-head-t...

23 May at 12:10

How to send JSON instead of a query string with $.ajax?

Can someone explain in an easy way how to make jQuery send actual JSON instead of a query string? ``` $.ajax({ url : url, dataType : 'json', // I was pretty sure this would do the trick ...

26 Apr at 00:42

VBA: Convert Text to Number

I have columns of numbers that, for whatever reason, are formatted as text. This prevents me from using arithmetic functions such as the subtotal function. What is the best way to convert these "text ...

4 Dec at 12:45

Safely limiting Ansible playbooks to a single machine?

I'm using Ansible for some simple user management tasks with a small group of computers. Currently, I have my playbooks set to `hosts: all` and my hosts file is just a single group with all machines l...

17 Jan at 14:8

Escape @ character in razor view engine

I am creating a sample ASP.NET MVC 3 site using Razor as view engine. The razor syntax starts with `@` character e.g. `@RenderBody()`. If I write @test on my cshtml page it gives me parse error > CS0...

7 Nov at 06:47

How can I define colors as variables in CSS?

I’m working on a CSS file that is quite long. I know that the client could ask for changes to the color scheme, and was wondering: is it possible to assign colors to variables, so that I can just chan...

23 Jul at 02:22

Angular2 - Radio Button Binding

I want to use radio button in a form using Angular 2 ``` Options : <br/> 1 : <input name="options" ng-control="options" type="radio" value="1" [(ng-model)]="model.options" ><br/> 2 : <input name=...

19 Oct at 11:19

Can't specify the 'async' modifier on the 'Main' method of a console app

I am new to asynchronous programming with the `async` modifier. I am trying to figure out how to make sure that my `Main` method of a console application actually runs asynchronously. ``` class Progr...

What is the difference between substr and substring?

What is the difference between ``` alert("abc".substr(0,2)); ``` and ``` alert("abc".substring(0,2)); ``` They both seem to output “ab”.

19 Sep at 11:40

Convert LocalDate to LocalDateTime or java.sql.Timestamp

I am using JodaTime 1.6.2. I have a `LocalDate` that I need to convert to either a (Joda) `LocalDateTime`, or a `java.sqlTimestamp` for ormapping. The reason for this is I have figured out how to co...

24 Jan at 19:4

PHP Call to undefined function

I am trying to call a function from another function. I get an error: ``` Fatal error: Call to undefined function getInitialInformation() in controller.php on line 24 ``` ``` require_once("model...

28 Mar at 20:49

How to get content body from a httpclient call?

I've been trying to figure out how to read the contents of a httpclient call, and I can't seem to get it. The response status I get is 200, but I can't figure out how to get to the actual Json being r...

15 Mar at 12:29

What is the difference between "npm install" and "npm ci"?

I'm working with continuous integration and discovered the [npm ci](https://docs.npmjs.com/cli/ci) command. I can't figure what the advantages are of using this command for my workflow. Is it fast...

XMLHttpRequest blocked by CORS Policy

I add an API with following script in let's say [http://www.test.com](http://www.test.com): ``` <script src="http://apiendpoint.com/api/v1/api.js"></script> <div id="api" data-apikey="LA59CJI9HZ-KIJ...

16 Jun at 18:55

Inverse of a matrix using numpy

I'd like to use numpy to calculate the inverse. But I'm getting an error: ``` 'numpy.ndarry' object has no attribute I ``` To calculate inverse of a matrix in numpy, say matrix M, it should be si...

8 Nov at 22:54

The requested URL /about was not found on this server

The home page of my wordpress website seems to be displaying correctly but if you click through to any of the other pages I get the following error message: ``` Not Found The requested URL /about wa...

Get Android Phone Model programmatically , How to get Device name and model programmatically in android?

I would like to know if there is a way for reading the Phone Model programmatically in Android. I would like to get a string like HTC Dream, Milestone, Sapphire or whatever...

What is “assert” in JavaScript?

What does `assert` mean in JavaScript? I’ve seen something like: ``` assert(function1() && function2() && function3(), "some text"); ``` And would like to know what the method `assert()` does.

31 May at 22:50

Node JS Promise.all and forEach

I have an array like structure that exposes async methods. The async method calls return array structures that in turn expose more async methods. I am creating another JSON object to store values obta...

Given a URL to a text file, what is the simplest way to read the contents of the text file?

In Python, when given the URL for a text file, what is the simplest way to access the contents off the text file and print the contents of the file out locally line-by-line without saving a local copy...

23 Jul at 22:36

What are the default access modifiers in C#?

What is the default access modifier for classes, methods, members, constructors, delegates and interfaces?

31 Oct at 08:36

WPF chart controls

I am looking for a very simple WPF chart which should have a 2D graph and should have pan and zoom facilities .

16 Dec at 14:29

SQL not a single-group group function

When I run the following SQL statement: ``` SELECT MAX(SUM(TIME)) FROM downloads GROUP BY SSN ``` It returns the maximum sum value of downloads by a customer, however if I try to find the social se...

8 Jun at 02:22

React-Redux: Actions must be plain objects. Use custom middleware for async actions

> Unhandled Rejection (Error): Actions must be plain objects. Use custom middleware for async actions. I wanted to add comments with every posts. So when fetch posts are run I want to call fetch comm...

15 Sep at 14:29