Search Results

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

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

  • Are there any Tutorials for Protobuf-net?

    - by AKRamkumar
    I have been reading about protobuf-net and it is amazing! Are there any tutorials that I could use? (More specifically for Dictionary<TKey,TValue> and contracts for generics) Are there any tips associated with it? Could I simply plug it into my current codebase or are there any changes I need to do?

    Read the article

  • GWT 1.4 TO 2.0 UiBinder

    - by manu sinha
    Hi I am upgrading a project with around 60 java classes, from 1.4 to 2.0 . Apart from replacing deprecated functions, adding generics, will converting the whole project into UI Binder approach i.e. XML and Corresponding working Java classes, be recommended. Or shall i go on adding new UI requirments using Ui Binder and leaving the existing code as it is?

    Read the article

  • How to implement a custom cell renderer for ScrollTable in GWT

    - by tronda
    I've used the ScrollTable widget for GWT and I have a need for a custom cell renderer so I can isolate this code from the rest of the app. I would like to use generics if possible to get it type safe. This cell renderer will take a long as a value and do some calculation before displaying the result. Anyone having a good example on how to implement such a custom renderer?

    Read the article

  • Java 5 to Java 1.4 Source Code Backporting Tool

    - by kolrie
    Is there a tool that, given a Java 5 level source code, will backport it to Java 1.4-compliant source code, by removing Generics declarations, transforming for eachs in simple fors or iteration fors, etc.? Please note that I am looking for a tool that translates source code to source code, not class binaries.

    Read the article

  • How to set multiple permissions in one class view, depending on http request

    - by andrew13331
    How can I change the permissions depending on if it is a get or a post. Is it possible to do it in one class or would I have to separate it out into two classes? If its a get I want "permission_classes = (permissions.IsAuthenticated)" and if its a post I want "permission_classes = (permissions.IsAdminUser)" class CategoryList(generics.ListCreateAPIView): queryset = QuestionCategory.objects.all() serializer_class = QuestionCategorySerializer permission_classes = (permissions.IsAuthenticated,)

    Read the article

  • What are the benefits of using ORM over XML Serialization/Deserialization?

    - by Tequila Jinx
    I've been reading about NHibernate and Microsoft's Entity Framework to perform Object Relational Mapping against my data access layer. I'm interested in the benefits of having an established framework to perform ORM, but I'm curious as to the performance costs of using it against standard XML Serialization and Deserialization. Right now, I develop stored procedures in Oracle and SQL Server that use XML Types for either input or output parameters and return or shred XML depending on need. I use a custom database command object that uses generics to deserialize the XML results into a specified serializable class. By using a combination of generics, xml (de)serialization and Microsoft's DAAB, I've got a process that's fairly simple to develop against regardless of the data source. Moreover, since I exclusively use Stored Procedures to perform database operations, I'm mostly protected from changes in the data structure. Here's an over-simplified example of what I've been doing. static void main() { testXmlClass test = new test(1); test.Name = "Foo"; test.Save(); } // Example Serializable Class ------------------------------------------------ [XmlRootAttribute("test")] class testXmlClass() { [XmlElement(Name="id")] public int ID {set; get;} [XmlElement(Name="name")] public string Name {set; get;} //create an instance of the class loaded with data. public testXmlClass(int id) { GenericDBProvider db = new GenericDBProvider(); this = db.ExecuteSerializable("myGetByIDProcedure"); } //save the class to the database... public Save() { GenericDBProvider db = new GenericDBProvider(); db.AddInParameter("myInputParameter", DbType.XML, this); db.ExecuteSerializableNonQuery("mySaveProcedure"); } } // Database Handler ---------------------------------------------------------- class GenericDBProvider { public T ExecuteSerializable<T>(string commandText) where T : class { XmlSerializer xml = new XmlSerializer(typeof(T)); // connection and command code is assumed for the purposes of this example. // the final results basically just come down to... return xml.Deserialize(commandResults) as T; } public void ExecuteSerializableNonQuery(string commandText) { // once again, connection and command code is assumed... // basically, just execute the command along with the specified // parameters which have been serialized. } public void AddInParameter(string name, DbType type, object value) { StringWriter w = new StringWriter(); XmlSerializer x = new XmlSerializer(value.GetType()); //handle serialization for serializable classes. if (type == DbType.Xml && (value.GetType() != typeof(System.String))) { x.Serialize(w, value); w.Close(); // store serialized object in a DbParameterCollection accessible // to my other methods. } else { //handle all other parameter types } } } I'm starting a new project which will rely heavily on database operations. I'm very curious to know whether my current practices will be sustainable in a high-traffic situation and whether or not I should consider switching to NHibernate or Microsoft's Entity Framework to perform what essentially seems to boil down to the same thing I'm currently doing. I appreciate any advice you may have.

    Read the article

  • lightweight publish/subscribe framework in java

    - by mdma
    Is there a good lightweight framework for java that provides the publish/subscribe pattern? Some ideal features Support for generics Registration of multiple subscribers to a publisher API primarily interfaces and some useful implementations purely in-memory, persistence and transaction guarantees not required. I know about JMS but that is overkill for my need. The publish/subscribed data are the result of scans of a file system, with scan results being fed to another component for processing, which are then processed before being fed to another and so on.

    Read the article

  • Good working habits to observe in project development?

    - by Will Marcouiller
    As my development experience grows, I see fit to stick to best practices from here and there to build somehow my own working practices while observing the conventions, etc. I'm currently working on a project which my goals is to graduate the security access model from an environment's Active Directory to another environment's automatically. I don't know for any of you, but as far as I'm concerned, I meet some real difficulties sticking to only one way, then develop. I mean, I learn something new everyday while visiting SO, and recently wanted to get acquainted with generics. On the other hand, I better know the Façade pattern which proved to be very practical in transactional programming in process systems. This seems to be less practical for desktop application as there are plenty of variables to consider in a desktop application that you don't have to care in transactional programming, as you're playing only with information data. As for my current project, I have: Groups; Organizational Units; Users. Which are all considered an entry in the Active Directory. This points out to be a good candidate for generics, as also approached this way by Bart de Smett's Linq to AD on CodePlex. He has a DirectorySource<T>, and to manage let's say groups, then he instantiate a source with the proper type: var groups = new DirectorySource<Group>(); This seems to be very a good way of doing. Despite, I seem to go from one pattern to another and I don't seem to be able to strictly stick to one. While I'm aware that one must not stay with only one way of doing, since each pattern statisfies certain advantages, while also illustrating disadvantages under some usage conditions, I seem to want to develop with both patterns having a singleton Façade class with the underlying factories which represent the sub systems: GroupsFactory; UsersFactory; OrganizationalUnitsFactory. Each of the factories offers the possible operations for their respective entity (group, user, OU). To make a very long story short, I often have plenty of ideas while developping and this causes me some trouble, as I go from an idea to another feeling completely lost after a while. Yet I understand the advantages and disavantages, I have no trouble choosing from one pattern to another depending on the situation. Nevertheless, when it comes to programming itself, if I'm not part of a team, I feel sometimes like I can't do anything good. That is, because I can't stand not doing something "perfect" the first time. The role I play within the project is both: the project manager and the programmer. I am more comfortable in the project manager role, architectural role, analytical role than the developer's. Has any of you some good habbits to observe in project development? Thanks to you all! =)

    Read the article

  • Which Java version do you mostly (have to) work with?

    - by ferdystschenko
    While from version 5 on, Java provides many extremely useful features like annotations, enums, generics, etc., 1.4 is still in use in many enterprise projects. So I'm wondering what the chances are that you still have to work with 1.4, thus being forced to go without JPA, EJB3 etc. In your answer, please also state the branch of company you work for. Which are the reasons for not switching to Java 5? Thanks, Armin

    Read the article

  • IoC and DI framework for .Net applications

    - by Lijo
    Hi Can you please explain how the following three are different in their intent? 1) Policy Injection Application Block 2) Structure Map IoC Managed 3) Managed Extensibility Framework In terms of the common tasks they do, which is simpler/aligned with generics and C# 3.0 ? Thanks Lijo

    Read the article

  • Easy XML Serializer for Java

    - by sdoca
    I'm looking for a way to serialize Java objects into XML for use by a RESTful web service. I don't have an XSD. I have looked at the following: JAXB - fairly heavy weight with annotations required on classes and also an ObjectFactory class and/or a jaxb.index file Simple - requires annotations but no other config classes/files. Unfortunately it can't serialize Sets. XStream - no annotations etc. required, but doesn't support generics Does anyone else have any suggestions?

    Read the article

  • Templates in C#

    - by John Doe
    I know generics are in C# to fulfill a role similar to C++ templates but I really need a way to generate some code at compile time - in this particular situation it would be very easy to solve the problem with C++ templates. Does anyone know of any alternatives? Perhaps a VS plug-in that preprocesses the code or something like that? It doesn't need to be very sophisticated, I just need to generate some methods at compile time.

    Read the article

  • Java library for trees similar to JGraphT for graphs?

    - by lexicore
    I'm a big fan of JGraphT, a Java library for graphs. Could anyone recommend a similar Java library for trees? Preferrably FOSS. What I need is a good API, preferrably typesafe with generics which allows modelling different kinds of trees (with some user data attached to verticies/edges) and run different algorithms and operations on these trees. For instance, traverse or balance. At the moment I'm not interested in visualization of trees.

    Read the article

  • Is it possible to make ListView display a text obtained through its ListViewItem.Tag?

    - by Dimitri C.
    I'd like to fill System.Windows.Forms.ListView with the items I've stored in a separate System.Collections.Generics.List<. I would like to avoid to store the data twice, once in the List< and once as a string in ListViewItem. Is there a way to make ListViewItem use some callback function to obtain the text to put in its columns from the Tag property, instead of using its Text property?

    Read the article

  • How do I change the build's SDK version in Xcode?

    - by Kavon Farvardin
    I'm using Xcode 2.5 on Mac 10.4.11 PPC. javac -version returns 1.5.x yet when I imported my source code and tried to build it in Xcode, I get errors all over because generics, annotations, and for-each loops are not supported in -source 1.3. I thought I found the setting to change the source version in Xcode in the above but it doesn't work. Any ideas?

    Read the article

  • What are the things Java got wrong?

    - by Alon
    I read a lot of blogs and see people all the time talking about bad things in the java programming language; a lot of them are about annotations and generics that were added to the language in 1.5 release. What are the things in the language or the API that you don't like or would design differently?

    Read the article

  • C#: How to find the default value for a run-time Type?

    - by George Mauer
    So given a static type in your code you can do var defaultMyTypeVal = default(MyType); How would you do the same thing given a variable of Type so you can use it during runtime? In other words how do I implement the following method without a bunch of if statements or using Generics (because I will not know the type I'm passing into the method at compile time)? public object GetDefaultValueForType(Type type) { .... }

    Read the article

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