Previous week Up Next week

Hello

Here is the latest Caml Weekly News, for the week of January 22 to 29, 2008.

  1. ledit 2.00 with .leditrc file
  2. PostDoc offer on JoCaml
  3. ocamlnet mini tutorial: netclient and cookie based authentication
  4. Palindromic Quine
  5. POPL 2009 Call for Workshop and Co-located Event Proposals
  6. Ocaml Meeting's talks available

ledit 2.00 with .leditrc file

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/901e327b0542a55b#bf40779d0f05bf13

Daniel de Rauglaudre announced:
I am happy to announce a new release of ledit : 2.00.

Ledit is a line editor allowing to run interactive commands (e.g. the
OCaml toplevel) with the ability to move the cursor, delete parts, see
balanced parentheses, move inside the history, things like that, like
in emacs or in the shell.

Main change:
 It is now possible to have one's own keys bindings in the file ".leditrc"
 of one's home directory (or defined by the environment variable LEDITRC).
 See manual page.
   Note: this file can be modified while ledit is running, the changes are
 immediately taken into account.

Download the sources at:
  http://pauillac.inria.fr/~ddr/ledit/
			

PostDoc offer on JoCaml

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/5b6eafbc010ebdc0#46e8c6d5c3335ab6

Luc Maranget announced:
Our team (Moscova, Inria Rocquencourt, France) proposes a
post-doctoral fellow position.


The work we propose can be summarized as
	 Illustrate, develop and extend JoCaml

A web page on the jocaml site http://jocaml.inria.fr/jobs.html
gives all details on the offer.

Some points of importance are :

  Application deadline Feb. 29, 2008.

  You (will) hold your Phd for less than one year at the recruitment date.

  You have strong background in functionnal programming, and
  good knowledge in process calculi, concurrent programming,
  network programming, or compiler construction.
			

ocamlnet mini tutorial: netclient and cookie based authentication

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/ccb132ec789dedda#ddbf4b65a1231770

Hendrik Tews said:
for ocamlnet novices I document here what you need to access web
sites that use cookies for authentication (eg, wikis or mailman).
With this you can let ocaml perform your mailing-list
administrator tasks or write a wiki bot.

Cookie authentication works as follows: When you first visit the
site you have to authenticate with username and password that are
usually sent (in cleartext) in a post request to the server. The
server responses with a cookie that will be used for
authentication in all following requests. 

Because you have to retrieve and set cookies in the headers you
cannot use the Http_client.Convenience module. You really have to
dive into ocamlnet.

Here comes the solution:

Netstring extension:

- You need get_set_cookie, which will retrieve cookies from a
 response header but which is not in ocamlnets netstring library
 currently. Download from [1] or with two additional helper
 functions from [2].


Prerequisites:

- Create a pipeline with "new Http_client.pipeline", it will
 process all http requests. (Don't ask me about timeouts and
 retries, the defaults work fine for me.)


Get going (download some page without authentication):

- Create a get call "new Http_client.get url"

