Search Results

Search found 14 results on 1 pages for 'riz'.

Page 1/1 | 1 

  • nhibernate subclass in code

    - by Antonio Nakic Alfirevic
    I would like to set up table-per-classhierarchy inheritance in nhibernate thru code. Everything else is set in XML mapping files except the subclasses. If i up the subclasses in xml all is well, but not from code. This is the code i use - my concrete subclass never gets created:( //the call NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration(); SetSubclass(config, typeof(TAction), typeof(tActionSub1), "Procedure"); //the method public static void SetSubclass(Configuration configuration, Type baseClass, Type subClass, string discriminatorValue) { PersistentClass persBaseClass = configuration.ClassMappings.Where(cm => cm.MappedClass == baseClass).Single(); SingleTableSubclass persSubClass = new SingleTableSubclass(persBaseClass); persSubClass.ClassName = subClass.AssemblyQualifiedName; persSubClass.DiscriminatorValue = discriminatorValue; persSubClass.EntityPersisterClass = typeof(SingleTableEntityPersister); persSubClass.ProxyInterfaceName = (subClass).AssemblyQualifiedName; persSubClass.NodeName = subClass.Name; persSubClass.EntityName = subClass.FullName; persBaseClass.AddSubclass(persSubClass); } the Xml mapping looks like this: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Riz.Pcm.Domain.BusinessObjects" assembly="Riz.Pcm.Domain"> <class name="Riz.Pcm.Domain.BusinessObjects.TAction, Riz.Pcm.Domain" table="dbo.tAction" lazy="true"> <id name="Id" column="ID"> <generator class="guid" /> </id> <discriminator type="String" formula="(select jt.Name from TJobType jt where jt.Id=JobTypeId)" insert="true" force="false"/> <many-to-one name="Session" column="SessionID" class="TSession" /> <property name="Order" column="Order1" /> <property name="ProcessStart" column="ProcessStart" /> <property name="ProcessEnd" column="ProcessEnd" /> <property name="Status" column="Status" /> <many-to-one name="JobType" column="JobTypeID" class="TJobType" /> <many-to-one name="Unit" column="UnitID" class="TUnit" /> <bag name="TActionProperties" lazy="true" cascade="all-delete-orphan" inverse="true" > <key column="ActionID"></key> <one-to-many class="TActionProperty"></one-to-many> </bag> <!--<subclass name="Riz.Pcm.Domain.tActionSub" discriminator-value="ZPower"></subclass>--> </class> </hibernate-mapping> What am I doing wrong? I can't find any examples on google:(

    Read the article

  • what's a good approach to working with multiple databases?

    - by Riz
    I'm working on a project that has its own database call it InternalDb, but also it queries two other databases, call them ExternalDb1 and ExternalDb2. Both ExternalDb1 and ExternalDb2 are actually required by a few other projects. I'm wondering what the best approach for dealing with this is? Currently, I've just created a project for each of these external databases and then generated Edmx and entities using the entity-framework approach. My thought was that I could then include these projects in any of my solutions that require access to these databases. Also, I don't have any separate business layers. I just have a solution like below: Project.Domain ExternalDb1Project.Domain ExternalDb2Project.Domain Project.Web So my Domain projects contain the data access as well as the POCOs generated by Entity Framework and any business logic. But I'm not sure if this is a good approach. For example if I want to do Validation in my Project.Domain on the entities in the InternalDb, it's fine. But if I want to do Validation for entities from either of the ExternalDbs, then I wonder where it should go? To be more specific, I retrieve Employees from ExternalDb1Project.Domain. However, I want to make sure they are Active. Where should this Validation go? How to architect a project like this at a high level? Also, I want to make sure that I use IoC for my data contexts so I can create Fakes when writing tests. I wonder where the interfaces for these various data contexts would reside?

    Read the article

  • should I create a new class for a specific piece of business logic?

    - by Riz
    I have a Request class based on the same Entity in my Domain. It currently only has property definitions. I'd like to add a method for checking a duplicate Request which I'll call from my controller. Should I add a method called CheckDuplicate in the Request class? Would I be violating the SRP? The method will need to access a database context to check already existing requests. I'm thinking creating another class altogether for this logic that accepts a datacontext as part of its constructor. But creating a whole new class for just one method seems like a waste too. Any advice?

    Read the article

  • Invoke "internal extern" constructor using reflections

    - by Riz
    Hi, I have following class (as seen through reflector) public class W : IDisposable { public W(string s); public W(string s, byte[] data); // more constructors [MethodImpl(MethodImplOptions.InternalCall)] internal extern W(string s, int i); public static W Func(string s, int i); } I am trying to call "internal extern" constructor or Func using reflections MethodInfo dynMethod = typeof(W).GetMethod("Func", BindingFlags.Static); object[] argVals = new object[] { "hi", 1 }; dynMethod.Invoke(null, argVals); and Type type = typeof(W); Type[] argTypes = new Type[] { typeof(System.String), typeof(System.Int32) }; ConstructorInfo cInfo = type.GetConstructor(BindingFlags.InvokeMethod | BindingFlags.NonPublic, null, argTypes, null); object[] argVals = new object[] { "hi", 1 }; dynMethod.Invoke(null, argVals); unfortunantly both variants rise NullReferenceException when trying to Invoke, so, I must be doing something wrong?

    Read the article

  • Browser plugin which can register it's own protocol

    - by Riz
    Hi, I need to implement browser plugin which can register it's own protocol (like someprotocol://someurl ) and be able to handle calls to this protocol (like user clicking on 'someprotocol' link calls function inside my plugin). As far as I undesrtand Skype does something simmilar, except I need to handle links within page context and not in separated app. Any advices on how this can be done? Can this be done without installing my own plugin, with help of flash/java?

    Read the article

  • Sending signal to daemon in php

    - by Riz
    Hi, I have a daemon written in PHP which is running on my linux machine. I am trying to send a signal to it through another php file. For this purpose I am trying posix_kill function. But its not working. When I run the php page, I get an error that php is compiled without --enable-grep I want to know how to enable it? OR what is the alternate way of sending signal to daemon?

    Read the article

  • Extract anything that looks like links from large amount of data in python

    - by Riz
    Hi, I have around 5 GB of html data which I want to process to find links to a set of websites and perform some additional filtering. Right now I use simple regexp for each site and iterate over them, searching for matches. In my case links can be outside of "a" tags and be not well formed in many ways(like "\n" in the middle of link) so I try to grab as much "links" as I can and check them later in other scripts(so no BeatifulSoup\lxml\etc). The problem is that my script is pretty slow, so I am thinking about any ways to speed it up. I am writing a set of test to check different approaches, but hope to get some advices :) Right now I am thinking about getting all links without filtering first(maybe using C module or standalone app, which doesn't use regexp but simple search to get start and end of every link) and then using regexp to match ones I need.

    Read the article

  • Reconstructing simple 3d enviroment(room) from photo

    - by Riz
    I have photo of a room with three walls and floor/ceiling or both. I am trying to reconstruct this room in 3d asking user for minimal input. Right now I use 8 points defined by user, angles of left and right wall(they can be quite different from 90) and one size "InLeftBottom-InRightBottom"(I need to have real size of this room for later use). I have no info about user's camera(I can read EXIF to get FOV and use constant height but this can be only used as additional info). Is this possible to ask user for less info? Maybe it's possible to get wall angles without user interaction? Or maybe I am completly wrong and should use different approach?

    Read the article

  • Is it possible to get RSA private key knowing public key and set of "original data=>encrypted data"

    - by Riz
    Hi, I work on apllication which allows plugins to access different set of functionality, every plugin provides "initialization string" which sets level of access to different features. Developers send me this strings, and I encrypt them using my 1024 bit RSA private key and send encoded data back. When started, my application decodes encoded data(encoded initialisation string) using built-in public key and if "decoded data != initialization string" it fails to start. So, is it possible to use a database of "initialization string" = "encoded initialization string"(extracted from other plugins) to crack my private key, or make it possible to bruteforce it in reasonable time?

    Read the article

  • Looking for python lib to manage remote tasks

    - by Riz
    Hi, I have server with django on it, this server runs some manage.py commands and update database. Now I need to move some of this tasks to different servers. I don't want to allow remote db access and need some tool\lib to be able to start task on remote servers by main server's command and update tasks code/add new tasks. I have ssh access to every server, all servers run under debian and all code in python. I was thiking about creating my own xmpp based solution(server sends messages to slave servers with commands to execute, like "update task", "run task"), or maybe some low-level ssh based solution where main server logs to slave servers and executes bash commands. But I would be happy to hear any advices.

    Read the article

  • A good extension to JSF that adheres to JSF2.0?

    - by Riz
    Hi, I have been looking for a JSF extension (Richfaces, IceFaces, and more) but all seem to be according to JSF1.x and ones for JSF2.0 are still alpha or in development and most of the documentation assumes you're using JSF1.2. Is there any production well known extension available?

    Read the article

  • Initializing ExportFactory using MEF

    - by Riz
    Scenario Application has multiple parts. Each part is in separate dll and implements interface IFoo All such dlls are present in same directory (plugins) The application can instantiate multiple instances of each part Below is the code snippet for the interfaces, part(export) and the import. The problem I am running into is, the "factories" object is initialized with empty list. However, if I try container.Resolve(typeof(IEnumerable< IFoo )) I do get object with the part. But that doesn't serve my purpose (point 4). Can anyone point what I am doing wrong here? public interface IFoo { string Name { get; } } public interface IFooMeta { string CompType { get; } } Implementation of IFoo in separate Dll [ExportMetadata("CompType", "Foo1")] [Export(typeof(IFoo), RequiredCreationPolicy = CreationPolicy.NonShared))] public class Foo1 : IFoo { public string Name { get { return this.GetType().ToString(); } } } Main application that loads all the parts and instantiate them as needed class PartsManager { [ImportMany] private IEnumerable<ExportFactory<IFoo, IFooMeta>> factories; public PartsManager() { IContainer container = ConstructContainer(); factories = (IEnumerable<ExportFactory<IFoo, IFooMeta>>) container.Resolve(typeof(IEnumerable<ExportFactory<IFoo, IFooMeta>>)); } private static IContainer ConstructContainer() { var catalog = new DirectoryCatalog(@"C:\plugins\"); var builder = new ContainerBuilder(); builder.RegisterComposablePartCatalog(catalog); return builder.Build(); } public IFoo GetPart(string compType) { var matchingFactory = factories.FirstOrDefault( x => x.Metadata.CompType == compType); if (factories == null) { return null; } else { IFoo foo = matchingFactory.CreateExport().Value; return foo; } } }

    Read the article

  • "Microsoft ne défend pas assez les Droits de l'Homme", Google n'apprécie pas que son concurrent rest

    "Microsoft ne défend pas assez les Droits de l'Homme", Google n'apprécie pas que son concurrent reste en Chine La morale businesso-américaine commence à s'intéresser au cas de la Chine. Suite à l'altercation musclée entre Google et le régime en place à Pékin, d'autres entreprises se mettent à considérer l'idée de quitter le pays du riz. La politique chinoise est montrée du doigt dans les discussions mondaines entre les dirigeants des plus grands groupes américains. Fort de son nouveau statut de justicier, Sergey Brin (l'un des co-fondateurs de Google), s'en est pris à Microsoft, accusant la firme de ne pas assez défendre les droits de l'Homme et la liberté d'expression. « J'es...

    Read the article

  • Microsoft et le Stade Toulousain mettent de l'IT dans leurs vêtements, quelles applications imaginez-vous pour ces nouveaux habits ?

    Bientôt de l'IT jusque dans nos vêtements Robe tweeteuse, T-Shirt promotionnel pour club de Rugby : quelles applications imaginez-vous pour ces nouvelles générations d'habits ? En collaboration avec Gordon Fowler « The Printing Dress » est une création de deux designers expérimentées travaillant pour Microsoft Research, Asta Roseway et Sheridan Martin Petit. Réalisée à partir de papier de riz noir et blanc, la robe intègre des boutons rappelant les touches des anciennes machines à écrire, cousus sur le corsage de la robe. Un ordinateur portable, un projecteur et quatre cartes de circuits y sont également intégrés. Bien qu'étant encore un prototyp...

    Read the article

1