Questions

How do I upload a file with metadata using a REST web service?

I have a REST web service that currently exposes this URL: [http://server/data/media](http://server/data/media) where users can `POST` the following JSON: ``` { "Name": "Test", "Latitude": ...

15 Oct at 00:21

Unfamiliar symbol in algorithm: what does ∀ mean?

I'm reading about an algorithm (it's a path-finding algorithm based on A*), and it contains a mathematical symbol I'm unfamiliar with: ∀ Here is the context: > v(s) ≥ g(s) = min(v(s') + c(s', s)) ∀s...

30 Jan at 13:13

Count Rows in Doctrine QueryBuilder

I'm using Doctrine's QueryBuilder to build a query, and I want to get the total count of results from the query. ``` $repository = $em->getRepository('FooBundle:Foo'); $qb = $repository->createQu...

10 Feb at 00:56

range() for floats

Is there a `range()` equivalent for floats in Python? ``` >>> range(0.5,5,1.5) [0, 1, 2, 3, 4] >>> range(0.5,5,0.5) Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> ...

1 Sep at 07:30

SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' using CakePHP

I am new to PHP and [CakePHP](http://en.wikipedia.org/wiki/CakePHP). I am finding problems while wiring my database using CakePHP. Below is my application configuration. I am on Bitnami WAMP stack 5...

9 Nov at 18:59

Make Maven to copy dependencies into target/lib

How do I get my project's runtime dependencies copied into the `target/lib` folder? As it is right now, after `mvn clean install` the `target` folder contains only my project's jar, but none of the...

jQuery get input value after keypress

I have the following function: ``` $(document).ready(function() { $("#dSuggest").keypress(function() { var dInput = $('input:text[name=dSuggest]').val(); console.log(dInput); ...

19 Aug at 09:40

Best XML parser for Java

I need to read smallish (few MB at the most, UTF-8 encoded) XML files, rummage around looking at various elements and attributes, perhaps modify a few and write the XML back out again to disk (prefera...

26 Oct at 03:22

How to add conditional attribute in Angular 2?

How can I conditionally add an element attribute e.g. the `checked` of a checkbox? Previous versions of Angular had `NgAttr` and I think `NgChecked` which all seem to provide the functionality that ...

17 May at 15:6

C# Passing Function as Argument

I've written a function in C# that does a numerical differentiation. It looks like this: ``` public double Diff(double x) { double h = 0.0000001; return (Function(x + h) - Function(x)) / h; }...

21 Mar at 23:8

Android: how do I check if activity is running?

Is there any simple way of determining whether or not a certain activity is active? I want to do certain things depending on which activity is active. eg: ``` if(activityrunning == activity1) //do t...

1 Dec at 15:27

git: fatal unable to auto-detect email address

I just cannot commit with git on Ubuntu 14.04 > git: fatal unable to auto-detect email address (got "some wrong email") I tried `git-config` with and without the `--global` option setting user.nam...

17 Feb at 10:19

How do I alias commands in git?

I saw a screencast where someone had gotten ``` git st git ci ``` to work. When I do it I get an error asking me if I meant something else. Being a git newb, I need to know what you have to do to...

9 Jun at 11:44

Find empty or NaN entry in Pandas Dataframe

I am trying to search through a Pandas Dataframe to find where it has a missing entry or a NaN entry. Here is a dataframe that I am working with: ``` cl_id a c d e ...

How to draw a checkmark / tick using CSS?

How to the tick symbol using CSS? The symbols I find using [Unicode](https://en.wikipedia.org/wiki/Check_mark#Unicode) isn't aesthetically-pleasing. Icon fonts are a great suggestion. I was looking...

6 May at 09:46

What is "origin" in Git?

When I run: ``` git push origin branchname ``` What exactly is `origin` and why do I have to type it before the branch name?

23 Apr at 20:15

Loading a properties file from Java package

I need to read a properties files that's buried in my package structure in `com.al.common.email.templates`. I've tried everything and I can't figure it out. In the end, my code will be running in a ...

28 Aug at 20:21

Get item in the list in Scala?

How in the world do you get just an element at index from the List in scala? I tried `get(i)`, and `[i]` - nothing works. Googling only returns how to "find" an element in the list. But I already kn...

17 Feb at 03:55

Bootstrap select dropdown list placeholder

I am trying to make a dropdown list that contains a placeholder. It doesn't seem to support `placeholder="stuff"` as other forms do. Is there a different way to obtain a placeholder in my dropdown?

28 Jan at 14:18

XPath:: Get following Sibling

I have following HTML Structure: I am trying to build a robust method to extract second color digest element since there will be many of these tag within the DOM. ``` <table> <tbody> <tr bgcolo...

23 Oct at 10:2

A tool to convert MATLAB code to Python

I have a bunch of MATLAB code from my MS thesis which I now want to convert to Python (using numpy/scipy and matplotlib) and distribute as open-source. I know the similarity between MATLAB and Python ...

24 Nov at 10:15

Check if checkbox is NOT checked on click - jQuery

I want to check if a checkbox just got unchecked, when a user clicks on it. The reason for this is because i want to do a validation when a user unchecks a checkbox. Because atleast one checkbox needs...

22 Jun at 15:22

Pretty Printing a pandas dataframe

How can I print a pandas dataframe as a nice text-based table, like the following? ``` +------------+---------+-------------+ | column_one | col_two | column_3 | +------------+---------+----------...

23 Jan at 22:35

Reading a space-delimited string into an array in Bash

I have a variable which contains a space-delimited string: ``` line="1 1.50 string" ``` I want to split that string with space as a delimiter and store the result in an array, so that the following...

3 Jan at 18:45

Setting the selected attribute on a select list using jQuery

I have the following HTML: ``` <select id="dropdown"> <option>A</option> <option>B</option> <option>C</option> </select> ``` I have the string "B" so I want to set the `selected` attrib...

8 Aug at 13:53