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...
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...
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...
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
...
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 ...
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&hl=en&x=1&y=0&z=1&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...
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...
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...
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 },
...
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?
...
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 ...
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...
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...
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....
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...
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.
...
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...
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...
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...
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...