204 Matching Annotations
  1. Last 7 days
    1. For branching out a separate path in an activity, use the Path() macro. It’s a convenient, simple way to declare alternative routes

      Seems like this would be a very common need: once you switch to a custom failure track, you want it to stay on that track until the end!!!

      The problem is that in a Railway, everything automatically has 2 outputs. But we really only need one (which is exactly what Path gives us). And you end up fighting the defaults when there are the automatic 2 outputs, because you have to remember to explicitly/verbosely redirect all of those outputs or they may end up going somewhere you don't want them to go.

      The default behavior of everything going to the next defined step is not helpful for doing that, and in fact is quite frustrating because you don't want unrelated steps to accidentally end up on one of the tasks in your custom failure track.

      And you can't use fail for custom-track steps becase that breaks magnetic_to for some reason.

      I was finding myself very in need of something like this, and was about to write my own DSL, but then I discovered this. I still think it needs a better DSL than this, but at least they provided a way to do this. Much needed.

      For this example, I might write something like this:

      step :decide_type, Output(Activity::Left, :credit_card) => Track(:with_credit_card)
      # Create the track, which would automatically create an implicit End with the same id.
      Track(:with_credit_card) do
          step :authorize
          step :charge

      I guess that's not much different than theirs. Main improvement is it avoids ugly need to specify end_id/end_task.

      But that wouldn't actually be enough either in this example, because you would actually want to have a failure track there and a path doesn't have one ... so it sounds like Subprocess and a new self-contained ProcessCreditCard Railway would be the best solution for this particular example... Subprocess is the ultimate in flexibility and gives us all the flexibility we need)

      But what if you had a path that you needed to direct to from 2 different tasks' outputs?

      Example: I came up with this, but it takes a lot of effort to keep my custom path/track hidden/"isolated" and prevent other tasks from automatically/implicitly going into those steps:

      class Example::ValidationErrorTrack < Trailblazer::Activity::Railway
        step :validate_model, Output(:failure) => Track(:validation_error)
        step :save,           Output(:failure) => Track(:validation_error)
        # Can't use fail here or the magnetic_to won't work and  Track(:validation_error) won't work
        step :log_validation_error, magnetic_to: :validation_error,
          Output(:success) => End(:validation_error), 
          Output(:failure) => End(:validation_error) 
      puts Trailblazer::Developer.render o
       {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model>
       {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=save>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=save>
       {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<End/:success>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Left} => #<End/:validation_error>
       {Trailblazer::Activity::Right} => #<End/:validation_error>

      Now attempt to do it with Path... Does the Path() have an ID we can reference? Or maybe we just keep a reference to the object and use it directly in 2 different places?

      class Example::ValidationErrorTrack::VPathHelper1 < Trailblazer::Activity::Railway
         validation_error_path = Path(end_id: "End.validation_error", end_task: End(:validation_error)) do
          step :log_validation_error
        step :validate_model, Output(:failure) => validation_error_path
        step :save,           Output(:failure) => validation_error_path
      o=Example::ValidationErrorTrack::VPathHelper1; puts Trailblazer::Developer.render o
       {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model>
       {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=save>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<End/:validation_error>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=save>
       {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<End/:success>

      It's just too bad that:

      • there's not a Railway helper in case you want multiple outputs, though we could probably create one pretty easily using Path as our template
      • we can't "inline" a separate Railway acitivity (Subprocess "nests" it rather than "inlines")
    2. step :direct_debit

      I don't think we would/should really want to make this the "success" (Right) path and :credit_card be the "failure" (Left) track.

      Maybe it's okay to repurpose Left and Right for something other than failure/success ... but only if we can actually change the default semantic of those signals/outputs. Is that possible? Maybe there's a way to override or delete the default outputs?

    1. Nick Brown. (2020, November 27). A researcher reads an online news article about a family suicide in another country and writes it up more or less verbatim as a ‘case report’, with a spurious reference to homicide. WTF @wileyglobal? 10.1111/ppc.12686 News article (trans by Google in pic): Https://t.co/uPZeRPN4jg https://t.co/tHW1XQGRyl [Tweet]. @sTeamTraen. https://twitter.com/sTeamTraen/status/1332413218271195137

    1. So, what can we do to check for None in our programs? You can use builtin Optional type and write a lot of if some is not None: conditions. But, having null checks here and there makes your code unreadable.
    1. Return None. That’s evil too! You either will end up with if something is not None: on almost every line and global pollution of your logic by type-checking conditionals, or will suffer from TypeError every day. Not a pleasant choice.
    1. Couldn't find on Steam. https://steamdb.info/app/793300/ claims that it is there, but https://store.steampowered.com/app/793300/?curator_clanid=4777282&utm_source=SteamDB just redirects to home page.

      Don't redirect to a different URL, esp. without a message explaining why it did so instead of keeping me on the page that I request. That's just incorrect behavior, and a poor UX. Respond with a 404 if the page doesn't exist.!

      That way (among other things), I could use Wayback Machine extension to see if I can find a cached version there.

      But even that (http://web.archive.org/web/*/https://store.steampowered.com/app/793300) is saying "huh?" so I'm confused.

      Where did it go and why?

      I guess it's no longer available, because this page says:

      section_type    ownersonly
      ReleaseState    unavailable

      ... but why?

    1. A fifth night of peaceful protests to denounce the imprisonment of a Spanish rap artist once more devolved into clashes between police and the members of fringe groups who set up street barricades and smashed storefront windows Saturday night in downtown Barcelona.

      Peaceful protests devolve into violence -- does this even really make them peaceful? Bizarre, lol.

  2. Feb 2021
    1. Tang, J. W., Bahnfleth, W. P., Bluyssen, P. M., Buonanno, G., Jimenez, J. L., Kurnitski, J., Li, Y., Miller, S., Sekhar, C., Morawska, L., Marr, L. C., Melikov, A. K., Nazaroff, W. W., Nielsen, P. V., Tellier, R., Wargocki, P., & Dancer, S. J. (2021). Dismantling myths on the airborne transmission of severe acute respiratory syndrome coronavirus (SARS-CoV-2). Journal of Hospital Infection, 0(0). https://doi.org/10.1016/j.jhin.2020.12.022

    1. please, for the love of god do NOT use Mint as a source of inspiration for a derivative distro. If you like Cinnamon or Mate, fine, but holy CHRIST do not let your infrastructure get as criminally sloppy as Mint's. No unholy mixing of Debian and Ubuntu debs into some kind of Frankenbuntu, no namespace collisions, no ... well, no being Mint in general, please!Ideally, I really, really hope you'll continue to support Ubuntu as a primary platform, regardless of what you do with Pop!_OS. But hooboy, do not turn into another Mint, please.
    1. But it shows, he said, how underhanded internet campaigns try to launder seemingly legitimate material like Mr. Vermulst’s article through a mesh of websites and fake social media accounts to give it an air of impartiality and authenticity.

      What are they even arguing? It sounds even like they are saying that Mr. Vermulst's "legitimate" article is being used to give a company an 'air of impartiality and authenticity,' and... this is somehow wrong?

      If the article is illegitimate, what is the wrong..? It's entirely separate from the fact that there apparently exists a network of bots that intends to share it.

  3. Jan 2021
    1. The same groups – including members of the popular “alt-right” Reddit forum The_Donald – used techniques that are used by reputation management firms and marketers to push their companies up Google’s search results, to ensure pro-Trump imagery and articles ranked highly.

      Obvious lie easily prevented through research -- the Donald is not Alt Right.

    1. Supporters of former President Donald Trump breached the Capitol building on January 6 and attempted to stop Congress from certifying Joe Biden's electoral win, believing that the 2020 election was stolen from Trump.

      This cannot be representative of all of the supporters who charged in at all. Not good journalism.

    1. When Snap was introduced Canonical promised it would never replace APT. This promise was broken. Some APT packages in the Ubuntu repositories not only install snap as a dependency but also run snap commands as root without your knowledge or consent and connect your computer to the remote proprietary store operated by Canonical.
    1. the bloody mount points. I couldn't believe that when I realised what was going on. I got the wire brush and dettol out and scraped it off my drive. Never, ever again.
    2. It won't work if $HOME is not under /home. Really. Not even if you softlink. You need a bind mount
    3. There's a lot of advice online showing how to get rid of snap. (e.g.: https://cialu.net/how-to-disable-and-remove-completely-snaps-in-ubuntu-linux/ worked for me) so the only result (so far, a few months later) is that Chromium has lost a user, and having upgraded Ubuntu since the original Warty, if snap becomes obligatory I'll have to take a look at Mint, or Devuan.
    4. I managed to remove it myself this morning...apparently it used to get it's hooks in so deep it was very difficult to remove the daemon as it interconnected with ubuntu-desktop for....reasons.
    5. Good. Hate snap. It's insidious and a pain to deal with.
    6. Plus, have you seen how many loopback mounting points it creates? "df" becomes very hard to use as it buries your actual drives with it's own. One for the daemon, one for GTK, one for Gnome, one for each of the snaps you have installed....
    7. it's an absolute resource hog
    8. Besides running contrary to the principles that lead a lot of people to Linux systems (a closed store that you can't alter...automatic updates you have no control over....run by just the one company)
    9. The strangest "quirk" I had was that I couldn't get the web browser to save a file directly to an attached, encrypted drive. Permissions problem. So I had to save to an interim folder then move it across by hand. Utter pain.
    10. I found that snap can cause lots of issues. I installed keepass using snap, and it installed as a sandboxed app. Very nice for security you would think. Well, a short while later, after 3 upgrades to keepass, it deleted the oldest snap container, which just happened to contain my password file. So secure that even you can't use your passwords now!
    11. If upstream code presumes things will work that dont in snap (e.g. accesses /tmp or /etc) the snap maintainer has to rewrite that code and maintain a fork. Pointless work. Packaging for .deb is a no-brainer.
    12. It's Snap that drove me to Arch, so it did me a huge favour. Seeing things like GNOME as a snap and other 'core' products wasn't something I was comfortable with. Personally, I prefer flatpaks as a packaging format when compared to snap and appimage. I agree that Linux needs an app delivery format, but snap's current implementation isn't it.
    13. I run a fairly ancient RedHat Enterprise 6 on my 32-bit test machine and if I need something requiring Gtk3 (such as a latest Firefox or Chrome), I just make a chroot and use debootstrap (from EPEL) to get me a Debian 9 userland for that program. Easy. No bizarre "app stores", no conflicting packages. Do people use Snap app-stores because they don't know how to use the chroot command? Or are they just lazy? If it is because they want the added security of a container, substitute chroot with lxc... Shouldn't be necessary though; if you avoid non-ethical software (i.e App-stores), you are very unlikely to need the added security.
    14. The cost of snap is too high. Its Linux ffs. We want it lean, mean, open, stable, file based, and bash friendly. We want our tools to work together, and above all, we want choice. Snap is none of that.
    15. Its not too complicated but it is an annoyance. I want /etc/hosts, /etc/resolv.conf, /etc/nsswitch.conf, /etc/rc.local and all the standard stuff to work. The heavy lifting is done in the kernel. All they need to do is leave it alone. Its getting harder to make Ubuntu behave like Linux.
    16. Did my first Xubuntu 20.04 LTS last month: no (dependency) trouble at all to remove snap and its systemd tentacles...
    1. There is seldom any good reason to use this option. Mixing ERB into your controllers defeats the MVC orientation of Rails and will make it harder for other developers to follow the logic of your project. Use a separate erb view instead.
  4. Dec 2020
    1. It took faaaaaaaaaaaaar too long to signup at this site to reply to you. This site rejected the real address I use for amazon, username.place@cocaine.ninja so I created an email address that I'll never check again just to signup here. I have zero tolerance for spam.
    2. no post edit, eh?Fine.
  5. Nov 2020
    1. DevtoolThis option controls if and how source maps are generated.

      If the option is (only) about source maps, then it should be called something like sourceMapTool instead.

  6. Oct 2020
    1. Just let the user fill in some fields, submit it to the server and if there are any errors notify them and let the user start over again. Is that a good approach? The answer is no, you don't want users to get frustrated waiting for a server round trip to get some form validation result.
    1. One of my favorite things to do with my friends is watching and ridiculing bad rom-coms, and Netflix has several to offer.

      There are many poorly made romcoms on Netflix that I am not proud to say I watched.

    1. Looks like the problem is that debounce defaults to waiting for 0 ms ... which is completely useless!

      It would be (and is) way to easy to omit the 2nd parameter to https://lodash.com/docs/4.17.15#debounce.

      Why is that an optional param with a default value?? It should be required!

      There must be some application where a delay of 0 is useless. https://www.geeksforgeeks.org/lodash-_-debounce-method/ alludes to / implies there may be a use:

      When the wait time is 0 and the leading option is false, then the func call is deferred until to the next tick.

      But I don't know what that use case is. For the use case / application of debouncing user input (where each character of input is delayed by at least 10 ms -- probably > 100 ms -- a delay of 0 seems utterly useless.

    1. just saying that if you're going to try to go with a markup approach, at least go all the way, instead of the frankenstein that is JSX
    2. mixing the turing complete of javascript with the markup of HTML eliminates the readability of JSX so that it is actually harder to parse than a solution like hyperscript
    3. I'm okay with an overall design that allows people to plugin the parts they need in order to be able to generically support a compile-to-javascript language, but to bake in support for one singular solution because its popular is simply bad engineering.
    4. hyperscript is much simpler to refactor and DRY up your code than with JSX, because, being vanilla javascript, its easier to work with variable assignment, loops and conditionals.
    1. cloud

      I noticed how Collins use ‘cloud’ constantly in this narrative, which perhaps foreshadowing a bad omen to come.

  7. Sep 2020
    1. Svelte will not offer a generic way to support style customizing via contextual class overrides (as we'd do it in plain HTML). Instead we'll invent something new that is entirely different. If a child component is provided and does not anticipate some contextual usage scenario (style wise) you'd need to copy it or hack around that via :global hacks.
    1. strict: only validate the input, and skip any coercion or transformation

      transform would have been a more descriptive name.

      strict is pretty ambiguous.

  8. Aug 2020
  9. Jul 2020
    1. the key method for conformation comparison used in this artical is wrong, so the result is not very informative.



    1. But the business model that we now call surveillance capitalism put paid to that, which is why you should never post anything on Facebook without being prepared to face the algorithmic consequences.

      I'm reminded a bit of the season 3 episode of Breaking Bad where Jesse Pinkman invites his drug dealing pals to a Narcotics Anonymous-type meeting so that they can target their meth sales. Fortunately the two low lifes had more morality and compassion than Facebook can manage.


    1. In fact, developers often tend to forget a simple, almost elementary fact: if users want to close the application or leave a site, they will — doesn’t matter which obstacles are placed on their path to the exit-button. The more obstacles there are the more negative the user experience will be.
    2. Users also don’t like to deal with dozens of opened tabs and some visitors tend to become quickly angry with the disabled back button. Furthermore, some visitors may not even realize that a new window was opened and hit the back-button mercilessly — without any result. That’s not user-friendly, and that’s not a good user experience we, web designers, strive for.
  10. Jun 2020