Questions

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

I have a project created by Maven integration in Eclipse. All work fine, but in the work space in all JSP files have this: ``` The superclass "javax.servlet.http.HttpServlet" was not found on the Jav...

12 Jan at 21:6

Completely cancel a rebase

I performed a rebase like this: ``` git rebase --onto master new_background_processing export_background_processing ``` That didn't do what I wanted it to, so I performed a reset: ``` git reset ...

20 Dec at 02:43

How to sort a dataFrame in python pandas by two or more columns?

Suppose I have a dataframe with columns `a`, `b` and `c`, I want to sort the dataframe by column `b` in ascending order, and by column `c` in descending order, how do I do this?

How to display length of filtered ng-repeat data

I have a data array which contains many objects (JSON format). The following can be assumed as the contents of this array: ``` var data = [ { "name": "Jim", "age" : 25 }, { "name":...

24 Feb at 22:8

Entity Framework Provider type could not be loaded?

I am trying to run my tests on TeamCity which is currently installed on my machine. > `System.InvalidOperationException`: The Entity Framework provider type '`System.Data.Entity.SqlServer.SqlProvid...

Best way to select random rows PostgreSQL

I want a random selection of rows in PostgreSQL, I tried this: ``` select * from table where random() < 0.01; ``` But some other recommend this: ``` select * from table order by random() limit 1000; ...

8 Apr at 03:59

Is there a better way to run a command N times in bash?

I occasionally run a bash command line like this: ``` n=0; while [[ $n -lt 10 ]]; do some_command; n=$((n+1)); done ``` To run `some_command` a number of times in a row -- 10 times in this case. O...

30 Aug at 01:17

Using .text() to retrieve only text not nested in child tags

If I have html like this: ``` <li id="listItem"> This is some text <span id="firstSpan">First span text</span> <span id="secondSpan">Second span text</span> </li> ``` I'm trying to use ...

13 Oct at 18:20

How to convert vector to array

How do I convert a `std::vector<double>` to a `double array[]`?

19 Mar at 17:46

How to get the absolute coordinates of a view

I'm trying to get the absolute screen pixel coordinates of the top left corner of a view. However, all methods I can find such as `getLeft()` and `getRight()` don't work as they all seem to be relativ...

14 Jan at 11:24

How to push both value and key into PHP array

Take a look at this code: ``` $GET = array(); $key = 'one=1'; $rule = explode('=', $key); /* array_push($GET, $rule[0] => $rule[1]); */ ``` I'm looking for something like this so that: ``` pri...

19 Dec at 06:6

What is the best way to call a script from another script?

I have a script named `test1.py` which is not in a module. It just has code that should execute when the script itself is run. There are no functions, classes, methods, etc. I have another script whic...

26 Feb at 17:15

PHPDoc type hinting for array of objects?

So, in PHPDoc one can specify `@var` above the member variable declaration to hint at its type. Then an IDE, for ex. PHPEd, will know what type of object it's working with and will be able to provide ...

18 Sep at 17:42

How to reject in async/await syntax?

How can I reject a promise that returned by an `async`/`await` function? e.g. Originally: ``` foo(id: string): Promise<A> { return new Promise((resolve, reject) => { someAsyncPromise().then((val...

Can't access object property, even though it shows up in a console log

Below, you can see the output from these two logs. The first clearly shows the full object with the property I'm trying to access, but on the very next line of code, I can't access it with `config.col...

4 Jul at 19:42

Convert DataFrame column type from string to datetime

How can I convert a DataFrame column of strings (in format) to datetime dtype?

Best practice to return errors in ASP.NET Web API

I have concerns on the way that we returns errors to client. Do we return error immediately by throwing [HttpResponseException](https://msdn.microsoft.com/en-us/library/system.web.http.httpresponseex...

11 May at 08:53

Overcoming "Display forbidden by X-Frame-Options"

I'm writing a tiny webpage whose purpose is to frame a few other pages, simply to consolidate them into a single browser window for ease of viewing. A few of the pages I'm trying to frame forbid bein...

12 Mar at 18:1

Getting the filenames of all files in a folder

I need to create a list with all names of the files in a folder. For example, if I have: ``` 000.jpg 012.jpg 013.jpg ``` I want to store them in a `ArrayList` with `[000,012,013]` as values. What...

23 May at 12:18

CSS technique for a horizontal line with words in the middle

I'm trying to make a horizontal rule with some text in the middle. For example: ----------------------------------- my title here ----------------------------- Is there a way to do that in CSS? With...

26 Aug at 19:35

How can I check the syntax of Python script without executing it?

I used to use `perl -c programfile` to check the syntax of a Perl program and then exit without executing it. Is there an equivalent way to do this for a Python script?

31 Mar at 00:26

Calling startActivity() from outside of an Activity context

I have implemented a `ListView` in my Android application. I bind to this `ListView` using a custom subclass of the `ArrayAdapter` class. Inside the overridden `ArrayAdapter.getView(...)` method, I ...

Find an element in DOM based on an attribute value

Can you please tell me if there is any DOM API which search for an element with given attribute name and attribute value: Something like: ``` doc.findElementByAttribute("myAttribute", "aValue"); ```...

30 Sep at 17:37

How do Python functions handle the types of parameters that you pass in?

Unless I'm mistaken, creating a function in Python works like this: ``` def my_func(param1, param2): # stuff ``` However, you don't actually give the types of those parameters. Also, if I remem...

18 Nov at 23:34

How to determine when a Git branch was created?

Is there a way to determine a Git branch was created? I have a branch in my repo and and I don't remember creating it and thought maybe seeing the creation timestamp would jog my memory.

24 Jul at 18:21