由买买提看人间百态

topics

全部话题 - 话题: mapping
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
vi
发帖数: 309
1
来自主题: Programming版 - STL set and map question
It feels like whereever you need a map, it can be done by a set,
by defining the key of the map as the key for the set, and have
the value of the map as regular data members.
What's the rational to make the difference between the two? Thanks.
e******r
发帖数: 220
2
来自主题: Programming版 - map是用什么data structure来implement的?
还有map, hash map, multi-map, 这几个什么区别? 看得都糊涂了.
P********e
发帖数: 2610
3
来自主题: Programming版 - stl的map可以嵌套几层?
比如
map >>>>
最多几曾
我套了4个,就一堆warning
P*****f
发帖数: 2272
4
来自主题: Programming版 - map shared memory to local process
no
map is just map
you can regard heap as a special map

地址
是多
w***g
发帖数: 5958
5
来自主题: Programming版 - map shared memory to local process
这一点很讨厌. 我觉得没有一个万全的方法. 不过我觉得下面的方法或许成功的可能
性比较大:
0. 所有的程序都是同一个可执行文件.
1. 每个程序都是一开始运行就map共享内存.
2. 第一个程序map共享内存后把地址记下来. 所有后继程序都试图map同样的地址.
最好还是建议你不要用pointer. 如果是C++的话可以自己写个类包装一下pointer, 把共
享内存的其实地址包装进去.
s***n
发帖数: 176
6
来自主题: Programming版 - google map 的问题

I don't think it is.

they can't. i don't know how often google updates its base map data but i
don't think they do it often cuz base map data is huge. well there is some
map that allows everybody to edit, check out openstreetmap.org
I*******e
发帖数: 1879
7
来自主题: Programming版 - [合集] huge map怎么算最短路径?
☆─────────────────────────────────────☆
CHKRUN (小鸡快跑) 于 (Fri May 8 14:57:34 2009) 提到:
Google map是怎么算最短路径的?
假如有一个非常非常大的network,nodes有250,000,edge有500,000
现在用的是Dijkstra with heap implementation,如果两点离的太远的话,非常慢,我
正考虑用A* 和 Dijkstra with Fibonacci heap,但是估计了下,应该还是不够快。
不知道有没有什么比较practical的shortest path algorithm?google map,Garmin,和
其他网上map是用的什么算法呢?多谢。
☆─────────────────────────────────────☆
smugmug (时刻拥有春天般的美丽心情) 于 (Fri May 8 15:13:21 2009) 提到:
Critical Graph (only containts major vertices)
l**t
发帖数: 64
8
来自主题: Programming版 - 问个有关C++ map的问题
这个不好证明吧,各个stl库的实现不同情况各异. map使用的RB tree,如果按顺序逐
个插入数据,也避免不了比较和树的旋转,算法复杂度是O(lgn)吧。map的迭代器的输
出是排好序的
建议试试hash_map,如果hash函数选得好,插入和查询的效率非常高,都是常数时间
另外数据load毕竟就一次,每次增加的数据直接插到map中,数据的查询操作才是重点

