-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Milan - restructured the warmup to resolve circular dependency issues…
… and added support to walker to read and un-thin the precompiled/warmed walk maps
- Loading branch information
Showing
11 changed files
with
136 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
_build/ | ||
node_modules/ | ||
.DS_Store | ||
src/core/material/precompiled/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
let warmed_nts = () => [%blob "precompiled/nts.txt"]; | ||
let warmed_stances = () => [%blob "precompiled/stances.txt"]; | ||
|
||
let _warmed_walked_r = () => [%blob "precompiled/walk_r_map.txt"]; | ||
let _warmed_walked_l = () => [%blob "precompiled/walk_l_map.txt"]; | ||
let _enter_r_map = () => [%blob "precompiled/enter_r_map.txt"]; | ||
let _enter_l_map = () => [%blob "precompiled/enter_l_map.txt"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,52 @@ | ||
// open Js_of_ocaml; | ||
// let date_now = () => { | ||
// [%js new Js.date_now]; | ||
// }; | ||
// let timestamp = () => date_now()##valueOf; | ||
// let copy_to_clipboard = (string: string): unit => { | ||
// /* Note: To use (deprecated) execommand would need to introduce | ||
// an invisible textarea and insert the string as you cannot | ||
// directly copy from a variable using it */ | ||
// /*let _ = | ||
// Dom_html.document##execCommand( | ||
// Js.string("copy"), | ||
// Js.bool(true), | ||
// Js.Opt.return(Js.string("testtest")), | ||
// );*/ | ||
// /* So instead we use the mode modern clipboard API. however | ||
// js_of_ocaml doesn't have bindings for it, so in the interest | ||
// of time I'm just using Unsafe.js_expr. Note the use of backticks | ||
// around the string in order to make this robust to the presence | ||
// of linebreaks in the string. */ | ||
// // note: using unsafe as js_of_ocaml doesn't have clipboard bindings | ||
// print_endline( | ||
// "Copying log to keyboard. An exception reading 'fallback to runtime evaluation' is expected.", | ||
// ); | ||
// string | ||
// |> Printf.sprintf("window.navigator.clipboard.writeText(`%s`);") | ||
// |> Js.Unsafe.js_expr; | ||
// }; | ||
open Js_of_ocaml; | ||
// let date_now = () => { | ||
// [%js new Js.date_now]; | ||
// }; | ||
// let timestamp = () => date_now()##valueOf; | ||
// let copy_to_clipboard = (string: string): unit => { | ||
// /* Note: To use (deprecated) execommand would need to introduce | ||
// an invisible textarea and insert the string as you cannot | ||
// directly copy from a variable using it */ | ||
// /*let _ = | ||
// Dom_html.document##execCommand( | ||
// Js.string("copy"), | ||
// Js.bool(true), | ||
// Js.Opt.return(Js.string("testtest")), | ||
// );*/ | ||
// /* So instead we use the mode modern clipboard API. however | ||
// js_of_ocaml doesn't have bindings for it, so in the interest | ||
// of time I'm just using Unsafe.js_expr. Note the use of backticks | ||
// around the string in order to make this robust to the presence | ||
// of linebreaks in the string. */ | ||
// // note: using unsafe as js_of_ocaml doesn't have clipboard bindings | ||
// print_endline( | ||
// "Copying log to keyboard. An exception reading 'fallback to runtime evaluation' is expected.", | ||
// ); | ||
// string | ||
// |> Printf.sprintf("window.navigator.clipboard.writeText(`%s`);") | ||
// |> Js.Unsafe.js_expr; | ||
// }; | ||
// let read_file = (file, k) => { | ||
// let reader = [%js new File.fileReader]; | ||
// reader##readAsText(file); | ||
// reader##.onload := | ||
// Dom.handler(_ => { | ||
// let result = reader##.result; | ||
// let option = Js.Opt.to_option(File.CoerceTo.string(result)); | ||
// let data = Option.map(Js.to_string, option); | ||
// k(data); | ||
// Js._true; | ||
// }); | ||
// }; | ||
|
||
let download_string_file = | ||
(~filename: string, ~content_type: string, ~contents: string) => { | ||
let blob = File.blob_from_string(~contentType=content_type, contents); | ||
let url = Dom_html.window##._URL##createObjectURL(blob); | ||
|
||
let link = Dom_html.createA(Dom_html.document); | ||
link##.href := url; | ||
link##setAttribute(Js.string("download"), Js.string(filename)); | ||
link##.onclick := Dom_html.handler(_ => {Js._true}); | ||
link##click; | ||
}; |