map

Help understanding segfault with std::map/boost::unordered_map

Hello, I have some code to handle resource (images, fonts, mesh data, etc.) management using a template'd static class, allowing client code to do something like: ResourceManager<Texture>::init("data/textures"); ResourceManager<Font>::init("data/fonts"); // later ... boost::shared_ptr<const Texture> tex = ResourceManager<Texture>::getR...

Indoor Custom Maps Application

Hello, I am currently in the research phase of my project on Android.I am interested in developing indoor custom maps application.There are 2 problems I am currently facing in this 1) I can't use GPS as it won't work in the indoor settings like a building or a mall and 2) I can't use Google Maps API as I need to show my location on a in...

Exclusions in map in Ruby.

How do I create an exclusion for a array map in Ruby. Here's what I want to achieve, a = [1,2,3,4] b = [5,6,7,8] a.map.each do |x| b.map.each do |y| if !(x == 1 && y == 7) puts "#{x} and #{y}" elsif !(x == 4 && y == 8) puts "#{x} and #{y}" end end end 1 and 5 1 and 6 1 and 7 # still here 1 and 8 2 and 5 2 an...

Confusing std::map insert behavior

I get some strange behavior when inserting values into a map: I always insert at the end of the map, but sometimes the entries get out of order. If I do a straight forward test, then I get no problems- the numbers are correctly ordered: map<int,int> testMap; for(int i = 0; i < 100; ++i) { // everything is ordered correctly here ...

Compilation problem when working with java.util.Map

Hi, I am trying to compile this program. It works perfectly for 2 Strings(Name, phone number) But not for 3 Strings (Name, phone number and sex). CODE (Not working code - 3 Strings (Name, phone number and sex)) import java.util.Map; import java.util.TreeMap; public class Ann { String name, phone; public Ann() { } public static ...

Tiling in Google Tile Server (x, y and z parameter)

Hi All I am working on Google Tile Server. I have written one WCF Service (C#) which fetches tile from Google server using http URL :- http://mt1.google.com/vt/lyrs=m@129&amp;hl=en&amp;x=1&amp;y=0&amp;z=1&amp;s=Galileo As you know, Google Tile requires three variable parameters x, y and z in it's URL to provide a tile. Other co-ordin...

var replacement = $("<li>").text($(this).text()).get(0); Means?

This is a jQuery example. But i didn't get the part below: var replacement = $("<li>").text($(this).text()).get(0); The original code: var mappedItems = $("li").map(function (index) { var replacement = $("<li>").text($(this).text()).get(0); if (index == 0) { // make the first item all caps $(replacement).text($(replaceme...

Displaying Live Location on a Map

Hey guys, I have a cellular phone which runs a program that uses GPS services. I want to be able to show the phone's current live location on a website. I have a VPS at my disposal. I'm using Waze's Map Services as my map (waze.co.il). I'm familiar with network protocols and client side / forms development but not very familiar with web...

java - loading different maps

OK so I have this applet I am making and I want it to generator a world according to a number... Here it is: public int[][] loadBoard(int map) { if (map == 1) { int[][] board = { { 2,2,24,24,24,24,24,3,3,0,0,0,1 }, { 2,2,24,23,23,23,24,1,3,0,0,0,1 }, { 1,1,24,23,23,23,24,1,3,3,3,3,1 }, { 1,1,24,24,23,24,24,1,1,1,1,3,1 }, ...

Microsoft Win32 to Microsoft .NET Framework API Map

all of we know the .net api is wrapper for win32 api now how can i find which .net function map in which win32 function i seen this list http://msdn.microsoft.com/en-us/library/aa302340.aspx but i need to know other function if i need any tool? ...

Reference as key in std::map

Suppose some data structure: typedef struct { std::string s; int i; } data; If I use the field data.s as key when adding instances of data in a map of type std::map<std::string&, data>, do the string gets copied? Is it safe to erase an element of the map because the reference will become invalid? Also do the answers to these ...

screen coordinates with a horizontal scroll bar

Hi all, I need to place icons on a map image. Since the map image is bigger than my screen resolution 1280 x 1024, a horizontal scroll bar is shown. I use Location x and y to place icons, but the problem is: placing an icon at location (0, 0) when the horizontal scroll bar is at left-most position is different from when the horizon...

How does the STL map::find function work without the equality operator?

Under the hood, an STL map is a red-black tree, and it uses the < operator of its keys or a user-provided comparison to figure out the location for element insertion. map::find() returns the element that matches the supplied key (if any matches are present) How can it do this without using an equality operator? Let's say my map has the...

How to install Google Earth /Map in Linux Server, and auto export image from it with cron job?

Have many geo-data collected from different source and in different formats. Want to convert them into KML and use Google Earth / Map as a Engine to render nice PNGs for me. My Client need to achieve or print out those PNGs every few hours. But seems the Google Earth / Map don't have a export API. We have considers other GIS program....

HowTo get a Map from a csv string

Hi, I'm fairly new to Scala, but I'm doing my exercises now. I have a string like "A>Augsburg;B>Berlin". What I want at the end is a map val mymap = Map("A"->"Augsburg", "B"->"Berlin") What I did is: val st = locations.split(";").map(dynamicListExtract _) with the function private def dynamicListExtract(input: String) = { if (inp...

What would a std::map extended initializer list look like?

If it even exists, what would a std::map extended initializer list look like? I've tried some combinations of... well, everything I could think of with GCC 4.4, but found nothing that compiled. ...

Make alt key work when using NX client on OSX to Ubuntu 10.04 host?

I am using NX Client on Mac OS X 10.6 to access my Ubuntu 10.04 machine. I would like to use the Option/Alt key to Alt-Tab in the window manager and as the Meta key in Emacs. Some searching on the internet suggests that I set my OSX ~/.Xmodmap file to: keycode 66 = Alt_L clear Mod1 add Mod1 = Alt_L Alt_R Or: clear Mod1 clear Mod2 k...

How to store (and read) large arrays/maps/whatever in Java?

Can anyone help me with following problem? I need to permanently save what I today have in arrays, to later use the data for calculations. I explain an example below. 1, I generate a long[][] which is far too big for my computers RAM. It is generated one row after the other. 2, I calculate something from my long[][] and save the result...

Mapping class to instance

I'm trying to build a simple entity/component system in c++ base on the second answer to this question : Best way to organize entities in a game? Now, I would like to have a static std::map that returns (and even automatically create, if possible). What I am thinking is something along the lines of: PositionComponent *pos = systems[P...

Using pair as key in a map (C++ / STL)

Hello, I want to use a pair from STL as a key of a map. #include <iostream> #include <map> using namespace std; int main() { typedef pair<char*, int> Key; typedef map< Key , char*> Mapa; Key p1 ("Apple", 45); Key p2 ("Berry", 20); Mapa mapa; mapa.insert(p1, "Manzana"); mapa.insert(p2, "Arandano"); return 0; } But the compiler...