text stringlengths 0 601k |
|---|
let rec print_term fmt { t_node ; t_ty ; t_attrs ; _ } = let print_ty fmt ty = match ty with None -> pp fmt " : prop " | Some ty -> pp fmt " :% a " print_ty ty in let print_t_node fmt t_node = match t_node with | Tconst c -> pp fmt " % a % a " Opprintast . constant c print_ty t_ty | Ttrue -> pp fmt " true % a " print_t... |
let board_width = 10 and board_height = 22 |
let term_color_map = function | Cyan -> cyan | Yellow -> yellow | Purple -> lred | Green -> green | Red -> red | Blue -> lblue | Orange -> lyellow |
let cell_color = function | Empty -> black | Color x -> term_color_map x |
let cell_char = function | Empty -> S " " | Color _ -> S " " # |
type event_or_tick = LEvent of LTerm_event . t | LTick |
let wait_for_event ui = LTerm_ui . wait ui >>= fun x -> return ( LEvent x ) |
let wait_for_tick ( ) = Lwt_unix . sleep ( gravity_period gravity ) >>= fun ( ) -> return ( LTick ) |
let rec loop ui state event_thread tick_thread = Lwt . choose [ event_thread ; tick_thread ] >>= fun e -> let cstate = ! state in let rstate = initial_state cstate . width cstate . height in LTerm_ui . draw ui ; match e with | LEvent ( LTerm_event . Key { code = Up } ) -> state := if cstate . over then rstate else upda... |
let draw_cell ctx v x y = LTerm_draw . draw_styled ctx y ( x + 1 ) ( eval [ B_bg ( cell_color v ) ; ( cell_char v ) ; E_fg ] ) |
let draw_tetromino ctx state = ignore ( BatList . map ( ( fun ( x , y ) -> draw_cell ctx ( Color state . tetromino . color ) x y ) % ( xyplus state . position ) % ( rotate ( rotation_matrix state . rotation ) state . tetromino . center ) ) state . tetromino . geometry ) |
let draw ui matrix state = let size = LTerm_ui . size ui in let ctx = LTerm_draw . context matrix size in LTerm_draw . clear ctx ; let draw_legend = let lctx = LTerm_draw . sub ctx { row1 = 0 ; col1 = state . width + 6 ; row2 = state . height ; col2 = 60 } in LTerm_draw . draw_styled lctx 1 0 ( eval [ B_fg cyan ; S ( P... |
let rec write_glyph ttf key glyf = |
let write_font ch ttf glyphs = ( ) |
let to_canvas ttf range_str = |
type header = { } |
type entry = { } |
type glyf_header = { } |
type glyf_simple = { } |
type glyf_component = { } |
type hmtx = { } |
type cmap_subtable_header = { } |
type cmap_format_0 = { } |
type cmap_format_4 = { } |
type cmap_format_6 = { } |
type cmap_format_12_group = { } |
type cmap_format_12 = { } |
type cmap_subtable = { } |
type cmap = { } |
type kern_subtable_header = { } |
type kern_pair = { } |
type kern_format_0 = { } |
type kern_format_2 = { } |
type kern_subtable = { } |
type kern = { } |
type name_record = { } |
type name = { } |
type head = { } |
type hhea = { } |
type loca = int32 array |
type maxp = { } |
type os2 = { } |
type ttf = { } |
type ttf_config = { } |
module type TEST_PIPELINE = functor ( Bfx : Biokepi . EDSL . Semantics ) -> sig val run : unit -> unit Bfx . observation end |
module Run_test ( Test_pipeline : TEST_PIPELINE ) = struct let write_file file ~ content = let out_file = open_out file in try output_string out_file content ; close_out out_file with _ -> close_out out_file let cmdf fmt = ksprintf ( fun s -> printf " CMD : % s \ n " %! s ; match Sys . command s with | 0 -> ( ) | other... |
module Pipeline_insane ( Bfx : Biokepi . EDSL . Semantics ) = struct let fastq_list ~ dataset files = List . map files ~ f : begin function | ` Pair ( r1 , r2 ) -> if Filename . check_suffix r1 " . gz " || Filename . check_suffix r1 " . fqz " then Bfx . ( fastq_gz ~ sample_name : dataset ~ r1 ( : input_url r1 ) ~ r2 ( ... |
module Somatic_simplish ( Bfx : Biokepi . EDSL . Semantics ) = struct module Insane_library = Pipeline_insane ( Bfx ) let vc = let normal = Insane_library . ( fastq_list ~ dataset ( : fst normal ) ( snd normal ) ) in let tumor = Insane_library . ( fastq_list ~ dataset ( : fst tumor ) ( snd tumor ) ) in let ot_hla = nor... |
let ( ) = let module Go_insane = Run_test ( Pipeline_insane ) in let insane_result = Go_insane . main " pipeline - insane " in let module Go_simple_somatic = Run_test ( Somatic_simplish ) in let simple_somatic_result = Go_simple_somatic . main " pipeline - simple - somatic " in let display_result mod_name results = pri... |
type ctx = { } |
let parse_header ctx = { } |
let parse_directory ctx header = } done ; directory |
let parse_head_table ctx = { } |
let parse_hhea_table ctx = { } |
let parse_maxp_table ctx = { } |
let parse_loca_table head maxp ctx = else |
let parse_hmtx_table maxp hhea ctx = ! last_advance_width else in { } ) |
let parse_cmap_table ctx = { } } } } | 12 -> { } } in { } in { } |
let parse_glyf_table maxp loca cmap hmtx ctx = v 1 end in end end ; } ) arg1 , arg2 arg1 , arg2 NoScale in } ; in in ) |
let parse_kern_table ctx = { } } } in { } } { } |
let parse_name_table ctx = { } in r { } , ! ttf_name |
let parse_os2_table ctx = { } |
let parse file : ttf = } in try in try None in { } |
let num_bits x = 0 else in |
let round x = int_of_float ( floor ( x . + 0 . 5 ) 5 ) 5 |
let to_twips v = round ( v . * 20 ) . |
type ctx = { } |
let align_bits x nbits = x land ( ( 1 lsl nbits ) - 1 ) 1 |
let move_to ctx x y = } |
let line_to ctx x y = } |
let curve_to ctx cx cy ax ay = } |
let write_paths ctx paths = try ( ) { } |
let rec write_glyph ctx key glyf = { } |
let write_font_layout ctx lut = { { } |
let bi v = if v then 1 else 0 |
let write_font2 ch b f2 = ) f2 . font_glyphs ; |
let to_swf ttf config = { } ; ; |
type glyf_transformation_matrix = { } |
type glyf_path = { } |
type simple_point = { } |
let mk_path t x y cx cy = { } |
let identity ( ) = { } |
let multiply m x y = |
let matrix_from_composite gc = in { } |
let relative_matrix m = { m with tx = 0 . 0 ; ty = 0 . 0 } 0 |
let make_coords relative mo g = match mo with ) |
let build_paths relative mo g = true false in in } ; in end ; end ; end done ; |
let rec build_glyph_paths ttf relative ( ? transformation = None ) None glyf = [ ] |
let map_char_code cc c4 = else end done ; ! index end |
let parse_range_str str = done ; end lut |
let build_lut ttf range_str = end in done ; done in ( ) ( ) lut |
type tvsymbol = { tv_name : Ident . t } [ @@ deriving show ] |
let tv_equal x y = Ident . equal x . tv_name y . tv_name |
module Tvar = struct type t = tvsymbol let equal = tv_equal let compare x y = Ident . compare x . tv_name y . tv_name let hash tv = Ident . hash tv . tv_name end |
module Htv = Hashtbl . Make ( Tvar ) |
module Mtv = Map . Make ( Tvar ) |
let create_tv id = { tv_name = id } |
let fresh_tv ( ? loc = Location . none ) s = { tv_name = Ident . create ~ loc s } |
let tv_of_string = let hs = Hashtbl . create 0 in fun ( ? loc = Location . none ) s -> try Hashtbl . find hs s with Not_found -> let tv = create_tv ( Ident . create ~ loc s ) in Hashtbl . add hs s tv ; tv |
type ty = { ty_node : ty_node } [ @@ deriving show ] ts_ident : Ident . t ; ts_args : tvsymbol list ; ts_alias : ty option ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.