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

Update Eclipse with Android development tools v. 23

Update Eclipse with Android development tools v. 23

I updated Eclipse with the new SDK tools (rev. 23), but now when Eclipse starts I receive the error: This Android SDK requires Android Developer Toolkit version 23.0.0 or above. Current version is 22.6.3.v201404151837-1123206. Please updat

ng-model for

ng-model for

I tried to use ng-model on input tag with type file:But after selecting a file, in controller, $scope.vm.uploadme is still undefined.How do I get the selected file in my controller? 1:I created

C++ delete - It deletes my objects but I can still access the data?

C++ delete - It deletes my objects but I can still access the data?

I have written a simple, working tetris game with each block as an instance of a class singleblock.class SingleBlock{ public: SingleBlock(int, int); ~SingleBlock(); int x; int y; SingleBlock *next;};class MultiBlock{ pu

Does Python support short-circuiting?

Does Python support short-circuiting?

Does Python support short-circuiting in boolean expressions? 1:Yep, both and and or operators short-circuit -- see the docs. 2:Short-circuiting behavior in operator and, or:Let's first define a useful function to determine if somethin

Relative imports for the billionth time

Relative imports for the billionth time

I've been herehttp://www.python.org/dev/peps/pep-0328/http://docs.python.org/2/tutorial/modules.html#packagesPython packages: relative importspython relative import example code does not workUltimate answer to relative python importsRelativ

Why does 128==128 return false but 127==127 return true when converting to Integer wrappers?

Why does 128==128 return false but 127==127 return true when converting to Integer wrappers?

class D { public static void main(String args[]) { Integer b2=128; Integer b3=128; System.out.println(b2==b3); }}Output:falseclass D { public static void main(String args[]) { Integer b2=127; Inte

Difference between method and function in Scala

Difference between method and function in Scala

I read Scala Functions (part of Another tour of Scala). In that post he stated: Methods and functions are not the same thingBut he didn't explain anything about it. What was he trying to say? 1:Jim has got this pretty much covered in hi

Delete commits from a branch in Git

Delete commits from a branch in Git

I would like to know how to delete a commit.By "delete", I mean it is as if I didn't make that commit, and when I do a push in the future, my changes will not push to the remote branch.I read git help, and I think the command I should use i

CSS - Equal Height Columns?

CSS - Equal Height Columns?

In CSS, I can do something like this:alt text http://i50.tinypic.com/2lcp555.pngBut I've no idea how to change that to something like:alt text http://i48.tinypic.com/30jp9nk.pngIs this possible with CSS?If yes, how can I do it without expli

Read whole ASCII file into C++ std::string [duplicate]

Read whole ASCII file into C++ std::string [duplicate]

This question already has an answer here: What is the best way to read an entire file into a std::string in C++? 11 answers I need to read a whole file

How do I check if an object has a property in JavaScript?

How do I check if an object has a property in JavaScript?

How do I check if an object has a property in JavaScript?Consider:x = {'key': 1};if ( x.hasOwnProperty('key') ) { //Do this}Is that the best way to do it? 1:I'm really confused by the answers that have been given - most of them are ju

Working with $scope.$emit and $scope.$on

Working with $scope.$emit and $scope.$on

How can I send my $scope object from one controller to another using .$emit and .$on methods?function firstCtrl($scope) { $scope.$emit('someEvent', [1,2,3]);}function secondCtrl($scope) { $scope.$on('someEvent', function(mass) { conso

MS Excel crashes when vba code runs

MS Excel crashes when vba code runs

I am having a problem with excel crashing when i run VBA code on an excel sheet.I have some code to add a formula to a range of cells as follows:Private Sub Worksheet_Change(ByVal Target As Range) Worksheets("testpage").Range("A1:A8").For

Static way to get 'Context' in Android?

Static way to get 'Context' in Android?

Is there a way to get the current Context instance inside a static method? I'm looking for that way because I hate saving the 'Context' instance each time it changes. 1:Do this:In the Android Manifest file, declare the following.

PHP + curl, HTTP POST sample code?

PHP + curl, HTTP POST sample code?

Can anyone show me how to do a php curl with an HTTP POST?I want to send data like this:username=user1, password=passuser1, gender=1To www.domain.comI expect the curl to return a response like result=OK. Are there any examples? 1:<?php/

What's different between UTF-8 and UTF-8 without BOM?

What's different between UTF-8 and UTF-8 without BOM?

What's different between UTF-8 and UTF-8 without a BOM? Which is better? 1:The UTF-8 BOM is a sequence of bytes (EF BB BF) that allows the reader to identify a file as being encoded in UTF-8.Normally, the BOM is used to signal the endia

Absolute vs relative URLs

Absolute vs relative URLs

I would like to know the differences between these two types of URLs: relative URLs (for pictures, CSS files, JS files, etc.) and absolute URLs.In addition, which one is better to use? 1:In general, it is considered best-practice to use

How to make an ImageView with rounded corners?

How to make an ImageView with rounded corners?

In Android, an ImageView is a rectangle by default. How can I make it a rounded rectangle (clip off all 4 corners of my Bitmap to be rounded rectangles) in the ImageView? 1:This is pretty late in response, but for anyone else that is lo

Reference — frequently asked questions about PDO

Reference — frequently asked questions about PDO

What is this?This is a list of frequently asked questions regarding PHP Data Objects Why is this?As PDO has some features unknown to a regular PHP user, questions regarding prepared statements and error handling in PDO are quite frequent. S

Where to place and how to read configuration resource files in servlet based application?

Where to place and how to read configuration resource files in servlet based application?

In my web application I have to send email to set of predefined users like [email protected], so I wish to add that to a .properties file and access it when required. Is this a correct procedure, if so then where should I place this file? I a

How to call Objective-C code from Swift

How to call Objective-C code from Swift

In the new Swift language from Apple, how does one call Objective-C code?Apple mentioned that they could co-exist in one application, but does this mean that one could technically re-use old classes made in Objective-C whilst building new c

What is the 'new' keyword in JavaScript?

What is the 'new' keyword in JavaScript?

The new keyword in JavaScript can be quite confusing when it is first encountered, as people tend to think that JavaScript is not an object-oriented programming language.What is it?What problems does it solve?When is it appropriate and when

How do I use extern to share variables between source files?

How do I use extern to share variables between source files?

I know that global variables in C sometimes have the extern keyword. What is an extern variable? What is the declaration like? What is its scope?This is related to sharing variables across source files, but how does that work precisely? Whe

“Thinking in AngularJS” if I have a jQuery background? [closed]

“Thinking in AngularJS” if I have a jQuery background? [closed]

Suppose I'm familiar with developing client-side applications in jQuery, but now I'd like to start using AngularJS. Can you describe the paradigm shift that is necessary? Here are a few questions that might help you frame an answer:How do I