Search Results

Search found 11381 results on 456 pages for 'intellectual property'.

Page 14/456 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • How do I use SPMemember.ID property to get User or Group

    - by Jason
    I have to write a utility to enumerate and manage the owners of groups within a SharePoint site. I know I can use the Groups property of the SPWeb object to retrieve a collection of groups. And I know I can use the Owner property of the group to get back the owner. My problem is that I do not know what to do next. The SPGroup.Owner property returns a SPMember object. The member object has one property called ID that returns the unique ID (an integer) of the member. What I cannot seem to find information on is how to use that integer value to determine if the member is a User or a Group and how to get back additional details (say the name). Any ideas? Thanks.

    Read the article

  • Protecting IP for scripting projects

    - by Francisco Garcia
    There are some tasks where the obvious language choice is with scripting languages: bash, Python, Ruby, Tcl... however I find it hard to protect a company IP once the product is delivered because the application is never compiled. The client will have complete access to every single line of code. Which one are the choices to protect a product IP when it is best implemented with scripting languages? (switching to a compiled language such as C++ should not be an option) I know that some interpreted languages can be compiled, but there are cases where the process can be inverted

    Read the article

  • ANT antcall a target that defines a property

    - by alem0lars
    In ANT I want to define a target (called A) that define a property and antcall it from another target (called B). I want that the target B, after antcalling the target A, can access to the property defined in the target A. For example: <target name="B"> <antcall target="A" inheritAll="true" inheritRefs="true" /> <echo>${myprop}</echo> </target> <target name="A"> <property name="myprop" value="myvalue" /> </target> However it doesn't work and <echo>${myprop}</echo> doesn't print myvalue (I think because the property myprop isn't defined in B). Is there any way to do that? Thanks..

    Read the article

  • Check checkbox checked property using jQuery

    - by Prasad
    I need to check the checked property of a checkbox and perform an action based on the checked property using jQuery. For example, if the age checkbox is checked, then I need to show a textbox to enter age, else hide the textbox. But the following code returns false by default: if($('#isAgeSelected').attr('checked')) { $("#txtAge").show(); } else { $("#txtAge").hide(); } How do I successfully query the checked property?

    Read the article

  • Manager property is not available for Full Text Search (SharePoint 2010)

    - by Vijay
    Hi, I had created a web part on MOSS 2007 which displays a organizational chart by searching (Full Text) the user profiles. To identify the subordinates of a user, I used to search for users with the particular user in Manager property. The query looked like this: SELECT AccountName, PreferredName, Manager, WorkEmail FROM scope() WHERE ("SCOPE" = 'People') AND Manager = 'domain\parent_user' But, the same query does not run in SharePoint 2010 as Manager crawled property does not exists. So, I created a new crawled property and mapped it to People:Manager(Text) now, the Manager property is always empty. Even a full crawl after clearing the indexes also not helping. Can anyone please help me in getting manager information in Full Text Search? Thanks in advance!

    Read the article

  • Modifying the Label Property(text and font) by a custom ComboBox

    - by BDotA
    I have created a custom combobox that has a LABEL property so when we drop it on a form, we can say the Label associated with this ComboBox is say Label2 this is what I wrote for its label property. The whole thing I want to do is that when I am assigning the Label property of my custom ComboBox to one of the labels on the form, I want that label to change its font to bold and also add an "*" to its Test property. thats it ... but it does not work! any ideas? private Label assignedLabelName; public Label AssignedLabelName { get { return assignedLabelName; } set { assignedLabelName = value; assignedLabelName.Text = "*" + assignedLabelName.Text; assignedLabelName.Font = new Font(AssignedLabelName.Font, FontStyle.Bold); } }

    Read the article

  • XAML Binding to property

    - by imslavko
    I have check box in my XAML+C# Windows Store application. Also I have bool property: WindowsStoreTestApp.SessionData.RememberUser which is public and static. I want check box's property IsChecked to be consistent (or binded, or mapped) to this bool property. I tried this: XAML <CheckBox x:Name="chbRemember1" IsChecked="{Binding Mode=TwoWay}"/> C# chbRemember1.DataContext = SessionData.RememberUser; Code for property: namespace WindowsStoreTestApp { public class SessionData { public static bool RememberUser { get; set; } } } But it doesn't seem to work. Can you help me?

    Read the article

  • Get a property value with only the object and the name of the property (but not the type)

    - by Vaccano
    Suppose I have a method that passes in the name of a property (as a string) and the object that the property is on (as object). How could I get the value of the property? Here is some code to make it a bit more concrete: protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight) { // The next line is made up code var currentValue = source.Current.CoolMethodToTakePropertyNameAndReturnValue(MappingName); // Paint out the retrieved value g.DrawString(currentValue.ToString() , _gridFont, new SolidBrush(Color.Black), bounds.Left + 1, bounds.Top); } MappingName is the name of the property I want to get the value for. What I need is CoolMethodToTakePropertyNameAndReturnValue. Any ideas? I am running on the Compact Framework. I would also prefer to avoid reflection (but if that is my only recourse then so be it). Thanks for any help.

    Read the article

  • Use QuickCheck by generating primes

    - by Dan
    Background For fun, I'm trying to write a property for quick-check that can test the basic idea behind cryptography with RSA. Choose two distinct primes, p and q. Let N = p*q e is some number relatively prime to (p-1)(q-1) (in practice, e is usually 3 for fast encoding) d is the modular inverse of e modulo (p-1)(q-1) For all x such that 1 < x < N, it is always true that (x^e)^d = x modulo N In other words, x is the "message", raising it to the eth power mod N is the act of "encoding" the message, and raising the encoded message to the dth power mod N is the act of "decoding" it. (The property is also trivially true for x = 1, a case which is its own encryption) Code Here are the methods I have coded up so far: import Test.QuickCheck -- modular exponentiation modExp :: Integral a => a -> a -> a -> a modExp y z n = modExp' (y `mod` n) z `mod` n where modExp' y z | z == 0 = 1 | even z = modExp (y*y) (z `div` 2) n | odd z = (modExp (y*y) (z `div` 2) n) * y -- relatively prime rPrime :: Integral a => a -> a -> Bool rPrime a b = gcd a b == 1 -- multiplicative inverse (modular) mInverse :: Integral a => a -> a -> a mInverse 1 _ = 1 mInverse x y = (n * y + 1) `div` x where n = x - mInverse (y `mod` x) x -- just a quick way to test for primality n `divides` x = x `mod` n == 0 primes = 2:filter isPrime [3..] isPrime x = null . filter (`divides` x) $ takeWhile (\y -> y*y <= x) primes -- the property prop_rsa (p,q,x) = isPrime p && isPrime q && p /= q && x > 1 && x < n && rPrime e t ==> x == (x `powModN` e) `powModN` d where e = 3 n = p*q t = (p-1)*(q-1) d = mInverse e t a `powModN` b = modExp a b n (Thanks, google and random blog, for the implementation of modular multiplicative inverse) Question The problem should be obvious: there are way too many conditions on the property to make it at all usable. Trying to invoke quickCheck prop_rsa in ghci made my terminal hang. So I've poked around the QuickCheck manual a bit, and it says: Properties may take the form forAll <generator> $ \<pattern> -> <property> How do I make a <generator> for prime numbers? Or with the other constraints, so that quickCheck doesn't have to sift through a bunch of failed conditions? Any other general advice (especially regarding QuickCheck) is welcome.

    Read the article

  • PHP object access using string

    - by Rob Waring
    Hi all, I have an object in PHP with some very odd property names. I just need to know how to access a property when it's name is "//www.w3.org/1999/02/22-rdf-syntax-ns#type". I found something that suggested $object->{'//www.w3.org/1999/02/22-rdf-syntax-ns#type'}; but that doesn't seem to work. Thanks in advance Rob

    Read the article

  • How to @synthesize a C-Style array of pointers?

    - by Peter Hajas
    I have a property defined in a class like so: @interface myClass UIImageView *drawImage[4]; ... @property (nonatomic, retain) UIImageView **drawImage; ... @synthesize drawImage; // This fails to compile I have found similar questions on StackOverflow and elsewhere, but none that really address this issue. What is the most Objective-C kosher way to do this?

    Read the article

  • Using properties in web.xml

    - by Pich
    Hi, I would like to control the settings in web.xml and using different once for different environments. Is it possible to use a property, from a property file on classpath, in web.xml? Something like this: <context-param> <param-name>myparam</param-name> <param-value>classpath:mypropertyfile.properties['myproperty']</param-value> </context-param> Best regards P

    Read the article

  • How to test an iPhone application update?

    - by sfkaos
    I already have an iPhone application (version 1.0) available in the App Store and am ready to submit a newer version (version 1.1). How do I test the new upgrade to make sure that the current sqlite database and property list files on the earlier version do not get deleted/overwritten etc? The new version assumes the old data in both the sqlite database and property lists remain. Or better yet, is there a resource I can use to walk me through what to watch for when developing an application update?

    Read the article

  • Hibernate session problem for transactions.

    - by Jani
    Hi all, I am new to hibernate and trying integrate hibernate with an existing spring based application. I configured session factory and transaction manager, transaction proxy template. I am also using Quartz scheduler in this application. When I run the application, I am getting the following exception. ERROR au.com.michaelpage.ctsgui.utils.OrganisationMergeProfileThread - Error while updating opportunity: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.jdbc.datasource.ConnectionHolder@9f6885] for key [weblogic.jdbc.common.internal.RmiDataSource@32b034] bound to thread [DefaultQuartzScheduler_Worker-0] My hibernate session configuration: <bean id="sessionFactoryAU" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="profileAU" /> </property> <property name="mappingResources"> <list> <value> /au/com/michaelpage/ctsgui/hibernate/dao/mappings/Opportunity.hbm.xml </value> <value> /au/com/michaelpage/ctsgui/hibernate/dao/mappings/Position.hbm.xml </value> <value> /au/com/michaelpage/ctsgui/hibernate/dao/mappings/EventRole.hbm.xml </value> </list> </property> <property name="hibernateProperties"> <props> <!-- Database Settings --> <prop key="hibernate.dialect"> org.hibernate.dialect.SybaseDialect </prop> <prop key="hibernate.query.factory_class"> org.hibernate.hql.ast.ASTQueryTranslatorFactory </prop> <!-- Cache settings --> <prop key="hibernate.cache.provider_class"> org.hibernate.cache.EhCacheProvider </prop> </props> </property> </bean> <!-- Transaction manager for a Hibernate SessionFactory --> <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref bean="sessionFactoryAU" /> </property> </bean> <!-- Transaction template for Managers --> <bean id="txProxyTemplateHibernateProfileAU" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="txManager" /> </property> <property name="transactionAttributes"> <props> <prop key="create*">PROPAGATION_REQUIRED</prop> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="update*">PROPAGATION_REQUIRED</prop> <prop key="delete*">PROPAGATION_REQUIRED</prop> <prop key="remove*">PROPAGATION_REQUIRED</prop> <prop key="get*">PROPAGATION_SUPPORTS</prop> </props> </property> </bean> <bean id="organisationMergeProfileMgrAU" parent="txProxyTemplateHibernateProfileAU"> <property name="target"> <bean class="au.com.michaelpage.ctsgui.mgr.profile.OrganisationMergeProfileMgrImpl"> <property name="commonProfileDao"> <ref bean="commonProfileDaoAU" /> </property> <property name="organisationMergeProfileDao"> <ref bean="organisationMergeDaoAU" /> </property> <property name="hibernateOrganisationDAO"> <ref bean="hibernateOrganisationDAOAU" /> </property> <property name="hibernateOpportunityDAO"> <ref bean="hibernateOpportunityDAOAU" /> </property> <property name="hibernatePositionDAO"> <ref bean="hibernatePositionDAOAU" /> </property> <property name="hibernateEventRoleDAO"> <ref bean="hibernateEventRoleDAOAU" /> </property> </bean> </property> </bean> My Quartz scheduler configuration: <bean id="organisationMergeJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="organisationMergeJob" /> <property name="targetMethod" value="execute" /> <property name="concurrent" value="false" /> </bean> <bean id="organisationMergeProfileRegularCheckerTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean"> <property name="jobDetail" ref="organisationMergeJobDetail" /> <property name="repeatInterval"> <util:constant static-field="au.com.michaelpage.ctsgui.common.Constants.CHECK_FREQUENCY" /> </property> </bean> Here is the bean definition for 'organisationMergeJob' <bean id="organisationMergeJob" class="au.com.michaelpage.ctsgui.utils.OrganisationMergeProfileThread"> <property name="organisationMergeMgr" ref="organisationMergeMgr"/> </bean> <bean id="organisationMergeMgr" class="au.com.michaelpage.ctsgui.mgr.OrganisationMergeMgrImpl"> <property name="organisationMergeDao" ref="organisationMergeDao"/> </bean> Any help to solve this? Thank you in advance. Hi skaffman, Here is the stack trace of the error: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.jdbc.datasource.ConnectionHolder@5f2fb8] for key [weblogic.jdbc.common.internal.RmiDataSource@326b7b] bound to thread [DefaultQuartzScheduler_Worker-3] Caused by: java.lang.IllegalStateException: Already value [org.springframework.jdbc.datasource.ConnectionHolder@5f2fb8] for key [weblogic.jdbc.common.internal.RmiDataSource@326b7b] bound to thread [DefaultQuartzScheduler_Worker-3] at org.springframework.transaction.support.TransactionSynchronizationManager.bindResource(TransactionSynchronizationManager.java:163) at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:526) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy73.updateEventRole(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy73.updateEventRole(Unknown Source) at au.com.michaelpage.ctsgui.utils.OrganisationMergeProfileThread.execute(OrganisationMergeProfileThread.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283) at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:272) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86) at org.quartz.core.JobRunShell.run(JobRunShell.java:203) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) Thank you. Here is the bean definition for 'organisationMergeMgr' <bean id="organisationMergeMgr" class="au.com.michaelpage.ctsgui.mgr.OrganisationMergeMgrImpl"> <property name="organisationMergeDao" ref="organisationMergeDao"/> </bean>

    Read the article

  • Looking for issue tracker software for residential property management

    - by Rob
    This question is about a computer software (as per SU guidelines) application for centrally tracking issues concerning the management of a residental block of flats (apartments as they say in the US and France). Issues are incidents - and their resultant unplanned maintenance to address them, also planned one-off maintenance and also regular planned routine maintenance. I live in a block of flats (apartments), and along with other residents, are looking to more closely watch over issues with the communal, shared areas of the premises (corridors, courtyards, stairs, lifts, lights, trash/bin shed, bike stands, parking areas etc) and their maintenance, currently done by a property management company. Our own homes are our own affair internally, its the outside communal areas that I have the interest. The aim being to control costs and possibly reduce them, by proactively managing the property using historical data to predict issues and also to scrutinise maintenance charges against such data to ensure that the costs are as expected. Trending could also be established whereby recurrences of things can be detected and pre-empted to reduce costs. As a software professional, I'm aware of Bugzilla, eventum being free tools for software - which could be customised to fit this application, but wondered if there was something more appropriate. It might be useful for such software to be on a web server, with secure access, so that residents can log in and view the issues.

    Read the article

  • Synchronizing the SamAccountName Property using Windows Azure Active Directory Sync Tool

    - by pk.
    Using this official documentation as a guide, I would expect the SamAccountName property to sync from my on-premise AD to Office 365. I think that it used to do exactly that, but now it seems that it doesn't so much sync the attribute as it does create an entirely new, unlinked value and store it in Office 365. This has caused some minor issues for me (broken scripts, annoying permissions management, etc.) and may be part of a more major issue regarding ADFS authentication. On-Premise PS C:\Windows\system32> Get-ADUser jdoe -Properties SamAccountName | fl SamAccountName SamAccountName : jdoe Office 365 Sync'ed Objects PS C:\Windows\system32> Get-Mailbox jdoe | fl SamAccountName SamAccountName : $1A7H20-K1LCOJFFBHGS I understand how to work around this issue in my scripts -- there exists the ImmutableId property which can be mapped back to the on-premise GUID. As far as the issue I'm having with ADFS, I'm less certain how to proceed and if this is causing my issues. At this point I really would just like some verification that I'm not crazy and that this used to be sync'ed at some point in the past and that Office 365 broke it relatively recently. I also think that MS documentation should perhaps be updated to exclude SamAccountName from the list of synchronized properties on the page I linked.

    Read the article

  • Series of abstract classes and NHibernate

    - by Chris Cowdery-Corvan
    Hello, and first off thanks for your time to look at this. For a research project I'm working on, I have a somewhat complex design (which I've been given) to persist to a database via NHibernate. Here's an example of the class hierarchy: TransitStrategy, TransportationCompany and TransportationLocation are all abstract classes. The XML configuration I have is presently: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Vacationizer" namespace="Vacationizer.Domain.Transit"> <class name="TransitStrategy"> <id name="TransitStrategyId"> <generator class="guid" /> </id> <property name="Restrictions" /> <joined-subclass name="Flight" table="Flight_TransitStrategy"> <key column="TransitStrategyId" /> <property name="DepartingAirport" /> <property name="ArrivingAirport" /> <property name="Airline" /> <property name="FlightNumber" /> <property name="FlightArrivalTime" /> <property name="FlightDepartureTime" /> </joined-subclass> <joined-subclass name="RentalCar" table="RentalCar_TransitStrategy"> <key column="TransitStrategyId" /> <property name="RentalCarBranch" /> <property name="CarMake" /> <property name="CarModel" /> <property name="CarYear" /> <property name="CarColor" /> <property name="RentalBegins" /> <property name="RentalEnds" /> </joined-subclass> </class> <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Vacationizer" namespace="Vacationizer.Domain.Transit"> <class name="TransportationCompany"> <id name="TransportationCompanyId"> <generator class="guid" /> </id> <property name="Name" /> <property name="Reviews" /> <property name="Website" /> <property name="Photo" /> <joined-subclass name="Airline" table="Airline_TransportationCompany"> <key column="TransportationLocationId" /> </joined-subclass> <joined-subclass name="RentalCarAgency" table="RentalCarAgency_TransportationCompany"> <key column="TransportationLocationId" /> </joined-subclass> </class> <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Vacationizer" namespace="Vacationizer.Domain.Transit"> <class name="TransportationLocation"> <id name="TransportationLocationId"> <generator class="guid" /> </id> <property name="Name" /> <property name="Image" /> <property name="Geolocation" /> <property name="Reviews" /> <!-- <property name="HoursOpen" />--> <property name="PhoneNumber" /> <property name="FaxNumber" /> <joined-subclass name="Airport" table="Airport_TransportationLocation"> <key column="TransportationLocationId" /> <property name="AirportCode" /> <property name="Website" /> </joined-subclass> <joined-subclass name="RentalCarBranch" table="RentalCarBranch_TransportationLocation"> <key column="TransitStrategyId" /> <property name="Agency" /> </joined-subclass> </class> However, whenever I try to use this schema I get this error/stack trace: ------ Test started: Assembly: Vacationizer.Tests.dll ------ TestCase 'M:Vacationizer.Tests.VacationRepository_Fixture.TestFixtureSetUp' failed: Could not compile the mapping document: Vacationizer.Mappings.TransitStrategy.hbm.xml NHibernate.MappingException: Could not compile the mapping document: Vacationizer.Mappings.TransitStrategy.hbm.xml ---> NHibernate.MappingException: Problem trying to set property type by reflection ---> NHibernate.MappingException: class Vacationizer.Domain.Transit.RentalCar, Vacationizer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null not found while looking for property: RentalCarBranch ---> NHibernate.PropertyNotFoundException: Could not find a getter for property 'RentalCarBranch' in class 'Vacationizer.Domain.Transit.RentalCar' at NHibernate.Properties.BasicPropertyAccessor.GetGetter(Type type, String propertyName) at NHibernate.Util.ReflectHelper.ReflectedPropertyClass(String className, String name, String accessorName) --- End of inner exception stack trace --- at NHibernate.Util.ReflectHelper.ReflectedPropertyClass(String className, String name, String accessorName) at NHibernate.Mapping.SimpleValue.SetTypeUsingReflection(String className, String propertyName, String accesorName) --- End of inner exception stack trace --- at NHibernate.Mapping.SimpleValue.SetTypeUsingReflection(String className, String propertyName, String accesorName) at NHibernate.Cfg.XmlHbmBinding.ClassBinder.CreateProperty(IValue value, String propertyName, String className, XmlNode subnode, IDictionary`2 inheritedMetas) at NHibernate.Cfg.XmlHbmBinding.ClassBinder.PropertiesFromXML(XmlNode node, PersistentClass model, IDictionary`2 inheritedMetas, UniqueKey uniqueKey, Boolean mutable, Boolean nullable, Boolean naturalId) at NHibernate.Cfg.XmlHbmBinding.JoinedSubclassBinder.HandleJoinedSubclass(PersistentClass model, XmlNode subnode, IDictionary`2 inheritedMetas) at NHibernate.Cfg.XmlHbmBinding.ClassBinder.PropertiesFromXML(XmlNode node, PersistentClass model, IDictionary`2 inheritedMetas, UniqueKey uniqueKey, Boolean mutable, Boolean nullable, Boolean naturalId) at NHibernate.Cfg.XmlHbmBinding.RootClassBinder.Bind(XmlNode node, HbmClass classSchema, IDictionary`2 inheritedMetas) at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.AddRootClasses(XmlNode parentNode, IDictionary`2 inheritedMetas) at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.Bind(XmlNode node) at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) --- End of inner exception stack trace --- at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception) at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) at NHibernate.Cfg.Configuration.ProcessMappingsQueue() at NHibernate.Cfg.Configuration.AddDocumentThroughQueue(NamedXmlDocument document) at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader, String name) at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name) at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly) at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly) at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName) at NHibernate.Cfg.Configuration.DoConfigure(IHibernateConfiguration hc) at NHibernate.Cfg.Configuration.Configure() VacationRepository_Fixture.cs(24,0): at Vacationizer.Tests.VacationRepository_Fixture.TestFixtureSetUp() 0 passed, 1 failed, 0 skipped, took 8.38 seconds (Ad hoc). Any ideas on how I can implement this differently? Thanks very much!

    Read the article

  • NHibernate, could not load an entity when column exists in the database.

    - by Eitan
    This is probably a simple question to answer but I just can't figure it out. I have a "Company" class with a many-to-one to "Address" which has a many to one to a composite id in "City". When I load a "Company" it loads the "Address", but if I call any property of "Address" I get the error: {"could not load an entity: [IDI.Domain.Entities.Address#2213][SQL: SELECT address0_.AddressId as AddressId13_0_, address0_.Street as Street13_0_, address0_.floor as floor13_0_, address0_.room as room13_0_, address0_.postalcode as postalcode13_0_, address0_.CountryCode as CountryC6_13_0_, address0_.CityName as CityName13_0_ FROM Address address0_ WHERE address0_.AddressId=?]"} The inner exception is: {"Invalid column name 'CountryCode'.\r\nInvalid column name 'CityName'."} What I don't understand is that I can run the query in sql server 2005 and it works, furthermore both those columns exist in the address table. Here are my HBMs: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="IDI.Domain" namespace="IDI.Domain.Entities" > <class name="IDI.Domain.Entities.Company,IDI.Domain" table="Companies"> <id column="CompanyId" name="CompanyId" unsaved-value="0"> <generator class="native"></generator> </id> <property column="Name" name="Name" not-null="true" type="String"></property> <property column="NameEng" name="NameEng" not-null="false" type="String"></property> <property column="Description" name="Description" not-null="false" type="String"></property> <property column="DescriptionEng" name="DescriptionEng" not-null="false" type="String"></property> <many-to-one name="Address" column="AddressId" not-null="false" cascade="save-update" class="IDI.Domain.Entities.Address,IDI.Domain"></many-to-one> <property column="Telephone" name="Telephone" not-null="false" type="String"></property> <property column="TelephoneTwo" name="TelephoneTwo" not-null="false" type="String"></property> <property column="Fax" name="Fax" not-null="false" type="String"></property> <property column="ContactMan" name="ContactMan" not-null="false" type="String"></property> <property column="ContactManEng" name="ContactManEng" not-null="false" type="String"></property> <property column="Email" name="Email" not-null="false" type="String"></property> </class> </hibernate-mapping> <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="IDI.Domain" namespace="IDI.Domain.Entities" > <class name="IDI.Domain.Entities.Address,IDI.Domain" table="Address"> <id name="AddressId" column="AddressId" type="Int32"> <generator class="native"></generator> </id> <property name="Street" column="Street" not-null="false" type="String"></property> <property name="Floor" column="floor" not-null="false" type="Int32"></property> <property name="Room" column="room" not-null="false" type="Int32"></property> <property name="PostalCode" column="postalcode" not-null="false" type="string"></property> <many-to-one class="IDI.Domain.Entities.City,IDI.Domain" name="City" update="false" insert="false"> <column name="CountryCode" sql-type="String" ></column> <column name="CityName" sql-type="String"></column> </many-to-one> </class> </hibernate-mapping> <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="IDI.Domain" namespace="IDI.Domain.Entities" > <class name="IDI.Domain.Entities.City,IDI.Domain" table="Cities"> <composite-id> <key-many-to-one class="IDI.Domain.Entities.Country,IDI.Domain" name="CountryCode" column="CountryCode"> </key-many-to-one> <key-property name="Name" column="Name" type="string"></key-property> </composite-id> </class> </hibernate-mapping> Here is my code that calls the Company: IList<BursaUser> user; if(String.IsNullOrEmpty(email) && String.IsNullOrEmpty(company)) return null; ICriteria criteria = Session.CreateCriteria(typeof (BursaUser), "user").CreateCriteria("Company", "comp"); if(String.IsNullOrEmpty(email) || String.IsNullOrEmpty(company) ) { user = String.IsNullOrEmpty(email) ? criteria.Add(Expression.Eq("comp.Name", company)).List<BursaUser>() : criteria.Add(Expression.Eq("user.Email", email)).List<BursaUser>(); } And finally here is where i get the error: "user" was already initialized with the code above: if (user.Company.Address.City == null) user.Company.Address.City = new City(); Thanks.

    Read the article

  • SortList duplicated key, but it shouldn't

    - by Luca
    I have a class which implements IList interface. I requires a "sorted view" of this list, but without modifying it (I cannot sort directly the IList class). These view shall be updated when the original list is modified, keeping items sorted. So, I've introduced a SortList creation method which create a SortList which has a comparer for the specific object contained in the original list. Here is the snippet of code: public class MyList<T> : ICollection, IList<T> { ... public SortedList CreateSortView(string property) { try { Lock(); SortListView sortView; if (mSortListViews.ContainsKey(property) == false) { // Create sorted view sortView = new SortListView(property, Count); mSortListViews.Add(property, sortView); foreach (T item in Items) sortView.Add(item); } else sortView = mSortListViews[property]; sortView.ReferenceCount++; return (sortView); } finally { Unlock(); } } public void DeleteSortView(string property) { try { Lock(); // Unreference sorted view mSortListViews[property].ReferenceCount--; // Remove sorted view if (mSortListViews[property].ReferenceCount == 0) mSortListViews.Remove(property); } finally { Unlock(); } } protected class SortListView : SortedList { /// <summary> /// /// </summary> /// <param name="property"></param> /// <param name="capacity"></param> public SortListView(string property, int capacity) : base(new GenericPropertyComparer(typeof(T).GetProperty(property, BindingFlags.Instance | BindingFlags.Public)), capacity) { } /// <summary> /// Reference count. /// </summary> public int ReferenceCount = 0; /// <summary> /// /// </summary> /// <param name="item"></param> public void Add(T item) { Add(item, item); } /// <summary> /// /// </summary> /// <param name="item"></param> public void Remove(T item) { // Base implementation base.Remove(item); } /// <summary> /// Compare object on a generic property. /// </summary> class GenericPropertyComparer : IComparer { #region Constructors /// <summary> /// Construct a GenericPropertyComparer specifying the property to compare. /// </summary> /// <param name="property"> /// A <see cref="PropertyInfo"/> which specify the property to be compared. /// </param> /// <remarks> /// The <paramref name="property"/> parameter imply that the compared objects have the specified property. The property /// must be readable, and its type must implement the IComparable interface. /// </remarks> public GenericPropertyComparer(PropertyInfo property) { if (property == null) throw new ArgumentException("property doesn't specify a valid property"); if (property.CanRead == false) throw new ArgumentException("property specify a write-only property"); if (property.PropertyType.GetInterface("IComparable") == null) throw new ArgumentException("property type doesn't IComparable"); mSortingProperty = property; } #endregion #region IComparer Implementation public int Compare(object x, object y) { IComparable propX = (IComparable)mSortingProperty.GetValue(x, null); IComparable propY = (IComparable)mSortingProperty.GetValue(y, null); return (propX.CompareTo(propY)); } /// <summary> /// Sorting property. /// </summary> private PropertyInfo mSortingProperty = null; #endregion } } /// <summary> /// Sorted views of this ReactList. /// </summary> private Dictionary<string, SortListView> mSortListViews = new Dictionary<string, SortListView>(); } Practically, class users request to create a SortListView specifying the name of property which determine the sorting, and using the reflection each SortListView defined a IComparer which keep sorted the items. Whenever an item is added or removed from the original list, every created SortListView will be updated with the same operation. This seems good at first chance, but it creates me problems since it give me the following exception when adding items to the SortList: System.ArgumentException: Item has already been added. Key in dictionary: 'PowerShell_ISE [C:\Windows\sysWOW64\WindowsPowerShell\v1.0\PowerShell_ISE.exe]' Key being added: 'PowerShell_ISE [C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe]' As you can see from the exception message, thrown by SortedListView.Add(object), the string representation of the key (the list item object) is different (note the path of the executable). Why SortList give me that exception? To solve this I tried to implement a GetHashCode implementation for the underlying object, but without success: public override int GetHashCode() { return ( base.GetHashCode() ^ mApplicationName.GetHashCode() ^ mApplicationPath.GetHashCode() ^ mCommandLine.GetHashCode() ^ mWorkingDirectory.GetHashCode() ); }

    Read the article

  • Error in loading component property (Swing GUI Forms)

    - by Christo Du Preez
    For no apparent reason all my Swing GUI forms using components linked to org.jdesktop.beansbinding.Converter started generating errors when trying to open the Design View: Error Error in loading component property: [JPanel]-filterTextField-converter. Cannot load property type class org.jdesktop.beansbinding.Converter. The property cannot be loaded. Errors occurred in loading... I'm currently using Netbeans 6.8. I opened my project in Netbeans 6.7.1 and all was fine but after a while the same thing happened. Looking at the .form and .java files and comparing it to previous backups, everything looks fine. Even my Netbeans tutorial project no longer works. What can cause this. Any suggestions would greatly be appreciated. After further investigation this is taken from my IDE's log : INFO: msg org.openide.ErrorManager$AnnException: msg at org.openide.ErrorManager$AnnException.findOrCreate(ErrorManager.java:867) at org.openide.ErrorManager$DelegatingErrorManager.annotate(ErrorManager.java:650) at org.netbeans.modules.form.GandalfPersistenceManager.annotateException(GandalfPersistenceManager.java:230) at org.netbeans.modules.form.GandalfPersistenceManager.annotateException(GandalfPersistenceManager.java:240) at org.netbeans.modules.form.GandalfPersistenceManager.getPropertyType(GandalfPersistenceManager.java:2362) at org.netbeans.modules.form.GandalfPersistenceManager.loadProperty(GandalfPersistenceManager.java:2041) at org.netbeans.modules.form.GandalfPersistenceManager.loadBindingProperties(GandalfPersistenceManager.java:2627) at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:900) at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:845) at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:979) at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:845) at org.netbeans.modules.form.GandalfPersistenceManager.loadNonVisuals(GandalfPersistenceManager.java:695) at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:529) at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:290) at org.netbeans.modules.form.FormEditor$3.run(FormEditor.java:339) at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:287) at org.openide.util.Mutex.doEventAccess(Mutex.java:1355) at org.openide.util.Mutex.readAccess(Mutex.java:317) at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:272) at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:337) at org.netbeans.modules.form.FormEditor.loadForm(FormEditor.java:266) at org.netbeans.modules.form.FormEditorSupport.loadForm(FormEditorSupport.java:306) at org.netbeans.modules.form.FormEditorSupport$3.run(FormEditorSupport.java:457) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:125) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: java.lang.ClassNotFoundException: Will not load class org.jdesktop.beansbinding.Converter arbitrarily from one of ModuleCL@738d08[org.jdesktop.beansbinding] and ModuleCL@167e3a5[javax.beans.binding] starting from SystemClassLoader[556 modules]; see http://wiki.netbeans.org/DevFaqModuleCCE at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:241) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:83) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:95) at org.netbeans.modules.form.FormUtils.loadClass(FormUtils.java:1445) at org.netbeans.modules.form.PersistenceObjectRegistry.loadClass(PersistenceObjectRegistry.java:95) at org.netbeans.modules.form.GandalfPersistenceManager.getClassFromString(GandalfPersistenceManager.java:5516) at org.netbeans.modules.form.GandalfPersistenceManager.getPropertyType(GandalfPersistenceManager.java:2348) ... 27 more msg Error in loading component property: Other Components-mainPanel-jTextField1-converter Cannot load property type class org.jdesktop.beansbinding.Converter. The property cannot be loaded. Can someone please help me with this issue. This is still not resolved and not being able to edit my Forms or loosing binding properties every time I need to edit a Form is a real pain and time consuming! Any help would greatly be appreciated. Thanx.

    Read the article

  • Make @JsonTypeInfo property optional

    - by Mark Peters
    I'm using @JsonTypeInfo to instruct Jackson to look in the @class property for concrete type information. However, sometimes I don't want to have to specify @class, particularly when the subtype can be inferred given the context. What's the best way to do that? Here's an example of the JSON: { "owner": {"name":"Dave"}, "residents":[ {"@class":"jacksonquestion.Dog","breed":"Greyhound"}, {"@class":"jacksonquestion.Human","name":"Cheryl"}, {"@class":"jacksonquestion.Human","name":"Timothy"} ] } and I'm trying to deserialize them into these classes (all in jacksonquestion.*): public class Household { private Human owner; private List<Animal> residents; public Human getOwner() { return owner; } public void setOwner(Human owner) { this.owner = owner; } public List<Animal> getResidents() { return residents; } public void setResidents(List<Animal> residents) { this.residents = residents; } } public class Animal {} public class Dog extends Animal { private String breed; public String getBreed() { return breed; } public void setBreed(String breed) { this.breed = breed; } } public class Human extends Animal { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } using this config: @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class") private static class AnimalMixin { } //... ObjectMapper objectMapper = new ObjectMapper(); objectMapper.getDeserializationConfig().addMixInAnnotations(Animal.class, AnimalMixin.class); Household household = objectMapper.readValue(json, Household.class); System.out.println(household); As you can see, the owner is declared as a Human, not an Animal, so I want to be able to omit @class and have Jackson infer the type as it normally would. When I run this though, I get org.codehaus.jackson.map.JsonMappingException: Unexpected token (END_OBJECT), expected FIELD_NAME: missing property '@class' that is to contain type id (for class jacksonquestion.Human) Since "owner" doesn't specify @class. Any ideas? One initial thought I had was to use @JsonTypeInfo on the property rather than the type. However, this cannot be leveraged to annotate the element type of a list.

    Read the article

  • Can't use attached property on combobox inside hierarchical datatemplate WPF

    - by jesse_t_r
    I'm hoping to use an attached property to assign a command to the selection changed event of a combobox that is embedded inside a treeview. I'm attempting to set the attached property inside the hierchical data template for the tree but the command is not set and does not fire when the item in the combobox is changed. I've found that setting the attached property directly on a combobox outside of a datatemplate works fine; here is how I'm trying to set the property in the template: <HierarchicalDataTemplate x:Key="template1" ItemsSource="{Binding Path=ChildColumns}"> <Border Background="{StaticResource TreeItem_Background}" BorderBrush="Blue" BorderThickness="2" CornerRadius="5" Margin="2,5,5,2" HorizontalAlignment="Left" > <Grid> <Grid.ColumnDefinitions > <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <TextBlock MinWidth="80" HorizontalAlignment="Left" Grid.Column="0" Margin="5,2,2,2" Grid.Row ="0" Text="{Binding Path=ColName}"/> <ComboBox Name="cboColType" Grid.Column="1" HorizontalAlignment="Right" ItemsSource="{Binding Source={StaticResource dataFromEnum}}" SelectedItem="{Binding Path=ColumnType}" Margin="2,2,2,2" local:ItemSelectedBehavior.ItemSelected="{Binding Path=LoadConfigCommand}" /> </Grid> </Border> </HierarchicalDataTemplate> I also tried creating a style <Style x:Key="childItemStyle" TargetType="{x:Type FrameworkElement}"> <Setter Property="local:ItemSelectedBehavior.ItemSelected" Value="{Binding Path=LoadConfigCommand}" /> </Style> and setting the itemcontainerstyle to the style in the hierarchical datatemplate..still no luck .. <HierarchicalDataTemplate> ... <ComboBox Name="cboColType" Grid.Column="1" HorizontalAlignment="Right" ItemsSource="{Binding Source={StaticResource dataFromEnum}}" SelectedItem="{Binding Path=ColumnType}" Margin="2,2,2,2" ItemContainerStyle={StaticeResource childItemStyle}" /> ... </HierarchicalDataTemplate> I'm still learning a lot about WPF so I'm assuming there is something particular about the hierchical datatemplate that is not allowing the attache dproperty to be set..I have found similar posts in the forums and tried to implement their solutions as above, but after a day of searching and experimenting wiht no luck I'm hoping some one has an idea about this...

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >