GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Untitled attachment

Download link

https://media.iddqd.social/media/bff25155f37adccffe4ad217dcdc9fc7cc73bdcb99d16645a8e9acc340f9426f.png

Notices where this attachment appears

  1. Embed this notice
    NEETzsche (neetzsche@iddqd.social)'s status on Monday, 25-Sep-2023 15:32:29 JST NEETzsche NEETzsche
    in reply to

    Turns out Matz did me one better natively in the language. There’s a #bsearch aggregate function which just goes through the numbers of a Range or Array and runs a little function against it. It finds the lowest qualifying element in O(log_n) time. Useful because you don’t have to be a FP-sperg and can run the code against some external thing which has all kinds of state.

    In my use case I wanted to find text size that is as high as possible but won’t overflow outside of a pixel range, but where the user can change the font and the input text so all kinds of wackiness can go on and doing exact calculation is kind of a pain in the ass.

    In conversation Monday, 25-Sep-2023 15:32:29 JST from iddqd.social permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.