Return-path: <michael.neubig@gmail.com>
Received: via dmail-2003(12) for +Mailbox; Fri, 21 Oct 2005 01:53:17 -0400
	(EDT)
Received: from CONVERSION-DAEMON.email.med.yale.edu by email.med.yale.edu
	(PMDF V6.2-X17 #31085) id <0IOP0OL014CSVZ@email.med.yale.edu> for
	mh76@email.med.yale.edu (ORCPT mh76@email.med.yale.edu); Fri, 21 Oct 2005
	01:53:16 -0400 (EDT)
Received: from mr5.its.yale.edu (mr5.its.yale.edu [130.132.50.48]) by
	email.med.yale.edu (PMDF V6.2-X17 #31085) with ESMTPS id
	<0IOP0XOI54CSYG@email.med.yale.edu> for mh76@email.med.yale.edu (ORCPT
	mh76@email.med.yale.edu); Fri, 21 Oct 2005 01:53:16 -0400 (EDT)
Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.199]) by
	mr5.its.yale.edu (8.12.11/8.12.11) with ESMTP id j9L5rGnn008521	for
	<michael.hines@yale.edu>; Fri, 21 Oct 2005 01:53:16 -0400
Received: by xproxy.gmail.com with SMTP id h26so372847wxd for
	<michael.hines@yale.edu>; Thu, 20 Oct 2005 22:53:16 -0700 (PDT)
Received: by 10.70.12.7 with SMTP id 7mr1532839wxl; Thu, 20 Oct 2005
	22:53:16 -0700 (PDT)
Received: by 10.70.87.12 with HTTP; Thu, 20 Oct 2005 22:53:16 -0700 (PDT)
Date: Thu, 20 Oct 2005 22:53:16 -0700
From: m n <michael.neubig@gmail.com>
Subject: snippet for google'n Python and NEURON docs
To: Michael Hines <michael.hines@yale.edu>
Message-id: <e553fefa0510202253i5000ca8u8b92f4d75415a285@mail.gmail.com>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: quoted-printable
Content-disposition: inline
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
	h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
	b=iIUbi2+/9xDb3lN9ipQRVEfn3d7TbcJCBD0g2yDxDuvp+OQv9tBXjbQdPyTEZjrhz0W9rCOSFllB6g61cMDhQ2LOgG9hzug+/0DuXMgZW3Vmf6+rGWQsO+ePnHvl030mAqwv05q+cLNVxd1luS0Zy7jUx65BTq8Pd9o7rhwu534=
X-Account-Key: account5
X-YaleITSMailFilter: Version 1.2b (attachment(s) not renamed)
X-Yale-Not-Spam: For more info see:
	http://www.yale.edu/email/spam/content.html
X-Yale-Spam-Score: (0.022)
X-Scanned-By: MIMEDefang 2.52 on 130.132.50.48
X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on
	ninja.med.yale.edu (ITS-Med - Yale University)
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_BY_IP,
	SARE_MSGID_LONG40 autolearn=no version=3.0.3

Hi Mike,

Hope things are going well.

FYI. These snippets that make searching the docs very convenient (at
least for me). To use one, make a bookmark out of it and move the
bookmark to the personal toolbar.  Then either select some text before
clicking on the bookmark, or click the bookmark first and enter text
into the prompt box.

I'm including 5.

1) basic search of docs.python.org
2) basic & advanced search of docs.python.org
3) basic & advanced of NEURON docs
4) template for customization, switch-case idiom
5) template for customization, if-else idiom

If They do not work for some reason, copy/paste the contents of the
bookmark that is failing and I'll troubleshoot the javascript.

Feel free to add any of the snippets to your website, or post them to the l=
ist.

Best,
Mike

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
1) basic search of docs.python.org

If this snippet arrives wrapped, then unwrap it back into one
contiguous line with zero spaces.

javascript:S=3D'docs.python.org';Q=3Ddocument.getSelection();if(!Q){void(Q=
=3Dprompt('SITE....'+S+'\n\n.....(text_selection_was_empty)',''))};if(Q)loc=
ation.href=3D'http://www.google.com/search?q=3Dsite:'+S+'+'+escape(Q)




=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
2) basic & advanced search of docs.python.org

If the first keyword is a single letter, then search is restricted to
sub directories

