Search Results

Search found 1008 results on 41 pages for 'generics'.

Page 36/41 | < Previous Page | 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • Java tool to remove warnings from code developed in java 1.4

    - by Nitin Ware
    Hi All, I am working on a soucre code which was developed using java 1.4 but now we want to migrate it to java 6. I was able to compile it but there are tons of warnings related to use of java generics wherever we have made use of collections framework. It is possible to remove them by manually make changes to them, but I wanna know if is there any tool which can run on the source code and remove all the warnings by making necessary changes ot the code. Any help will be highly appreciated. Cheers, Nitin Ware

    Read the article

  • Rough/near equivalents of Java and .NET technologies/frameworks

    - by Paul Sasik
    I work in a shop that is a mix of mostly Java and .NET technologists. When discussing new solutions and architectures we often encounter impedance in trying to compare the various technologies, frameworks, APIs etc. in use between the two camps. It seems that each camp knows little about the other and we end up comparing apples to oranges and forgetting about the bushels. While researching the topic I found this: Java -- .Net rough equivalents It's a nice list but it's not quite exhaustive and is missing the key .NET 3.0 technologies and a few other tidbits. To complete that list: what are the near/rough equivalents (or a combination of technologies) in Java to the following in .NET? WCF WPF Silverlight WF Generics Lambda expressions Linq (not Linq-to-SQL) ...have i missed anything else? Note that I omitted technologies that are already covered in the linked article. I would also like to hear feedback on whether the linked article is accurate. Thanks. (Will CW if requested.)

    Read the article

  • XSLT: Disable output escaping in an entire document.

    - by Kragen
    I'm trying to generate some C# code using xslt - its working great until I get to generics and need to output some text like this: MyClass<Type> In this case I've found that the only way to emit this is to do the following: MyClass<xsl:text disable-output-escaping="yes">&lt;</xsl:text>Type<xsl:text disable-output-escaping="yes">&gt;</xsl:text> Where: Often it all needs to go on one line, otherwise you end up with line breaks in the generated code In the above example I technically could have used only 1 <xsl:text />, however usually the type Type is given by some other template, e.g: <xsl:value-of select="@type" /> I don't mind having to write &lt; a lot, but I would like to avoid writing <xsl:text disable-output-escaping="yes">&lt;</xsl:text> for just a single character! Is there any way of doing disable-output-escaping="yes" for the entire document?

    Read the article

  • Equivalent of Bloch's Effective Java for C#

    - by Elliot Vargas
    I've jumped into the C# bandwagon and was wondering if there's an equivalent of Joshua Bloch's Effective Java for the C# world. I've already being able to apply some Java knowledge to C# given their similarity but I'm interested in knowledge to make the most effective use of C# specific features. For example, Generics are not implemented equally in Java and C#, so it's not clear to me if the Java Generic "techniques" will work in C# as well. I'm mostly interested in C# 3.0. That is (of course) unless you guys think I would benefit for looking into versions 1 and 2 features.

    Read the article

  • Is this an example of polymorphism?

    - by computer-science-student
    I'm working on a homework assignment (a project), for which one criterion is that I must make use of polymorphism in a way which noticeably improves the overall quality or functionality of my code. I made a Hash Table which looks like this: public class HashTable<E extends Hashable>{ ... } where Hashable is an interface I made that has a hash() function. I know that using generics this way improves the quality of my code, since now HashTable can work with pretty much any type I want (instead of just ints or Strings for example). But I'm not sure if it demonstrates polymorphism. I think it does, because E can be any type that implements Hashable. In other words HashTable is a class which can work with (practically) any type. But I'm not quite sure - is that polymorphism? Perhaps can I get some clarification as to what exactly polymorphism is? Thanks in advance!

    Read the article

  • Functional languages targeting the LLVM

    - by Matthew
    Are there any languages that target the LLVM that: Are statically typed Use type inference Are functional (i.e. lambda expressions, closures, list primitives, list comprehensions, etc.) Have first class object-oriented features (inheritance, polymorphism, mixins, etc.) Have a sophisticated type system (generics, covariance and contravariance, etc.) Scala is all of these, but only targets the JVM. F# (and to some extent C#) is most if not all of these, but only targets .NET. What similar language targets the LLVM?

    Read the article

  • Clipboard Debugging

    - by Jake Pearson
    In the olden times of .NET 1.1, I could use the SoapFormatter to find out exactly what was getting serialized when I copied an object into the clipboard. Fast forward to 2010, and I tried to do the same trick. It turns out the SoapFormatter does not support generics. Is there an alternative way to find out exactly what binary objects are serialized into the clipboard? For example lets say I have this class: public class Foo { public List<Goo> Children; } If I send an instance of it to the clipboard, I would like to take a look at what is in the clipboard to see if it's children list was included or not. Update: I was finally able to find the over copied field with the debugger. Visual Studio did it's job.

    Read the article

  • Advice about a good Java book?

    - by camac1
    Hi people, I am new to Java but have experience programming in C/C++/C#. I wanted to learn Java SE 6 first before moving to Java EE 6. After making some research online for appropriate Java SE 6 books, I found that these are appropriate for me to get an excellent idea of Java SE 6: 1) Head First Java, 2nd Edition 2) An Intermediate Level Book <----------- 3) Effective Java (2nd Edition) 4) Java Concurrency in Practice 5) Java Generics and Collections 6) Java Concise Reference Series: Swing And AWT 7) Java Reflection in Action However, I am having trouble choosing an Intermediate Level Book which will provide me with breadth and depth in Java SE 6. I was thinking about the book "Thinking in Java (4th Edition)"....Unfortunately, its deals with Java SE 5 and not the latest version. Could anybody please advice me an intermediate level book which could provide me with breadth and depth in Java SE 6. Regards

    Read the article

  • Performing complicated XPath queries in Scala

    - by Ken Bloom
    What's the simplest API to use in scala to perform the following XPath queries on a document? //s:Annotation[@type='attitude']/s:Content/s:Parameter[@role='type' and not(text())] //s:Annotation[s:Content/s:Parameter[@role='id' and not(text())]]/@type The only documentation I can find on Scala's XML libraries has no information on performing complicated real XPath queries. I used to like JDOM for this purpose (in Java), but since JDOM doesn't support generics, it will be painful to work with in Scala. (Other XML libraries for Java have tended to be even more painful in Java, but I admit I don't know the landscape real well.)

    Read the article

  • Injecting EntityManager Vs. EntityManagerFactory

    - by SB
    A long question, please bear with me. We are using Spring+JPA for a web application. My team is debating over injecting EntityManagerFactory in the GenericDAO(a DAO based on Generics something on the lines provided by APPFUSE, we do not use JpaDaosupport for some reason) over injecting an EntityManager. We are using "application managed persistence". The arguments against injecting a EntityManagerFactory is that its too heavy and so is not required, the EntityManager does what we need. Also, as Spring would create a new instance of a DAO for every web request(I doubt this) there are not going to be any concurrency issues as in the same EntityManager instance is shared by two threads. The argument for injecting EFM is that its a good practice over all its always good to have a handle to a factory. I am not sure which is the best approach, can someone please enlighten me? SB

    Read the article

  • Delphi - online technical tests

    - by RBA
    I have searched for some online Delphi programming tests, and except the small test for Delphi certification and several tests on Delphi.about.com I did find nothing. Any ideas where I can find some Delphi online tests? LE: defining online Delphi programming tests: - technical questions about Delphi fundamentals,Data types,classes, libraries, generics, database concepts, etc. Examples here (Delphi Developer Certification Exam Study Guide) and here. LE2: tests to take after you have read all the articles from this question: Questions every good Delphi developer should be able to answer?

    Read the article

  • Using a general class for execution with try/catch/finally?

    - by antirysm
    I find myself having a lot of this in different methods in my code: try { runABunchOfMethods(); } catch (Exception ex) { logger.Log(ex); } What about creating this: public static class Executor { private static ILogger logger; public delegate void ExecuteThis(); static Executor() { // logger = ...GetLoggerFromIoC(); } public static void Execute(ExecuteThis executeThis) { try { executeThis(); } catch (Exception ex) { logger.Log(ex); } } } And just using it like this: private void RunSomething() { Method1(someClassVar); Method2(someOtherClassVar); } ... Executor.Execute(RunSomething); Are there any downsides to this approach? (You could add Executor-methods and delegates when you want a finally and use generics for the type of Exeception you want to catch...)

    Read the article

  • What are some "mental steps" a developer must take to begin moving from SQL to NO-SQL (CouchDB, Fath

    - by Byron Sommardahl
    I have my mind firmly wrapped around relational databases and how to code efficiently against them. Most of my experience is with MySQL and SQL. I like many of the things I'm hearing about document-based databases, especially when someone in a recent podcast mentioned huge performance benefits. So, if I'm going to go down that road, what are some of the mental steps I must take to shift from SQL to NO-SQL? If it makes any difference in your answer, I'm a C# developer primarily (today, anyhow). I'm used to ORM's like EF and Linq to SQL. Before ORMs, I rolled my own objects with generics and datareaders. Maybe that matters, maybe it doesn't. Here are some more specific: How do I need to think about joins? How will I query without a SELECT statement? What happens to my existing stored objects when I add a property in my code? (feel free to add questions of your own here)

    Read the article

  • How to add .Net3.5 dll into .Net2.0 project?

    - by macias
    I have a dll which is based on .net 3.5 -- it uses internally for example Linq, but the exposed API is straightforward, no fancy stuff. Since C# generics are resolved at compile time I assume that for calling party all it counts is API (all public parts). However when I try to use this dll from net2.0 project I get info, that the dll cannot be referenced because the dll or one of its dependencies requires a later version of .net framework. I can install any .net version I want on target computer (when entire app is installed), but I cannot change .net version for the project itself. So: how to solve this? When adding a C dll to this project I had no such problems, so are C# dlls self-contained or not?

    Read the article

  • When is @uncheckedVariance needed in Scala, and why is it used in GenericTraversableTemplate?

    - by retronym
    @uncheckedVariance can be used to bridge the gap between Scala's declaration site variance annotations and Java's invariant generics. scala import java.util.Comparator import java.util.Comparator scala trait Foo[T] extends Comparator[T] defined trait Foo scala trait Foo[-T] extends Comparator[T] :5: error: contravariant type T occurs in invariant position in type [-T]java.lang.Object with java.util.Comparator[T] of trait Foo trait Foo[-T] extends Comparator[T] ^ scala import annotation.unchecked._ import annotation.unchecked._ scala trait Foo[-T] extends Comparator[T @uncheckedVariance] defined trait Foo This says that java.util.Comparator is naturally contra-variant, that is the type parameter T appears in parameters and never in a return type. Which begs the question, why is it also used in the Scala collections library: trait GenericTraversableTemplate[+A, +CC[X] <: Traversable[X]] extends HasNewBuilder[A, CC[A] @uncheckedVariance] What are the valid uses for this annotation?

    Read the article

  • Why are developers proud to say our application is XXX lines of code? [closed]

    - by mbcrump
    I admit, I used to do it. I was proud to tell a fellow developer my application is 10K+ lines of code. I thought it was a "Look at me, I'm smart" statement. Time passed and I realized that a experienced developer would be constantly refactoring all of his code. Not only for the sake of remembering what it was doing, but because he realizes he is smarter today than he was yesterday. No longer was it cool to have multiple nested if statements or completely ignoring generics/lambdas. So, whats your take on this? Do you do it and why?

    Read the article

  • NoClassDefFoundError when running java tool under Xcode

    - by pancake
    Hi all, I'm trying to create a Java Tool by using Xcode. I've already changed my build.xml to have Xcode target java 1.6 and not 1.3 so I can use generics. I'm getting no build errors and using 'javac' and 'java' in the terminal works. Now I want it to work in Xcode as well. I keep getting the following error: Exception in thread "main" java.lang.NoClassDefFoundError: MyClass where 'MyClass' is the class containing the main method. It probably has something to do with the classpath, which as the build.xml prescribes is "${bin}". There is a bin folder in my project folder, and it contains all the .class files needed to run the program. If anybody could help me, it'd be great!

    Read the article

  • creating BeanInfo objects in NetBeans 6.1 does not work for some objects

    - by Coder
    I have recently learned about BeanInfo classes in Java, and have successfully used them to add icons to my custom GUI components which extend swing components such as JTextField, however i have a more specialized GUI component which extends from another one of my GUI components, which then extends from JTextField. Ie. the class hierarchy is of the form "A - B - JTextField". I can create a bean info object that works for class B, but when i click on the bean info editor option in netbeans to create a bean info object for class A, nothing happens. Ie. there is no error pop-up and a bean info object is not created. There isn't much difference between class A and B. Both A and B have default no argument constructors and they are very similar to each other. The only thing i can really think of is that A uses generics and B does not. I would like to create a beaninfo object for class A so that i can add custom icons for that component. Any help would be appreciated. Thanks.

    Read the article

  • What are the other new features of C# 4.0, after dynamic and optional parameters?

    - by Abel
    So, C# 4.0 came out yesterday. It introduced the much-debated dynamic keyword, named and optional parameters. Smaller improvements were the implicit ref and recognizing of indexed and default properties on COM methods, contra- and co-variance (really a .NET CLR feature, not C# only) and... Is that really it? Are dynamic and optional/named params the only real improvements to C#? Or did I miss something? Not that I'm complaining, but it seems a bit meager after C# 2.0 (generics) and C# 3.0 (lambda, LINQ). Maybe the language just reached actual maturity?

    Read the article

  • Benefits of arrays

    - by Vitalii Fedorenko
    As I see it, the advantages of List over array are pretty obvious: Generics provide more precise typing: List<Integer>, List<? extends Number>, List<? super Integer>. List interface has a bunch useful methods: addAll, remove etc. While for arrays all standard operations except get/set must be performed in a procedure manner by passing it to a static method. Collections offer different implementations like ArrayList, LinkedList, unmodifieable and synchronized lists, which can be hidden under common List interface. OOB length control. As disadvantages I can only mention absence of syntactic sugar and runtime type check. At the same time supporting of both structures requires frequent using of asList and toArray methods, which makes code less readable. So I am curious if there are any important benefits of using arrays that I miss.

    Read the article

  • Set Default DateTime Format c#

    - by Matthew Hood
    Is there a way of setting or overriding the default DateTime format for an entire application. I am writing an app in C# .Net MVC 1.0 and use alot of generics and reflection. Would be much simpler if I could override the default DateTime.ToString() format to be "dd-MMM-yyyy". I do not want this format to change when the site is run on a different machine. Edit - Just to clarify I mean specifically calling the ToString, not some other extension function, this is because of the reflection / generated code. Would be easier to just change the ToString output.

    Read the article

  • Why does the CPU window always appear when trying to debug my project after a rebuild in Delphi 2010

    - by James
    Hi, Whenever I rebuild my application and try to step into a break-point the CPU window always appears. From what I understand the CPU window appears when DCU does not match up with the source file, however, in my case the DCU's are defintely being re-compiled and there are no old ones lying around or anything like that. The strange thing here is if I close down the application and re-open the project, place the breakpoint and run it works fine. I can even modify files and just press F9 to run the project and it works fine....it only seems to be when I rebuild the project (via IDE Project menu or the project context menu) that this CPU window never breaks into the source (even though it can find it!). I also noticed in the callstack a unit called Generics is always the top of the stack, never the unit my break point is in, this is no way related to where my break point is. Any ideas?

    Read the article

  • Action T synchronous and asynchronous

    - by raffaeu
    Hi everybody I have a contextmenustrip control that allows you to execute an action is two different flawours. Sync and Async. I am trying to covert everything using Generics so I did this: public class BaseContextMenu<T> : IContextMenu { private T executor ... public void Exec(Action<T> action){ action.Invoke(this.executor); } public void ExecAsync(Action<T> asyncAction){ ... } How I can write the async method in order to execute the generic action and 'do something' with the menu in the meanwhile? I saw that the signature of BeginInvoke is something like: asyncAction.BeginInvoke(thi.executor, IAsyncCallback, object);

    Read the article

  • Can using non primitive Integer/ Long datatypes too frequently in the application, hurt the performance??

    - by Marcos
    I am using Long/Integer data types very frequently in my application, to build Generic datatypes. I fear that using these wrapper objects instead of primitive data types may be harmful for performance since each time it needs to create objects which is an expensive operation. but also it seems that I have no other choice(when I have to use primtives with generics) rather than just using them. However, still it would be great if you can suggest if there is anything I could do to make it better. or any way if I could just avoid it ?? Also What may be the downsides of this ? Suggestions welcomed!

    Read the article

  • if all my views are passed a strongly typed viewdata, if they have a baseviewdata class, can I set a

    - by Blankman
    I want all my views to inherit from a baseview data so I can set some shared properties that all my views will need. Can I set some properties in OnExecuting so I don't have to do it for all Actions? I want to then display the string value of the property in all my view pages. If yes, how can I do this? I need to hook into the base view data somehow? so i'll have: public MyViewData : ViewData { } And I need one for generics also?

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41  | Next Page >