好?速度有差别么?
m*****u
发帖数: 1342
9
来自主题: Programming版 - C++ STL map find does not work ???
Sample code below. My problem is after I insert first element, from
second time on, ticker_map->end() == map_iterator is always false, in
other words, it always find new element already existing in the map
(which is not the case).
I have dealt with STL map before, this is a new problem to me. Any
advice will be appreciated !!!
======
struct ltstr
{
bool operator()(const char* s1, const char* s2) const
{
return strcmp(s1, s2) < 0;
}
};
typedef map stock
d*******n
发帖数: 524
10
The output of the following piece of simple code to test stl map is very
weird.
//-------------------code-----------------------------
#include
#include
using namespace std;
class A{
public:
class CompA{
public:
bool operator() (const A& lhs, const A& rhs) const {
return (lhs.index < rhs.index);
}
};
string str;
int index;
A(string s = "", int i = 0) : str(s), index(i) {}
};
int main(){
map myMap;
m
t****t
发帖数: 6806
11
exactly, you select the best data structure for your problem. you seem to
want to use the integer as the key since you compared it -- then you should
use array.
so make up your mind: what do you want to use as key? the string, use map<
string, int> or map; the index, use map or multimap<
int, string> or vector or string[].
you still need to clear up your concepts. it's still a mess.

not
have
d****p
发帖数: 685
12
来自主题: Programming版 - 求助一个std::map的怪问题
Make sure when using operator [], the key does exist otherwise it will
insert a new value (probably initialized with 0) with the key.
So use map.find(key) != map.end() to check whether the key exists first
before retrieving the value.
STL map is based on redblack tree.
t****t
发帖数: 6806
13
来自主题: Programming版 - 如何在c++里定义一个map of map
i think you can't do that. reference type is not assignable or moveable. you
may use pointer type but that's more trouble. you may use shared_ptr<>
though.
for c++0x, your concern doesn't not exist since map<> itself is movable. so
value passing (of map<>) is as efficient as using explicit pointer.
d****p
发帖数: 685
14
来自主题: Programming版 - 如何在c++里定义一个map of map
You are right: the mapped type cannot be reference since certain operations
on map element may introduce reference of reference.
So a pointer or wapper reference could be considered. Or use pointer
container.
Admire you are very much c++0x aware when talking any c++ topic :-) Let's
wait for its arrival!

you
so
t****t
发帖数: 6806
15
来自主题: Programming版 - STL map
you answered yourself, STL map is not hash map since it keeps order. usually
STL map is implemented in R-B tree, but there is no strict requirement for
this.

