Search Results

Search found 7576 results on 304 pages for 'map'.

Page 2/304 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Identity Map Pattern and the Entity Framework

    - by nikolaosk
    This is going to be the seventh post of a series of posts regarding ASP.Net and the Entity Framework and how we can use Entity Framework to access our datastore. You can find the first one here , the second one here and the third one here , the fourth one here , the fifth one here and the sixth one here . I have a post regarding ASP.Net and EntityDataSource. You can read it here .I have 3 more posts on Profiling Entity Framework applications. You can have a look at them here , here and here . In...(read more)

    Read the article

  • How to create multiboot flash drive

    - by Nrew
    I've found a guide here: http://www.pendrivelinux.com/boot-multiple-iso-from-usb-multiboot-usb/ And found this menu.lst in my flash drive, which seems to be the one that I'm seeing when I boot using my flash drive: # This Menu Created by Lance http://www.pendrivelinux.com # Ongoing Suggested Menu Entries and the Suggestor are noted! default 0 timeout 30 color NORMAL HIGHLIGHT HELPTEXT HEADING splashimage=(hd0,0)/splash.xpm.gz foreground=FFFFFF background=0066FF title Memtest86+ find --set-root /memtest86+-4.00.iso map --mem /memtest86+-4.00.iso (hd32) map --hook root (hd32) chainloader (hd32) # Suggested by madprofessor title Boot Clonezilla root (hd0,0) kernel /clonezilla/live/vmlinuz live-media-path=clonezilla/live bootfrom=/dev/sd boot=live union=aufs noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=791 ip=frommedia initrd /clonezilla/live/initrd.img title Parted Magic 4.9 (Partition Tools) find --set-root /pmagic-4.9.iso map /pmagic-4.9.iso (hd32) map --hook root (hd32) chainloader (hd32) # Suggested by Deb title Partition Wizard 4.2 (Partition Tools) find --set-root /pwhe42.iso map /pwhe42.iso (hd32) map --hook root (hd32) chainloader (hd32) title Balder DOS image (FreeDOS) map --unsafe-boot /balder10.img (fd0) map --hook chainloader --force (fd0)+1 rootnoverify (fd0) # Suggested by Szymon Silski title Linux Mint 8 find --set-root /LinuxMint-8.iso map /LinuxMint-8.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/mint.seed boot=casper persistent iso-scan/filename=/LinuxMint-8.iso splash initrd /casper/initrd.lz title Ubuntu 10.04 find --set-root /ubuntu-10.04-desktop-i386.iso map /ubuntu-10.04-desktop-i386.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper persistent iso-scan/filename=/ubuntu-10.04-desktop-i386.iso splash initrd /casper/initrd.lz title Xubuntu 10.04 (XFCE Desktop) find --set-root /xubuntu-10.04-desktop-i386.iso map /xubuntu-10.04-desktop-i386.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/xubuntu.seed boot=casper persistent iso-scan/filename=/xubuntu-10.04-desktop-i386.iso splash initrd /casper/initrd.lz title Kubuntu 10.04 (KDE Desktop) find --set-root /kubuntu-10.04-desktop-i386.iso map /kubuntu-10.04-desktop-i386.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/kubuntu.seed boot=casper persistent iso-scan/filename=/kubuntu-10.04-desktop-i386.iso splash initrd /casper/initrd.lz # Suggested by Ambriel title Lubuntu 10.04 (LXDE Lightweight Desktop) find --set-root /lubuntu-10.04.iso map /lubuntu-10.04.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/lubuntu.seed boot=casper persistent iso-scan/filename=/lubuntu-10.04.iso splash initrd /casper/initrd.lz title Ubuntu 10.04 Netbook Remix (NetBook Distro) find --set-root /ubuntu-10.04-netbook-i386.iso map /ubuntu-10.04-netbook-i386.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/netbook-remix.seed boot=casper persistent iso-scan/filename=/ubuntu-10.04-netbook-i386.iso splash initrd /casper/initrd.lz title Ubuntu 10.04 Server Edition Installer (32 bit Installer Only) find --set-root /ubuntu-10.04-server-i386.iso map /ubuntu-10.04-server-i386.iso (0xff) map --hook root (0xff) kernel /install/vmlinuz file=/cdrom/preseed/ubuntu-server.seed boot=install iso-scan/filename=/ubuntu-10.04-server-i386.iso splash initrd /install/initrd.gz title Ubuntu 9.10 find --set-root /ubuntu-9.10-desktop-i386.iso map /ubuntu-9.10-desktop-i386.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper persistent iso-scan/filename=/ubuntu-9.10-desktop-i386.iso splash initrd /casper/initrd.lz title Xubuntu 9.10 find --set-root /xubuntu-9.10-desktop-i386.iso map /xubuntu-9.10-desktop-i386.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/xubuntu.seed boot=casper persistent iso-scan/filename=/xubuntu-9.10-desktop-i386.iso splash initrd /casper/initrd.lz title Kubuntu 9.10 find --set-root /kubuntu-9.10-desktop-i386.iso map /kubuntu-9.10-desktop-i386.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/kubuntu.seed boot=casper persistent iso-scan/filename=/kubuntu-9.10-desktop-i386.iso splash initrd /casper/initrd.lz # Ubuntu Server and Netbook Remix suggested by Wojciech Holek title Ubuntu 9.10 Server Edition Installer (Installer Only) find --set-root /ubuntu-9.10-server-i386.iso map /ubuntu-9.10-server-i386.iso (0xff) map --hook root (0xff) kernel /install/vmlinuz file=/cdrom/preseed/ubuntu-server.seed boot=install iso-scan/filename=/ubuntu-9.10-server-i386.iso splash initrd /install/initrd.gz title Ubuntu 9.10 Netbook Remix (NetBook Distro) find --set-root /ubuntu-9.10-netbook-remix-i386.iso map /ubuntu-9.10-netbook-remix-i386.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/netbook-remix.seed boot=casper persistent iso-scan/filename=/ubuntu-9.10-netbook-remix-i386.iso splash initrd /casper/initrd.lz title Ubuntu 9.10 Rescue Remix (Recovery Tools) find --set-root /ubuntu-rescue-remix-9-10-revision1.iso map /ubuntu-rescue-remix-9-10-revision1.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=/ubuntu-rescue-remix-9-10-revision1.iso splash initrd /casper/initrd.lz title DSL 4.4.10 find --set-root /dsl-4.4.10-initrd.iso map --mem /dsl-4.4.10-initrd.iso (hd32) map --hook root (hd32) chainloader (hd32) title AVG Rescue CD (Anti-Virus + Anti-Spyware) find --set-root /avg_arl_en_90_100114.iso map /avg_arl_en_90_100114.iso (hd32) map --hook chainloader (hd32) title Ultimate Boot CD 4.11 find --set-root /ubcd411.iso map /ubcd411.iso (hd32) map --hook chainloader (hd32) title OphCrack XP 2.3.1 (XP Password Cracker) find --set-root /ophcrack-xp-livecd-2.3.1.iso map /ophcrack-xp-livecd-2.3.1.iso (0xff) map --hook root (0xff) kernel /boot/bzImage rw root=/dev/null vga=normal lang=C kmap=us screen=1024x768x16 autologin initrd /boot/rootfs.gz title OphCrack Vista 2.3.1 (Vista Password Cracker) find --set-root /ophcrack-vista-livecd-2.3.1.iso map /ophcrack-vista-livecd-2.3.1.iso (0xff) map --hook root (0xff) kernel /boot/bzImage rw root=/dev/null vga=normal lang=C kmap=us screen=1024x768x16 autologin initrd /boot/rootfs.gz # Suggested by Greg Steer title Offline NT Password & Registy Editor find --set-root /cd080802.iso map /cd080802.iso (hd32) map --hook chainloader (hd32) title SliTaz 2.0 find --set-root /slitaz-2.0.iso map --mem /slitaz-2.0.iso (hd32) map --hook chainloader (hd32) title Riplinux 9.3 find --set-root /RIPLinuX-9.3.iso map --heads=0 --sectors-per-track=0 /RIPLinuX-9.3.iso (0xff) || map --heads=0 --sectors-per-track=0 --mem /RIPLinuX-9.3.iso (0xff) map --hook chainloader (0xff) # Suggested by Sunny title YlmF (Windows Like OS) find --set-root /YlmF_OS_EN_v1.0.iso map /YlmF_OS_EN_v1.0.iso (0xff) map --hook root (0xff) kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper persistent iso-scan/filename=/YlmF_OS_EN_v1.0.iso splash initrd /casper/initrd.lz # Suggested by Martin Andersson title DBAN 1.0.7 (Drive Nuker) find --set-root /dban-1.0.7_i386.iso map --mem /dban-1.0.7_i386.iso (hd32) map --hook root (hd32) chainloader (hd32) # Suggested by Robin McGough title xPUD 0.9.2 (NetBook Distro) find --set-root --ignore-floppies --ignore-cd /xpud-0.9.2.iso map --heads=0 --sectors-per-track=0 /xpud-0.9.2.iso (hd32) map --hook chainloader (hd32) title Puppy 4.3.1 find --set-root /puppy/pup-431.sfs kernel /puppy/vmlinuz initrd /puppy/initrd.gz # Suggested by Relst title Run a Linux OS from the Internet kernel /gpxe.lkrn I also put some .iso files for os installers (Windows xp sp2 and Ubuntu 10.04) But they didn't show up in the list when I booted Do I need to: extract the .iso files and put in in their respective folders? Add the os that I added on the menu.lst? How do I add the iso image(os) in the menu.lst? Before adding the .iso files I first made a folder named Windows xp sp2 then placed the .iso files in there. Please help, I think I need to add the folder name or the file name on the menu.lst but I don't know how

    Read the article

  • Concept of creating static Map

    - by chetan
    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 value we stored before.

    Read the article

  • C++ dictionary/map with added order

    - by Gopalakrishnan Subramani
    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 the way I have added? Anything with STL is fine or other alternative suggestions also fine

    Read the article

  • Pattern matching against Scala Map type

    - by Tom Morris
    Imagine I have a Map[String, String] in Scala. I want to match against the full set of key–value pairings in the map. Something like this ought to be possible val record = Map("amenity" -> "restaurant", "cuisine" -> "chinese", "name" -> "Golden Palace") record match { case Map("amenity" -> "restaurant", "cuisine" -> "chinese") => "a Chinese restaurant" case Map("amenity" -> "restaurant", "cuisine" -> "italian") => "an Italian restaurant" case Map("amenity" -> "restaurant") => "some other restaurant" case _ => "something else entirely" } The compiler complains thulsy: error: value Map is not a case class constructor, nor does it have an unapply/unapplySeq method What currently is the best way to pattern match for key–value combinations in a Map?

    Read the article

  • Hive NR map progress inconsistent and regurlarly restart from 0%

    - by user92471
    I have a Yarn MR (with two ec2 instances to mapreduce) job on a dataset of approximately a thousand avro records, and the map phase is behaving erratically. See the progress below. Of course i checked the logs on resourcemanager and nodemanagers and saw nothing suspicious, but these logs are too verbose What is going on there ? hive> select * from nikon where qs_cs_s_aid='VIEW' limit 10; Total MapReduce jobs = 1 Launching Job 1 out of 1 Number of reduce tasks is set to 0 since there's no reduce operator Starting Job = job_1352281315350_0020, Tracking URL = http://blabla.ec2.internal:8088/proxy/application_1352281315350_0020/ Kill Command = /usr/lib/hadoop/bin/hadoop job -Dmapred.job.tracker=blabla.com:8032 -kill job_1352281315350_0020 Hadoop job information for Stage-1: number of mappers: 4; number of reducers: 0 2012-11-07 11:14:40,976 Stage-1 map = 0%, reduce = 0% 2012-11-07 11:15:06,136 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 10.38 sec 2012-11-07 11:15:07,253 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 12.18 sec 2012-11-07 11:15:08,371 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 12.18 sec 2012-11-07 11:15:09,491 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 12.18 sec 2012-11-07 11:15:10,643 Stage-1 map = 2%, reduce = 0%, Cumulative CPU 15.42 sec (...) 2012-11-07 11:15:35,441 Stage-1 map = 28%, reduce = 0%, Cumulative CPU 37.77 sec 2012-11-07 11:15:36,486 Stage-1 map = 28%, reduce = 0%, Cumulative CPU 37.77 sec here restart at 16% ? 2012-11-07 11:15:37,692 Stage-1 map = 16%, reduce = 0%, Cumulative CPU 21.15 sec 2012-11-07 11:15:38,815 Stage-1 map = 16%, reduce = 0%, Cumulative CPU 21.15 sec 2012-11-07 11:15:39,865 Stage-1 map = 16%, reduce = 0%, Cumulative CPU 21.15 sec 2012-11-07 11:15:41,064 Stage-1 map = 18%, reduce = 0%, Cumulative CPU 22.4 sec 2012-11-07 11:15:42,181 Stage-1 map = 18%, reduce = 0%, Cumulative CPU 22.4 sec 2012-11-07 11:15:43,299 Stage-1 map = 18%, reduce = 0%, Cumulative CPU 22.4 sec here restart at 0% ? 2012-11-07 11:15:44,418 Stage-1 map = 0%, reduce = 0% 2012-11-07 11:16:02,076 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 6.86 sec 2012-11-07 11:16:03,193 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 6.86 sec 2012-11-07 11:16:04,259 Stage-1 map = 2%, reduce = 0%, Cumulative CPU 8.45 sec (...) 2012-11-07 11:16:31,291 Stage-1 map = 22%, reduce = 0%, Cumulative CPU 35.34 sec 2012-11-07 11:16:32,414 Stage-1 map = 26%, reduce = 0%, Cumulative CPU 37.93 sec here restart at 11% ? 2012-11-07 11:16:33,459 Stage-1 map = 11%, reduce = 0%, Cumulative CPU 19.53 sec 2012-11-07 11:16:34,507 Stage-1 map = 11%, reduce = 0%, Cumulative CPU 19.53 sec 2012-11-07 11:16:35,731 Stage-1 map = 13%, reduce = 0%, Cumulative CPU 21.47 sec (...) 2012-11-07 11:16:46,839 Stage-1 map = 17%, reduce = 0%, Cumulative CPU 24.14 sec here restart at 0% ? 2012-11-07 11:16:47,939 Stage-1 map = 0%, reduce = 0% 2012-11-07 11:16:56,653 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 7.54 sec 2012-11-07 11:16:57,814 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 7.54 sec (...) Needless to say the job crashes after some time with an Error: java.io.IOException: java.io.IOException: java.lang.ArrayIndexOutOfBoundsException: -56

    Read the article

  • java.util.Map with HtmlDataTable

    - by gerry
    Hi, I'm developing an application on GlassFish v3 which uses Suns-RI of JavaEE6 and JSF2.0, etc. And the bad thing is, that no changes/switches away from Suns RI can be made (to use MyFaces or something like that). Now, the problem is, that I want to build HtmlDatatable by hand ( in Java code). The datatable should represent a java.util.Map where the first column should display the key and the second the values of the map. I've build successfully a PanelGrid from a java.util.List and used every time the "setExpressionValue" methods of UIComponent to bind the UI to the underlying List. But now, this doesn't work with the Map. Here is a snippet of my code: public HtmlDataTable getEntityDetailsDataTable() { ... Application app = FacesContext.getCurrentInstance().getApplication(); HtmlDataTable component = (HtmlDataTable)app.createComponent(HtmlDataTable.COMPONENT_TYPE); component.setValueExpression("value", ExpressionUtil.createValueExpression("#{entityTree.entity."+fieldName+".entrySet()}", Map.class)); component.setVar("param"); UIColumn column = new UIColumn(); UIOutput label1 = DynamicHtmlComponentCreator.createHtmlOutputText("#{param[key]}", String.class); column.getChildren().add(label1); UIOutput label2 = DynamicHtmlComponentCreator.createHtmlOutputText("#{param[value]}", String.class); column.getChildren().add(label2); component.getChildren().add(column); ... return component; } component.getChildren().add(column); ... return component; } So, further the problem is, that this code only prints out the content of the Map, on another page I need the values displayed in HtmlInputText elements and the whole map updated if the user clicks a i.e. "Save" button. So, further the problem is, that this code only prints out the content of the Map, on another page I need the values displayed in HtmlInputText elements and the whole map updated if the user clicks a i.e. "Save" button. If there is a workaround, to represent the Map as to Lists...please help me, because for this (map as 2 lists) I've no idea how the underlying map/database model can be updated again. Hopefully, someone can help me....

    Read the article

  • Google Map + MarkerClusterer only takes place when map completely zooms out

    - by user415795
    The clustering works but somehow it only takes place at the maximum zoom out(the largest view with all nations), the moment I zoom in by 1 value, the clustering icon changes back to markers. I try with all kinds of values on the maxZoom and gridSize clusterer options with no help. Can someone please kindly advice. Thanks. <script language="javascript" type="text/javascript"> var markersArray = []; var mc = null; var markersArray = []; var mc = null; var map; var mapOptions; var geocoder; var infoWindow; var http_request = false; var lat = 0; var lng = 0; var startingZoom = 7; var lowestZoom = 1; // The lower the number, the more places can be seen on within the bounds. var highestZoom = 8; function mapLoad() { geocoder = new google.maps.Geocoder(); infoWindow = new google.maps.InfoWindow(); mapOptions = { zoomControl: true, zoom: 2, minZoom: lowestZoom, maxzoom: highestZoom, draggable: true, scrollwheel: true, disableDoubleClickZoom: true, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map'), mapOptions); } $(document).ready(function () { var searchUrl; var locations; // Place the user's current location marker on the map var Location = new google.maps.LatLng(1.340319, 103.743744); var Location2 = new google.maps.LatLng(1.322347, 103.757881); createMarker('1', Location, 'My Location', '', '', '', '/Images/home.png'); createMarker('1', Location2, 'My Location', '', '', '', '/Images/bb.png'); var bounds = new google.maps.LatLngBounds(); bounds.extend(gameLocation); map.fitBounds(bounds); }); // Create the marker with address information function createMarker(actId, point, address1, address2, town, postcode, icon) { var marker = new google.maps.Marker({ map: map, icon: icon, position: point, title: address1, animation: google.maps.Animation.DROP }); marker.metadata = { id: actId }; markersArray.push(marker); mc = new MarkerClusterer(map, markersArray); return marker; } </script>

    Read the article

  • How to code the set method of a Map with another Map as value?

    - by Nazgulled
    I normally do this to set a new Map to a private variable: public static void setListaClausulas(Map<String, Clausula> nvLista) { listaClausulas = new TreeMap<String, Clausula>(nvLista); } I suppose this is ok to set a new copy of the nvLista and all it's members and not a reference, is it? But now I have a Map inside another Map and I'm doing this: public static void setListaClausulas(Map<String, Map<String, Clausula>> nvLista) { listaClausulas = new TreeMap<String, Map<String, Clausula>>(nvLista); } Is this the correct way to do it or do you recommend something else? What I want is to set a new copy of nvLista (and all it's elements) and not copy just the reference.

    Read the article

  • Moving only the contents of a map and not the map itself on linux

    - by WebDevHobo
    Using the cp command, one can move files and folders on linux. I want to make a new user and move the contents of the skeleton map to their home directory. I use this command: cp -r /etc/skel/ /home/testuser/ However, this only creates a skel folder in testuser. The idea is that the contents of the /etc/skel folder be copied to /home/testuser, and not that a map be made in /home/testuser with those contents. I've checked the man page: Link, but nothing on there really seemed like the solution to me. Is there a way to do this, or do files really need to be moved manually, 1 by 1?

    Read the article

  • How to find relation between change in latitudes at centre of map and top/bottom

    - by Imran
    Hi, Im having little trouble finding a relation between the movement at centre and edge of a circle, Im doing for panning world map,my map extent is 180,89:-180,-89, my map pans by adding change(dx,dY) to its extents and not its centre. Now a situation has arrrised where I have to move the map to a specific centre, to calculate the change in longitudes is very easy and simple, but its the change in lattitudes that has caused problem. It seems the change in centreY of map is more than the change at edge of the mapY, or simply if I have to move the map centre from 0long,0lat to 73long,33lat, for dX I simply get 73, but for dY apparently it looks 33 but if i add 33 to top of map that is 89 , it will be 122 which is incorrect since Latitudes are between 90 and -90 . It seems a case a projection of a circle on 2D plane where the edge of circle since is moving backward due to angle expereinces less change and the centre expereinces more change, now is there a relation between these two factors? I tried converting the difference between OriginY and destinationY into radians and then add to Top and Bottom of Map, but it did'nt really work for me. Please note that the map is project on a virtual canvas whose width starts from 256 and increases by 256*2^z , z=0 is default and whole world is visible at that extent of canvas code: public void moveMapTo(double destinationLongitude,double destinationLattitude) // moves map to the new centre { double dXLong=destinationLongitude-centreLongitude; double atanhsinO = atanh(Math.sin(destinationLattitude * Math.PI / 180.00)); double atanhsinD = atanh(Math.sin(centreLatitude * Math.PI / 180.00)); double atanhCentre = (atanhsinD + atanhsinO) / 2; double latitudeSpan =destinationLattitude - centreLatitude; double radianOfCentreLatitude = Math.atan(Math.sinh(atanhCentre)); double dXLat=latitudeSpan / Math.cos(radianOfCentreLatitude); dXLat*=getLattitudeSpan()*(Math.PI/180); <--- HERE IS THE PORBLEM System.out.println("dxLong:"+dXLong+"_dxLat:"+dXLat); mapLeft+=dXLong; mapRight+=dXLong; mapTop+=dXLat; mapBottom+=dXLat; } ////latitude span function private double getLattitudeSpan() { double latitudeSpan = mapTop - mapBottom; latitudeSpan = latitudeSpan / Math.cos(radianOfCentreLatitude); return Math.abs(latitudeSpan); } //ht

    Read the article

  • add extra hint icon at current google map

    - by user315396
    my code is written from http://stackoverflow.com/questions/1171433/jquery-xml-and-google-map Now all marker icons can be displayed at current google map. But now I want to add some function. When getting description of item (it will map to opposite icon) ,if user click this description, a hint will display near the map icon at google. I still can't how to start.I can get lat and lng of location. PS:some of markers will map to same point.

    Read the article

  • ArrayList and Map problem in grails

    - by xain
    Hi, I have a service that contains a map: static Map cargosMap = ['1':'item1','2':'item 2','3':'item 3'] that is returned via a method in the service: static Map getCargos() { [cargosMap] } A controller calls it like this: def mform = { Map cargos = empService.getCargos() [cargos:cargos] } In the gsp, I have the select: <g:select name="cg1" from="${cargos}" /> But I'm getting the exception: Error 500: Executing action ....caused exception: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ... with class 'java.util.ArrayList' to class 'java.util.Map' Any clues ? Thanks

    Read the article

  • More Efficient Data Structure for Large Layered Tile Map

    - by Stupac
    It seems like the popular method is to break the map up into regions and load them as needed, my problem is that in my game there are many AI entities other than the player out performing actions in virtually all the regions of the map. Let's just say I have a 5000x5000 map, when I use a 2D array of byte's to render it my game uses around 17 MB of memory, as soon as I change that data structure to a my own defined MapCell class (which only contains a single field: byte terrain) my game's memory consumption rockets up to 400+ MB. I plan on adding layering, so an array of byte's won't cut it and I figure I'd need to add a List of some sort to the MapCell class to provide objects in the layers. I'm only rendering tiles that are on screen, but I need the rest of the map to be represented in memory since it is constantly used in Update. So my question is, how can I reduce the memory consumption of my map while still maintaining the above requirements? Thank you for your time! Here's a few snippets my C# code in XNA4: public static void LoadMapData() { // Test map generations int xSize = 5000; int ySize = 5000; MapCell[,] map = new MapCell[xSize,ySize]; //byte[,] map = new byte[xSize, ySize]; Terrain[] terrains = new Terrain[4]; terrains[0] = grass; terrains[1] = dirt; terrains[2] = rock; terrains[3] = water; Random random = new Random(); for(int x = 0; x < xSize; x++) { for(int y = 0; y < ySize; y++) { //map[x,y] = new MapCell(terrains[random.Next(4)]); map[x,y] = new MapCell((byte)random.Next(4)); //map[x, y] = (byte)random.Next(4); } } testMap = new TileMap(map, xSize, ySize); // End test map setup currentMap = testMap; } public class MapCell { //public TerrainType terrain; public byte terrain; public MapCell(byte itsTerrain) { terrain = itsTerrain; } // the type of terrain this cell is treated as /*public Terrain terrain { get; set; } public MapCell(Terrain itsTerrain) { terrain = itsTerrain; }*/ }

    Read the article

  • Go - Using a map for its set properties with user defined types

    - by Seth Hoenig
    I'm trying to use the built-in map type as a set for a type of my own (Point, in this case). The problem is, when I assign a Point to the map, and then later create a new, but equal point and use it as a key, the map behaves as though that key is not in the map. Is this not possible to do? // maptest.go package main import "fmt" func main() { set := make(map[*Point]bool) printSet(set) set[NewPoint(0, 0)] = true printSet(set) set[NewPoint(0, 2)] = true printSet(set) _, ok := set[NewPoint(3, 3)] // not in map if !ok { fmt.Print("correct error code for non existent element\n") } else { fmt.Print("incorrect error code for non existent element\n") } c, ok := set[NewPoint(0, 2)] // another one just like it already in map if ok { fmt.Print("correct error code for existent element\n") // should get this } else { fmt.Print("incorrect error code for existent element\n") // get this } fmt.Printf("c: %t\n", c) } func printSet(stuff map[*Point]bool) { fmt.Print("Set:\n") for k, v := range stuff { fmt.Printf("%s: %t\n", k, v) } } type Point struct { row int col int } func NewPoint(r, c int) *Point { return &Point{r, c} } func (p *Point) String() string { return fmt.Sprintf("{%d, %d}", p.row, p.col) } func (p *Point) Eq(o *Point) bool { return p.row == o.row && p.col == o.col }

    Read the article

  • Fit Map onto Google Map

    - by Viplime
    I would like to fit my map onto the same place in google maps.I have max 10 gps(latitude and longitude) positions on my map and I want to fit it on google maps using the points.I think I need to use overlay features of google maps.However, I need to transform my map to fit properly.How do i transform my map(image) to be able to fit it onto google maps? Is there an google method or API for it? Thanks.

    Read the article

  • Bing Maps - how to link to a push pin from a link outside the map

    - by Rajah
    I have a Virtual Earth Maps (Bing Maps??) to which I have added a set of pushpins. Each pushpin is labelled 1 to n. In addition to adding pushpins to the map, I also add text to the web-page that contains the description to each pushpin. I would like to add a link to the text outside the map, that when clicked will open the balloon associated with the corresponding pushpin. How do I open the balloon associated with a pushpin, through a link that exists outside the map? To get a better understanding, look at my map: link. When you click load, PushPins are added to the map. I would like to have a link from the list on the right of the map, that opens the corresponding PushPin. Thanks in advance!

    Read the article

  • Join map and refer to its key/value in HQL

    - by alamar
    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 == :foo and map value == :bar"? I can join it using select album from Album album join album.externalIds ids But how would I then refer to ids' key and value? ids.key.id = :foo and ids.value = :bar doesn't work, and hibernate doc is silent on this topic. Naive approaches that didn't work: select album from Album album join album.externalIds externalId where index(externalId).id = :foo and externalId = :bar and select album from Album album join album.externalIds externalId join index(externalId) major where major.id = :foo and externalId = :bar

    Read the article

  • google collections ordering on map values

    - by chris-gr
    I would like to order a map based on the values. Function<Map.Entry<A, Double>, Double> getSimFunction = new Function<Map.Entry<A, Double>, Double>() { public Double apply(Map.Entry<A, Double> entry) { return entry.getValue(); } }; final Ordering<Map.Entry<A, Double>> entryOrdering = Ordering.natural().onResultOf(getSimFunction); ImmutableSortedMap.orderedBy(entryOrdering).putAll(....).build(); How can I create a new sortedMap based on the ordering results or a sortedset based on the map.keyset()?

    Read the article

  • Need help with map (c++, STL)

    - by Mike Dooley
    Hi folks! Actually I'm new to C++. I tried something out (actually the map container) but it doesn't work the way I assumed it will... Before posting my code, I will explain it shortly. I created 3 classes: ClassA ClassDerivedA ClassAnotherDerivedA The two last ones are derived from "ClassA". Further I created a map: map<string,ClassA> test_map; I put some objects (from Type ClassDerivedA and ClassAnotherDerivedA) into the map. Keep in mind: the mapped value is from type "ClassA". This will only work because of Polymorphism. Finally I created an iterator which runs over my map and compares the user input with my keys in the map. If they match, it will call a specific method called "printOutput". And there is the Problem: Although i declared "printOutput" as "virtual" the only method called is the one from my base class, but why? and here is the code: #include <iostream> #include <map> using namespace std; class ClassA { public: virtual void printOutput() { cout << "ClassA" << endl; } }; class ClassDerivedA : public ClassA { public: void printOutput() { cout << "ClassDerivedA" << endl; } }; class ClassAnotherDerivedA: public ClassA { public: void printOutput() { cout << "ClassAnotherDerivedA" << endl; } }; int main() { ClassDerivedA class_derived_a; ClassAnotherDerivedA class_another_a; map<string,ClassA> test_map; test_map.insert(pair<string,ClassA>("deriveda", class_derived_a)); test_map.insert(pair<string,ClassA>("anothera", class_another_a)); string s; while( cin >> s ) { if( s != "quit" ) { map<string,ClassA>::iterator it = test_map.find(s); if(it != test_map.end()) it->second.printOutput(); } else break; } } Blockquote

    Read the article

  • Use of for_each on map elements

    - by Antonio
    I have a map where I'd like to perform a call on every data type object member function. I yet know how to do this on any sequence but, is it possible to do it on an associative container? The closest answer I could find was this: Boost.Bind to access std::map elements in std::for_each. But I cannot use boost in my project so, is there an STL alternative that I'm missing to boost::bind? If not possible, I thought on creating a temporary sequence for pointers to the data objects and then, call for_each on it, something like this: class MyClass { public: void Method() const; } std::map<int, MyClass> Map; //... std::vector<MyClass*> Vector; std::transform(Map.begin(), Map.end(), std::back_inserter(Vector), std::mem_fun_ref(&std::map<int, MyClass>::value_type::second)); std::for_each(Vector.begin(), Vector.end(), std::mem_fun(&MyClass::Method)); It looks too obfuscated and I don't really like it. Any suggestions?

    Read the article

  • More on Map Testing

    - by Michael Stephenson
    I have been chatting with Maurice den Heijer recently about his codeplex project for the BizTalk Map Testing Framework (http://mtf.codeplex.com/). Some of you may remember the article I did for BizTalk 2009 and 2006 about how to test maps but with Maurice's project he is effectively looking at how to improve productivity and quality by building some useful testing features within the framework to simplify the process of testing maps. As part of our discussion we realized that we both had slightly different approaches to how we validate the output from the map. Put simple Maurice does some xpath validation of the data in various nodes where as my approach for most standard cases is to use serialization to allow you to validate the output using normal MSTest assertions. I'm not really going to go into the pro's and con's of each approach because I think there is a place for both and also I'm sure others have various approaches which work too. What would be great is for the map testing framework to provide support for different ways of testing which can cover everything from simple cases to some very specialized scenarios. So as agreed with Maurice I have done the sample which I will talk about in the rest of this article to show how we can use the serialization approach to create and compare the input and output from a map in normal development testing. Prerequisites One of the common patterns I usually implement when developing BizTalk solutions is to use xsd.exe to create .net classes for most of the schemas used within the solution. In the testing pattern I will take advantage of these .net classes. The Map In this sample the map we will use is very simple and just concatenates some data from the input message to the output message. Hopefully the below picture illustrates this well. The Test In the test I'm basically taking the following actions: Use the .net class generated from the schema to create an input message for the map Serialize the input object to a file Run the map from .net using the standard BizTalk test method which was generated for running the map Deserialize the output file from the map execution to a .net class representing the output schema Use MsTest assertions to validate things about the output message The below picture shows this: As you can see the code for this is pretty simple and it's all strongly typed which means changes to my schema which can affect the tests can be easily picked up as compilation errors. I can then chose to have one test which validates most of the output from the map, or to have many specific tests covering individual scenarios within the map. Summary Hopefully this post illustrates a powerful yet simple way of effectively testing many BizTalk mapping scenarios. I will probably have more conversations with Maurice about these approaches and perhaps some of the above will be included in the mapping test framework.   The sample can be downloaded from here: http://cid-983a58358c675769.office.live.com/self.aspx/Blog%20Samples/More%20Map%20Testing/MapTestSample.zip

    Read the article

  • Creating a tiled map with blender

    - by JamesB
    I'm looking at creating map tiles based on a 3D model made in blender, The map is 16 x 16 in blender. I've got 4 different zoom levels and each tile is 100 x 100 pixels. The entire map at the most zoomed out level is 4 x 4 tiles constructing an image of 400 x 400. The most zoomed in level is 256 x 256 obviously constructing an image of 25600 x 25600 What I need is a script for blender that can create the tiles from the model. I've never written in python before so I've been trying to adapt a couple of the scripts which are already there. So far I've come up with a script, but it doesn't work very well. I'm having real difficulties getting the tiles to line up seamlessly. I'm not too concerned about changing the height of the camera as I can always create the same zoomed out tiles at 6400 x 6400 images and split the resulting images into the correct tiles. Here is what I've got so far... #!BPY """ Name: 'Export Map Tiles' Blender: '242' Group: 'Export' Tip: 'Export to Map' """ import Blender from Blender import Scene,sys from Blender.Scene import Render def init(): thumbsize = 200 CameraHeight = 4.4 YStart = -8 YMove = 4 XStart = -8 XMove = 4 ZoomLevel = 1 Path = "/Images/Map/" Blender.drawmap = [thumbsize,CameraHeight,YStart,YMove,XStart,XMove,ZoomLevel,Path] def show_prefs(): buttonthumbsize = Blender.Draw.Create(Blender.drawmap[0]); buttonCameraHeight = Blender.Draw.Create(Blender.drawmap[1]) buttonYStart = Blender.Draw.Create(Blender.drawmap[2]) buttonYMove = Blender.Draw.Create(Blender.drawmap[3]) buttonXStart = Blender.Draw.Create(Blender.drawmap[4]) buttonXMove = Blender.Draw.Create(Blender.drawmap[5]) buttonZoomLevel = Blender.Draw.Create(Blender.drawmap[6]) buttonPath = Blender.Draw.Create(Blender.drawmap[7]) block = [] block.append(("Image Size", buttonthumbsize, 0, 500)) block.append(("Camera Height", buttonCameraHeight, -0, 10)) block.append(("Y Start", buttonYStart, -10, 10)) block.append(("Y Move", buttonYMove, 0, 5)) block.append(("X Start", buttonXStart,-10, 10)) block.append(("X Move", buttonXMove, 0, 5)) block.append(("Zoom Level", buttonZoomLevel, 1, 10)) block.append(("Export Path", buttonPath,0,200,"The Path to save the tiles")) retval = Blender.Draw.PupBlock("Draw Map: Preferences" , block) if retval: Blender.drawmap[0] = buttonthumbsize.val Blender.drawmap[1] = buttonCameraHeight.val Blender.drawmap[2] = buttonYStart.val Blender.drawmap[3] = buttonYMove.val Blender.drawmap[4] = buttonXStart.val Blender.drawmap[5] = buttonXMove.val Blender.drawmap[6] = buttonZoomLevel.val Blender.drawmap[7] = buttonPath.val Export() def Export(): scn = Scene.GetCurrent() context = scn.getRenderingContext() def cutStr(str): #cut off path leaving name c = str.find("\\") while c != -1: c = c + 1 str = str[c:] c = str.find("\\") str = str[:-6] return str #variables from gui: thumbsize,CameraHeight,YStart,YMove,XStart,XMove,ZoomLevel,Path = Blender.drawmap XMove = XMove / ZoomLevel YMove = YMove / ZoomLevel Camera = Scene.GetCurrent().getCurrentCamera() Camera.LocZ = CameraHeight / ZoomLevel YStart = YStart + (YMove / 2) XStart = XStart + (XMove / 2) #Point it straight down Camera.RotX = 0 Camera.RotY = 0 Camera.RotZ = 0 TileCount = 4**ZoomLevel #Because the first thing we do is move the camera, start it off the map Camera.LocY = YStart - YMove for i in range(0,TileCount): Camera.LocY = Camera.LocY + YMove Camera.LocX = XStart - XMove for j in range(0,TileCount): Camera.LocX = Camera.LocX + XMove Render.EnableDispWin() context.extensions = True context.renderPath = Path #setting thumbsize context.imageSizeX(thumbsize) context.imageSizeY(thumbsize) #could be put into a gui. context.imageType = Render.PNG context.enableOversampling(0) #render context.render() #save image ZasString = '%s' %(int(ZoomLevel)) XasString = '%s' %(int(j+1)) YasString = '%s' %(int((3-i)+1)) context.saveRenderedImage("Z" + ZasString + "X" + XasString + "Y" + YasString) #close the windows Render.CloseRenderWindow() try: type(Blender.drawmap) except: #print 'initialize extern variables' init() show_prefs()

    Read the article

  • Google map "zoomend" event issue

    - by ebae
    On my html page, I have a google map with a few markers. I want all the markers to be cleared once the zoom is changed on the map with the following code. GEvent.addListener(map, "zoomend", function() { map.clearOverlays(); } But what happens is actually the markers are removed by the "clearOverlays()" function, but then they appear again. Any idea why? Where is it going after the event is handled?

    Read the article

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