Tag: io

54 votes
30 answers
918 views
When to use LinkedList over ArrayList in Java?

I've always been one to simply use: List<String> names = new ArrayList<>(); I use the inte

avatar
Sena
0 1 0 9
asked 07 September, 2021
67 votes
30 answers
829 views
How do I efficiently iterate over each entry in a Java Map?

If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained wit

avatar
Daniel
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
339 views
Create ArrayList from array

I have an array that is initialized like: Element[] array = {new Element(1), new Element(2), new Element(3)};

avatar
Margo
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
2.4K views
What are the differences between a HashMap and a Hashtable in Java?

What are the differences between a HashMap and a Hashtable in Java? Which is more efficient for non-threaded

avatar
Eddie
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
55 votes
30 answers
2K views
How do I read / convert an InputStream into a String in Java?

If you have a java.io.InputStream object, how should you process that object and produce a String? Suppose I

avatar
Margo
0 1 0 9
asked 07 September, 2021
63 votes
27 answers
2.9K views
Why is processing a sorted array faster than processing an unsorted array?

Here is a piece of C++ code that shows some very peculiar behavior. For some strange reason, sorting the data

avatar
Boyd
0 1 0 9
asked 07 September, 2021
69 votes
3 answers
3.1K views
60 votes
6 answers
984 views
Upstream too big - nginx + codeigniter

I am getting this error from Nginx, but can't seem to figure it out! I am using codeigniter and am using

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
62 votes
12 answers
3.1K views
Does CodeIgniter automatically prevent SQL injection?

I just inherited a project because the last developer left. The project is built off of Code Igniter. I&apo

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
57 votes
11 answers
772 views
the best way to make codeigniter website multi-language. calling from lang arrays depends on lang session?

I'm researching hours and hours, but I could not find any clear, efficient way to make it :/ I have a co

avatar
Solomon
0 1 0 9
asked 07 September, 2021
55 votes
14 answers
2.8K views
Where do I put image files, css, js, etc. in Codeigniter?

Where is it acceptable to put css folders and image file folders? I was thinking inside the view folder? Howev

avatar
Joseph
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
1.7K views
Convert form data to JavaScript object with jQuery

How do I convert all elements of my form to a JavaScript object? I'd like to have some way of automatic

avatar
Percy
0 1 0 9
asked 07 September, 2021
48 votes
30 answers
2.3K views
What is the best way to detect a mobile device?

Is there a way to detect whether or not a user is using a mobile device in jQuery? Something similar to the CS

avatar
Dorian
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.4K views
How can I know which radio button is selected via jQuery?

I have two radio buttons and want to post the value of the selected one. How can I get the value with jQuery?

avatar
Luis
0 1 0 9
asked 07 September, 2021
51 votes
14 answers
2.7K views
event.preventDefault() vs. return false

When I want to prevent other event handlers from executing after a certain event is fired, I can use one of tw

avatar
Vi
0 1 0 9
asked 07 September, 2021
51 votes
25 answers
3.1K views
What is the difference between call and apply?

What is the difference between using call and apply to invoke a function? var func = function() { alert(&ap

avatar
Solomon
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
1.2K views
Which "href" value should I use for JavaScript links, "#" or "javascript:void(0)"?

The following are two methods of building a link that has the sole purpose of running JavaScript code. Which i

avatar
Lynette
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
2.7K views
How to validate an email address in JavaScript

Is there a regular expression to verify an email address in JavaScript?

avatar
Leonardo
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
950 views
For-each over an array in JavaScript

How can I loop through all the entries in an array using JavaScript? I thought it was something like this: f

avatar
Cortez
0 1 0 9
asked 07 September, 2021