Hacker Newsnew | past | comments | ask | show | jobs | submit | null_driver's commentslogin

harryk.dev


I'm looking to leverage the upcoming WebNN browser spec with my spreadsheet app. I think integration with vision, audio and language models opens a whole new world of possibilities as traditional spreadsheet apps lean more towards mainly numerical data.

https://harryk.dev/apps/eincalc


I tend to rely on old traditional methods and recently came across this dissection which opened up my interpretation of the whole dreaming process (a way in which we are "renewed"): https://www.youtube.com/watch?v=uz4SRe-PH7A


Ocaml also has `@@` which gives `'a -> ('a -> 'b) -> 'b = <fun>` and `|>` for `('a -> 'b) -> 'a -> 'b = <fun>` so you can also do:

```ocaml

  type point = { x: float; y: float};;

  let euclidean a a' =
    let xd = (a'.x -. a.x) in
    let yd = (a'.y -. a.y) in
    sqrt ((xd*.xd) +. (yd*.yd))
  ;;

  let is_in_unit_circle x =
    x <= 1.

  let quadsolve iterations hits =
    ((4. *. hits) /. Float.of_int iterations)

  let estimate iters =
    let origin    = { x = 0.; y = 0. } in
     Array.init iters (fun _ -> { x = (Random.float 1.); y = (Random.float 1.) })
     |> Array.map (euclidean origin)
     |> Array.map is_in_unit_circle
     |> Array.fold_left (fun x y ->  if y then x +. 1. else x ) 0.
     |> quadsolve iters
;;

```

  utop # estimate 1000000;;
  - : float = 3.141432

Edit: formatting


Markdown fence blocks don't work. For monospace, indent 2 or more spaces.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: