<commit_before>(*{{{ Copyright (c) 2014 <NAME> <<EMAIL>>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
  }}}*)

(*

Description:

(1) Enter a username and click the button to query github and get a JSON
description of the users public repositories.

(2) Download the given file and show it's size and the first 1K of date.

Build instructions:

$ ocamlfind c -syntax camlp4o -package lwt.syntax -package js_of_ocaml.syntax \
    -package cohttp.js -linkpkg -o test_xhr.byte test_xhr.ml

This is done through oasis with --enable-tests

The next step is to convert to javscript.  I'm not sure how to automate this step
with oasis.

$ js_of_ocaml +weak.js test_xhr.byte -o lib_test/test_xhr.js

to load it in the browser run

$ ./test_net_lwt_server.native

and navigate to

http://localhost:8081/lib_test/index.html

(this is required for the download to be allowed under the same origin security policy)<commit_msg>Improve documentation in the `test_xhr.ml` js_of_ocaml test<commit_after>(*{{{ Copyright (c) 2014 <NAME> <<EMAIL>>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
  }}}*)

(*

Description:

(1) Enter a username and click the button to query github and get a JSON
description of the users public repositories.

(2) Download the given file and show its size and the first 1K of date.

Build instructions:

$ ocamlfind c -package lwt.ppx -package js_of_ocaml.ppx \
    -package cohttp.js -linkpkg -o test_xhr.byte test_xhr.ml

This is done through oasis with --enable-tests

The next step is to convert to javascript.  I'm not sure how to automate this step
with oasis.

$ js_of_ocaml +weak.js test_xhr.byte -o lib_test/test_xhr.js

to load it in the browser run

$ ./test_net_lwt_server.native

and navigate to

http://localhost:8081/lib_test/index.html

(this is required for the download to be allowed under the same origin security policy)
{'fraction_non_alphanumeric': 0.06234491315136476, 'fraction_numerical': 0.007133995037220843, 'mean_word_length': 4.0947867298578196, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7618740', 'n_tokens_mistral': 976, 'n_tokens_neox': 900, 'n_words': 457}