Questions

Input widths on Bootstrap 3

I am closing this question by selecting the top answer to keep people from adding answers without really understanding the question. In reality there is no way to do it with the build in functionalit...

How to create a simple map using JavaScript/JQuery

How can you create the JavaScript/JQuery equivalent of this Java code: ``` Map map = new HashMap(); //Doesn't not have to be a hash map, any key/value map is fine map.put(myKey1, myObj1); map.put(myK...

22 Nov at 15:28

Label axes on Seaborn Barplot

I'm trying to use my own labels for a Seaborn barplot with the following code: ``` import pandas as pd import seaborn as sns fake = pd.DataFrame({'cat': ['red', 'green', 'blue'], 'val': [1, 2, 3]...

Drop all duplicate rows across multiple columns in Python Pandas

The pandas `drop_duplicates` function is great for "uniquifying" a dataframe. I would like to drop all rows which are duplicates across a subset of columns. Is this possible? ``` A B C 0 foo 0 ...

Eclipse error: "The import XXX cannot be resolved"

I'm trying to work with Hibernate in Eclipse. I'm creating a new simple project and I've downloaded a collegue project too, via CVS. Both don't work, while on my collegue's Eclipse do. The problem is ...

31 May at 11:41

How can I add a box-shadow on one side of an element?

I need to create a box-shadow on some `block` element, but only (for example) on its right side. The way I do it is to wrap the inner element with `box-shadow` into an outer one with `padding-right` a...

24 Apr at 04:51

Removing trailing newline character from fgets() input

I am trying to get some data from the user and send it to another function in gcc. The code is something like this. ``` printf("Enter your Name: "); if (!(fgets(Name, sizeof Name, stdin) != NULL)) { ...

14 Mar at 06:23

How do I search an SQL Server database for a string?

I know it's possible, but I don't know how. I need to search an SQL Server database for all mentions of a specific string. For example: I would like to search all tables, views, functions, stored pr...

What are all the possible values for HTTP "Content-Type" header?

I have to validate the `Content-Type` header value before passing it to an HTTP request. Is there a specific list for all the possible values of `Content-Type`? Otherwise, is there a way to validate...

Iterating through a Collection, avoiding ConcurrentModificationException when removing objects in a loop

We all know you can't do the following because of `ConcurrentModificationException`: ``` for (Object i : l) { if (condition(i)) { l.remove(i); } } ``` But this apparently works some...

20 Oct at 13:4

Find where python is installed (if it isn't default dir)

Python is on my machine, I just don't know where, if I type python in terminal it will open Python 2.6.4, this isn't in it's default directory, there surely is a way of finding it's install location f...

11 Apr at 13:12

List all tables in postgresql information_schema

What is the best way to list all of the tables within PostgreSQL's information_schema? To clarify: I am working with an empty DB (I have not added any of my own tables), but I want to see every table ...

23 Nov at 15:17

Integer division: How do you produce a double?

For this code block: ``` int num = 5; int denom = 7; double d = num / denom; ``` the value of `d` is `0.0`. It can be forced to work by casting: ``` double d = ((double) num) / denom; ``` But is...

7 Apr at 09:13

Check if a string is a date value

What is an easy way to check if a value is a valid date, any known date format allowed. For example I have the values `10-11-2009`, `10/11/2009`, `2009-11-10T07:00:00+0000` which should all be recog...

1 Aug at 08:44

java.io.FileNotFoundException: the system cannot find the file specified

I have a file named "`word.txt`". It is in the same directory as my `java` file. But when I try to access it in the following code this error occurs: ``` Exception in thread "main" java.io.FileNot...

14 Feb at 03:10

What is "X-Content-Type-Options=nosniff"?

I am doing some penetration testing on my localhost with OWASP ZAP, and it keeps reporting this message: > The Anti-MIME-Sniffing header X-Content-Type-Options was not set to 'nosniff'This check is...

How to store arrays in MySQL?

I have two tables in MySQL. Table Person has the following columns: | id | name | fruits | | -- | ---- | ------ | The `fruits` column may hold null or an array of strings like ('apple', 'orange',...

15 Jun at 23:32

Add x and y labels to a pandas plot

Suppose I have the following code that plots something very simple using pandas: ``` import pandas as pd values = [[1, 2], [2, 5]] df2 = pd.DataFrame(values, columns=['Type A', 'Type B'], ...

20 Oct at 23:5

Undefined symbols for architecture arm64

I am getting a Apple Mach-O Linker Error everytime I import a file from CocoaPods. ``` Undefined symbols for architecture arm64: "_OBJC_CLASS_$_FBSession", referenced from: someFile ld: symbol(s) n...

12 May at 15:42

How to reset / remove chrome's input highlighting / focus border?

I have seen that chrome puts a thicker border on `:focus` but it kind of looks off in my case where I've used border-radius also. Is there anyway to remove that? ![image: chrome :focus border](https...

8 Sep at 14:44

How do I count occurrence of unique values inside a list

So I'm trying to make this program that will ask the user for input and store the values in an array / list. Then when a blank line is entered it will tell the user how many of those values are unique...

16 Feb at 20:52

How to print like printf in Python3?

In Python 2 I used: ``` print "a=%d,b=%d" % (f(x,n),g(x,n)) ``` I've tried: ``` print("a=%d,b=%d") % (f(x,n),g(x,n)) ```

2 Aug at 20:0

List files ONLY in the current directory

In Python, I only want to list all the files in the current directory ONLY. I do not want files listed from any sub directory or parent. There do seem to be similar solutions out there, but they don'...

21 Oct at 18:19

Server.MapPath("."), Server.MapPath("~"), Server.MapPath(@"\"), Server.MapPath("/"). What is the difference?

Can anyone explain the difference between `Server.MapPath(".")`, `Server.MapPath("~")`, `Server.MapPath(@"\")` and `Server.MapPath("/")`?

Error Code: 1062. Duplicate entry '1' for key 'PRIMARY'

I have a problem on this error message, when i try this: ``` INSERT INTO `PROGETTO`.`UFFICIO-INFORMAZIONI` (`ID`, `viale`, `num_civico`, `data_apertura`, `data_chiusura`, `orario_apertura`, `orario...