The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
1answer
32 views

How to map collection of unique large numbers to an array?

I have a list of unique 8 byte random ids and new ids are generated often. Let's say that the total number of ids can become at most N (let's say 100,000). Now, I want to map each of these ids to a ...
2
votes
2answers
114 views

What is the most idiomatic way to iterate collection with different action for first element?

Sometimes we meet a situation where we should iterate (or map) over a collection, applying the same procedure (function) for all elements except the first one. The simplest example is finding the max ...
0
votes
2answers
61 views

Implementing map with tail recursion

I am trying to solve this exercise. It is about reimplementing the map function in haskell for learning purpose. I found a solution which doesn't browse all the elements of the list (simple linked ...
1
vote
2answers
46 views

Type of map for Try[T]

I was looking at the type of map for Try[T] in Scala, which is: def map[S](f: T=>S): Try[S] From Haskell, I am used to the type of map being: map :: (a->b)->[a]->[b] This seems very ...
1
vote
2answers
4k views

sorting using a custom definition of “>” and “< ” in python

suppose I have a custom function such as def greater(a, b): if (a % b) % 2 == 0: return 1 return 0 It defines how to compare two numbers and determine which is greater. In this ...
5
votes
1answer
69 views

Storing pairs in a map

If I have a Pair class like this: class Pair<K, L>{ public final K a; public final L b; public Pair(K obj1, L obj2){this.a = obj1; this.b = obj2;} //... } I want to associate a ...
3
votes
1answer
205 views

Divide the world map into fixed sized blocks

I am developing an app where I need to divide the entire world map into fixed sized square blocks. For simplicity, think of it as a problem of dividing the google maps into a fixed sized block. I can ...
2
votes
3answers
758 views

What means mapping in terms of programming

My question is what means a mapper and the action of mapping something? For example, I often hear things like: Mapping the classes Mapping the objects from the database Mapping the objects Mapping ...
-3
votes
2answers
183 views

Integer Map Algorithm [closed]

For my project, I need to map integers so that inputting int X will output int Y where both X and Y are defined during runtime. I've used Dictionary<int,int> in .NET but its memory use is too ...
-2
votes
1answer
103 views

DDD - map or object [closed]

What is correct by DDD - should I create map of two objects eg Map or should i use more meaningfull object that will contain this pair MoreMeaningfullName{Obj1, Obj2} ? If using first approach, I don'...
2
votes
1answer
252 views

Determine exact coordinates for a map image?

My brother suggested that I should write a web app that lets students create and print blank maps. A blank map is a map that contains country borders, waters etc. but no text labels. The first use ...
15
votes
4answers
2k views

“Use map instead of class to represent data” -Rich Hickey

In this video by Rich Hickey, the Clojure creator, he advises to use map to represent data instead of using a class to represent it, as done in Java. I don't understand how it can be better, since how ...
1
vote
4answers
932 views

Adding values to HashMap

I want to add values to a HashMap, which would be used by methods in the same class. I have two solutions: Adding all the values with static When the first method is called, add the values ...
1
vote
1answer
69 views

Reduce Operations on Distributed Databases

I would like to ask you about optimizing reduce operations (e.g. count) on multiple databases. Let's say there is a user table that is stored in various countries and sharding is made based on the ...
8
votes
1answer
527 views

How do I efficiently store all OpenStreetMap data in an indexed way?

I have a PBF file that contains the following information about a country: Nodes, each with their own longitude, latitude and properties; used to store points in a 2D space. Ways, each with their ...
1
vote
1answer
73 views

storing map template in database

I am working on an application that displays choropleth maps. These maps are of all different types, some display state by county, country by state/province, or world by country. How should I ...
1
vote
2answers
4k views

Dataset with coordinates of borders of countries [closed]

I am creating an application that visually displays world regions, e.g. to place markers within an administrative region. Does a dataset exist with geometrical or geographical (long/lat) descriptions ...
2
votes
1answer
174 views

How to find out if a tile is being covered by a polygon?

Given a (intersecting) polygon, I'd like find out which tiles are being covered by the polygon. Example: Details: Tiles are square, 1 unit wide/high The grid begins in (0,0) The corners of the ...
4
votes
2answers
1k views

How can “hash functions” be used to implement hash maps at all?

My understandment is that hash maps allow us to link, say, a string, to certain memory location. But if every string were to be linked to a unique place in memory it would need a huge block of empty ...
2
votes
2answers
711 views

Mapping a list of optional values to an optional list of values

I have encountered the following pattern while programming in Haskell (but the pattern could occur in any language supporting lists, option types, and mapping of a function over a list). I have types ...
-2
votes
1answer
16k views

Why does HashMap allow only one null key? [closed]

A HashMap allows only one null key. Is it because it allows only unique keys? Or is there another reason?
2
votes
2answers
1k views

Google Maps-based desktop application [closed]

I want to build a desktop application which has google maps embedded to it. This app should have a thread to read coordinate data online a usb microphone to use. This application will move the google ...
1
vote
2answers
3k views

How do I initialize a Scala map with more than 4 initial elements in Java?

For 4 or fewer elements, something like this works (or at least compiles): import scala.collection.immutable.Map; Map<String,String> HAI_MAP = new Map4<>("Hello", "World", ...
1
vote
1answer
96 views

how to map controllers , models, and views as a todo list

Before starting on a current project I was wondering if there is a terminology for what I am planning on doing? Basically what I want to do is map out every object in layers such as all the ...
17
votes
6answers
2k views

Map of functions vs switch statement

I'm working on a project that processes requests, and there are two components to the request: the command and the parameters. The handler for each command is very simple (< 10 lines, often < 5)....
5
votes
2answers
553 views

GIS-based data visualization and maintenance tool

Background Looking to leverage an existing GIS system for exploring organizational data. Architecture The following figure represents a high-level overview of the system's desired features: The ...
6
votes
1answer
168 views

Multi-platform Map Application

I'm working on a web project (PHP, jQuery) which currently using Google Maps powering up the map functionality of the application, however we need to make it multi-platform like you can go to the ...
2
votes
2answers
143 views

What can I do in order to inform users of potential errors in my software in order to minimize liability?

I'm an independent software developer that's spent the last few months creating software for viewing and searching map data. The software has some navigation functionality as well (mapping, directions,...
2
votes
2answers
186 views

Best approach for saving highlighted areas on geographical map

I am designing an application that allow users to highlight areas of a geographical map using a tool that is like brush or a pen. The tool basically draw a circle with a single click and continue ...
3
votes
1answer
212 views

For csv database extracts, how do map keys not create a dependency?

A lot of my work is done with .csv extracts (reports) from databases. As I have been programming in Clojure, I've received comments that relying on vector indexes creates dependencies. I understand ...
1
vote
1answer
687 views

Countour Mapping API

I have done some searching on Google, but haven't come up with much as of yet. I am wanting to take a set of point data, which I had previously been using to create weighted points for a heat map ...
4
votes
1answer
2k views

(How can I / Am I allowed to) Use Google Maps as a Texture on an OpenGL object?

Note: I asked a very similar question on StackOverflow but did not get much attention, so was directed to http://programmers.stackexchange.com as licensing issues seem to have more interest here... I ...
5
votes
2answers
7k views

What is the advantage of using map datastructure?

I am a member of some online coding website and today when I submitted a solution in C++, I saw there were much better answers in C++ itself which took considerably less time. The solutions were open ...
3
votes
1answer
519 views

Find the average speed for roads

I am working on a mobile application and I would like to ask you a question. Is there an API or a method to get/calculate the average speed that a car should have in a road. I am working on a GPS like ...
1
vote
3answers
376 views

Is an assocative array ordered?

An associative array has many common similar names, hash, keymap, map, table, index. It's a map of keys and values but I cannot find a reputable definition of the phrase which tells me whether a map ...