Tag: int

55 votes
12 answers
772 views
Why don't self-closing script elements work?

What is the reason browsers do not correctly recognize: <script src="foobar.js" /> <!-- self-closing

avatar
Xavier
0 1 0 9
asked 07 September, 2021
61 votes
12 answers
2.6K views
What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?

What's the difference if one web page starts with <!DOCTYPE html> <html> <head>

avatar
Don
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
1.1K views
What&apos;s the simplest way to print a Java array?

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + &

avatar
Jeff
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
1.9K views
How can I fix &apos;android.os.NetworkOnMainThreadException&apos;?

I got an error while running my Android project for RssReader. Code: URL url = new URL(urlToRssFeed); SAXPa

avatar
Rudy
0 1 0 9
asked 07 September, 2021
52 votes
30 answers
2.6K views
How do I convert a String to an int in Java?

How can I convert a String to an int in Java? My String contains only numbers, and I want to return the numbe

avatar
Louetta
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
2.2K views
How do I generate random integers within a specific range in Java?

How do I generate a random int value in a specific range? I have tried the following, but those do not work: A

avatar
Patsy
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
2.6K views
Avoiding NullPointerException in Java

I use object != null a lot to avoid NullPointerException. What is an alternative to: if (someobject != null) {

avatar
Serina
0 1 0 9
asked 07 September, 2021
71 votes
30 answers
2.9K views
How to round to at most 2 decimal places, if necessary?

I'd like to round at most 2 decimal places, but only if necessary. Input: 10 1.7777777 9.1 Output: 1

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
57 votes
29 answers
1.2K views
What does "use strict" do in JavaScript, and what is the reasoning behind it?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error:

avatar
Ali
0 1 0 9
asked 07 September, 2021
69 votes
7 answers
1.9K views
How does PHP &apos;foreach&apos; actually work?

Let me prefix this by saying that I know what foreach is, does and how to use it. This question concerns how i

avatar
Leonardo
0 1 0 9
asked 07 September, 2021
59 votes
1 answers
1K views
Jquery ui - sortable: drag by icon &apos;handle&apos; within sortable element

I have jquery ui sortables working fine but my sortable elements have other interactive elements within them.

avatar
Wei
0 1 0 9
asked 07 September, 2021