What is the default username and password in Tomcat?
I installed Netbeans and tryed to access the server's manager using: (id/pass)manager/manager, admin/admin, system/password... None of them worked.
C++ Erase vector element by value rather than by position?
``` vector<int> myVector; ``` and lets say the values in the vector are this (in this order): ``` 5 9 2 8 0 7 ``` If I wanted to erase the element that contains the value of "8", I think I would ...
- Modified
- 25 Apr at 15:40
Add single element to array in numpy
I have a numpy array containing: ``` [1, 2, 3] ``` I want to create an array containing: ``` [1, 2, 3, 1] ``` That is, I want to add the first element on to the end of the array. I have tried t...
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?
- Modified
- 1 Nov at 22:31
Downloading MySQL dump from command line
I am moving away from Linode because I don't have the Linux sysadmin skills necessary; before I complete the transition to a more noob-friendly service, I need to download the contents of a MySQL data...
- Modified
- 21 Nov at 00:48
Converting double to integer in Java
In Java, I want to convert a double to an integer, I know if you do this: ``` double x = 1.5; int y = (int)x; ``` you get y=1. If you do this: ``` int y = (int)Math.round(x); ``` You'll likely g...
How do I delay a function call for 5 seconds?
I want `widget.Rotator.rotate()` to be delayed 5 seconds between calls... how do I do this in jQuery... it seems like jQuery's `delay()` wouldn't work for this...
- Modified
- 19 Jan at 17:33
Gradle: Execution failed for task ':processDebugManifest'
I'm getting a gradle error at building since yesterday - it just came randomly.... Full stacktrace here: My project depends on multiple libraries and it built without any problems until yesterday (e...
- Modified
- 11 Jul at 07:44
Preloading images with jQuery
I'm looking for a quick and easy way to preload images with JavaScript. I'm using jQuery if that's important. I saw this here ([http://nettuts.com...](http://nettuts.com/tutorials/javascript-ajax/the...
- Modified
- 5 May at 18:4
How do I add python3 kernel to jupyter (IPython)
My `Jupyter` notebooks installed with `python 2` kernel. I do not understand why. I might have messed something up when I did the install. I already have `python 3` installed. How can I add it to `Ju...
- Modified
- 16 Jan at 23:14
How to implement class constants?
In TypeScript, the `const` keyword cannot be used to declare class properties. Doing so causes the compiler to an error with "A class member cannot have the 'const' keyword." I find myself in need to ...
- Modified
- 28 Dec at 23:59
How do I convert an object to an array?
``` <?php print_r($response->response->docs); ?> ``` Outputs the following: ``` Array ( [0] => Object ( [_fields:private] => Array ...
- Modified
- 10 Mar at 08:7
How to reset the state of a Redux store?
I am using Redux for state management. How do I reset the store to its initial state? For example, let’s say I have two user accounts (`u1` and `u2`). Imagine the following sequence of events: 1. U...
- Modified
- 13 May at 03:30
React.js: Set innerHTML vs dangerouslySetInnerHTML
Is there any "behind the scenes" difference from setting an element's innerHTML vs setting the dangerouslySetInnerHTML property on an element? Assume I'm properly sanitizing things for the sake of sim...
- Modified
- 24 Aug at 07:45
Get month name from number
How can I get the month name from the month number? For instance, if I have `3`, I want to return `march` ``` date.tm_month() ``` How to get the string `march`?
Redirecting to a certain route based on condition
I'm writing a small AngularJS app that has a login view and a main view, configured like so: ``` $routeProvider .when('/main' , {templateUrl: 'partials/main.html', controller: MainController}) .wh...
How can I manually set an Angular form field as invalid?
I am working on a login form and if the user enters invalid credentials we want to mark both the email and password fields as invalid and display a message that says the login failed. How do I go abou...
- Modified
- 11 Dec at 20:49
Send POST data on redirect with JavaScript/jQuery?
Basically what I want to do is send `POST` data when I change the `window.location`, as if a user has submitted a form and it went to a new page. I need to do it this way because I need to pass along ...
- Modified
- 25 Oct at 20:53
How to use sessions in an ASP.NET MVC 4 application?
I am new to ASP.NET MVC. I have used PHP before and it was easy to create a session and select user records based on the current session variables. I have looked everywhere on the Internet for a sim...
- Modified
- 26 Feb at 02:58
Easy way to write contents of a Java InputStream to an OutputStream
I was surprised to find today that I couldn't track down any simple way to write the contents of an `InputStream` to an `OutputStream` in Java. Obviously, the byte buffer code isn't difficult to write...
How to get the path of src/test/resources directory in JUnit?
I know I can load a file from src/test/resources with: ``` getClass().getResource("somefile").getFile() ``` But how can I get the full path to the src/test/resources , i.e. I don't want to load a f...
What is the best collation to use for MySQL with PHP?
I'm wondering if there is a "best" choice for collation in MySQL for a general website where you aren't 100% sure of what will be entered? I understand that all the encodings should be the same, such ...
Find the last element of an array while using a foreach loop in PHP
I am writing a SQL query creator using some parameters. In Java, it's very easy to detect the last element of an array from inside the for loop by just checking the current array position with the arr...
Java split string to array
I need help with the `split()` method. I have the following`String`: ``` String values = "0|0|0|1|||0|1|0|||"; ``` I need to put the values into an array. There are 3 possible strings: "0", "1", ...