home.social

#either — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #either, aggregated by home.social.

fetched live
  1. Ненормальное марковское программирование: бег по правилам

    Продолжение. Начало здесь . Предыдущая часть . Репозиторий с кодом - на гитхабе . (Сокращения: НАМ - нормальные алгорифмы Маркова, КТ - компайл-тайм, РТ - рантайм). Следующая неприятность, которая нас ждёт, - это циклы, которые в КТ вовсе не циклы. Нам надо как-то научиться бегать по правилам, из которых состоит НАМ-программа.

    habr.com/ru/articles/1049258/

    #нормальные_алгоритмы_маркова #constexpr #template #template_metaprogramming #string #compiletime #compiletime_computation #c++ #монады #either

  2. I am SO stealing this idea - knit tiny ornaments from scrap yarn! Maybe all-pastel socks & sweaters for my Ostara wreath, come March? So cute!
    Great idea, pic also, is from ShelbyKnits, @shelbyknits.bsky.social ~
    #knit #mini #ornaments w #scrap #yarn #doublepoints or #straight #needles #either #way #cute #gift #idea #trim #tree #wreath #trimming #decoration #ball #hank #scrap #yarn #cotton #wool #bamboo #cable #pattern #count #stitch #color #work #bobbins #crochet #knitting #knitter #knit #purl

  3. I am SO stealing this idea - knit tiny ornaments from scrap yarn! Maybe all-pastel socks & sweaters for my Ostara wreath, come March? So cute!
    Great idea, pic also, is from ShelbyKnits, @shelbyknits.bsky.social ~
    #knit #mini #ornaments w #scrap #yarn #doublepoints or #straight #needles #either #way #cute #gift #idea #trim #tree #wreath #trimming #decoration #ball #hank #scrap #yarn #cotton #wool #bamboo #cable #pattern #count #stitch #color #work #bobbins #crochet #knitting #knitter #knit #purl

  4. Прагматичное функциональное программирование в Java

    Прагматичное функциональное программирование в Java при помощи монады XResult<T> , которая сочетает в себе свойства Optional<T> , Result<T> и Either<L,R> Читать далее ...

    habr.com/ru/articles/876736/

    #monad #optional #result #either #error_handling

  5. Episode seventy-three is up now! Today's song is Say Yes by Elliott Smith.

    I discuss the way the seemingly crudely arranged elements come together beautifully, and how this song differs from the rest of his discography.

    youtube.com/watch?v=y8XfAiaSMj

    #podcast #dailypodcast #pigeon #pigeonsongspod #music #songs #elliottsmith #sayyes #either/or #eitheror #acoustic #indie

  6. I remember when "Lock her up!" was fine with them.
    Now that "Lock him up!" is suddenly bad, this just proves that pronouns do matter to these people after all.
    #pronouns #he #she #her #him #LockHimUp #throw #away the #key #LGBTQ #gender #neutral #feminine #masculine #GQP #GOP #attack #most #vulnerable #among #us for #political #power #culture #wars vs. #federal #charges #four #federal #cases & 91 #indictments for #crimes not #misdemeanors #either

  7. I remember when "Lock her up!" was fine with them.
    Now that "Lock him up!" is suddenly bad, this just proves that pronouns do matter to these people after all.
    #pronouns #he #she #her #him #LockHimUp #throw #away the #key #LGBTQ #gender #neutral #feminine #masculine #GQP #GOP #attack #most #vulnerable #among #us for #political #power #culture #wars vs. #federal #charges #four #federal #cases & 91 #indictments for #crimes not #misdemeanors #either

  8. What looked good at the cafeteria and I really wanted -
    The special: chicken wings w choice of dipping sauce, cole slaw, & parmesan french fries. For dessert, turtle cheesecake (huge blob of caramel on top).
    What I got at the cafeteria instead -
    Baked fish, rice pilaf. No dessert.
    #turtle #caramel #cheesecake #please #parmesan #french #fries #too #nope #no #chicken #wings #either #baked #fish #summer is #coming #sun #bathing #swimsuit #weather #soon #tempting #cafeteria #today #lunch #special

  9. Где мне это пригодится в жизни или применение Nothing в Kotlin на примере

    В данной статье я хочу показать, почему развитая система типов в языке программирования это здорово. Я попробую провести небольшой ликбез о таких на первый взгляд сложных вещах, как sealed-иерархии, ковариантность и тип Nothing на понятном практическом примере создания своей реализации типа из функционального программирования Either.

    habr.com/ru/articles/809711/

    #kotlin #системы_типов #функциональное_программирование #either #ковариантность #covariance #nothing

  10. Muy interesante este vídeo dónde se exponen las ventajas e inconvenientes de usar Either vs Exceptions, nos os dejéis engañar por el título "clickbaitero" el contenido es top 👌

    youtube.com/watch?v=8WdprhzmQe

    #code #errorHandling #either #exceptions

  11. Blending OO + FP is so easy in #ruby. My favorite is using monads to build elegant pipelines (a.k.a. the Railway Pattern).

    One aspect, in particular, is pipeline termination -- the point where you unwrap your monad for final deliver -- and use of Dry Monads' `#either` is perfect for this.

    Here's an example where I *either* log successful user deletion or fail with an error and abort. 🚀

    💡If you've never watched Scott Wlaschin's talk on Railway Programming, definitely check it out!

  12. Blending OO + FP is so easy in #ruby. My favorite is using monads to build elegant pipelines (a.k.a. the Railway Pattern).

    One aspect, in particular, is pipeline termination -- the point where you unwrap your monad for final deliver -- and use of Dry Monads' `#either` is perfect for this.

    Here's an example where I *either* log successful user deletion or fail with an error and abort. 🚀

    💡If you've never watched Scott Wlaschin's talk on Railway Programming, definitely check it out!

  13. Laid out at my community gardens, 48th/ 10th, guy at Kinkos FedEx 40th/ 6th sent me to Staples 39th/ 5th for a nice walk #today in #NYC.
    #color #copies #too #big #for #fedex #walking #Theatre #District #Clinton #Times #Square #Bryant #Park #partly #sunny #not #cloudy #either

  14. For any ruby :ruby: devs out there, wanted to share a neat little open-source :opensource: module I wrote to solve a common problem. Keep in mind ruby is not my main language so if there is a batter approach here I'm all ears.

    Basically right now I have a game (text based mud) and in normal and expected fashion objects in the game are created when their objects get initialized, such as a new player being created. The system then periodically saves the universe by marshalling all the object into some serialized format and saves it to a file from time to time. As tends to be the case with serialization, however, when an object is restored, such as a previous player logging out and back in, then the class is created directly without the initialize method getting called , its class and instance variables are simply populated directly.

    This is where problems can arise if you change the system and add new features (such as a new variable to an object). New objects that are created will populate the new variable correctly through the initialize method however already existing players will not have that variable set at all (it won't be nil, it simply wont be set, which is a distinctly different state). This is the problem I solved.

    What I did was created a mix-in module that lets you set default values for variables, once a class is reinstated from storage it checked if any variables that have defaults are unset (nil variables are considered set) and then applies the default value to them. In this way legacy objects will be able to update to new code changes automatically when it loads. To prevent duplicating code you can even intentionally leave it out of the initialize method and rely on the defaults when it is appropriate to do so.

    Moreover the defaults do not have to be static values but can be determined based on the existing state of the object, which makes them dynamic and flexible... a class that uses the mixin could look like this:

    require 'defaults'

    class Foo
    include Defaults

    # @bar defaults to @baz*2
    default(:bar) { |this| this.baz * 2 }
    # @faaboo defaults to 178
    default(:faaboo) { 178 }

    def initialize
    @baz = 13

    #this line can be ommited
    @bar = 26
    # if you add this line instead
    load_defaults
    #either work fine
    end
    end

    Here is a link to the module:

    git.qoto.org/aethyr/Aethyr/-/b

    You can see a class that utilizes this new feature here:

    git.qoto.org/aethyr/Aethyr/-/b

    #Ruby #RubyLang #Programming #Coding #software #ComputerScience @Science #code #source #sourcecode #opensource #oss #game #gaming #gamedev #QotoJournal