map

Map problem when passing it as model to view in grails

Hi, In a controller, I have populated a map that has a string as key and a list as value; in the gsp, I try to show them like this: <g:each in="${sector}" var="entry" > <br/>${entry.key}<br/> <g:each in="${entry.value}" var="item" > ${item.name}<br/> </g:each> </g:each> The problem is that item is considered as string, so I ...

Concept of creating static Map

I want to create a Map object that can lose value only if we explicitly delete it from map. I have created Map object like public static Map<Long,String> listUser =new HasMap<Long,String>(); but every time class object is created new instance of Map is also created that contain null value. I want to create a Map instance that contain ...

Memory Allocation for a Map with a fixed number of insertions

I want to insert n elements into a map where n is known ahead of time. I do not want memory allocation at each insertion. I want all memory allocation at the beginning. Is there a way to do this? If so, how? Will writing some sort of memory allocator help? I ran GMan's code and got the following output. GetMem is printed from a call to ...

defining < operator for map of list iterators

I'd like to use iterators from an STL list as keys in a map. For example: using namespace std; list<int> l; map<list<int>::const_iterator, int> t; int main(int argv, char * argc) { l.push_back(1); t[l.begin()] = 5; } However, list iterators do not have a comparison operator defined (in contrast to random acc...

Add a "mapview" in a webOS app

Hi, I'm not familiar yet with WebOS dev (just started this weekend) but I didn't find any "MapView" widget in the reference library. Is there any way to include a WebView in my app or do I have to start the map app from my app ? Thanx. ...

Is there any thing hashmap can do but map cannot?

Hi, I only know that the difference between hashmap and map is that hashmap is implemented with hash function but map is implemented with tree. Could any body add anything more? Based on this, is there any thing hashmap can do but map cannot? ...

OutOfMemoryException Processing Large File

We are loading a large flat file into BizTalk Server 2006 (Original release, not R2) - about 125 MB. We run a map against it and then take each row and make a call out to a stored procedure. We receive the OutOfMemoryException during orchestration processing, the Windows Service restarts, uses full 2 GB memory, and crashes again. The ...

Is there a way to change the map data for the Android Google Map API?

I need to use a different datasource inside a map in Android than the google provided data. Is there a way to change the datasource to a tile based service (openstreetmap.org for example)? Or are there other Android map APIs which are OpenSource and can be adapted (except Ericcson Mobile Maps - this doesn't work for me because of the li...

java: PropertyChangeSupport for Map or EnumMap?

Is there a version of either java.beans.PropertyChangeSupport or com.jgoodies.binding.beans.ExtendedPropertyChangeSupport which is helpful for supporting change listeners along the lines of a Map or EnumMap? (a key-value store with known limited keys and change listeners for all the values in the map) I don't really need beans-type acce...

How to query collections in NHibernate

Hi, I have a class: public class User { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual IDictionary<string, string> Attributes { get; set; } } and a mapping file: <class name="User" table="Users"> <id name="Id"> <generator class="hilo"/> </id> <property name=...

C++ dictionary/map with added order

I want to have something similar to map but while iterating I want them to be in the same order as it is added. Example map.insert("one", 1); map.insert("two", 2); map.insert("three", 3); While iterating I want the items to be like "one", ""two", "three"..By default, map doesn't provide this added order. How to get the map elements t...

shared memory STL maps

Hello, I am writing an Apache module in C++. I need to store the common data that all childs need to read as a portion of shared memory. Structure is kind of map of vectors, so I want to use STL map and vectors for it. I have written a shared allocator and a shared manager for the purpose, they work fine for vectors but not for maps, bel...

Accessing local map data with AppEngine

I'm creating an app with AppEngine (Java) that needs access to local map information. In general, I'd like to search any query such as: gas stations, cheap restaurants, banks, or whatever in a certain area. What is the best way to do this, and with which Service or API ? ...

How to get top/left x/y of image map with javascript / jquery?

Using jQuery's position() or offset(), I can't seeme to get the top/left coordinates of an image map area. It works in FF, but nothing else - no webkit, IE, Opera. $('area').bind("click",function(){ alert($(this).position().left); }); <area shape="rect" coords="14,25,205,150" href="#"> Anyone know of a different way to access these...

What container type provides better (average) performance than std::map?

In the following example a std::map structure is filled with 26 values from A - Z (for key) and 0 - 26 for value. The time taken (on my system) to lookup the last entry (10000000 times) is roughly 250 ms for the vector, and 125 ms for the map. (I compiled using release mode, with O3 option turned on for g++ 4.4) But if for some odd reas...

Object does not exist after constructor?

Hello, I have a constructor that looks like this (in c++): Interpreter::Interpreter() { tempDat == new DataObject(); tempDat->clear(); } the constructor of dataObject does absolutely nothing, and clear does this: bool DataObject::clear() { //clear the object if (current_max_id > 0) { inde...

C++ STL Map vs Vector speed

In the interpreter for my experimental programming language I have a symbol table. Each symbol consists of a name and a value (the value can be e.g.: of type string, int, function, etc.). At first I represented the table with a vector and iterated through the symbols checking if the given symbol name fitted. Then I though using a map,...

GNUPLOT: 2d histogram from set of points.

Hello, I have a pairs of the points with their weights: #x y w 0.111342 0.478917 0.232487 0.398107 1.79559 0.221714 0.200731 2.58651 0.0776068 0.0967412 1.49904 0.0645355 6.17638 8.63101 0.715604 0.306128 3.10917 0.0984595 0.340707 3.19344 0.10669 7.18627 8.59859 0.835751 8.56 9.63894 0.888065 5.14272 6.86074 0.749587 0.747...

How to see the contents of std::map in Visual C++ .NET (Visual Studio 2003) while debugging?

I need to see the contents of a std::map variable while debugging. However, if i click on it in the Autos/Locals Tab, I see implementation specific stuff, instead of the keys and its contents which I want to look at. Is there a work-around i'm missing ? ...

Interactive US Map

Is there any jQuery (or standalone) plugin that would allow be to build an Interactive US map just like this: http://bit.ly/9PSiDB Many thanks ...