Search Results

Search found 6357 results on 255 pages for 'generic relations'.

Page 114/255 | < Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >

  • Setting log level of message at runtime in slf4j

    - by scompt.com
    When using log4j, the Logger.log(Priority p, Object message) method is available and can be used to log a message at a log level determined at runtime. We're using this fact and this tip to redirect stderr to a logger at a specific log level. slf4j doesn't have a generic log() method that I can find. Does that mean there's no way to implement the above?

    Read the article

  • Does MS PnP Unity Scan for Assemblies Like StructureMap?

    - by rasx
    In Using StructureMap 2.5 to scan all assemblies in a folder, we can see that StructureMap uses AssembliesFromPath() to explicitly look for types to resolve. What is the equivalent of this in Microsoft Unity? Because Unity is such a generic term, searching for documents about this online is not that easy. Update: Unity has something called an Assembly Matching Rule but its description does not communicate to me that it scans folders.

    Read the article

  • Nullable<> as TModel for ViewPage

    - by Alexander Prokofyev
    What are the possible reasons what Nullable<> types are disallowed to be passed as TModel parameter of System.Web.Mvc.ViewPage<TModel> generic? This could be handy sometimes. In ASP.NET MVC source defined what TModel should be a class: public class ViewPage<TModel> : ViewPage where TModel : class but Nullable types are value types. Maybe definition could be less restrictive...

    Read the article

  • What do you use to keep notes as a developer?

    - by Mike Duncan
    Where as a developer do like to you keep your code snippets, links, checklists, final solutions to problems etc? I've fooled with Google Notebook, MS Onenote, TreePad, textfiles, and Evernote a bit (currently leaning toward Evernote). All have pros and cons but none seem to be really suited to developers. Is anyone super-happy with a collection / note system that's not just generic GTD, but with developer-centric utility?

    Read the article

  • Accessing other controls by name in a Silverlight ControlTemplate

    - by Chris S
    I have a custom control that inherits from ContentControl. Inside the generic.xaml file is a simple Grid with 2 rows: Row 1 - A toggle button Row 2 - A StackPanel with a TextBlock, named "Stackpanel1" The ToggleButton has its own nested ControlTemplate which has VisualStates for Checked/Unchecked. Is it possible to reference "Stackpanel1" from inside the ToggleButton's control template somehow? In order to show or hide the stackpanel.

    Read the article

  • Up to date, JPA compliant GenericDAO Implementation

    - by HDave
    I read this article: http://www.ibm.com/developerworks/java/library/j-genericdao.html several times and believe I understand what it is saying. However, it is 4 years old and I have a JPA compliant Java application to contend with. In addition, I see that there is a JPATemplate in Spring that has some good functionality, but the Spring documentation says it is already deprecated! Can anybody point me to a solid, modern, JPA compliant, Spring based, working example of a GenericDAOImpl that proxies an Interface to provide generic finder execution?

    Read the article

  • What is the big deal with IQueryable?

    - by jjr2527
    I've seen a lot of people talking about IQueryable and I haven't quite picked up on what all the buzz is about. I always work with generic List's and find they are very rich in the way you can "query" them and work with them, even run LINQ queries against them. So I'm wondering if there is a good reason to start considering a different default collection in my projects.

    Read the article

  • How do I create a strongly typed BeginForm?

    - by itchi
    I've seen a few examples of people using this syntax for HTML.BeginForm: (Html.BeginForm<Type>(action => action.ActionName(id))) But when I try this syntax all I get is a: The non-generic method System.Web.Mvc.Html.FormExtensions.BeginForm(System.Web.Mvc.HtmlHelper)' cannot be used with type arguments What am I missing?

    Read the article

  • Best way to handle global state

    - by David
    Hi there, I was wondering if anyone could offer some advice on 'best practices' for using global state in a web application - specifically PHP, although im looking for generic best practices i.e. design patterns etc. At the moment I just use a static class, calling it Configs. I suppose this is similar to using the registry pattern but surely there is a more elegant way of handling global data within an application - i just cant think of a better way though.

    Read the article

  • Closures in Java 7

    - by Schildmeijer
    I have heard that closures could be introduced in the next Java standard that is scheduled to be released somewhere around next summer. What would this syntax look like? I read somewhere that introducing closures in java is a bigger change than generic was in java 5. Is this true? pros and cons? (By now we definitely know that closures not will be included in the next Java release) OR edit: http://puredanger.com/tech/2009/11/18/closures-after-all/ :D

    Read the article

  • asp.net 4.0 web forms routing - default/wildcard route

    - by Martin Robins
    I there a simple way when using ASP.NET 4.0 routing with Web Forms to produce a route that will act as some kind of wildcard? It seems to me that within WebForms, you have to specify a route for every page - I am looking for some kind of generic route that can be used where nothing specific is required, perhaps mapping directly from path to path so... http://somedomain.com/folder1/folder2/page would possibly map to folder1/folder2/page.aspx Any suggestions? Thanks

    Read the article

  • error to send SMS

    - by deni
    i have a problem with that code.. i got a error when i execute CommSetting.comm.SendMessage(pdu); the error is Phone reports generic communication error or syntax error can u tell me how to solve my problem?? thx i develop with c#, VS 2008

    Read the article

  • What's "@Override" there for in java?

    - by symfony
    public class Animal { public void eat() { System.out.println("I eat like a generic Animal."); } } public class Wolf extends Animal { @Override public void eat() { System.out.println("I eat like a wolf!"); } } Does @Override actually have some functionality or it's just kinda comment?

    Read the article

  • How can I import one Gradle script into another?

    - by Ant
    Hi all, I have a complex gradle script that wraps up a load of functionality around building and deploying a number of netbeans projects to a number of environments. The script works very well, but in essence it is all configured through half a dozen maps holding project and environment information. I want to abstract the tasks away into another file, so that I can simply define my maps in a simple build file, and import the tasks from the other file. In this way, I can use the same core tasks for a number of projects and configure those projects with a simple set of maps. Can anyone tell me how I can import one gradle file into another, in a similar manner to Ant's task? I've trawled Gradle's docs to no avail so far. Additional Info After Tom's response below, I thought I'd try and clarify exactly what I mean. Basically I have a gradle script which runs a number of subprojects. However, the subprojects are all Netbeans projects, and come with their own ant build scripts, so I have tasks in gradle to call each of these. My problem is that I have some configuration at the top of the file, such as: projects = [ [name:"MySubproject1", shortname: "sub1", env:"mainEnv", cvs_module="mod1"], [name:"MySubproject2", shortname: "sub2", env:"altEnv", cvs_module="mod2"] ] I then generate tasks such as: projects.each({ task "checkout_$it.shortname" << { // Code to for example check module out from cvs using config from 'it'. } }) I have many of these sort of task generation snippets, and all of them are generic - they entirely depend on the config in the projects list. So what I want is a way to put this in a separate script and import it in the following sort of way: projects = [ [name:"MySubproject1", shortname: "sub1", env:"mainEnv", cvs_module="mod1"], [name:"MySubproject2", shortname: "sub2", env:"altEnv", cvs_module="mod2"] ] import("tasks.gradle") // This will import and run the script so that all tasks are generated for the projects given above. So in this example, tasks.gradle will have all the generic task generation code in, and will get run for the projects defined in the main build.gradle file. In this way, tasks.gradle is a file that can be used by all large projects that consist of a number of sub-projects with Netbeans ant build files.

    Read the article

  • Auto-scaffolding Index views in ASP.NET MVC

    - by DanM
    I'm trying to write an auto-scaffolder for Index views. I'd like to be able to pass in a collection of models or view-models (e.g., IQueryable<MyViewModel>) and get back an HTML table that uses the DisplayName attribute for the headings (th elements) and Html.Display(propertyName) for the cells (td elements). Each row should correspond to one item in the collection. Here's what I have so far: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <% var items = (IQueryable<TestProj.ViewModels.TestViewModel>)Model; // Should be generic! var properties = items.First().GetMetadata().Properties .Where(pm => pm.ShowForDisplay && !ViewData.TemplateInfo.Visited(pm)); %> <table> <tr> <% foreach(var property in properties) { %> <th> <%= property.DisplayName %> </th> <% } %> </tr> <% foreach(var item in items) { %> <tr> <% foreach(var property in properties) { %> <td> <%= Html.Display(property.DisplayName) %> // This doesn't work! </td> <% } %> </tr> <% } %> </table> Two problems with this: I'd like it to be generic. So, I'd like to replace var items = (IQueryable<TestProj.ViewModels.TestViewModel>)Model; with var items = (IQueryable<T>)Model; or something to that effect. The <td> elements are not working because the Html in <%= Html.Display(property.DisplayName) %> contains the model for the view, which is a collection of items, not the item itself. Somehow, I need to obtain an HtmlHelper object whose Model property is the current item, but I'm not sure how to do that. How do I solve these two problems?

    Read the article

  • Inline instantiation of a constant List

    - by Roflcoptr
    I try to do something like this: public const List<String> METRICS = new List<String>() { SourceFile.LOC, SourceFile.MCCABE, SourceFile.NOM, SourceFile.NOA, SourceFile.FANOUT, SourceFile.FANIN, SourceFile.NOPAR, SourceFile.NDC, SourceFile.CALLS }; But unfortunately this doesn't work: FileStorer.METRICS' is of type 'System.Collections.Generic.List<string>'. A const field of a reference type other than string can only be initialized with null. How can I solve this problem?

    Read the article

  • informatica mapping examples

    - by user223541
    i want to devlope generic mapping for handling data bases errors in Informatica. Can any one give me any examples of such mappings ? Also can u suggent me some resources for informatica samples mappings (livw webiste or links)

    Read the article

  • how to acess and change variable of kernel space from user space

    - by bhavin
    i, I have posted query previously and i am repeating same I want to modify igmpv3 (Linux) which is inbuilt in kernel2.6.-- such that it reads a value from a file and appropriately decides reserved(res 1) value inside the igmpv3 paket which is sent by a host. I want to add more to above question by saying that this is more a generic question of changing variable of kernel space from user space. Thanks in advance for your help. Regards, Bhavin

    Read the article

  • Flash AS 3.0 building a message console approach

    - by vasion
    I am having trouble figuring out how to build a console for my application so i can send msgs to it from any class in the package. i tried to send a generic Event, but I cannot find a way send a msg together with the event, or at least a reference to the object which is dispatching the event. what approach would you suggest?

    Read the article

  • List of Django model instance foreign keys losing consistency during state changes.

    - by Joshua
    I have model, Match, with two foreign keys: class Match(model.Model): winner = models.ForeignKey(Player) loser = models.ForeignKey(Player) When I loop over Match I find that each model instance uses a unique object for the foreign key. This ends up biting me because it introduces inconsistency, here is an example: >>> def print_elo(match_list): ... for match in match_list: ... print match.winner.id, match.winner.elo ... print match.loser.id, match.loser.elo ... >>> print_elo(teacher_match_list) 4 1192.0000000000 2 1192.0000000000 5 1208.0000000000 2 1192.0000000000 5 1208.0000000000 4 1192.0000000000 >>> teacher_match_list[0].winner.elo = 3000 >>> print_elo(teacher_match_list) 4 3000 # Object 4 2 1192.0000000000 5 1208.0000000000 2 1192.0000000000 5 1208.0000000000 4 1192.0000000000 # Object 4 >>> I solved this problem like so: def unify_refrences(match_list): """Makes each unique refrence to a model instance non-unique. In cases where multiple model instances are being used django creates a new object for each model instance, even if it that means creating the same instance twice. If one of these objects has its state changed any other object refrencing the same model instance will not be updated. This method ensure that state changes are seen. It makes sure that variables which hold objects pointing to the same model all hold the same object. Visually this means that a list of [var1, var2] whose internals look like so: var1 --> object1 --> model1 var2 --> object2 --> model1 Will result in the internals being changed so that: var1 --> object1 --> model1 var2 ------^ """ match_dict = {} for match in match_list: try: match.winner = match_dict[match.winner.id] except KeyError: match_dict[match.winner.id] = match.winner try: match.loser = match_dict[match.loser.id] except KeyError: match_dict[match.loser.id] = match.loser My question: Is there a way to solve the problem more elegantly through the use of QuerySets without needing to call save at any point? If not, I'd like to make the solution more generic: how can you get a list of the foreign keys on a model instance or do you have a better generic solution to my problem? Please correct me if you think I don't understand why this is happening.

    Read the article

  • AD - DirectoryServices: VBNET2.0 - Speaking architecture...

    - by Will Marcouiller
    I've been mandated to write an application to migrate the Active Directory access models to another environment. Here's the context: I'm stuck with VB.NET 2005 and .NET Framework 2.0; The application must use the Windows authenticated user to manage AD; The objects I have to handle are Groups, Users and OrganizationalUnits; I intend to use the Façade design pattern to provider ease of use and a fully reusable code; I plan to write a factory for each of the objects managed (group, ou, user); The use of Attributes should be useful here, I guess; As everything is about the DirectoryEntry class when accessing the AD, it seems a good candidate for generic types. Obligatory features: User creates new OUs manually; User creates new group manually; User creates new user (these users are services accounts) manually; Application reads an XML file which contains the OUs, groups and users to create; Application informs the user about the OUs, groups and users that shall be created; User specifies the domain environment where to migrate the XML input file designated objects; User makes changes if needed, and launches the task operations; Application performs required by the XML input file operations against the underlying AD as specified by the user; Application informs the user upon completion. Linear features: User fetches OUs, groups, users; User changes OUs, groups, users; User deletes OUs, groups, users; The application logs AD entries and operations performed, plus errors and exceptions; Nice-to-have features: Application rollbacks operations on error or exception. I've been working for weeks now to get acquainted with the AD and the System.DirectoryServices assembly. But I don't seem to find a way to be fully satisfied with what I'm doing and always looking for better. I have studied Bret de Smet's Linq to AD on CodePlex, but then again, I can't use it as I'm stuck with .NET 2.0, so no Linq! But I've learned about Attributes, and seen that he's working with generic types as he codes a DirectorySource class to perform the operations for OUs, groups and users. Any suggestions? Thanks for any help, code sample, ideas, architural solution, everything!

    Read the article

< Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >