Questions

What is the best Battleship AI?

Battleship! Back in 2003 (when I was 17), I competed in a [Battleship AI](http://www.xtremevbtalk.com/t89846.html) coding competition. Even though I lost that tournament, I had a lot of fun and lear...

9 Sep at 19:50

Is it a good practice to use an empty URL for a HTML form's action attribute? (action="")

I am wondering if anyone can give a "best practices" response to using blank HTML form actions to post back to the current page. There is [a post asking what a blank HTML form action does here](https...

23 May at 12:3

Watermark / hint / placeholder text in TextBox?

How can I put some text into a `TextBox` which will be removed automatically when the user types something in it?

24 Jun at 18:16

What is the "continue" keyword and how does it work in Java?

I saw this keyword for the first time and I was wondering if someone could explain to me what it does. - `continue`- -

18 Sep at 15:10

How do you check if a JavaScript Object is a DOM Object?

I'm trying to get: ``` document.createElement('div') //=> true {tagName: 'foobar something'} //=> false ``` In my own scripts, I used to just use this since I never needed `tagName` as a property...

24 Dec at 10:13

Exit codes in Python

I got a message saying `script xyz.py returned exit code 0`. What does this mean? What do the exit codes in Python mean? How many are there? Which ones are important?

15 Oct at 09:11

DateTime "null" / uninitialized value?

How do you deal with a DateTime that should be able to contain an uninitialized value (equivalent to null)? I have a class which might have a DateTime property value set or not. I was thinking of init...

12 Feb at 18:5

How do I position one image on top of another in HTML?

I'm a beginner at rails programming, attempting to show many images on a page. Some images are to lay on top of others. To make it simple, say I want a blue square, with a red square in the upper ri...

19 Sep at 10:49

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

I am trying to run cv2, but when I try to import it, I get the following error: ``` ImportError: libGL.so.1: cannot open shared object file: No such file or directory ``` The suggested solution onlin...

2 Feb at 15:1

Is it ok to run docker from inside docker?

I'm running Jenkins inside a Docker container. I wonder if it's ok for the Jenkins container to also be a Docker host? What I'm thinking about is to start a new docker container for each integration t...

28 Jan at 17:15

How to list all databases in the mongo shell?

I know how to [list all collections in a particular database](https://stackoverflow.com/questions/8866041/how-to-list-all-collections-in-the-mongo-shell), but how do I list all available databases in ...

10 Feb at 05:6

How to update record using Entity Framework 6?

I am trying to update a record using EF6. First finding the record, if it exists, update. Here is my code: ``` var book = new Model.Book { BookNumber = _book.BookNumber, BookName = _book.Book...

HttpClient not supporting PostAsJsonAsync method C#

I am trying to call a web API from my web application. I am using .Net 4.5 and while writing the code I am getting the error `HttpClient` does not contain a definition `PostAsJsonAsync` method. Below...

Update R using RStudio

How can I update R via RStudio?

8 May at 20:13

Reading a List from properties file and load with spring annotation @Value

I want to have a list of values in a .properties file, ie: ``` my.list.of.strings=ABC,CDE,EFG ``` And to load it in my class directly, ie: ``` @Value("${my.list.of.strings}") private List<String> ...

18 Apr at 03:35

What to do on TransactionTooLargeException

I got a `TransactionTooLargeException`. Not reproducible. In the docs it says > The Binder transaction failed because it was too large.During a remote procedure call, the arguments and the return valu...

20 Jun at 09:12

How to import multiple .csv files at once?

Suppose we have a folder containing multiple data.csv files, each containing the same number of variables but each from different times. Is there a way in R to import them all simultaneously rather th...

13 Oct at 19:28

What is reverse()?

When I read Django code sometimes, I see in some templates `reverse()`. I am not quite sure what this is but it is used together with HttpResponseRedirect. How and when is this `reverse()` supposed to...

18 Apr at 06:33

if arguments is equal to this string, define a variable like this string

I am doing some bash script and now I got one variable call `source` and one array called `samples`, like this: ``` source='country' samples=(US Canada Mexico...) ``` as I want to expand the number...

8 Jul at 06:24

How to perform case-insensitive sorting array of string in JavaScript?

I have an array of strings I need to sort in JavaScript, but in a case-insensitive way. How to perform this?

3 Dec at 18:30

return query based on date

I have a data like this in mongodb ``` { "latitude" : "", "longitude" : "", "course" : "", "battery" : "0", "imei" : "0", "altitude" : "F:3.82V", "mcc" : "07", ...

18 Jun at 21:12

MySQL error 2006: mysql server has gone away

I'm running a server at my office to process some files and report the results to a remote MySQL server. The files processing takes some time and the process dies halfway through with the following e...

11 Nov at 06:4

How to select a drop-down menu value with Selenium using Python?

I need to select an element from a menu. For example: ``` <select id="fruits01" class="select" name="fruits"> <option value="0">Choose your fruits:</option> <option value="1">Banana</option> ...

Better naming in Tuple classes than "Item1", "Item2"

Is there a way to use a Tuple class, but supply the names of the items in it? For example: ``` public Tuple<int, int, int int> GetOrderRelatedIds() ``` That returns the ids for OrderGroupId, Order...

12 Oct at 20:10

Convert array of strings into a string in Java

I want the Java code for converting an array of strings into an string.

7 Apr at 07:25