require
A**u
发帖数: 2458
16
来自主题: Programming版 - 请教一个c++ map问题
我的函数是这样的
void build_dict(map& dict);
string number_to_string(int x, const map& dict); 这里有问题,加
上const,不能编译通过
int main(){
map dict;
build_dict(dict);
cout << number_to_string(888,dict);
return 0;
}
请问大家 难道stl里的模板类,不能象内置类型一样用 const T&吗?
多谢了
w****o
发帖数: 2260
17
【 以下文字转载自 JobHunting 讨论区 】
发信人: winhao (勇敢的人), 信区: JobHunting
标 题: 问几个关于hash, map, set的问题
发信站: BBS 未名空间站 (Wed Mar 7 14:52:17 2012, 美东)
1. STL中的std::unordered_map是不是等同于(或者是类似)Java中的Hashmap?
2. STL中的std::map是不是等同于(或者是类似)Java中的Treemap?
3. STL中hashtable是哪个类实现的?Java中类似的哪个类叫什么名字?问的就是在STL
和Java下都是叫什么名字。
4. 为什么在我的linux机器上的目录/usr/include/c++/4.1.2下只有set, map而没有
multiset和multimap?你们的系统里有multiset和multimap吗?
另外我发现STL的unordered_map和unordered_set是定义在/usr/include/c++/4.1.2/
tr1下面的。
谢谢!
w****o
发帖数: 2260
18
【 以下文字转载自 JobHunting 讨论区 】
发信人: winhao (勇敢的人), 信区: JobHunting
标 题: 问几个关于hash, map, set的问题
发信站: BBS 未名空间站 (Wed Mar 7 14:52:17 2012, 美东)
1. STL中的std::unordered_map是不是等同于(或者是类似)Java中的Hashmap?
2. STL中的std::map是不是等同于(或者是类似)Java中的Treemap?
3. STL中hashtable是哪个类实现的?Java中类似的哪个类叫什么名字?问的就是在STL
和Java下都是叫什么名字。
4. 为什么在我的linux机器上的目录/usr/include/c++/4.1.2下只有set, map而没有
multiset和multimap?你们的系统里有multiset和multimap吗?
另外我发现STL的unordered_map和unordered_set是定义在/usr/include/c++/4.1.2/
tr1下面的。
谢谢!
t**********s
发帖数: 930
19
来自主题: Programming版 - 怎么把一个Map放到queue里? (转载)
【 以下文字转载自 Java 讨论区 】
发信人: tennisalways (tennisforever), 信区: Java
标 题: 怎么把一个Map放到queue里?
发信站: BBS 未名空间站 (Wed Mar 13 07:09:10 2013, 美东)
我有个Server端应用,每当一个client接入,这个App就生成一个新的instance,并访问一
个end point读取资料一次.
我现在想对这个round trip time进行统计. 所以我将每次访问end point的时间,和相
对应的RTT生成个Map,放到个queue里,以便查找某个时间段RTT的 min/max/average.
之所以用queue,是因为我不想让数据无限增长.超过时间段就踢出去.Map里的访问时间,
就是用来决定数据是否在时间上已经expire了用的.
另外,可能多个查询程序运行.这会不会造成queue的lock?
我用个什么样的queue好呢?
w*s
发帖数: 7227
20
【 以下文字转载自 BuildingWeb 讨论区 】
发信人: wds (网虫都是loser), 信区: BuildingWeb
标 题: how to add both shopping store and restaurant in google map
发信站: BBS 未名空间站 (Sun Jun 16 23:23:44 2013, 美东)
hi i run a small store,
ppl always ask where the restaurant is, where grocery store is ...
if i just search restaurants near me in google map, it'll show several
restaurants,
but not grocery stores.
how can i put all these in google map and then embed to my webpage ?
many thanks !
L***s
发帖数: 1148
21
# CoffeeScript
map = (s, f) -> (x) -> exists s, (y) -> f(y) == x
# i.e.
map = (s, f) ->
(x) ->
exists s, (y) ->
f(y) == x
// JavaScript
var map = function(s, f) {
return function(x) {
return exists(s, function(y) {
return f(y) === x;
});
};
};
d**k
发帖数: 1223
22
晕死了,似乎很简单的问题却一直搞不定!有一台机器(可能是xp, 也可能是2003),
上面的一个folder 已经share 开了;现在我想在一台server 2003上map 这个folder,
但是死活不work. 给的错误是“network path couldn't found” 一类的。我觉得
share应该是没有问题的,因为我在另外两台xp上可以毫无问题的map这个folder, 但是
就是不能从2003上map. 有趣的是,我是了另外一个server 2003, 也不work. 难道
server 2003 有什么默认设置要改?我插了一下service, 我已经把web client
service 打开了,还是不work. 求救! 谢谢各位高人了!
h****n
发帖数: 37
23
现在做的一个PROJECT需要做个类似CXTERM的UNIX-based 中文输入环境.我从
CXTERM的源代码里找到不少不同输入法的KEYBOARD MAPPING,但是感觉上
五笔的不够全.不知道那里可以找到可共享的中文KEYBOARD MAPPING FILE.
还有谁知道RADICAL LOOKUP INPUT是什么输入法? 哪里可以找到它的KEYBOARD
MAPPING FILE.
谢谢.
V**O
发帖数: 13
24
来自主题: Windows版 - Map Network Drive help (转载)
【 以下文字转载自 Internet 讨论区 】
发信人: VERO (水泊凉山), 信区: Internet
标 题: Map Network Drive help
发信站: BBS 未名空间站 (Thu Dec 20 22:44:50 2007)
I have two computers A & B. A is connected to a wirless router through
cable. B is connected to the same wireless router through wifi.
For A, I set C:\User as a share folder.
For B, I open the file explorer, click tools->map network drive->browse
but I can not find the shared folder from computer A.
Strange thing is, I can see B from A, by click tools->map network dri
d**k
发帖数: 1223
25
晕死了,似乎很简单的问题却一直搞不定!有一台机器(可能是xp, 也可能是2003),
上面的一个folder 已经share 开了;现在我想在一台server 2003上map 这个folder,
但是死活不work. 给的错误是“network path couldn't found” 一类的。我觉得
share应该是没有问题的,因为我在另外两台xp上可以毫无问题的map这个folder, 但是
就是不能从2003上map. 有趣的是,我是了另外一个server 2003, 也不work. 难道
server 2003 有什么默认设置要改?我插了一下service, 我已经把web client
service 打开了,还是不work. 求救! 谢谢各位高人了!
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)