Questions

Non-static method requires a target

I have a controller action that works fine on Firefox both locally and in production, and IE locally, but not IE in production. Here is my controller action: ``` public ActionResult MNPurchase() { ...

twitter bootstrap typeahead ajax example

I'm trying to find a working example of the [twitter bootstrap typeahead](http://twitter.github.com/bootstrap/javascript.html#typeahead) element that will make an ajax call to populate it's dropdown. ...

Why can't I push to this bare repository?

Can you explain what is wrong with this workflow? ``` $ git init --bare bare Initialized empty Git repository in /work/fun/git_experiments/bare/ $ git clone bare alice Cloning into alice... done. war...

27 May at 21:12

Is the underscore prefix for property and method names merely a convention?

Is the underscore prefix in JavaScript only a convention, like for example in Python private class methods are? From the 2.7 Python documentation: > “Private” instance variables that cannot be acc...

24 Jun at 11:9

Truncate number to two decimal places without rounding

Suppose I have a value of 15.7784514, I want to display it 15.77 with no rounding. ``` var num = parseFloat(15.7784514); document.write(num.toFixed(1)+"<br />"); document.write(num.toFixed(2)+"<br />...

18 Jan at 11:35

in_array() and multidimensional array

I use `in_array()` to check whether a value exists in an array like below, ``` $a = array("Mac", "NT", "Irix", "Linux"); if (in_array("Irix", $a)) { echo "Got Irix"; } //print_r($a); ``` but ...

9 Sep at 12:26

How do I calculate percentiles with python/numpy?

Is there a convenient way to calculate percentiles for a sequence or single-dimensional numpy array? I am looking for something similar to Excel's percentile function. I looked in NumPy's statistics...

How to access random item in list?

I have an ArrayList, and I need to be able to click a button and then randomly pick out a string from that list and display it in a messagebox. How would I go about doing this?

20 Sep at 13:41

Date only from TextBoxFor()

I'm having trouble displaying the only date part of a DateTime into a textbox using TextBoxFor<,>(expression, htmlAttributes). The model is based on Linq2SQL, field is a DateTime on SQL and in the En...

1 Mar at 15:58

How to do a JUnit assert on a message in a logger

I have some code-under-test that calls on a Java logger to report its status. In the JUnit test code, I would like to verify that the correct log entry was made in this logger. Something along the fol...

10 Jul at 05:19

MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET

What is main difference between `INSERT INTO table VALUES ..` and `INSERT INTO table SET`? Example: ``` INSERT INTO table (a, b, c) VALUES (1,2,3) INSERT INTO table SET a=1, b=2, c=3 ``` And wha...

9 Feb at 18:57

String replacement in Objective-C

How to replace a character is a string in Objective-C?

9 May at 17:43

How do I decompile a .NET EXE into readable C# source code?

I wrote a C# application for a client a couple of years ago, but I no longer have the source code. All I have is the EXE that I deployed on the client's PC. Is there a way I can generate C# source c...

How do I get the directory that a program is running from?

Is there a platform-agnostic and filesystem-agnostic method to obtain the full path of the directory from where a program is running using C/C++? Not to be confused with the current working directory....

14 Feb at 12:53

How to get the changes on a branch in Git

What is the best way to get a log of commits on a branch since the time it was branched from the current branch? My solution so far is: ``` git log $(git merge-base HEAD branch)..branch ``` The doc...

24 Jul at 11:40

php execute a background process

I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the user being aware of the time it takes for t...

7 Sep at 14:44

Detect if the device is iPhone X

My iOS app uses a custom height for the `UINavigationBar` which leads to some problems on the new iPhone X. Does someone already know how to detect programmatically (in Objective-C) if an app is ru...

21 Mar at 06:9

.NET Core vs ASP.NET Core

What exactly is the difference between .NET Core and ASP.NET Core? Are they mutually exclusive? I heard ASP.NET Core is built on .NET Core, but it can also be built on the full .NET framework. So wh...

26 Feb at 21:24

Prevent content from expanding grid items

Is there anything like `table-layout: fixed` for CSS grids? --- I tried to create a year-view calendar with a big 4x3 grid for the months and therein nested 7x6 grids for the days. The calendar...

19 Feb at 10:28

Read the current full URL with React?

How do I get the full URL from within a ReactJS component? I'm thinking it should be something like `this.props.location` but it is `undefined`

3 Oct at 02:5

After installing with pip, "jupyter: command not found"

After installing with `pip install jupyter`, terminal still cannot find `jupyter notebook`. Ubuntu simply says `command not found`. Similar with `ipython`. Did `pip` not get install properly or s...

7 Jun at 12:36

Vagrant error : Failed to mount folders in Linux guest

I have some issues with Vagrant shared folders, my base system is Ubuntu 13.10 desktop. I do not understand why I have this error is something that is not right configured ? Is a NFS issue or Virtual...

28 Mar at 15:46

Logical operators for Boolean indexing in Pandas

I'm working with a Boolean index in Pandas. The question is why the statement: ``` a[(a['some_column']==some_number) & (a['some_other_column']==some_other_number)] ``` works fine whereas ``` a[(a['so...

What is the difference between "long", "long long", "long int", and "long long int" in C++?

I am transitioning from Java to C++ and have some questions about the `long` data type. In Java, to hold an integer greater than 2, you would simply write `long x;`. However, in C++, it seems that `lo...

22 Nov at 18:9

S3 - Access-Control-Allow-Origin Header

Did anyone manage to add `Access-Control-Allow-Origin` to the response headers? What I need is something like this: ``` <img src="http://360assets.s3.amazonaws.com/tours/8b16734d-336c-48c7-95c4-3a93...