map

Visual C++'s implementation of std::map

How is std::map implemented in Visual C++? I know that some tree data structures just flag nodes as deleted when they are removed, instead of removing them right away. I need to make sure that my elements are never compared to elements which are no longer in the map. EDIT: I know that the implementation is probably correct wrt. the co...

C++: multiple keyed map

I am searching for a (multi)map where there values are associated by different key types. Basically what was asked here for Java but for C++. Is there something like this already or do I have to implement it myself? Another, more simple case (the above case would solve this already but there may be a more simple solution esp for this ...

OpenGL Heightmap

I am working on a project for school and part of it was making a height map. I managed to create the height map as requested, but was hoping to go for a little extra credit and smooth the entire surface. Here's an image of what I have now: http://img.photobucket.com/albums/v222/shavus/hMap.png The code that I used to generate it was ...

WPF 2010 Static map

Hi All, I am creating a WPF application in .net 4.0. Basically I want to have a map of the world (2d) where by I can place images on, depending on their country location. This map can be an image however, it would be hard to determine the co-ordinates for the location right? Can someone provide me with the simplest way of doing this? ...

How to define an iterator in a template?

Hello, I'm trying to define an iterator to iterate my map to erase it (destructor) I'm getting an error : incompatible iterator. My destructor looks like this : Consortium<S,T>::~Consortium() { map<const S, Node<T>*>::iterator deleteIterator; for (m_consortiumMap.begin() ; deleteIterator != m_consortiumMap.end() ; del...

Does map::iterator yield lvalues ?

In other words, when i is a map<K,V>::iterator, do the following provide the expected semantics (ie. it modifies the map): *i = make_pair(k, v); i->first = k; i->second = v; ? Update: The first two lines are invalid, since the return value of operator* is (convertible to?) a pair<const K, V>. What about the third line ? Assuming a y...

List vs Map in Java

Hi there, I didnt get the sense of Maps in Java. When is it recommended to use a Map instead of a List? thanks in advance, nohereman ...

How to remove an automatic click event on google map overlay?

Hi, Can anyone help me to remove click event from the kml polygon? When I click on any part of polygon, window message pops up with a data KML TEST which is from KML file. I just want to have polygon drawn over google map without having any click events. Does anyone know how to achieve this? This is my page: http://www.keithwoodrow.c...

Drupal Location CCK map does not center at location point.

I have applied and configured CCK Location module to show node location on map (GMap, GMap location modules). However there is small issue that map does not show location at the centre (address marker is off the screen and user must scroll through the map to find it ;-). It looks like map is centred one map screen off to the left (to t...

C++ template type that can be stored in a std::map and then exposing the map publicly.

Hi, I have a class myclass that has a private member param_map class some_class { private: std::map<std::string,std::shared_ptr<parameter> > param_map; }; I want to expose this map to allow other classes, I have already created add, delete, get parameter methods, which do, what you think. But I would like to expose this so other...

JAXB XmlJavaTypeAdapter Map from List : pros/cons of this design pattern

Hi, I have written a JAXB mapping that stored a sublist inside a root element in a LinkedHashMap<String, Object> instead of a Collection<Object> maintained through a specific XmlJavaTypeAdapter. Hereunder a sample: @XmlRootElement public class Parent { @XmlJavaTypeAdapter(ListToMapAdapter.class) @XmlElement private LinkedHa...

GMap map and Tabs display conflict in Drupal

I am using Tabs and CCK Fieldgroup Tabs module to put node GMap CCK location map in a tab. When I put GMap location map in one of the node tabs (Tabs module) other than first one (default), the map view does not centre properly the marker. It slides one width off the screen to the east (right). I need to press "scroll right" arrow once o...

why i can't reverse a list of list in python

hello, i wanted to do something like this but this code return list of None (i think it's because list.reverse() is reversing the list in place): map(lambda row: row.reverse(), figure) i tried this one, but the reversed return an iterator : map(reversed, figure) finally i did something like this , which work for me , but i don't ...

Is there a best practice for writing maps literal style in Java?

In short, if you want to write a map of e.g. constants in Java, which in e.g. Python and Javascript you would write as a literal, T<String,String> CONSTANTS = { "CONSTANT_NAME_0": CONSTANT_VALUE_0 , "CONSTANT_NAME_1": CONSTANT_VALUE_1 , "CONSTANT_NAME_2": CONSTANT_VALUE_2 , //... } ; is there a Class or any preset Obj...

Java time-based map with expiring keys

Do any of you know of a Java Map or similar standard data store that automatically purges entries after a given timeout? Preferably in an open source library that is accessible via maven? I know of ways to implement the functionality myself and have done it several times in the past, so I'm not asking for advice in that respect, but for...

C++ map declaration under g++

I have such declaraition using namespace std; map < string, string> attr; if i write it in class or in global namespace it is compiled ok, but if I write it inside function it doesn't. Why? How can I solve it ? ...

Can one control the identity of objects in Java, and if so, how?

Hi all, This is a trivial programming question. I am not an expert in Java. Say I use objects of custom classes Company and Employee, in a manner similar to what many RDBMS examples do: class Employee { Company company; } class Company { String name; } I need to guarantee that different Company objects have unique names - i....

Passing url to Three20 TTURLMap

I am trying to pass in a URL as a parameter to a TTURLMap like this: [map from@"tt://person/(initWithURL:)" toViewController: [PersonViewController class]]; I then have a TTStyledTableItemCell with links that render like this: <a href="tt://person/http://persons.url.com/blah"&gt;Person name</a> but when I click on these links the l...

How to reference a grails GSP model variable indirectly e.g. via .get(...)

I'm using a GSP for sending out emails based on the MailService plug-in. The sendMail closure passes (amongst others) body(view:..., model:myModel) I know that I can access every item of the myModel Map just using ${itemName} in the GSP. However as I sometimes want to build the item name dynamically like 'item'+i, I need to have some su...

Accessing Sqlite3 database using JavaScript

Hi all, I hope someone can help me here. I am developing two apps at the minute, one iPhone, one Mac. Both have maps, the iPhone one has standard map and the Mac one has an embedded webviw that displays the map using a webpage with JavaScript. What I would like to do is to take the core data sqlite3 database from the iphone app and re...