- Process the call: Add it to the pipeline (method #add) and run
 the pipeline (#run). By this the call will be changed and
 contain the response. 

- Check the response status (#response_status), which should
 usually be `OK and get the page (#response_body#value).

- In case of error convert the status into something readable
 with Nethttp.string_of_http_status or consult the response
 status message (#response_status_text).


Login:

- Create post call with 
 "new Http_client.post url parameters", the parameters are a
 string * string list, eq 
   [("wpName", "mywikiname");
    ("wpPassword", "mywikipasswd");
    ("wpLoginattempt", "Log in")]
 for a MediaWiki.

 [In order to get the parameters save the login page, change the
 method of the right from into "GET", load the page into a
 browser, press the login button and parse the new URL you get.]

- Process the call.

- Check the status (#response_status): For MediaWiki it should be
 `Found, for mailman and others `Ok (don't ask me why).

- Retrieve the response header (#response_header) and extract the
 cookies with get_set_cookies from [2].


Make an authenticated request:

- Create your call "new get url" for getting a page or 
 "new post url" for performing an action.

- Access the request header (#request_header `Base) and add your
 cookies there (set_cookies from [2]). This is all done via
 side-effects, no need to write the modified header back into
 the call.

- Process the call and get the response.


Compilation:

- with findlib and -package netclient -linkpkg:

 ocamlfind {ocamlc,ocamlopt} -package netclient -linkpkg your files ...


Acknowledgements:

- Praise Gerd Stolpmann for ocamlnet and findlib.



That's it. For an example go to [3], which contains a MediaWiki
bot that updates structural information in the Mozilla wiki [4].
The needed utility functions are in wiki_http: wiki_login to
login, download to download a web page, get_page to get a wiki page
and write_wiki_page to write one.


Resources:

[1] https://godirepo.camlcity.org/wwwsvn/trunk/code/get-set-cookie.ml?rev=1145&root=lib-ocamlnet2&view=auto

[2] http://www.sos.cs.ru.nl/cgi-bin/~tews/olmar/viewvc-patch.cgi/elsa/olmar/wiki_bot/netstring_ext.ml?revision=HEAD&view=markup

[3] http://www.sos.cs.ru.nl/cgi-bin/~tews/olmar/viewvc-patch.cgi/elsa/olmar/wiki_bot/

[4] http://wiki.mozilla.org/Elsa_ast_nodes
			

Palindromic Quine

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/8be83ea9d8614b58#1d2154145083fdb7

Keisuke Nakano announced:
A 'Palindromic Quine' code is now wanted by a shortest-code contest at:

http://golf.shinh.org/p.rb?Palindromic+Quine

The code should be a Quine, which prints its own code without reading
its source file. Additionally, the code should be palindromic, which
reads the same forward as it does backward. Shorter code is better.
Lots of programming languages are available including OCaml, of course.

Please submit your palindromic Quine to the above contest if you find it.
The deadline is Thursday, 7 February 2008, 16:46:39, GMT.
All submitted programs will be revealed after the deadline.
At present the shortest code in OCaml has 205 bytes.
			

POPL 2009 Call for Workshop and Co-located Event Proposals

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/77c03faa35a1e208#6252fb6c4136044e

Yitzhak Mandelbaum:
	   POPL 2009 - CALL FOR WORKSHOP AND CO-LOCATED EVENT PROPOSALS

		POPL 2009, the 36th ACM SIGPLAN-SIGACT
	   Symposium on Principles of Programming Languages

			  21-23 January 2009
                         Savannah, Georgia

----------------------------------------------------------------------


The 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming
Languages (POPL 2009) will be held in Savannah, Georgia from
January 21 to January 23. POPL provides a forum for the discussion of
fundamental principles and important innovations in the design,
definition, analysis, transformation, implementation and verification
of programming languages, programming systems, and programming
abstractions. Both experimental and theoretical papers on principles
and innovations are welcome, ranging from formal frameworks to reports
on practical experiences.

Proposals are invited for events to be co-located with POPL 2009,
including tutorials, workshops and conferences. Co-located events can
either be sponsored directly by SIGPLAN or supported through in-cooperation
status.

** Submission details **

Deadline for submission:     Monday, March 10th, 2008
Notification of acceptance:  Tuesday, April 22nd, 2008

Prospective meeting organizers are invited to submit a completed
meeting proposal form to the POPL 2009 workshop chair (Yitzhak
Mandelbaum) by March 10th, 2008.  Please note that this is a firm
deadline.  Organizers will be notified if their proposal is accepted
by April 22nd, 2008, and, if successful, are required to produce a
final report after the workshop has taken place that is suitable for
publication in SIGPLAN Notices.

** Selection committee **

The event proposals will be evaluated by a committee comprising the
following members of the POPL 2009 organising committee, together with
the members of the SIGPLAN executive committee.

Yitzhak Mandelbaum   AT&T Labs - Research        Workshops chair
Zhong Shao           Yale University             General chair
Benjamin Pierce      University of Pennsylvania  Program chair


** Further information **

For the full Call for Workshop and Co-located Event Proposals and all
of the associated forms, visit the POPL 2009 website, or access them
directly at:

http://www.research.att.com/~yitzhak/workshops/popl09/call_for_events.html

A copy of this announcement can be found at:

http://www.research.att.com/~yitzhak/workshops/popl09/call_for_events.txt

Any queries regarding POPL 2009 co-located event proposals should be
addressed to the workshops chair (Yitzhak Mandelbaum), via email to
popl-workshops *at* research.att.com.
			

Ocaml Meeting's talks available

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/13fa0656df8a9d77#84bb14093cd5511e

Gabriel Kerneis:
I recorded the talks during the Ocaml Meeting. They are available (raw 
from the recorder). Links here (at the top of the page): 

http://cocan.org/events/europe/ocamlmeetingparis2008 

Any help welcomed to improve it (cut the silences, split into several 
smaller files, etc).
			
Earlier, Sylvain Le Gall had said:
You can already read every presentations on the website (.pdf and .odp).
At one time in the future, i will also put the video of every talks
somewhere (YouTube?) and a link on the wiki page. 

http://wiki.cocan.org/events/europe/ocamlmeetingparis2008
			
Hezekiah M. Carty said:
There are IRC transcripts available here:
http://tunes.org/~nef/logs/ocaml/08.01.26 which may clarify things
somewhat.
			

Using folding to read the cwn in vim 6+

Here is a quick trick to help you read this CWN if you are viewing it using vim (version 6 or greater).

:set foldmethod=expr
:set foldexpr=getline(v:lnum)=~'^=\\{78}$'?'<1':1
zM

If you know of a better way, please let me know.


Old cwn

If you happen to miss a CWN, you can send me a message and I'll mail it to you, or go take a look at the archive or the RSS feed of the archives.

If you also wish to receive it every week by mail, you may subscribe online.


Alan Schmitt