0
голосов
1ответов
733 просмотров

How can I display custom icon and two hyperlinks in model pop up on Blackberry map?

I need to display a custom icon and two hyperlinks in model pop up on Blackberry map. How can I do this?

13
голосов
4ответов
5125 просмотров

std::map difference between index and insert calls

What is the difference between the index overloaded operator and the insert method call for std::map? ie: some_map["x"] = 500; vs. some_map.insert(pair<std::string, int>("x", 500));

2
голосов
2ответов
6274 просмотров

std::map::iterator crashes program on increment

What could cause this? Here's the stack trace: #0 0x0645c0f5 in std::_Rb_tree_increment (__x=0x83ee5b0) at ../../../../libstdc++-v3/src/tree.cc:69 #1 0x0805409a in std::_Rb_tree_iterator<std::pair<std::string const, Widget*> >::operator++ ( this=0xbffff144) at /usr/lib...

0
голосов
1ответов
3012 просмотров

How to map file path from different folder location easily?

how to map the path to the file easily? public_html/api/function.php <?php function writetologfile($content) { $filename = 'logfile/testing_randomstring.txt'; if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } fclose($h...

0
голосов
5ответов
426 просмотров

C++ map object not growing when members added

Below the map 'widgets' is always size of 1 for some reason. There should be 4 when it's done. Output: Widget: widget_ram_label:layout_bar:0 1 Widget: widget_ram_active:layout_bar:0 1 Widget: widget_ram_total:layout_bar:0 1 Widget: widget_wlan0_label:layout_bar:0 1 Here's widgets: std::map&l...

0
голосов
1ответов
1791 просмотров

How to query distinct values from map with given key in Hibernate?

I have following Hibernate 3 mapping for User class: <class name="org.test.User" table="users"> ... some other mapping... <map name="metadata" table="user_metadata"> <cache usage="transactional"/> <key column="user_id" not-null="true" foreign-key="FK_US...

2
голосов
5ответов
2958 просмотров

Java swap two keys in a Map

Welcome. I have a generic void method swap that takes a Map and 2 keys. The method will swap the values associated with the keys in the Map. I already checked that both keys are contained in the Map somewhere else, but in this method, I can't use looping. My method answer: public static<K, W&...

1
голосов
4ответов
8659 просмотров

Java setting values from a Map to a Set

I am trying to make a method that takes the first Map whose values are sets and a second empty Map whose values are Lists and fills the second Map with the same key/value Mappings as the first. The 2nd map will have every key in the 1st Map, but associated with it is a List of all the same elemen...

0
голосов
2ответов
196 просмотров

JQuery - arrays

how can I create map to send it like post-data, using ajax? For exmaple, I has an iterator each function, where I should do something like: var map = []; ...each(function() { map[ $(this).key() ] = $(this).val(); }); Or what another synax?

0
голосов
2ответов
2191 просмотров

Hibernate - How to use an Enumeration as Map's Key

My entity defines a field like Map<String, String> props; I've got this hibernate xml configuration <map name="props" table="PROPS"> <key column="id"/> <index column="name" type="string"/> <element column="value" type="string"/> </map>...

0
голосов
2ответов
88 просмотров

Building a map simulation system

I'm currently working on a project that simulates a map with routes on it that allows users to decide their destination, and the system will calculate the shortest path to it. The map should receives real-time traffic data in which the traffic flow changes along the way while the vehicle is trave...

2
голосов
3ответов
1056 просмотров

Java: Data structure for caching computation result?

I have an expensive computation, the result of which I'd like to cache. Is there some way to make a map with two keys? I'm thinking of something like Map<(Thing1, Thing2), Integer>. Then I could check: if (! cache.contains(thing1, thing2)) { return computeResult(); } else { return cac...

0
голосов
2ответов
1010 просмотров

How to reset default location map of Nerddinner?

It's a simple issue which I want to modify for a long time. Could anyone let me know where I could change the default map location from "USA" to "UK" or other country? Many thanks.

0
голосов
5ответов
869 просмотров

Java: Data structure for sorting objects/maintaining a key in that order?

I want to maintain a collection of objects of type Odp. Odp implements Comparable. I need to be able to refer to an object in the collection with its integer name. This integer must correspond to its sort order (not insertion order). Each integer only applies to one Odp, and vice versa. I have a...

27
голосов
9ответов
20371 просмотров

Recommend a fast & scalable persistent Map - Java

I need a disk backed Map structure to use in a Java app. It must have the following criteria: Capable of storing millions of records (even billions) Fast lookup - the majority of operations on the Map will simply to see if a key already exists. This, and 1 above are the most important criteria....

4
голосов
6ответов
428 просмотров

Three map implementations in javascript. Which one is better?

I wrote a simple map implementation for some task. Then, out of curiosity, I wrote two more. I like map1 but the code is kinda hard to read. If somebody is interested, I'd appreciate a simple code review. Which one is better? Do you know some other way to implement this in javascript? var map =...

5
голосов
2ответов
242 просмотров

Creating array from object function using map

I have an array of HTML::Elements obtained from HTML::TreeBuilder and HTML::Element->find and I need to assign their as_text value to some other variables. I know I can really easily do my ($var1, $var2) = ($arr[0]->as_text, $arr[1]->as_text); but I was hoping I could use map instead ...

2
голосов
9ответов
5189 просмотров

Compound String key in HashMap

We are storing a String key in a HashMap that is a concatenation of three String fields and a boolean field. Problem is duplicate keys can be created if the delimiter appears in the field value. So to get around this, based on advice in another post, I'm planning on creating a key class which w...

69
голосов
5ответов
69593 просмотров

Bad idea to use String key in HashMap?

I understand that the String class' hashCode() method is not guarantied to generate unique hash codes for distinct String-s. I see a lot of usage of putting String keys into HashMap-s (using the default String hashCode() method). A lot of this usage could result in significant application issue...

3
голосов
7ответов
2664 просмотров

Data lookup method for small data set with Java?

We have to lookup some data based on three input data fields. The lookup has to be fast. There are only about 20 possible lookup combinations. We've implemented this using a static HashMap instance where we create a key by concatinating the three data fields. Is there a better way to do this ...

1
голосов
1ответов
3841 просмотров

Problem with Firefox & IE8 not showing mouseover alt text for image maps

I have the following HTML: <div style="position: relative; text-align: left;"> <img id="chart_6c544b37_ac9d_49ed_912e_5ff8ad6c0181_BaseImage" src="chart.gif" width="460px" height="240px" usemap="#chart_6c544b37_ac9d_49ed_912e_5ff8ad6c0181" border="0"> <map name="chart_6c544b37_ac...

19
голосов
8ответов
9285 просмотров

Renaming first and second of a map iterator

Is there any way to rename the first and second accessor functions of a map iterator. I understand they have these names because of the underlying pair which represents the key and value, but I'd like the iterators to be a little more readable. I think this might be possible using an iterator a...

41
голосов
8ответов
65332 просмотров

How does one instantiate an array of maps in Java?

I can declare an array of maps using generics to specify the map type: private Map<String, Integer>[] myMaps; However, I can't figure out how to instantiate it properly: myMaps = new HashMap<String, Integer>[count]; // gives "generic array creation" error myMaps = new HashMap[coun...

2
голосов
3ответов
723 просмотров

Modifying module level variables in an anonymous array in Ruby

I am in the midst of learning Ruby and thought I was clever with the following piece of code: [@start,@end].map!{ |time| time += operation == :add ? amount : -(amount) } where @start, @end are two module level variables, operation can be one of :add or :sub, and amount is an float amount to ad...

2
голосов
6ответов
1304 просмотров

C++ map question

I have an integral position-based algorithm. (That is, the output of the algorithm is based on a curvilinear position, and each result is influenced by the values of the previous results). To avoid recalculating each time, I would like to pre-calculate at a given sample rate, and subsequently pe...

5
голосов
3ответов
7531 просмотров

C++ STL map with a custom class as second type

I'd like to create a map with an int and my own custom class. Is there a way to do this? map<int, MyClass> myMap; If not, how do I go about accomplishing this? Basically, I want an id(or preferably an enum) to point to my own custom class. In most other languages, this would be a simp...

1
голосов
2ответов
1715 просмотров

JNA-Mapping Delphi Function

How do i map this function with JNA: Delphi code: function getData(InData1: PChar; InData2: PChar; Data: TArray16; var OutData1: PChar; var OutData2: PChar): integer; stdcall; with: TArray16 = array[0..15] of char; The i...

10
голосов
5ответов
4760 просмотров

Where to get Terrain Data - both free and paid?

Where can you get terrain data? What resolution data can you get for free? What resolution data can you get when you buy the data? How much is that data? I found this site that has free terrain data. The resolution is 30m x 30m. Is that the best that can be found for free?

2
голосов
7ответов
9848 просмотров

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

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

9
голосов
8ответов
4403 просмотров

Why is the list my Perl map returns just 1's?

The code I wrote is as below : #!/usr/bin/perl my @input = ( "a.txt" , "b.txt" , "c.txt" ) ; my @output = map { $_ =~ s/\..*$// } @input ; print @output ; My intention is to let the file name without the extension stored in the array @output. but instead it stores the value returned by s//...