|
I'm confused by the following code:
import java.util.ArrayList; import java.util.LinkedList; import java.util.List; public class GenericsTest<T extends List> { public void foo() { T var = (T) new LinkedList(); } public static void main(String[] ...
Started by Eric Rosenberg on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Java does not generate a strongly-typed class when you supply a generic type parameter, it simply use the least common denominating type that would work for all the possible... .
I assumed you are coming from C#? In that case, Java generics are not C# generics .
|
|
I have a simple little test app written in Flex 3 (MXML and some AS3). I can compile it to a SWF just fine, but I'd like to make it into an EXE so I can give it to a couple of my coworkers who might find it useful.
With Flash 8, I could just target an...
Started by Herms on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Imaginaryboy....
Open your SWF with that and you'll see a 'Create Projector...' menu item in the File menu which will create the stand-alone EXE .
In your Flex SDK folders you should see a 'runtimes\player\win\FlashPlayer.exe' which is a stand alone Flash player .
|
|
How to do this in Java - passing a collection of subtype to a method requiring a collection of base type?
The example below gives:
The method foo(Map<String,List>) is not applicable for the arguments (Map<String,MyList>)
I can implement by...
Started by horace on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You know that any value you fetch from the map will be a list, but you don't know what kind of value is valid... .
Change foo to:
private void foo(Map <String, ? extends List> in) { }
That will restrict what you can do within foo , but that's reasonable .
|
Ask your Facebook Friends
|
I got the following response from the iPhone Developer Program via email.
Your application is requiring unexpected additional time for review. We apologize for the delay, and will update you with further status as soon as we are able.
I submitted an application...
Started by obsoleteModel81 on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
I won't develop for the iPhone since it means I'm totally... .
I'm with @Shahmir on this one (in the comments).
Wait until you get the final answer, then address concerns they have .
It may or may not be accepted.
It means just what it says until you hear more .
|
|
I created a website which loads an a question pool from an XML file and generates random tests for my users to practice for an exam. Some of the tests take a while for the user complete, and they may not finish it all in one sitting, so I would like for...
Started by NickLarsen on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Of course this approach has limitations and might not be applicable in... .
You might store the user state in a database and sore the primary key in a cookie which will allow you to later identify users .
Persistent cookies on users computers comes to mind.
|
|
All,
I was wondering if anyone has an intermit enough knowledge of rubys 'require' to tell me if the following is valid ruby or not;
class Something def initialize(mode) case mode when :one then require 'some_gem' when :two then require 'other_gem' end...
Started by roja on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Yes it's perfectly valid and works as expected because require....
require doesn't have scope, while load does.
If so, would the require place the gem into the global namespace as the same require at the top of the file would?
Yes.
|
|
Simple question. Why use require_once to include classes that you use within a file? For example, if I create a class that extends Zend_Db_Table_Abstract , I don't really need to have this in the class declaration file:
require_once "Zend/Db/Table/Select...
Started by Typeoneerror on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Its not necessary to do this in your project if you know for a fact you will be using the autoloader, but if you are working on a framework (like Zend) that will be used... .
Simple Answer: If you aren't using the autoloader, the functionality will not break .
|
|
Hello,
A similar question was already asked ( http://stackoverflow.com/questions/7492/how-do-you-stress-test-a-web-application ), but I'd like to test a web application that prevents double-submits and takes some counter-XSRF actions and therefore REQUIRES...
Started by wilth on
, 9 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Multiply those requirements by even 100 and you.
Expensive to run, often requiring 300MB or more of RAM.
|
|
What is the recommended "cleanest" way to manage a partial that appears on many views and also requires a viewmodel (assume it needs to get some data from a DB).
Started by Bobbie on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
This allows you to call an action from the view, and get the generated view inside your view: http://www.davidhayden.me/2009/11/htmlaction-and-htmlrenderaction-in-aspnet-mvc... .
In the new ASP.NET MVC 2 framework, you can use the Html.RenderAction() method .
|
|
I'm working on some production software, using C# on the .NET framework. I really would like to be able to use LINQ on the project. I believe it requires .NET version 3.5 (correct me if I'm wrong). This application is a commercial software app, required...
Started by Danny on
, 10 posts
by 10 people.
Answer Snippets (Read the full thread at stackoverflow):
Versions of Windows then requiring the latest and greatest framework version doesn't feel too.
|