any

How do I validate a subset of content in an XML document when it can occur in any order?

Hi, I have a document with a bunch of elements under a single root element which has a few elements I care about, and want to validate; but those elements may occur anywhere in the document. There are also other elements that I don't want to validate; I don't care if they're there or what's in 'em. I tried the obvious thing, an XSD wi...

Declaring element with ANY name in DTD

Hello everyone. Is it possible to declare an element in my DTD which can have ANY name? So far I have learnt that ANY can be used only for the data type as in: <!ELEMENT element-name ANY> Any help will be most appreciated. -- Ali ...

WAIT for "any process" to finish

Is there any built in feature in bash to wait for any process to finish? We use " wait" only for the child processes to finish. I would like to know if there is any way to wait for any process to finish before proceeding in any script. A mechanical way to do this is as follows but I would like to know if there is any built in feature in...

any() function in Python with a callback

The Python standard library defines an any() function that Return True if any element of the iterable is true. If the iterable is empty, return False. It checks only if the elements evaluate to True. What I want it to be able so specify a callback to tell if an element fits the bill like: any([1, 2, 'joe'], lambda e: isinstance(e,...

Hibernate @Any doesn't work with FLEX and BLAZE DS

I have a class using the @Any annotation to store references to arbitrary persistable object ... @Any(metaColumn = @Column(name = "IFT_CD")) @AnyMetaDef(idType = "long", metaType = "long", metaValues = { @MetaValue(targetEntity = Participation.class, value = "101"), @MetaValue(targetEntity =...

sql: trying to select the second biggest element but selects the biggest

we want to have the second biggest element. We first use ANY to exclude the biggest one. Then we use all to select the biggest. However when we run this query, it shows the biggest and not the second one. Why? SELECT * FROM bestelling WHERE totaalprijs > ALL ( SELECT totaalprijs FROM bestelling WHERE totaalprijs < ANY (...

prolog program to find equality of two lists in any order

I wanted to write a prolog program to find equality of two lists, the order of elements doesn't matter. So I wrote following: del( _ , [ ] , [ ] ) . del( X , [ X|T ] , T ). del( X , [ H|T ] , [ H|T1 ] ) :- X \= H , del( X , T , T1 ). member( X, [ X | _ ] ) . member( X, [ _ | T ] ) :- member( X, T ). eq...

how to convert html file i.e. compatible to display within flash..?

I allready developed the standalone flash exe to disaply both the HTML and .swf files using AS3 I have 1000 s of html files that are compatible with flash because only some tags are supported by flash. Is there any tool or common script to convert the flash compatible html. ...

Storing objects in the array

Hello, I want to save boost signals objects in the map (association: signal name → signal object). The signals signature is different, so the second type of map should be boost::any. map<string, any> mSignalAssociation; The question is how to store objects without defining type of new signal signature? typedef boost::signals2::signal...

Boost any usage

Hello, how can I insert my own class objects into ptr_map from boost. The objects are templated so I can't use some static typename in the map. So I did: ptr_map<string, any> someMap; My class inherits the boost::noncopyable. someMap.insert("Test", new MyClass<SomeTemplate>()); The error is: error: no matching function for call to ...

Casting from any

Hello, I'm packing some classes into ptr_map with any typed value. class EventManager { ptr_map<string, any> mSomeMap; public: typedef signals2::signal<void (int someSignature)> KeyEvent; EventManager() { mSomeMap["KeyPressed"] = new any(new KeyEvent()); } }; Now I want to restore my signal objec...

casting pointers

Hello, I'm using ptr_map for storing different types of pointers. boost::ptr_map<string, any> someMap; I store there some templated class objects: someMap.insert("1", new SomeClass<int>()); someMap.insert("2", new SomeClass<float>()); Now I want to get values from map. Here is a sample with references: template<typename T> T &get(...

How can I do bi-directional mapping over @Any annotated property?

In this article http://www.jroller.com/eyallupu/entry/hibernate_the_any_annotation and also in this question http://stackoverflow.com/questions/217831/how-to-use-hibernate-any-related-annotations, how @Any annotation can be used was explained. But how can I get borrows for each DVD/VHS/BOOK? How can I do mapping definition on DVD/VHS/BOO...

How to print boost::any to a stream?

I have a Map std::map<std::string, boost::any>, which comes from the boost::program_options package. Now I would like to print the content of that map: for(po::variables_map::const_iterator it = vm.begin(); it != vm.end(); ++it) { std::cerr << it->first << ": " << it->second << std::endl; } Unfortunately, that is not possible becau...

Any type mapping with different Id types

Hi there, I'm working on an event-planning application for the contacts in a phone book. Avoiding all the public virtual and protected stuff, my Contact class looks like: class Contact { //... Int32 Id { get; private set; } //primary key; String Name { get; private set; } //... } A customer asked me to handle both h...

simplify simple C++ code -- something like Pythons any

Hi, Right now, I have this code: bool isAnyTrue() { for(std::list< boost::shared_ptr<Foo> >::iterator i = mylist.begin(); i != mylist.end(); ++i) { if( (*i)->isTrue() ) return true; } return false; } I have used Boost here and then but I couldn't really remember any simple way to write it somewhat lik...

Preventing NHibernate foreign key creation for <any> mapping

Is there a way from preventing SchemaExport from generating a foreign key constraint on mapping type? I saw a similar question about mapping, but unfortunately that wont do for . I couldn't find answer to this in NHibernate reference, but maybe someone knows a trick? I'd like to avoid removing constraint afterwards. ...

Storing boost function

Hello, I have to store a list of different boost::function objects. To provide this I'm using boost::any. I have a few functions which takes different functions signatures, pack them into any and then insert into special map with given type. Here is the code: enum TypeEnumerator { e_int, e_float, e_double }; typedef map< st...

boost::any, variants, calling functions based on arrays of them.

Given a set of functions, such as: template<class A1> Void Go(A1 a); template<class A1, class A2> Void Go(A1 a1, A2 a2); template<class A1, class A2, class A3> Void Go(A1 a1, A2 a2, A3 a3); Is it possible to take an array of some variant type and given its contents, fire the correct function? My application for this is that I want ...

LinqResult.Any() Resulting In NullReferenceException

What could be causing this error: NullReferenceException was unhanded, Object reference not set to an instance of an object. var LinqResult = from a in Db.Table select new {Table = a}; if(LinqResult.Any()) { //Blah blah blah } ...