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

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

Conversation

Notices

  1. Embed this notice
    iced depresso (icedquinn@blob.cat)'s status on Monday, 25-Sep-2023 15:16:23 JST iced depresso iced depresso
    • NEETzsche
    @NEETzsche i think i've done something like that in Nim. though i wouldn't call it "range" since it seems to be a binary search tool.

    though i usually would hold off on that too until you've run in to a couple of instances where you actually needed to reuse the same code.
    In conversation Monday, 25-Sep-2023 15:16:23 JST from blob.cat permalink
    • Embed this notice
      NEETzsche (neetzsche@iddqd.social)'s status on Monday, 25-Sep-2023 15:16:21 JST NEETzsche NEETzsche
      in reply to

      That’s a native class in Ruby. I’m fixing it because I found a really funny bug right off the bat.

      In conversation Monday, 25-Sep-2023 15:16:21 JST permalink
    • Embed this notice
      NEETzsche (neetzsche@iddqd.social)'s status on Monday, 25-Sep-2023 15:25:49 JST NEETzsche NEETzsche
      in reply to
      • NEETzsche

      This is kind of a shitpost to begin with. But in Ruby, you can just “open up” existing classes and add shit to them. I wanted a #bisect_left and #bisect_right method to take the left and right halves of a “Range.” My riff, which was tongue-in-cheek, was that if this were JavaScript I’d release this as a gem (library) on its own

      In conversation Monday, 25-Sep-2023 15:25:49 JST permalink

      Attachments


      1. https://media.iddqd.social/media/d222f49e5cc61f915920b3e531f10e9bb52a9045f8c4d1737675129ca7f6095d.png
    • 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 permalink

      Attachments



      1. https://media.iddqd.social/media/bff25155f37adccffe4ad217dcdc9fc7cc73bdcb99d16645a8e9acc340f9426f.png
    • Embed this notice
      iced depresso (icedquinn@blob.cat)'s status on Monday, 25-Sep-2023 15:32:30 JST iced depresso iced depresso
      in reply to
      • NEETzsche
      @NEETzsche yes and there are times that micropackages are fine
      In conversation Monday, 25-Sep-2023 15:32:30 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • 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.