Solving a "communications link failure" with JDBC and MySQL
I'm trying to connect to the local MySQL server but I keep getting an error. Here is the code. ``` public class Connect { public static void main(String[] args) { Connection conn = null...
Put current changes in a new Git branch
I've been editing some modules on the master branch but I haven't committed them. I'm now thinking that these changes should really be on an experimental branch and not the master branch. How can I g...
- Modified
- 1 Dec at 14:38
Global variables in Java
How do you define Global variables in Java ?
- Modified
- 6 Jun at 14:3
How to copy files from 'assets' folder to sdcard?
I have a few files in the `assets` folder. I need to copy all of them to a folder say /sdcard/folder. I want to do this from within a thread. How do I do it?
How to stop an animation (cancel() does not work)
I need to stop a running translate animation. The `.cancel()` method of `Animation` has no effect; the animation goes until the end anyway. How do you cancel a running animation?
Adjust width of input field to its input
``` <input type="text" value="1" style="min-width:1px;" /> ``` This is my code and it is not working. Is there any other way in HTML, JavaScript, PHP or CSS to set minimum width? I want a text input...
- Modified
- 27 Jul at 13:51
Update value of a nested dictionary of varying depth
I'm looking for a way to update dict `dictionary1` with the contents of dict `update` wihout overwriting `levelA` ``` dictionary1 = { "level1": { "level2": {"levelA": 0, "levelB": 1} }...
- Modified
- 22 Feb at 19:23
Maven: add a dependency to a jar by relative path
I have a proprietary jar that I want to add to my pom as a dependency. But I don't want to add it to a repository. The reason is that I want my usual maven commands such as `mvn compile`, etc, to wor...
- Modified
- 9 Feb at 14:36
Difference between new and override
Wondering what the difference is between the following: Case 1: Base Class ``` public void DoIt(); ``` Case 1: Inherited class ``` public new void DoIt(); ``` Case 2: Base Class ``` public vi...
- Modified
- 7 Jan at 20:51
How to parse CSV data?
Where could I find some JavaScript code to parse CSV data?
- Modified
- 22 Aug at 19:34
LINQ: Select an object and change some properties without creating a new object
I want to change some properties of a LINQ query result object without creating a new object and manually setting every property. Is this possible? Example: ``` var list = from something in someLis...
How do I crop an image using C#?
How do I crop an image using C#?
- Modified
- 23 Apr at 00:29
How to put comments in Django templates?
I would like to comment this with a line: ``` {% if something.property %} <table> <tr>... {% # this is a comment %} {% if something.property %} <table> <tr>... ```
- Modified
- 31 Jul at 18:7
Is there an onSelect event or equivalent for HTML <select>?
I have an input form that lets me select from multiple options, and do something when the user the selection. Eg, ``` <select onChange="javascript:doSomething();"> <option>A</option> <option>B</...
- Modified
- 25 Jan at 00:21
Check if a row exists, otherwise insert
I need to write a T-SQL stored procedure that updates a row in a table. If the row doesn't exist, insert it. All this steps wrapped by a transaction. This is for a booking system, so it must be . It m...
- Modified
- 29 Dec at 01:2
How can I use Bash syntax in Makefile targets?
I often find [Bash](http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29) syntax very helpful, e.g. process substitution like in `diff <(sort file1) <(sort file2)`. Is it possible to use such Bash comm...
How to determine if a type implements a specific generic interface type
Assume the following type definitions: ``` public interface IFoo<T> : IBar<T> {} public class Foo<T> : IFoo<T> {} ``` How do I find out whether the type `Foo` implements the generic interface `IBar...
- Modified
- 2 Feb at 15:36
Why does Boolean.ToString output "True" and not "true"
``` true.ToString() false.toString(); Output: True False ``` Is there a valid reason for it being "True" and not "true"? It breaks when writing XML as XML's boolean type , and also isn't compatibl...
How to increase the max upload file size in ASP.NET?
I have a form that excepts a file upload in ASP.NET. I need to increase the max upload size to above the 4 MB default. I have found in certain places referencing the below code at [msdn](http://msdn....
- Modified
- 16 Mar at 02:8
Typescript: No index signature with a parameter of type 'string' was found on type '{ "A": string; }
I have some vanilla javascript code that takes a string input, splits the string into characters, and then matches those characters to a key on an object. ``` DNATranscriber = { "G":"C", "C":...
- Modified
- 12 Jun at 19:9
Get safe area inset top and bottom heights
What would be the most proper way to get both top and bottom height for the unsafe areas? [](https://i.stack.imgur.com/hQXf7.png)
- Modified
- 28 Oct at 12:56
Correct way to push into state array
I seem to be having issues pushing data into a state array. I am trying to achieve it this way: ``` this.setState({ myArray: this.state.myArray.push('new value') }) ``` But I believe this is incorr...
- Modified
- 25 May at 11:8
How to add "class" to host element?
I dont't know how to add to my component `<component></component>` a dynamic attribute but inside the template html (component.html). The only solution I found is to modify the item via "ElementRef...
- Modified
- 6 Jan at 21:23
How to interpret loss and accuracy for a machine learning model
When I trained my neural network with Theano or Tensorflow, they will report a variable called "loss" per epoch. How should I interpret this variable? Higher loss is better or worse, or what does it ...
- Modified
- 28 Mar at 11:44
Operation Not Permitted when on root - El Capitan (rootless disabled)
I am trying to move something to on OS X El Capitan. I have disabled rootless using the following commands: `sudo nvram boot-args="rootless=0"; sudo reboot`, but I keep getting the same error: ``` ...
- Modified
- 7 Jan at 12:0