T,t -- Python Tutorial
L,l -- Python Library Reference
M,m -- Python Macintosh Library Modules
R,r -- Python Reference Manual
E,e -- Python Extending and Embedding
A,a -- Python/C API
else -- search not restricted

once again, unwrap to a contiguous line,
but this time:

-- leave the space in:  join(' ')
-- leave the space in:  split(' ')
-- leave the space between pairs of 'else' and 'if'



javascript:
R=3D'http://www.google.com/search?q=3Dsite:';
S=3D'docs.python.org';
T=3D'+';
Q=3Ddocument.getSelection();
if(!Q){void(Q=3Dprompt('SITE:.....'+S+'\n\n.....(text_selection_was_empty)'=
,''))};
K=3DQ.split(' ');
if(K[0].length=3D=3D1){
T=3DK[0];
Q=3DK.slice(1).join(' ');
if('tT'.indexOf(T)!=3D-1){T=3D'/tut+'
}else if('lL'.indexOf(T)!=3D-1){T=3D'/lib+'
}else if('rR'.indexOf(T)!=3D-1){T=3D'/ref+'
}else if('eE'.indexOf(T)!=3D-1){T=3D'/ext+'
}else if('mM'.indexOf(T)!=3D-1){T=3D'/mac+'
}else if('aA'.indexOf(T)!=3D-1){T=3D'/api+'
}else{T=3D'+'};};
if(Q)location.href=3DR+S+T+escape(Q)





=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
3) b & a of NEURON docs

-- leave the space in:  join(' ')
-- leave the space in:  split(' ')

javascript:
R=3D'http://www.google.com/search?q=3Dsite:';
S=3D'www.neuron.yale.edu/neuron/docs';
T=3D'+';
Q=3Ddocument.getSelection();
if(!Q){void(Q=3Dprompt(S+'\n\n.....(text_selection_was_empty)',''))};
K=3DQ.split(' ');
if(K[0].length=3D=3D1){
T=3DK[0];
Q=3DK.slice(1).join(' ');
switch(T){
case'N':T=3D'/help/neuron/neuron+';break;
case'c':T=3D'/help/neuron/general/classes+';break;
case'f':T=3D'/help/neuron/general/function+';break;
case'm':T=3D'/help/neuron/general/classes/matrix+';break;
case'v':T=3D'/help/neuron/general/classes/vector+';break;
}};if(Q)location.href=3DR+S+T+escape(Q)




=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
4) template for customization, switch-case idiom

-- leave the space in:  join(' ')
-- leave the space in:  split(' ')

javascript:
R=3D'http://www.google.com/search?q=3Dsite:';
S=3D'www.neuron.yale.edu/neuron/docs';
T=3D'+';
Q=3Ddocument.getSelection();
if(!Q){void(Q=3Dprompt(S+'\n\n.....(text_selection_was_empty)',''))};
K=3DQ.split(' ');
if(K[0].length=3D=3D1){
T=3DK[0];
Q=3DK.slice(1).join(' ');
switch(T){
case'A':T=3D'/+';break;
case'B':T=3D'/+';break;
case'C':T=3D'/+';break;
case'D':T=3D'/+';break;
case'E':T=3D'/+';break;
case'F':T=3D'/+';break;
case'G':T=3D'/+';break;
case'H':T=3D'/+';break;
case'I':T=3D'/+';break;
case'J':T=3D'/+';break;
case'K':T=3D'/+';break;
case'L':T=3D'/+';break;
case'M':T=3D'/+';break;
case'N':T=3D'/+';break;
case'O':T=3D'/+';break;
case'P':T=3D'/+';break;
case'Q':T=3D'/+';break;
case'R':T=3D'/+';break;
case'S':T=3D'/+';break;
case'T':T=3D'/+';break;
case'U':T=3D'/+';break;
case'V':T=3D'/+';break;
case'W':T=3D'/+';break;
case'X':T=3D'/+';break;
case'Y':T=3D'/+';break;
case'Z':T=3D'/+';break;
case'a':T=3D'/+';break;
case'b':T=3D'/+';break;
case'c':T=3D'/+';break;
case'd':T=3D'/+';break;
case'e':T=3D'/+';break;
case'f':T=3D'/+';break;
case'g':T=3D'/+';break;
case'h':T=3D'/+';break;
case'i':T=3D'/+';break;
case'j':T=3D'/+';break;
case'k':T=3D'/+';break;
case'l':T=3D'/+';break;
case'm':T=3D'/+';break;
case'n':T=3D'/+';break;
case'o':T=3D'/+';break;
case'p':T=3D'/+';break;
case'q':T=3D'/+';break;
case'r':T=3D'/+';break;
case's':T=3D'/+';break;
case't':T=3D'/+';break;
case'u':T=3D'/+';break;
case'v':T=3D'/+';break;
case'w':T=3D'/+';break;
case'x':T=3D'/+';break;
case'y':T=3D'/+';break;
case'z':T=3D'/+';break;
}};if(Q)location.href=3DR+S+T+escape(Q)






