tiflolinux.org - GNU Social
  • Login

Bienvenido

  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Piggo🐽 (piggo@piggo.space)'s status on Friday, 03-Mar-2023 21:42:56 CET Piggo🐽 Piggo🐽
    • Ekaitz Zárraga 👹
    @ekaitz_zarraga or turn them into integers with some bit magic and hope it doesnt get fucked up by javascript representing everything as float internally
    In conversation Friday, 03-Mar-2023 21:42:56 CET from piggo.space permalink
    • Piggo🐽 (piggo@piggo.space)'s status on Friday, 03-Mar-2023 21:45:11 CET Piggo🐽 Piggo🐽
      in reply to
      • Ekaitz Zárraga 👹
      • ɗ𐐩ʃƕρʋ
      @deshipu @ekaitz_zarraga yes thats what im saying. but it fakes integers pretty well most of the time
      In conversation Friday, 03-Mar-2023 21:45:11 CET permalink
    • ɗ𐐩ʃƕρʋ (deshipu@fosstodon.org)'s status on Friday, 03-Mar-2023 21:45:12 CET ɗ𐐩ʃƕρʋ ɗ𐐩ʃƕρʋ
      in reply to
      • Ekaitz Zárraga 👹

      @piggo @ekaitz_zarraga javascript also doesn't have integers...

      In conversation Friday, 03-Mar-2023 21:45:12 CET permalink
    • ɗ𐐩ʃƕρʋ (deshipu@fosstodon.org)'s status on Friday, 03-Mar-2023 21:48:47 CET ɗ𐐩ʃƕρʋ ɗ𐐩ʃƕρʋ
      • Ekaitz Zárraga 👹

      @ekaitz_zarraga @piggo they really are an internal implementation detail for the objects, that got exposed

      In conversation Friday, 03-Mar-2023 21:48:47 CET permalink
    • Piggo🐽 (piggo@piggo.space)'s status on Friday, 03-Mar-2023 21:53:40 CET Piggo🐽 Piggo🐽
      • Ekaitz Zárraga 👹
      • ɗ𐐩ʃƕρʋ
      @ekaitz_zarraga @deshipu so its a linked hashmap? honestly i just use plain arrays and objects for everything, it's ugly but fast enough for most things
      In conversation Friday, 03-Mar-2023 21:53:40 CET permalink
    • ɗ𐐩ʃƕρʋ (deshipu@fosstodon.org)'s status on Friday, 03-Mar-2023 21:56:29 CET ɗ𐐩ʃƕρʋ ɗ𐐩ʃƕρʋ
      • Ekaitz Zárraga 👹

      @ekaitz_zarraga @piggo hmm, and you can't have a custom hashing function on your own object?

      In conversation Friday, 03-Mar-2023 21:56:29 CET permalink
    • Piggo🐽 (piggo@piggo.space)'s status on Friday, 03-Mar-2023 21:58:05 CET Piggo🐽 Piggo🐽
      • Ekaitz Zárraga 👹
      • ɗ𐐩ʃƕρʋ
      @ekaitz_zarraga @deshipu what i meant is something like

      let coord = ((x & 0xFFFF) << 16) | (y & 0xFFFF);

      but that's of course for unsigned integers only and so obvious you probably dismissed it already
      In conversation Friday, 03-Mar-2023 21:58:05 CET permalink
    • Piggo🐽 (piggo@piggo.space)'s status on Friday, 03-Mar-2023 22:01:34 CET Piggo🐽 Piggo🐽
      • Ekaitz Zárraga 👹
      • ɗ𐐩ʃƕρʋ
      @ekaitz_zarraga @deshipu the proper webshit developer solution is to download some Map node_module that does this (and does the shitty JSON hack internally but you don't see it 🙈)
      In conversation Friday, 03-Mar-2023 22:01:34 CET permalink
    • ɗ𐐩ʃƕρʋ (deshipu@fosstodon.org)'s status on Friday, 03-Mar-2023 22:02:01 CET ɗ𐐩ʃƕρʋ ɗ𐐩ʃƕρʋ
      • Ekaitz Zárraga 👹

      @ekaitz_zarraga @piggo I don't know about JavaScript, but in Python there is a __hash__ magic method, which defaults to object's id, which tells the dicts how to hash the objects of that type. So by default they get hashed by id, which gives you pretty much what you described, but you can change it to only use some values from the object that you choose. There is no problem with foreach, because the dict stores both the keys and the hashes.

      In conversation Friday, 03-Mar-2023 22:02:01 CET permalink
    • Piggo🐽 (piggo@piggo.space)'s status on Friday, 03-Mar-2023 22:04:34 CET Piggo🐽 Piggo🐽
      • Ekaitz Zárraga 👹
      • ɗ𐐩ʃƕρʋ
      @ekaitz_zarraga @deshipu is there some didactic reason why you're not using es6 class there?
      In conversation Friday, 03-Mar-2023 22:04:34 CET permalink
    • Piggo🐽 (piggo@piggo.space)'s status on Friday, 03-Mar-2023 22:07:17 CET Piggo🐽 Piggo🐽
      • Ekaitz Zárraga 👹
      • ɗ𐐩ʃƕρʋ
      @ekaitz_zarraga @deshipu here's one more shit falling into your fan
      In conversation Friday, 03-Mar-2023 22:07:17 CET permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

tiflolinux.org - GNU Social is a social network, courtesy of tiflolinux.org. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All tiflolinux.org - GNU Social content and data are available under the Creative Commons Attribution 3.0 license.