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

How to change the href for a hyperlink using jQuery

How to change the href for a hyperlink using jQuery

How can you change the href for a hyperlink using jQuery? 1:$("a").attr("href", "http://www.google.com/")...Will modify the href of all hyperlinks to point to Google. You probably want a somewhat more refined selector though. For instanc

Get escaped URL parameter

Get escaped URL parameter

I'm looking for a jQuery plugin that can get URL parameters, and support this search string without outputting the JavaScript error: "malformed URI sequence". If there isn't a jQuery plugin that supports this, I need to know how to modify i

Explain the encapsulated anonymous function syntax

Explain the encapsulated anonymous function syntax

SummaryCan you explain the reasoning behind the syntax for encapsulated anonymous functions in JavaScript? Why does this work: (function(){})(); but this doesn't: function(){}();?What I knowIn JavaScript, one creates a named function like t

What is dependency injection?

What is dependency injection?

There have been several questions already posted with specific questions about dependency injection, such as when to use it and what frameworks are there for it. However,What is dependency injection and when/why should or shouldn't it be us

How to scroll the window automatically when mouse moves bottom of the page using jquery

How to scroll the window automatically when mouse moves bottom of the page using jquery

I have 50 divs,But in my window it shows only 25,I do drag and drop activity on these divs.So If i drag my first div near 25th div,It should scroll automatically to show the remaining divs.How do i do this in jquery? any idea?I am using Nes

from sys import argv - what is the function of “script”

from sys import argv - what is the function of “script”

I am reading "Learn Python the Hard Way" and was confused by the "script" part of the second line.from sys import argvscript, filename = argvFrom what I understand, the second line says: script and filename comprise argv.I tried running my

Hide HTML element by id

Hide HTML element by id

Hopefully there's a quick and dirty way to remove the "Ask Question" (or hide it) from a page where I can only add CSS and Javascript: Ask Question I can't hide the nav class because other pag

Which file is Perl's diamond operator (null file handle) currently reading from?

Which file is Perl's diamond operator (null file handle) currently reading from?

I'm using Perl's diamond operator to read from files specified on the command line.I'd like to be able to report messages like "Trouble on line $. of file $FILENAME", but how can I tell which file is currently used by the diamond? 1:Se

Python: finding lowest integer

Python: finding lowest integer

I have the following code:l = ['-1.2', '0.0', '1']x = 100.0for i in l: if i The code should find the lowest value in my list (-1.2) but instead when i print 'x' it finds the value is still 100.0Where is my code going wrong? 1:To find

How to restore folders (or entire buckets) to Amazon S3 from Glacier?

How to restore folders (or entire buckets) to Amazon S3 from Glacier?

I changed the lifecycle for a bunch of my buckets on Amazon S3 so their storage class was set to Glacier. I did this using the online AWS Console. I now need those files again. I know how to restore them back to S3 per file. But my buck

What is the expected behaviour of @PostConstruct in @Configuration classes?

What is the expected behaviour of @PostConstruct in @Configuration classes?

We are reusing a project that defines its beans with spring java-config (using @Configuration), and in one such class it has a @PostConstruct init method.What is the expected behaviour here - when is this method invoked? In regard to beans,

How do I render  side-by-side?

How do I render side-by-side?

I'm looking to create a navigation menu with list items rendered in one line. How do I do this? 1:li { display: inline;}EDIT: I now realize why I felt strange answering with display: inline: because I usually use float: left myself i

How do you determine a processing time in Python?

How do you determine a processing time in Python?

I'm new to Python, and confused by the date/time documentation. I want to compute the time that it takes to perform a computation.In java, I would write:long timeBefore = System.currentTimeMillis();doStuff();long timeAfter = System.current

sprintf() without trailing null space in C

sprintf() without trailing null space in C

Is there a way to use the C sprintf() function without it adding a '\0' character at the end of its output? I need to write formatted text in the middle of a fixed width string. 1:There is no way to tell sprintf() not to write a trailing

#1242 - Subquery returns more than 1 row - mysql

#1242 - Subquery returns more than 1 row - mysql

I am trying to make a select statement that selects the image names from a MySQL database.The table is called - pictures_archive. I am also trying to select these pictures depending on the category they have. The code is:SELECT pictures_ar

Memory mapping of files vs CreateFile/ReadFile [closed]

Memory mapping of files vs CreateFile/ReadFile [closed]

What are the drawbacks (if any) of using memory mapped file to read (regular sized files) over doing the same using CreateFile ReadFile combination? 1:With ReadFile/WriteFile you have deterministic error handling semantics. When you use

How to use javascript proxy for nested objects

How to use javascript proxy for nested objects

I have this code in js bin: var validator = { set (target, key, value) { console.log(target); console.log(key); console.log(value); if(isObject(target[key])){ } return true }}var person = { firstName: "alfred",

How to stop the viewForAnnotation method from overriding the default user location blue beacon in iO

How to stop the viewForAnnotation method from overriding the default user location blue beacon in iO

Right now I am populating a map view with annotations, and also displaying the user's current location. With the viewForAnnotation method, it overrides all annotations with the default red pin, but I want to return the views for the other a

How to support NSCalendar with both iOS 7 and 8?

How to support NSCalendar with both iOS 7 and 8?

iOS 8 introduced some new values for old methods.For instance, creating a calendar used to be like this:NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];Now, the calendar identifier has changed and

How to add option values on silviomoreto's Bootstrap-Select

How to add option values on silviomoreto's Bootstrap-Select

I used silviomoreto's bootstrap-select but I'm having problems.I have 2 Dropdowns (Select) a Region dropdown and Cities. Now, I have a jquery onchange function, the function will change the values in the cities dropdown depending on the reg

How to pass dynamic value in @Url.Action?

How to pass dynamic value in @Url.Action?

I have written following jquery in my partial view: $.ajax({ type: "POST", url: '@Url.Action("PostActionName", "ControllerName")', data: { Id: "01" }, success: function(data) { if (data.s

Git push takes forever

Git push takes forever

When I am trying to push to my remote git repository, but it is taking forever and nothing happens. I waited for so long, but push is never getting finished. My OS is Ubuntu 12.10. Thank you. 1:Try using the --verbose option to see what

Local time zone offset in PostgreSQL

Local time zone offset in PostgreSQL

My web app stores all timestamps in UTC without time zones. I have a shell/psql script that returns a list of recent logins, and I want that script to display login times in the server's local time zone (which may vary depending on where th

Is Xcode 5 Asset Catalog backwards compatible with pre-iOS 7?

Is Xcode 5 Asset Catalog backwards compatible with pre-iOS 7?

Xcode 5 introduced Asset Catalog, which seems very cool. However I haven't find much information about it. Specifically, I'm interested whether the usage of Asset Catalog has any impact on the app regarding its compatibility.Is Asset Catalo