You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by paul jobs <we...@gmail.com> on 2008/12/30 12:37:42 UTC

how to cluster browser columns into firefox, ie, opera, chrome, windows, linux,mac os from the given browser name

map:
function(doc) {
if(doc.browser)
  emit(doc.browser, 1);
}

reduce:function(keys, values) { return sum(values)}

how to cluster browser columns into firefox, ie, opera, chrome, windows,
linux,mac os from the given browser name
is it possible to construct a view and reduce function in couchdb thanks
Documents  Key
Value  *"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"*1*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET
CLR 2.0.50727)"*4*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET
CLR 2.0.50727; .NET CLR 1.1.4322)"*1*"Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; Foxy/1; Foxy/1)"*4*"Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; InfoPath.1)"*1*"Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.1; MAXTHON 2.0)"*7*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR
2.0.50727)"*1*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.0.3705)"*1*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
.NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)"*3*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR
2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)"*1*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR
2.0.50727; InfoPath.1)"*2*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"*2*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1)"*
2*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
1.1.4322)"*52*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 2.0.50727; InfoPath.1)"*4*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; SV1; .NET CLR 2.0.50727)"*16*"Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1; FDM)"*11*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; SV1; FunWebProducts; .NET CLR 1.0.3705; .NET CLR 2.0.50727; .NET CLR
1.1.4322; Media Center PC 4.0)"*4*"Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322)"*14*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR
2.0.50727; InfoPath.1)"*1*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; SV1; FunWebProducts; Media Center PC 3.0; .NET CLR 1.0.3705;
InfoPath.1)"*1*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
FunWebProducts; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) )"*1
*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts)"*6
*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB5; .NET CLR
1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR
3.0.04506.30)"*9*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB5; .NET CLR 1.1.4322; UGA6PV
2.2.362.3; .NET CLR 2.0.50727)"*1*"Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1; GTB5)"*1*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; SV1; Hewlett-Packard; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR
2.0.50727; InfoPath.2)"*1*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; SV1; InfoPath.1)"*4*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; MathPlayer 2.10b; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"*1
*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
SIMBAR={0FE79DA2-550F-4E3F-93C5-476C07C6CBE3}; .NET CLR
2.0.50727)"*10*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1;
SIMBAR={1A0F9FE2-EADB-11DC-8A0C-000C765BD136}; .NET CLR
1.1.4322)"*1*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1;
SIMBAR={2FC0011F-985F-4FA0-AA38-92A4A90310FE}; .NET CLR
2.0.50727)"*2*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1;
SIMBAR={30027AE2-B872-462C-957D-9DC1CFF2C122})"*2*"Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1; SV1;
SIMBAR={AC0C60E4-37A4-4BC0-84CA-520FC62D8365}; InfoPath.1)"*6*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1;
SIMBAR={C1D19CCC-C4F9-448C-B0F9-B9F8F9836BEB}; .NET CLR 1.1.4322; .NET CLR
2.0.50727)"*8*"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1)"*57*"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1)"*1*"Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR
2.0.50727)"*1*"Mozilla/4.0
(compatible; MSIE 7.0; AOL 9.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR
2.0.50727; InfoPath.2)"*6*"Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.0;
Windows NT 5.1; FunWebProducts; GTB5)"*3*"Mozilla/4.0 (compatible; MSIE 7.0;
AOL 9.0; Windows NT 5.1)"*19*"Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.0;
Windows NT 6.0; FunWebProducts; SLCC1; .NET CLR 2.0.50727; Media Center PC
5.0; .NET CLR 3.0.04506)"*5*"Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.0;
Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR
3.0.04506; InfoPath.2)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; InfoPath.1)"
*17*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
InfoPath.2)"*2*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR
3.0.04506.648)"*5*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET
CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30;
InfoPath.2)"*3*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR
2.0.50727; .NET CLR 3.0.04506.30)"*1*"Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR
3.0.04506.648; .NET CLR 3.5.21022; InfoPath.1)"*2*"Mozilla/4.0 (compatible;
MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR
3.0.04506.648; .NET CLR 3.5.21022)"*2*"Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Hotbar 10.2.196.0;
InfoPath.1)"*2*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30; .NET CLR
3.0.04506.648)"*6*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET
CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; Creative ZENcast
v2.01.01)"*1*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR
2.0.50727; InfoPath.1)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR
3.0.04506.30)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET
CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2)"*10*"Mozilla/4.0 (compatible;
MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; WinuE v6;
InfoPath.2; WinuE v6)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
.NET CLR 1.1.4322; .NET CLR 2.0.50727)"*20*"Mozilla/4.0 (compatible; MSIE
7.0; Windows NT 5.1; .NET CLR 1.1.4322; Dealio Toolbar 3.1.1)"*1*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET
CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)"*1*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET
CLR 2.0.50727)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET
CLR 1.1.4322; InfoPath.1)"*6*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR
3.0.04506.30; .NET CLR 3.0.04506.648)"*2*"Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR
3.0.04506.30)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET
CLR 1.1.4322; InfoPath.2)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; .NET CLR 1.1.4322)"*23*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)"*3*"Mozilla/4.0 (compatible;
MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET
CLR 1.1.4322; InfoPath.2)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
InfoPath.1)"*10*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322;
InfoPath.1)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322)"*
11*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727;
InfoPath.1)"*3*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
2.0.50727; InfoPath.2)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; .NET CLR 2.0.50727)"*35*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; (R1 1.5); .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 3.1)"*5
*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; (R1 1.5); .NET CLR
1.1.4322; HbTools 4.7.7; .NET CLR 2.0.50727)"*2*"Mozilla/4.0 (compatible;
MSIE 7.0; Windows NT 5.1; Avant Browser; InfoPath.1; .NET CLR
1.1.4322)"*5*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; Foxy/1; Foxy/1)"*1*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; .NET CLR 1.1.4322;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR
3.0.04506.648)"*5*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; .NET CLR 1.1.4322;
.NET CLR 2.0.50727; Hotbar 10.2.236.0)"*2*"Mozilla/4.0 (compatible; MSIE
7.0; Windows NT 5.1; FunWebProducts; .NET CLR 1.1.4322; .NET CLR 2.0.50727;
InfoPath.2)"*2*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
FunWebProducts; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"*11*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; .NET CLR 1.1.4322;
InfoPath.1; .NET CLR 2.0.50727; CDSource=v11c.01;
CDSource=v11c.01)"*5*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; .NET CLR 1.1.4322;
InfoPath.1; .NET CLR 2.0.50727)"*1*"Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; FunWebProducts; .NET CLR 1.1.4322; Seekmo 10.0.341.0; .NET
CLR 2.0.50727)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
FunWebProducts; .NET CLR 1.1.4322)"*9*"Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; FunWebProducts; .NET CLR 2.0.50727)"*7*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; BCD2000; AntivirXP08;
MSDigitalLocker; .NET CLR 2.0.50727)"*2*"Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; FunWebProducts; GTB5; .NET CLR 1.1.4322; .NET CLR 2.0.50727;
.NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)"*2*"Mozilla/4.0 (compatible;
MSIE 7.0; Windows NT 5.1; FunWebProducts; GTB5; .NET CLR 1.1.4322;
InfoPath.1)"*16*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
FunWebProducts; IEMB3; IEMB3)"*3*"Mozilla/4.0 (compatible; MSIE 7.0; Windows
NT 5.1; FunWebProducts; InfoPath.1; .NET CLR 2.0.50727)"*4*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts;
InfoPath.2)"*10*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; MSN
Optimized;IT; .NET CLR 3.0.04506.30; MSN Optimized;IT)"*1*"Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts;
SIMBAR={81799482-B6CE-44B0-B4FB-2DA167D67706}; InfoPath.1; .NET CLR
2.0.50727)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
FunWebProducts; SIMBAR={D77D396C-4169-47CC-86B8-FA28137D16D4}; .NET CLR
1.1.4322)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
FunWebProducts; SIMBAR={E188EADB-D458-48EF-ADCF-1C3BF8998328}; .NET CLR
1.1.4322)"*1*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
FunWebProducts)"*9*"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
GoogleT5; .NET CLR 1.1.4322)"*7*"Mozilla/4.0 (compatible; MSIE 7.0; Windows
NT 5.1; GTB5; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"*4

Re: how to cluster browser columns into firefox, ie, opera, chrome, windows, linux,mac os from the given browser name

Posted by Jan Lehnardt <ja...@apache.org>.
On 30 Dec 2008, at 12:37, paul jobs wrote:

>
> how to cluster browser columns into firefox, ie, opera, chrome,  
> windows,
> linux,mac os from the given browser name
> is it possible to construct a view and reduce function in couchdb  
> thanks

extract the browser name from the user agent string in the map function.