Create a powerful dictionary [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I want to creat a class or something in order to store different kinds of information, like string, map, bool, int, etc.
I want to do is like: 
dictionary func(dictionary & dict){}.
And the content in the dictionary is not fixed, maybe I use func1(), and func2(), but they require different arguments.
For now, I created a class to store arguments, it has different kinds of members, is it a good way? Or I need to find a good solution? Thanks

You would be best served by leveraging the existing std::undordered_map hashtable/map implementation perhaps in combination with boost.any if you want to mix key or value types.

Related

Which technology is used? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am thinking which technology is needed for making copy of this web service: http://dziswieczorem.pl/
Does someone know any almoust-ready solution (especially for map-things) implemented in django?
Or maybe could anyone give me tips in which technology it would be easier to implement something like that?
To be more concrete:
Is there some ready template containing world map like on page that I wrote about above? I also need a chat feature.
For the map functionality, you may get some benefit from django-gmapi, but I've never tried it so I don't know if it's exactly what you want or not.
As far as chat, there seem to be a few options here that you could consider: http://www.djangopackages.com/grids/g/chat/

Informatica : Sequence generate [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Without using sequence generator How can we generate sequences in informatica mapping ?
Thanks
Well, like others said, I would have preferred to get a specific question on why you are trying to avoid sequence generator. Having said that, if i open myself to "the idea of an alternate" to sequence generator, some things do come to mind
If you have a relatively simplistic mapping, you can embed a oracle/db sequence.nextval call hidden in the source qualifier.
you can embed db/sequence call in a sql tranformation too. But know that it would be anti-performant.
you will be able to achieve a sequence generator behaviour using a persistent variable too, but there are limitations and downsides.
So, again, depending upon what you are trying to do and where you are getting stuck, you might want to repost/edit your question.. and perhaps get a more direct answer.

Strategy Pattern at runtime? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a strategy pattern, and would like to run it in a main loop in a game for example. The problem is there will be a memory leak If I'm not deleting the instance, and I also would like to use that instance somewhere else. How can I deal with memory allocation/deallocation in a strategy pattern.
CompressionContext *ctx = new CompressionContext();
//we could assume context is already set by preferences
ctx->setCompressionStrategy(new ZipCompressionStrategy());
//get a list of files
ctx->createArchive(fileList);
Use an std::shared_ptr<CompressionContextBase> instead of a CompressionContextBase* (i.e. a raw pointer).
Edit: This is just a suggestion, based on the information you provided, there may be other smart pointer implementations with different semantics, such as e.g. unique_ptr, which might be more suited. As #akappa suggests, you may want to read up on the topic more, to make a better decision -- again, based on the information in the question, you probably want a shared_ptr but there might be additional considerations you omitted.

Haskell function which takes a list and return tuples [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I have ordederd to make a function, which takes a list ex [3,4,6,1,29] and returns a list of tuples [(3,4),(4,6),(6,1),(1,29)]
This is a very easy question, it's really hard to help without defeating the purpose...
If you are allowed to use predifined functions, there is already one which can do almost all work for you (if you don't know which one, try finding it with http://www.haskell.org/hoogle/ ). Take a step back and think about the easier question how to produce a list [(3,3),(4,4),(6,6),(1,1),(29,29)].
If you can't use predefined functions, then recursion is your friend: What do you need to do for an empty list? What for a list with one element? With two elements?
Without any own effort I can't give more hints. If you're stuck, extend your question and show what you already got, and we'll try to help.

C++ Segregated Free Lists [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I need to use segregated free lists for a homework assignment and I was wondering if the STL or some other library had these already written so I don't have to reinvent the wheel?
I don't think STL has anything, but it looks like the Boost library might have it, http://www.boost.org/doc/libs/1_38_0/libs/pool/doc/interfaces/simple_segregated_storage.html
The STL implementations I've used support an allocator as a template parameter, which you could use to make a container use your segregated free list, but you'd still be writing your own.