=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
) template for customization, if-else idiom

-- leave the space in:  join(' ')
-- leave the space in:  split(' ')

javascript:
R=3D'http://www.google.com/search?q=3Dsite:';
S=3D'www.neuron.yale.edu/neuron/docs';
T=3D'+';
Q=3Ddocument.getSelection();
if(!Q){void(Q=3Dprompt('SITE:.....'+S+'\n\n.....(text_selection_was_empty)'=
,''))};
K=3DQ.split(' ');
if(K[0].length=3D=3D1){
T=3DK[0];
Q=3DK.slice(1).join(' ');
      if(T=3D=3D'A'){T=3D'/+'
}else if(T=3D=3D'B'){T=3D'/+'
}else if(T=3D=3D'C'){T=3D'/+'
}else if(T=3D=3D'D'){T=3D'/+'
}else if(T=3D=3D'E'){T=3D'/+'
}else if(T=3D=3D'F'){T=3D'/+'
}else if(T=3D=3D'G'){T=3D'/+'
}else if(T=3D=3D'H'){T=3D'/+'
}else if(T=3D=3D'I'){T=3D'/+'
}else if(T=3D=3D'J'){T=3D'/+'
}else if(T=3D=3D'K'){T=3D'/+'
}else if(T=3D=3D'L'){T=3D'/+'
}else if(T=3D=3D'M'){T=3D'/+'
}else if(T=3D=3D'N'){T=3D'/+'
}else if(T=3D=3D'O'){T=3D'/+'
}else if(T=3D=3D'P'){T=3D'/+'
}else if(T=3D=3D'Q'){T=3D'/+'
}else if(T=3D=3D'R'){T=3D'/+'
}else if(T=3D=3D'S'){T=3D'/+'
}else if(T=3D=3D'T'){T=3D'/+'
}else if(T=3D=3D'U'){T=3D'/+'
}else if(T=3D=3D'V'){T=3D'/+'
}else if(T=3D=3D'W'){T=3D'/+'
}else if(T=3D=3D'X'){T=3D'/+'
}else if(T=3D=3D'Y'){T=3D'/+'
}else if(T=3D=3D'Z'){T=3D'/+'
}else if(T=3D=3D'a'){T=3D'/+'
}else if(T=3D=3D'b'){T=3D'/+'
}else if(T=3D=3D'c'){T=3D'/+'
}else if(T=3D=3D'd'){T=3D'/+'
}else if(T=3D=3D'e'){T=3D'/+'
}else if(T=3D=3D'f'){T=3D'/+'
}else if(T=3D=3D'g'){T=3D'/+'
}else if(T=3D=3D'h'){T=3D'/+'
}else if(T=3D=3D'i'){T=3D'/+'
}else if(T=3D=3D'j'){T=3D'/+'
}else if(T=3D=3D'k'){T=3D'/+'
}else if(T=3D=3D'l'){T=3D'/+'
}else if(T=3D=3D'm'){T=3D'/+'
}else if(T=3D=3D'n'){T=3D'/+'
}else if(T=3D=3D'o'){T=3D'/+'
}else if(T=3D=3D'p'){T=3D'/+'
}else if(T=3D=3D'q'){T=3D'/+'
}else if(T=3D=3D'r'){T=3D'/+'
}else if(T=3D=3D's'){T=3D'/+'
}else if(T=3D=3D't'){T=3D'/+'
}else if(T=3D=3D'u'){T=3D'/+'
}else if(T=3D=3D'v'){T=3D'/+'
}else if(T=3D=3D'w'){T=3D'/+'
}else if(T=3D=3D'x'){T=3D'/+'
}else if(T=3D=3D'y'){T=3D'/+'
}else if(T=3D=3D'z'){T=3D'/+'
}else{T=3D'/+'
};};if(Q)location.href=3DR+S+T+escape(Q)


