Questions

how to disable DIV element and everything inside

I need to disable a DIV and all it's content using Javascript. I can swear that doing a simple ``` <div disabled="true"> ``` was working for me before, but for some reason it no longer works. I ...

14 Feb at 05:28

How do you merge two Git repositories?

Consider the following scenario: I have developed a small experimental project A in its own Git repo. It has now matured, and I'd like A to be part of larger project B, which has its own big reposito...

17 Feb at 20:38

How to reload page every 5 seconds?

I am converting one layout to html; once I make the changes in code/html/css, every time I have to hit F5. Is there any simple javascript/jQuery solution for this? I.e. after I add the script, reload ...

3 Apr at 17:52

Converting JSON String to Dictionary Not List

I am trying to pass in a JSON file and convert the data into a dictionary. So far, this is what I have done: ``` import json json1_file = open('json1') json1_str = json1_file.read() json1_data = jso...

9 Nov at 15:16

add onclick function to a submit button

I'm just learning javascript and php. I created a contact form and I'd like the submit button to accomplish two things when I press it: 1. submit the data to me (this part is working) 2. read my on...

23 May at 12:34

java.util.Date to XMLGregorianCalendar

Isn't there a convenient way of getting from a java.util.Date to a XMLGregorianCalendar?

25 May at 14:25

Should I make HTML Anchors with 'name' or 'id'?

When one wants to refer to some part of a webpage with the "`http://example.com/#foo`" method, should one use ``` <h1><a name="foo"/>Foo Title</h1> ``` or ``` <h1 id="foo">Foo Title</h1> ``` The...

2 Aug at 14:38

How to return 2 values from a Java method?

I am trying to return 2 values from a Java method but I get these errors. Here is my code: ``` // Method code public static int something(){ int number1 = 1; int number2 = 2; return numb...

4 Oct at 14:6

Could not install packages due to an EnvironmentError: [WinError 5] Access is denied:

I have windows 10. I have completed installing Tensorflow. It works. It says "Hello Tensorflow!". But it has all of this before it: ``` 2018-08-18 18:16:01.500579: I T:\src\github\tensorflow\tensorflo...

19 Dec at 08:2

Query for documents where array size is greater than 1

I have a MongoDB collection with documents in the following format: ``` { "_id" : ObjectId("4e8ae86d08101908e1000001"), "name" : ["Name"], "zipcode" : ["2223"] } { "_id" : ObjectId("4e8ae86d0...

11 Jun at 05:6

Convert DataFrame column type from string to datetime

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

Sass Variable in CSS calc() function

I'm trying to use the `calc()` function in a Sass stylesheet, but I'm having some issues. Here's my code: ``` $body_padding: 50px body padding-top: $body_padding height: calc(100% - $body_pad...

23 Aug at 00:4

Why does git say "Pull is not possible because you have unmerged files"?

When I try to pull in my project directory in the terminal, I see the following error: ``` harsukh@harsukh-desktop:~/Sites/branch1$ git pull origin master U app/config/app.php U app/config/database.p...

The definitive guide to form-based website authentication

> #### Moderator note: This question is not a good fit for our question and answer format with the [topicality rules](/help/on-topic) which currently apply for Stack Overflow. We normally use a "his...

What does -> mean in Python function definitions?

I've recently noticed something interesting when looking at [Python 3.3 grammar specification](http://docs.python.org/3.3/reference/grammar.html): ``` funcdef: 'def' NAME parameters ['->' test] ':' su...

Convert JSON to Map

What is the best way to convert a JSON code as this: ``` { "data" : { "field1" : "value1", "field2" : "value2" } } ``` in a Java Map in which one the keys are (field...

27 Nov at 22:18

How do I load a file from resource folder?

My project has the following structure: ``` /src/main/java/ /src/main/resources/ /src/test/java/ /src/test/resources/ ``` I have a file in `/src/test/resources/test.csv` and I want to load the file...

8 Nov at 13:3

What's the best way to limit text length of EditText in Android

What's the best way to limit the text length of an `EditText` in Android? Is there a way to do this via xml?

5 Dec at 12:41

Including both href and onclick to HTML <a> tag

If I have this element: ``` <a href="www.mysite.com" onClick="javascript.function();">Item</a> ``` How can I make both `href` and `onClick` work, preferably with `onClick` running first?

26 Jul at 08:52

How can I split and parse a string in Python?

I am trying to split this string in python: `2.7.0_bf4fda703454` I want to split that string on the underscore `_` so that I can use the value on the left side.

21 Feb at 20:28

Counting DISTINCT over multiple columns

Is there a better way of doing a query like this: ``` SELECT COUNT(*) FROM (SELECT DISTINCT DocumentId, DocumentSessionId FROM DocumentOutputItems) AS internalQuery ``` I need to count the n...

How can I remove an SSH key?

I currently have an old SSH key uploaded on a server. The problem is I lost my `~/.ssh` directory (with the original `id_rsa` and `id_rsa.pub` files). Consequently, I want to remove the old SSH key di...

23 Aug at 17:13

CSS to set A4 paper size

I need simulate an A4 paper in web and allow to print this page as it is show on browser (Chrome, specifically). I set the element size to 21cm x 29.7cm, but when I send to print (or print preview) it...

3 Apr at 09:21

Vertical rulers in Visual Studio Code

### Rendering More than One Ruler in VS Code --- VS Code's default configuration for a ruler is demonstrated below. ``` "editor.ruler": 80 ``` The issue I am having with the default VS Code con...

7 Jun at 13:25

How to count the frequency of the elements in an unordered list?

Given an unordered list of values like ``` a = [5, 1, 2, 2, 4, 3, 1, 2, 3, 1, 1, 5, 2] ``` How can I get the frequency of each value that appears in the list, like so? ``` # `a` has 4 instances of `1...

29 Jul at 00:55