map

jQuery - change a list of elements to an associative array

Given an associative array (of the sort returned by jQuery.serializeArray()) like this: [ { 'name': 'abc', 'value': 'aaa', '__proto__': [Object] }, { 'name': 'def', 'value': 'bbb', '__proto__': [Object] }, { 'name': 'abc', 'value': 'ccc', '__proto__': [Object] } ] How can one convert this, using either jQuery or just javascript, to an...

GMap Polyline position of center

When I create Gmap she needed to establish the center and zoom Once we've created a map via the GMap2 constructor, we need to initialize it. This initialization is accomplished with use of the map's setCenter () method. The setCenter () method requires a GLatLng coordinate and a zoom level and this method must be sent ...

How to save esri map as an image file

Hi, I am using Silverlight 3 and I am trying to take a screenshot of esri map. I was able to take a screenshot and save as a file for silverlight controls, but when I try to access Esri map image, I get "Pixel access not allowed" error. I heard this is because of different domain (I am trying to get map image on the client side, and...

Python: map in place

I was wondering if there is a way to run map on something. The way map works is it takes an iterable and applies a function to each item in that iterable producing a list. Is there a way to have map modify the iterable object itself? ...

iPhone Map issue

Hi all, I am working on a map application in iPhone. While loading the MapViewController the map is not loaded automatically in the mapView, When we drag the mapView the area outside the intial view is loaded. Also when we double tap on the map it get start loading. Can anybody help me fixing this.? Thanks in Advance, Shibin ...

How to concat two c++ map

Hello, Anybody knows how to concat these two map: map<string, map<string,string>> map1; map<string, map<string,string>> map2; I just want to add map2 to map1 and keep all elements already in map1 i.e. add map2 at the end of map1. I'v tried map1.insert(map2.begin(), map2.end()) but it does not work since it overwrites old elements in ...

Is "map" a loop?

While answering this question, I came to realize that I was not sure whether Perl's map can be considered a loop or not? On one hand, it quacks/walks like a loop (does O(n) work, can be easily re-written by an equivalent loop, and sort of fits the common definition = "a sequence of instructions that is continually repeated"). On the ot...

Join map and refer to its key/value in HQL

Suppose I have a map: <map name="externalIds" table="album_external_ids"> <key column="album_id" not-null="true"/> <map-key-many-to-many class="Major" column="major_id"/> <element column="external_id" type="string" not-null="true"/> </map> How do I make a HQL meaning "select entities where map key's id...

How to efficiently use Enum objects as keys in the Map data structure?

Is there a more efficient and specialized implementation of a Map collection where Enum objects can serve as keys? ...

Haskell maps returning a monad

The lookup function in Data.Map and Data.IntMap currently return values wrapped in Maybe with the type signature lookup :: Ord k => k -> Map k a -> Maybe a It used to have the more general type of lookup :: (Monad m, Ord k) => k -> Map k a -> m a I realize the former likely reduces the need of extra type specification, but ...

Four-color theorem in Prolog (using a dynamic predicate)

Hi, I'm working on coloring a map according to the four-color theorem (http://en.wikipedia.org/wiki/Four_color_theorem) with SWI-Prolog. So far my program looks like this: colour(red). colour(blue). map_color(A,B,C) :- colour(A), colour(B), colour(C), C \= B, C \= A. (the actual progam would be mo...

what use does the javascript forEach method have (that map can't do)?

Hey all, The only difference I see in map and foreach is that map is returning an array and foreach is not. However, I don't even understand the last line of the foreach method "func.call(scope, this[i], i, this);". For example, isn't "this" and "scope" referring to same object and isn't this[i] and i referring to the current value in t...

Map works, but throws a popup error at load complainig about wrong api key

Ok, I see a lot of people have this problem, but none answer I found either here or at stackoverflow. Problem: Map works super fine! But throws an error at load "This map needs a different api key... sign up at......" Already signed up, already got a key. On some forum post a guy told that in this case map loads twice, once with the wron...

Releasing memory from map. C++

std::map<int, int> * mp = new std::map<int, int>; for(int i = 0; i < 999999; i++){ mp->insert(std::pair<int, int>(i, 999999-i )); } p("created"); //mp->clear(); - doesn't help either delete mp; p("freed"); The problem is: "delete mp" doesn't do anything. To compare: std::vector<int> * vc = new std::vector<int>; for(int i = ...

Google StreetView Mountain Biking

I'm working on a DIY google streetview for mountain biking. I was wondering if anyone had any ideas on how I might best get decent results? I'm looking for help with everything from what kind of cameras to use to get as much imagery as possible and how I might stitch images together. Thanks! ...

How can I generate an "unlimited" world?

I would like to create a game with an endless (in reality an extremely large) world in which the player can move about. Whether or not I will ever get around to implement the game is one matter, but I find the idea interesting and would like some input on how to do it. The point is to have a world where all data is generated randomly o...

Hibernate MapKeyManyToMany gives composite key where none exists

I have a Hibernate (3.3.1) mapping of a map using a three-way join table: @Entity public class SiteConfiguration extends ConfigurationSet { @ManyToMany @MapKeyManyToMany(joinColumns=@JoinColumn(name="SiteTypeInstallationId")) @JoinTable( name="SiteConfig_InstConfig", joinColumns = @JoinColumn(name="SiteConfigId"), inve...

mapping list of different types implementing same function?

I want to apply a function to every element in a list (map) but the elements may have different types but all implement the same function (here "putOut") like an interface. However I cannot create a list of this "interface" type (here "Outputable"). How do I map a list of different types implementing the same function? import Control.M...

C++: How to clean up a vector/map properly

Hi, If I have a vector<string*> *vect or a map<pair<string*, int*>, string*> *map, how to clean up everything (including all object the vector/map contains)? (Everything (vector, map, contents, string, ints) is allocated with new) Is delete vect; delete map; enough? ...

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 ...