Type List vs type ArrayList in Java

Type List vs type ArrayList in Java

(1) List<?> myList = new ArrayList<?>();(2) ArrayList<?> myList = new ArrayList<?>();I understand that with (1), implementations of the List interface can be swapped. It seems that (1) is typically used in an application regardless of need

PHP does not display error messages

PHP does not display error messages

I installed XAMPP 1.7.4 (with PHP 5.3.5), the problem is PHP does not display any error messages. E.g. if I connect to MYSQL with mysql_connect() without parameters, PHP will not complain about the required fields.Why is this?How can I conf

Do a “git export” (like “svn export”)?

Do a “git export” (like “svn export”)?

I've been wondering whether there is a good "git export" solution that creates a copy of a tree without the .git repository directory. There are at least three methods I know of:git clone followed by removing the .git repository directory.g

jQuery animate backgroundColor

jQuery animate backgroundColor

I am trying to animate a change in backgroundColor using jQuery on mouseover.I have checked some example and I seem to have it right, it works with other properties like fontSize, but with backgroundColor I get and "Invalid Property" js err

Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes

Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes

What exactly are process and update in PrimeFaces p:commandXxx components and execute and render in f:ajax tag?Which works at the time of validation? What does update attribute do rather than updating value to component from back end? Do pr

Manipulating an Access database from Java without ODBC

Manipulating an Access database from Java without ODBC

I want to manipulate a Microsoft Access database (.accdb or .mdb file) from my Java project. I don't want to use the JDBC-ODBC Bridge and the Access ODBC driver from Microsoft because:the JDBC-ODBC Bridge has been removed from Java SE 8 and

Validate decimal numbers in JavaScript - IsNumeric()

Validate decimal numbers in JavaScript - IsNumeric()

What's the cleanest, most effective way to validate decimal numbers in JavaScript?Bonus points for:Clarity. Solution should be clean and simple.Cross-platform.Test cases:01. IsNumeric('-1') => true02. IsNumeric('-1.5') => true03. Is

What is a NullPointerException, and how do I fix it?

What is a NullPointerException, and how do I fix it?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? 1:When you dec

CSS classes in email [duplicate]

CSS classes in email [duplicate]

This question already has an answer here: What tools to automatically inline CSS style to create email HTML code? [closed] 12 answers As far as I know,

Why relative path doesn't work in Ruby require

Why relative path doesn't work in Ruby require

I'm starting learning Ruby, one thing that I don't understand, why relative path for require directive doesn't work in ruby. It's something that works almost in every scripting language that I now (JSP, PHP...). I explain with a real exampl

uncaught throw :warden in Devise Testing

uncaught throw :warden in Devise Testing

I have just begun with testing Devise. I am unable to understand of why i am getting this error :: Failure/Error: subject.current_user.should_not be_nil ArgumentError: uncaught throw :wardenThis is the code in my spec :: require "spec

How do I use Chosen jQuery in my html file?

How do I use Chosen jQuery in my html file?

How do I apply Chosen jQuery in my html page?I have a select form so I need to use the multiple select by Chosen to make it look more user friendly. A B C DI've downloaded the files and copied it into my webpage

Java -classpath option

Java -classpath option

Will the use of -classpath option with java, add to or replace the contents of the CLASSPATH env variable? 1:Using the classpath variable it overrides the CLASSPATH of Environment variable but only for that session. If you restart the ap

How can I check if I'm on the last element when iterating using foreach syntax [duplicate]

How can I check if I'm on the last element when iterating using foreach syntax [duplicate]

This question already has an answer here: Printing lists with commas C++ 23 answers For example:for( auto &iter: item_vector ) { if(not_on_the_last

Control Flow via Return vs. If/Else [closed]

Control Flow via Return vs. If/Else [closed]

Which one is better (implicit control flow via return or control flow via if) -- see below. Please explain what you see as advantage/disadvantage to either one. I like option A because it's less code. Flow via Return:public ActionResult Edi

Why does Debug.WriteLine incorrectly format strings?

Why does Debug.WriteLine incorrectly format strings?

I have the following Debug.WriteLine:Debug.WriteLine("Metadata Version: {0}", version); // update: version is a stringThe output is: 2.0: Metadata Version: {0}Why is the string formatted this way?I didn't see anything in MSDN documentation

Ruby: How to check if a string contains multiple items?

Ruby: How to check if a string contains multiple items?

I'm familiar with Ruby's include? method for strings, but how can I check a string for multiple things?Specifically, I need to check if a string contains "Fwd:" or "FW:" (and should be case insensitive)Example string would be: "FWD: Your Am

Hadoop release missing /conf directory

Hadoop release missing /conf directory

I am trying to install a single node setup of Hadoop on Ubuntu. I started following the instructions on the Hadoop 2.3 docs.But I seem to be missing something very simple.First, it says to To get a Hadoop distribution, download a recent s

Where does  in web.config go for MVC applications?

Where does in web.config go for MVC applications?

I'm attempting to implement custom error handling in my MVC 4 app. I'm not certain where in my web.config the is supposed to go, and the general information I need to include in it. 1: goes inside :

remove whitespace in std::string [duplicate]

remove whitespace in std::string [duplicate]

This question already has an answer here: Remove spaces from std::string in C++ 12 answers In C++, what's an easy way to turn:This std::string\t\tHELLO

how do I iterate through internal properties in c#

how do I iterate through internal properties in c#

public class TestClass{ public string property1 { get; set; } public string property2 { get; set; } internal string property3 { get; set; } internal string property4 { get; set; } internal string property5

error Please #define _AFXDLL or do not use /MD[d] occurs even after making changes in Project Proper

error Please #define _AFXDLL or do not use /MD[d] occurs even after making changes in Project Proper

I am working on Win32 project in Visual Studio 2011. It is generating MFC error when I includes afx.h or afxwin.h.To resolve this, I have made the following changes in the Project Properties tab :1) Use of MFC : Use MFC in a shared DLL2) C+

Convert JNI types to Native types

Convert JNI types to Native types

While there is documentation regarding turning a jstring to a native string (string nativeString = env->GetStringUTFChars(jStringVariable, NULL);) I can't find an example which will convert a jboolean to a bool or a jint to an int. Can any

What's the difference between Uri.Host and Uri.Authority

What's the difference between Uri.Host and Uri.Authority

System.Uri has Host, Authority, and DnsSafeHost. MS provides a nice example of when Host and DnsSafeHost are different here.I'd like a similar example/explanation for Host and Authority. 1:Yes Brandon is absolutely correct, in layman te

How do I use one Java program, to monitor another Java program's output?

How do I use one Java program, to monitor another Java program's output?

Below is diagram that shows what I'm trying to do : it is just 2 programs. One is a simple Child program that writes out integers every 2 seconds, line-by-line .The other is a Parent program that monitors the log file ( just a very basic te