Search Results

Search found 8467 results on 339 pages for 'map layers'.

Page 7/339 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Problem with std::map and std::pair

    - by Tom
    Hi everyone. I have a small program I want to execute to test something #include <map> #include <iostream> using namespace std; struct _pos{ float xi; float xf; bool operator<(_pos& other){ return this->xi < other.xi; } }; struct _val{ float f; }; int main() { map<_pos,_val> m; struct _pos k1 = {0,10}; struct _pos k2 = {10,15}; struct _val v1 = {5.5}; struct _val v2 = {12.3}; m.insert(std::pair<_pos,_val>(k1,v1)); m.insert(std::pair<_pos,_val>(k2,v2)); return 0; } The problem is that when I try to compile it, I get the following error $ g++ m2.cpp -o mtest In file included from /usr/include/c++/4.4/bits/stl_tree.h:64, from /usr/include/c++/4.4/map:60, from m2.cpp:1: /usr/include/c++/4.4/bits/stl_function.h: In member function ‘bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = _pos]’: /usr/include/c++/4.4/bits/stl_tree.h:1170: instantiated from ‘std::pair<typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(const _Val&) [with _Key = _pos, _Val = std::pair<const _pos, _val>, _KeyOfValue = std::_Select1st<std::pair<const _pos, _val> >, _Compare = std::less<_pos>, _Alloc = std::allocator<std::pair<const _pos, _val> >]’ /usr/include/c++/4.4/bits/stl_map.h:500: instantiated from ‘std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename _Alloc::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(const std::pair<const _Key, _Tp>&) [with _Key = _pos, _Tp = _val, _Compare = std::less<_pos>, _Alloc = std::allocator<std::pair<const _pos, _val> >]’ m2.cpp:30: instantiated from here /usr/include/c++/4.4/bits/stl_function.h:230: error: no match for ‘operator<’ in ‘__x < __y’ m2.cpp:9: note: candidates are: bool _pos::operator<(_pos&) $ I thought that declaring the operator< on the key would solve the problem, but its still there. What could be wrong? Thanks in advance.

    Read the article

  • Zip codes in Radius Google Map

    - by Lee
    Hope someone can advise, I would like to be able to use google map API to find all Zip codes/cities with x Miles of a point. Has anyone done such a thing with google map or maybe some other type of service. Would love to know if so how you have achieved it ! Thank you if you can advise.

    Read the article

  • convert perl map with multiple key to c++

    - by YY
    I want to convert a code from perl to c++, and my problem is multi key map in perl! example: perl: $address{name}{familyName} = $someAddress; and keys are not unique. I want similar data structure in c++ using map or ...!? also I want to search and obtain values with first key for example I want such %keys{name} in c++ .

    Read the article

  • bash "map" equivalent: run command on each file

    - by Claudiu
    I often have a command that processes one file, and I want to run it on every file in a directory. Is there any built-in way to do this? For example, say I have a program data which outputs an important number about a file: ./data foo 137 ./data bar 42 I want to run it on every file in the directory in some manner like this: map data `ls *` ls * | map data to yield output like this: foo: 137 bar: 42

    Read the article

  • Why is my Map broken?

    - by Kirk
    Scenario: Creating a server which has Room objects which contain User objects. I want to store the rooms in a Map of some sort by Id (a string). Desired Behavior: When a user makes a request via the server, I should be able to look up the Room by id from the library and then add the user to the room, if that's what the request needs. Currently I use the static function in my Library.java class where the Map is stored to retrieve Rooms: public class Library { private static Hashtable<String, Rooms> myRooms = new Hashtable<String, Rooms>(); public static addRoom(String s, Room r) { myRooms.put(s, r); } public static Room getRoomById(String s) { return myRooms.get(s); } } In another class I'll do the equivalent of myRoom.addUser(user); What I'm observing using Hashtable, is that no matter how many times I add a user to the Room returned by getRoomById, the user is not in the room later. I thought that in Java, the object that was returned was essentially a reference to the data, the same object that was in the Hashtable with the same references; but, it isn't behaving like that. Is there a way to get this behavior? Maybe with a wrapper of some sort? Am I just using the wrong variant of map? Help?

    Read the article

  • Black outline around map polygons (IE)

    - by user146780
    This only happens in some IE's. Here: http://animactions.ca/Animactions/volet_entreprise.php You may notice that when you click and drag on one of the circles, you will get something similar to this: http://img534.imageshack.us/img534/7578/errorra.png I cannot figure it out. Here is my image map: <p class="style2"> <map id="FPMap0" name="FPMap0"> <area coords="405, 8, 375, 10, 353, 13, 322, 30, 317, 48, 327, 69, 344, 75, 370, 84, 401, 86, 428, 81, 454, 69, 466, 56, 468, 37, 452, 19, 419, 9" href="le_developpement_des_equipes_de_travail.php" shape="poly" style="outline:0" target="_blank" /> <area coords="95, 164, 65, 166, 43, 174, 21, 186, 16, 206, 27, 225, 48, 237, 76, 241, 99, 241, 129, 236, 151, 228, 165, 214, 167, 194, 154, 177, 130, 168, 105, 165" href="le_developpement_operationnel.php" shape="poly" style="outline:0" target="_blank" /> <area coords="138, 17, 115, 7, 95, 8, 63, 8, 41, 20, 21, 35, 23, 60, 42, 74, 77, 83, 117, 86, 144, 76, 164, 62, 173, 40, 156, 21, 137, 12" href="coaching_strategique_de_cadre.php" shape="poly" style="border-width:0" target="_blank" /> </map> <img alt="services entreprise" height="258" src="Images/service_ent.PNG" width="490" usemap="#FPMap0" /></p> I really hope someone can figure this out because I'v tried everything... Thanks

    Read the article

  • Where to start with map application

    - by rfders
    Hi there, i'm trying to desing a new application which allow user see he/her current location on a custom map (office, university compus, etc). but actually i have a couple of question in my mind (i haven't designed this kind of application before). i'm wondering: How can i draw my own maps, what is the best option for it? there any format that i have to care of, there are any specification about it ? Once i have my custom map. how can i do to mapping a global position system with the local positions ? What are the tricks behing zoom on maps ? just differents layers with more or less informations and those layers changes on users demand ? If a whant to mark some specific points over the map, like a cafeteria, boss's office etc, how can i do that ? Sorry if my questions are too much generics and dumb, but i really need some clues about this topic because i don't have any idea how to design this kind of application as best as possible. and we don't whant to reinvent the wheel. I will appreciate any help that you can provide me in order to desing this application

    Read the article

  • Html page mini map or map overview

    - by sybrex
    I have a big html page, like 4000x6000 px with images and text. I'd like to have something like a map overview of this page in a small div. A scaled version of the whole page which i could use to navigate. Does anyone know some js script or example how to do that? Thanks.

    Read the article

  • Converting Inkscape layers directly to a slideshow presentation?

    - by darenw
    I'm creating a slideshow in Inkscape. There's one or more layer per slide, plus several background layers, and some special layers to be used on several slides in a row, etc. In the past, I'd create each slide as a .png image by turning on appropriate layers and exporting an image. This is tedious and easy to make mistakes. Is it possible to automate this? To enable the right layers and save all slides directly to a file format suitable for presenatations, such as .ppt, which I can give to anyone for display? The solution will have to work on Linux.

    Read the article

  • BizTalk 2009 - Error when Testing Map with Flat File Source Schema

    - by StuartBrierley
    I have recently been creating some flat file schemas using the BizTalk Server 2009 Flat File Schema Wizard.  I have then been mapping these flat file schemas to a "normal" xml schema format. I have not previsouly had any cause to map flat files and ran into some trouble when testing the first of these flat file maps; with an instance of the flat file as the source it threw an XSL transform error: Test Map.btm: error btm1050: XSL transform error: Unable to write output instance to the following <file:///C:\Documents and Settings\sbrierley\Local Settings\Temp\_MapData\Test Mapping\Test Map_output.xml>. Data at the root level is invalid. Line 1, position 1. Due to the complexity of the map in question I decided to created a small test map using the same source and destination schemas to see if I could pinpoint the problem.  Although the source message instance vaildated correctly against the flat file schema, when I then tested this simplified map I got the same error. After a time of fruitless head scratching and some serious google time I figured out what the problem was. Looking at the map properties I noticed that I had the test map input set to "XML" - for a flat file instance this should be set to "native".

    Read the article

  • Java Simple WGS84 Lat Lon to Pixel X, Y

    - by Cnich
    I've read a multitude of information regarding map projection today. The amount of information available is overwhelming. I am attempting to simply convert lat, long values into a screen X, Y coordinate not using any map. I do not need the values projected onto any map, just on the window. The window itself is representing approx. a 1500x1500 meter location. Lat, Long accuracy needed is to a 1/10th of a second. What may be some simpler ways in converting lat/long representation to the screen? I've read several articles and post regarding translation onto images, but nothing related to the natural java coordinate system. Thanks for any insight.

    Read the article

  • Android Map Performance poor because of many Overlays?

    - by Dave
    Hi, I have a map in my android application that shows many markers (~20-50). But the app performs very poor when i try to scroll/zoom (in Google Android Maps i did a sample search for pizza and there were also some 20-50 results found and i didn't notice any particular performance problems when zooming/scrolling through the map). Here is my (pseudo)code: onCreate() { .... drawable = this.getResources().getDrawable(R.drawable.marker1); itemizedOverlay = new MyItemizedOverlay(drawable,mapView); ... callWebServiceToRetrieveData(); createMarkers(); } createMarkers(){ for(elem:bigList){ GeoPoint geoPoint = new GeoPoint((int)(elem.getLat()*1000000), (int) (elem.getLon()*1000000)); OverlayItem overlayItem = new OverlayItem(geoPoint, elem.getName(), elem.getData()); itemizedOverlay.addOverlay(overlayItem); mapOverlays.add(itemizedOverlay); } mapView.invalidate(); } the MyItemizedOverlay.addOverlay looks like this: public void addOverlay(OverlayItem overlay) { m_overlays.add(overlay); populate(); }

    Read the article

  • T-4 Templates for ASP.NET Web Form Databound Control Friendly Logical Layers

    - by Mohammad Ashraful Alam
    I just released an open source project at codeplex, which includes a set of T-4 templates that will enable you to build ASP.NET Web Form Data Bound controls friendly testable logical layer based on Entity Framework 4.0 with just few clicks! In this open source project you will get Entity Framework 4.0 based T-4 templates for following types of logical layers: Data Access Layer: Entity Framework 4.0 provides excellent ORM data access layer. It also includes support for T-4 templates, as built-in code generation strategy in Visual Studio 2010, where we can customize default structure of data access layer based on Entity Framework. default structure of data access layer has been enhanced to get support for mock testing in Entity Framework 4.0 object model. Business Logic Layer: ASP.NET web form based data bound control friendly business logic layer, which will enable you few clicks to build data bound web applications on top of ASP.NET Web Form and Entity Framework 4.0 quickly with great support of mock testing. Download it to make your web development productive. Enjoy!

    Read the article

  • iPhone: Switching from a map screen to a battle screen without the map progress being reset

    - by user298261
    Hello! I'm trying to make a role-playing game, and I want the game to work so that it transitions to the battle NIB for battles, then returns back to the map NIB afterward, yet still retain all the progress the player has made exploring the dungeon. I've tried proto-typing this with just a view-switcher, where one view creates content, and then switches to the other view, and then coming back from the other view. However, once the view goes back to the original, the original view is reset. How to make the data persistent so that it doesn't reset after every "battle"? Thanks!

    Read the article

  • How can let Qt Graphics View Framework support custom layers

    - by jnblue
    Qt's graphics view frameworks is very powerful, but I have not found a way to support custom layers. In Qt, there is a QGraphicsScene::ItemLayer,but QGraphicsScene renders all items are in this layer. I want manage the items with several layers, Just like Illustrator and CorelDraw. all the item only in the current layer will receive the event, be selected or get the key focus etc.. Other layers(not current layer) will not receive all scene event. The most reasons of using layers is I could catalogue a large number of items more clearly.And without needing transfer events to all the layers' items ,I think the graphics frameworks will be more efficient. The last question, does QGraphicsView support rendering server stacked graphics scenes at the same time? If support, I think the "custom layers" can be solved in this way. Thanks very much!

    Read the article

  • problem with iterate over java.util.Map using "JSF" OR JSTL TAGS

    - by New-To-Java
    I'm using Richfaces jsf and I want to iterate over an Map<Object,Object>. I see many examples on sun forums and other sites but in my case it doesn't work ! here is my xhtml code : <c:forEach items="#{order.customOptions}" var="option"> <h:outputText value="this text does not print"/> <h:outputText value="#{option.value.name}" /> <h:outputText value="#{option.value.key}" /> </c:forEach> and the "order" object is of type "Order". "customOptios" is of type Map<CustomOption,CustomOptionValue> and when I create an javascript alert on to print '#{order.customeOptions}' it's content is true. but it's not even enter in c:forEach loop. please heeeeelp me :(

    Read the article

  • std::map operator[] and automatically created new objects

    - by thomas-gies
    I'm a little bit scared about something like this: std::map<DWORD, DWORD> tmap; tmap[0]+=1; tmap[0]+=1; tmap[0]+=1; Since DWORD's are not automatically initialized, I'm always afraid of tmap[0] being a random number that is incremented. How does the map know hot to initialize a DWORD if the runtime does not know how to do it? Is it guaranteed, that the result is always tmap[0] == 3?

    Read the article

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

    - by Bernie Perez
    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}); this.box.activate(); }, notice: function (bounds) { areaSelected(bounds); } }); map.addControl(control); to capture the "Shift Create a Box" control and use the area selected as my area of interest. However the values come back as pixels. But I want Longitude and Latitude, not pixels. The Mouse Position control does show the correct long & lat. I really don't care how to box is created, I just want an easy way for the user to select a area of the map and I need to get the lat & longs of the area. (Box, Circle, doesn't matter)

    Read the article

  • How to sort Map in Java

    - by kalpesh
    hi i want to sort map according to its key value plz see code below public static void main(String[] args) { SortedMap map = new TreeMap(); // Add some elements: map.put("2", "Two"); map.put("1", "One"); map.put("5", "Five"); map.put("4", "Four"); map.put("3", "Three"); map.put("10", "Ten"); map.put("12", "Twelve"); map.put("7", "Seven"); map.put("9", "Nine"); Iterator iterator = map.keySet().iterator(); while (iterator.hasNext()) { Object key = iterator.next(); System.out.println("key : " + key + " value :" + map.get(key)); } } Result Should come below key : 1 value :One key : 2 value :Two key : 3 value :Three key : 4 value :Four key : 5 value :Five key : 7 value :Seven key : 9 value :Nine key : 10 value :Ten key : 12 value :Twelve

    Read the article

  • Clojure: Testing every value from map operation for truth

    - by Ralph
    How can I test that every value in the collection returned by map is true? I am using the following: (defn test [f coll] (every? #(identity %) (map f coll))) with the anonymous function #(identity %), but I was wondering if there is a better way. I cannot use (apply and ...) because and is a macro. UPDATE: BTW, I am making my way through The Haskell Road to Logic, Maths, and Programming, by Kees Doets and Jan can Eijck, but doing the exercises in Clojure. It's a very interesting book.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >