map

Linq Map! or Collect!

What is the Linq equivalent to the map! or collect! method in Ruby? a = [ "a", "b", "c", "d" ] a.collect! {|x| x + "!" } a #=> [ "a!", "b!", "c!", "d!" ] I could do this by iterating over the collection with a foreach, but I was wondering if there was a more elegant Linq solution. ...

What compliance and legal clearances are required to use Google MAP API with Iphone Apps?

We are using 2 following google services, we need to talk to google folks if we need to do some additional stuff to fulfill the conditions: Reverse Geocoding APIs: For getting city and state from the iphone's geocodes (latitudes and longitudes) Doing a Local Business Search: based on city and state Also is it mandatory to embade Goog...

How to check for TR1 while compiling?

Dear all: We are programming a logging library that keeps itself in a .hpp file. We would like to include <tr1/unordered_map> (if the compiler supports TR1,) or the standard <map> otherwise. Is there a standard way of checking at compile time if tr1 is available or not? I was thinking that the same way that the "__cplusplus" define sym...

Looking for image rectification resources

I'm looking for some good resources (articles, algorithm descriptions, SW libraries...) on image rectification for GIS purposes. Are there any .NET-accessible open source libraries for this? Thanks in advance ...

Iterator access performance for STL map vs. vector?

What is the performance difference between using an iterator to loop through an STL map, versus a vector? I'd like to use the map key for insertion, deletion, and some accesses, but I also need to do regular accesses to every element in the map. ...

Field Names for Struts2 map entries in a JSP

I want to populate a map property on a Struts2 action from a JSP. What is the format of the data names that I should use? Initially I am interested in populating a Map<String, String> but in the future I would be interesting in populating a Map<String, DomainClass> where the DomainClass has properties of its own. ...

How to use Android Map to zoom with hand gesture (iphone like)

How do you use the Android API to zoom in and out maps with the 2 finger gestures like iPhone? ...

Whats the best way to make this Java program?

This the description of the program brief: Produce a software that keeps track of courses taught by lecturers at College. For each course, a course code and title needs to be recorded, as well as a list of lecturers taking that course needs to be recorded. The system should allow courses and lecturers to be added and removed from the...

How can I mix layers with different coordinate system in OpenLayers?

I'm using an OpenLayers-map and I want to use in it different mapservers, that use different coordinate systems. Can OpenLayers integrate it in the same map and automatically converts coordinate-systems? ...

What is an array/ordered lookup database?

I'm looking for a database that supports the following functionality: 1) Records in the database are like Python dictionaries or Perl hashes. For example, a "purchase" record might look like this: <purchase 5436> = { product: "BMX Bike", price: 99.50, city: "Springfield" } 2) The records are stored in arrays of variable length. The d...

shortest path in hash map

The following is a data set I have stored in a hash map, and I have to find the shortest path between two values. 9244, 4322, 4886, 5989, 8598, 9979, 1447, 9657 8598, 6752, 7146, 1951, 660, 1447, 7779 568, 1951, 4886, 2570, 9026, 9489, 7779 6752, 3424, 1977, 4746, 9657 77 The key value of the hash map is the first value of each line, ...

Terracotta Performance and Tips

I am just learning how to use Terracotta after discovering it about a month ago. It is a very cool technology. Basically what I am trying to do: My root (System of Record) is a ConcurrentHashMap. The main Instrumented Class is a "JavaBean" with 30 or so fields that I want to exist in the HashMap. There will be about 20000 of these J...

Weird bug while inserting into C++ std::map

I'm trying to insert some value pairs into a std::map. In the first case, I receive a pointer to the map, dereference it and use the subscript operator to assign a value. i.e. (*foo)[index] = bar; Later, when I try to iterate over the collection, I'm returned key/value pairs which contain null for the value attribute in all cases ex...

Java HashMap indexed on 2 keys

I want to create a HashMap in java for users with preferences. This would be easy to do in a database, but unfortunately I can't use a database. What I need is a way to find a user by name in the HashMap, and to find all the users with a certain interest (e.g. golf). If I delete a user, then all their interests should be deleted. Anyon...

remove_if equivalent for std::map

I was trying to erase a range of elements from map based on particular condition. How do I do it using STL algorithms? Initially I thought of using remove_if but it is not possible as remove_if does not work for associative container. Is there any "remove_if" equivalent algorithm which works for map ? As a simple option, I thought of ...

how to make a map<CLSID, string>?

I want to create a container which can associate a CLSID structure to something else (for example, a string); for example, std::map. (the CLSID means standard Windows CLSID structure) However when I want to use its find() and insert (object[clsid] = string), the STL just failed and gives errors. Does anyone know how to solve this? Fo...

How to reproject map with a cascading UMN-mapserver?

I have UMN configured as a cascading mapserver. I want it to reproject the map while cascading through UMN. How can I do that? Is that possible at all? ...

Creating a Box Control over an area of the map with OpenLayers

I am using OpenLayers to create a box of interest with my program. I am using this code: var control = new OpenLayers.Control(); OpenLayers.Util.extend(control, { draw: function () { this.box = new OpenLayers.Handler.Box( control, {"done": this.notice}, {keyMask: OpenLayers.Handler.MOD_SHIFT}); ...

Using an PNG or JPEG for Map with OpenLayers (Scale/Zoom Problem)

I am using an image to display my map with OpenLayers. My JS code looks like this: map = new OpenLayers.Map('map'); var options = {numZoomLevels: 7, isBaseLayer: true, }; var globe = new OpenLayers.Layer.Image( 'Globe ESA', 'http://upload.wikimedia.org/wikipedia/commons/0/07/World_map_blank_blac...

SQLite C++ Access Columns by Name

Is there a way to access SQLite results by column name (like a C++ Map) instead of index number in C/C++? For example, Python's SQLite access allows dictionary access Results = Query("SELECT * FROM table"); print Results['colname'] print Results['anothercol'] Any similar methods available in C++ for the SQLite's interface? ...