10,000 Matching Annotations
  1. Jan 2022
    1. For given hash, OpenStruct constructor only converts its top level keys.require 'ostruct' h = { foo: { bar: 1 } } obj = OpenStruct.new(h) obj.foo # => { bar: 1} obj.foo.bar # => NoMethodError: undefined method `bar' for {:bar=>1}:Hash
    1. It's worth noting that an error can coexist and be returned in a successful request alongside data. This is because in GraphQL a query can have partially failed but still contain some data. In that case CombinedError will be passed to us with graphQLErrors, while data may still be set.
    1. I just got caught out by realising I wasn't wrapping my component in a <Provider> that provides our own GraphQL client because the default context value is a urql client. I get why this is a good default out the box for getting started, but I'd love to disable that so that we can ensure all our components are wrapped with a provider that exposes our custom client.
      • defaults

      • disable defaults/safeguard to make sure you always provide a value

    1. Exchanges are bi-directional. So suppose you have the default order: [dedupExchange, cacheExchange, fetchExchange], then an operation describing the GraphQL request, which is only the intent to send a request, goes from outer to inner, or left to right. It'll reach dedup first, then cache, then fetch. This is the operation stream. The operation result stream goes the other way. fetch might emit a result, which is seen by cache, and then seen by dedup. This is a little abstract and we will need some visuals to make this an accessible concept to everyone. This is how it works because every exchange receives a stream of operations. It can then transform this stream and call forward with an altered stream (so every exchange has full control over filtering, mapping, reducing, timing of operations). Furthermore, every return value of an exchange is a stream of results. This means that the simplest exchange just forwards all operations and returns an unaltered stream of results: ({ forward }) => ops$ => forward(ops$). For your "error exchange" (which we should probably provide by default?) this means that it must come before the fetch exchange: [dedupExchange, cacheExchange, errorExchange, fetchExchange] Specifically, it won't need to alter the operations probably, but it will need to look at the results from the fetchExchange which means it must be outside fetch or come before it. Here's an example of a simple implementation of such an exchange: import { filter, pipe, tap } from 'wonka'; import { Exchange } from 'urql'; export const errorExchange: Exchange = ({ forward }) => ops$ => { return pipe( forward(ops$), tap(({ error }) => { // If the OperationResult has an error send a request to sentry if (error) { // the error is a CombinedError with networkError and graphqlErrors properties sentryFireAndForgetHere() // Whatever error reporting you have } }) ); };

      exchange

    1. It’s important to understand that an implements clause is only a check that the class can be treated as the interface type. It doesn’t change the type of the class or its methods at all. A common source of error is to assume that an implements clause will change the class type - it doesn’t!
    1. My case is that I have a component which takes an object as a prop. As the user changes the object's values, they can either Save or Cancel. So in the component I have two variables: value and valueUnsaved. It's similar to the example on my comment above. To avoid mutating the original object directly, I assign valueUnsaved as a deep clone of value. If value is changed outside of the component, valueUnsaved should be updated.
    2. updating b should update a as well. updating a will update b back again in the reactive declaration.

      don't quite understand.

      how could this ever update a?

         $: b = a * 2;
      
    3. For me there is a distinct difference between these two scripts: let a = 1; $: b = a * 2; let a = 1; let b; $: { b = a * 2 }; The first example defines a "recipe" for how to create b and b is completely defined by that declaration. Outside of that it is immutable, data flows only into a single sink. The second example declares a variable b and then uses a reactive statement to update it. But it also allows you to do with b whatever you want. If someone wants to go that route (definitely not me), they are free to do so at their own risk of ensuring consistency.
    1. I still cannot get over the fact that this is not mentioned in the documentation. I do not want to sound negative or unappreciative towards the work that went into this tool (because it has many awesome parts and awesome people working on it and contributing to it), but I do feel kind of let down that "basic" internal mechanics are not explained at all. You either have to find them out yourself or hope some other programmers did and wrote an article about it.
    1. I'm not sure what behaviour it is that you expect. "$; foo = bar.a" means that you expect foo to always be whatever bar.a is, and "bind:value={foo}" means that you expect foo to to be whatever has been entered in the input. It can't be both!
    1. Oh, I just figured out a workaround for my project, in case it helps someone. If you want the source of truth on the prop to come from the child component, then leave it undefined in the parent. Then, you can make the reactive variable have a condition on the presence of that variable. eg: <script> let prop; $: prop && console.log(prop); </script> <Child bind:prop/> Might not work for every use case but maybe that helps someone.
  2. www.metacritic.com www.metacritic.com
    1. Absolutely shockingly awful game from a company that puts out poor quality games. And furthermore, tries to sue YouTubers who don’t like their games for ‘slander’. Shocking games and shocking developers. Avoid at all costs.
    1. When you give an element a width of 100% in CSS, you’re basically saying “Make this element’s content area exactly equal to the explicit width of its parent — but only if its parent has an explicit width.” So, if you have a parent container that’s 400px wide, a child element given a width of 100% will also be 400px wide, and will still be subject to margins, paddings, and borders — on top of the 100% width setting.
    1. In the "When sending message, automatically" section, uncheck "Place a copy in."

      This seems inconsistent (since we do specify a folder for Drafts), but I confirmed that it still gets stored in Sent even after unchecking this. I guess because Gmail adds the Sent tag on the server, whereas with a draft, it is initiated client-side so the client has to be responsible for adding that tag.

    1. So if you subscribe to both Inbox and All mail you are in practise downloaded your mails twice. If you then delete a mail in inbox it doesnt go away in All mail. It just get the trash-tag. In my opinion you should never subscribe to All mail. You never need to see it. All you need to see are INBOX, TRASH, SENT and the folders YOU created in your gmail-account.
    1. Thunderbird determines connection details (such as ports, server names, security protocols, etc.) by looking up your email provider in a database that contains connection information for all the major Internet Service Providers (ISPs). After determining the provider of your account (as specified after the "@" symbol in your email address) Thunderbird can usually provide the account details.
    1. When you initially logon with OAuth2, you will be redirect to Google’s sign-in page,. Once you have signed in, Google issues you a special OAuth2 token which is saved in Thunderbird and can be seen in the same place as passwords. So when you next logon to gmail, it is using that unique OAuth ID instead of password.
    1. Thunderbird provides the ability to archive messages - that is, to move them from the default folders to archive folders without deleting the messages altogether. This makes it easy to organize archives or move them to a backup device, and keep the Inbox clean. Messages can only be archived manually, not automatically.
    1. Even if you didn't intentionally make any changes, please check that this setting is enabled.

      Similarly...

      I noticed in 2 of the 3 accounts I had set up in Geary that IMAP access was disabled. I don't remember disabling it.

      Geary had downloaded from all 3 of these accounts on 2021-12-15, but was not able to today 2022-01-10.

    2. If there is still a problem, try clearing Captcha again.  I acknowledge you wrote that you already did this, but you must open that page using the account that you are setting up in Thunderbird.  If you are signed into multiple Google accounts, the page will open with the primary account.  To be certain that you have used the correct account, please try again after signing out.

      This is a real usability issue.

      That page (https://accounts.google.com/b/0/DisplayUnlockCaptcha) doesn't even tell you which account is active or give you any way to switch.

      As a guess, I tried changing the number, like this: https://accounts.google.com/b/3/DisplayUnlockCaptcha to the same number as I saw in the URL for the account that I wanted to affect: https://mail.google.com/mail/u/3/#inbox and I think it worked (but again, no way to know for sure which account was affected).

    1. “Money corrupts; bitcoin corrupts absolutely. Disregarding all of bitcoin's shortcomings, a financial instrument that brings out the worst in people—greed—won't change the world for the better.” —https://www.cynicusrex.com/file/cryptocultscience.html.
    1. The highest rating Pure Health Fungus Eliminator got on Amazon is 4.0/5 stars. Meanwhile, it got 4.9 stars out of 5 on its official website. I’m not saying that the higher rating is entirely biased. But I just think that we get to see more honest reviews outside its site.
    1. I wish there's some kind of an optional ghost or something that I can follow after a while to teach me why I cannot get past a certain area.

      I've wished for this in Mario Maker 2, esp. since you can't just open the level in the editor to see where to go like you could in MM1.

    1. Out-of-band communication may even be by beeps from the PC speaker on the server's Motherboard.

      Huh? Please elaborate. Why/when would it do this? Who would be there to hear the beeps?

    1. Your character feels nigh impossible to control - you move very very fast, but if youre in the air, you dont stop moving the moment you stop holding a direction, so you have to constantly cancel out your momentum to stop, but if you dont do it perfectly you suddenly fly in the other direction
    1. I bought this game in order to review it, seeing as there were no current reviews for it. I thought I'd help the game out by maybe giving it that tiny bit of publicity it needed to get off the ground.
    1. A good riddance from the ultra realistic modern 2021 games . Or maybe its my personal opinion that most games towards the better side should be like 16-bit only. It certainly took me back to the era of Nintendo when I frankly used to enjoy gaming the most. The look and feel of Tobe's quite resonates with good old konami games, Contra, adventure island, Super Mario, Circus Charlie, Dangerous Dave.
    1. Code that is per-component instance should go into a second <script> tag.

      But this seems to conflict with https://hyp.is/NO4vMmzVEeylBfOiPbtB2w/kit.svelte.dev/docs

      The load function is reactive, and will re-run when its parameters change, but only if they are used in the function.

      which seems to imply that load is not just run once for the component statically, but rather, since it can be reactive to:

      url, params, fetch, session and stuff

      may be sufficiently like a per-instance callback, that it could be used instead of onMount?

  3. Dec 2021
    1. A plumber was a man who used lead for many reasons. Since lead was very malleable and had a low melting temperature it was employed quite a great deal to seal and repair.Pipes used to be connected and secured just as they are at present, although now we use plastics or ceramics.
    2. One may think that the pipes leading to the sink, and the job of installing or maintaining them is described as plumbing since pipes were previously made with lead and the Latin word for lead was plumbum (consequently the elemental letters Pb).While this fact is absolutely valid, it is additionally true that plumbers were once employed in additional ways than installing pipes when the phrase plumber originally became popular in French then English within a century around the 14th Century A.D.
    3. Furthermore, lead is very weighty and so it was often used in the role of a weight. At the end of a twine hung to be certain of a perpendicular line it is described as a plumb bob. Persons in charge of water workings earlier than the era of dependable pressure systems had to fall back on on gravity defined methods and so accurate lines and levels were essential.
    1. The diagram raises an interesting question which you may not have thought about before. How does all the information from the internet get to the right device inside the network? If you visit howtogeek.com on your laptop how does it end up on your laptop and not your son’s desktop if the public-facing IP address is the same for all devices? Advertisement pagespeed.lazyLoadImages.overrideAttributeFunctions();tmntag.cmd.push(function(){tmntag.adTag('purch_Y_C_0_1', false);}); This is thanks to a wonderful bit of routing magic known as a Network Address Translation (NAT).

      may not have thought about before

    1. We tag and release gems according to the Semantic Versioning principle. As a result of this policy, you can (and should) specify a dependency on this gem using the Pessimistic Version Constraint with two digits of precision.

      you can (and should)...

    1. Nested contexts tags are overwritten not merged: TestProf::LetItBe.configure do |config| config.default_modifiers[:freeze] = false end context "with reload", let_it_be_modifiers: {reload: true} do # uses freeze: false, reload: true here context "with freeze", let_it_be_modifiers: {freeze: true} do # uses only freeze: true (reload: true is overwritten by new metadata) end end

      good clarification

    1. It's well-suited for dev/test since it doesn't need an external infrastructure, but it's a poor fit for production since it drops pending jobs on restart.

      .

    1. declaration accepts: | null | [] | [null] | [{foo: 'BAR'}] ------------------------------------------------------------------------ [Vote!]! | no | yes | no | yes [Vote]! | no | yes | yes | yes [Vote!] | yes | yes | no | yes [Vote] | yes | yes | yes | yes
    2. [Vote!]! means that the field (in this case votes) cannot return null and that it must resolve to an array and that none of the individuals items inside that array can be null. So [] and [{}] and [{foo: 'BAR'}] would all be valid (assuming foo is non-null). However, the following would throw: [{foo: 'BAR'}, null] [Vote]! means that the field cannot return null, but any individual item in the returned list can be null. [Vote!] means that the entire field can be null, but if it does return a value, it needs to an array and each item in that array cannot be null. [Vote] means that the entire field can be null, but if it does return a value, it needs to an array. However, any member of the array may also be null.
    1. I could look into this more to understand where things are going wrong, if you can suggest to me which part of the way this is working might be off.

      where even to look?

    2. Besides that configuration, SvelteKit is just a normal Vite project that does rendering on both SSR and client-side.

      "is just..."

      This description makes it sound simple

    1. Just import it the normal way. Then Vite can use the CJS version on the server-side and ESM version on the client-side. Forcing it to always be ESM breaks SSR with the latest SvelteKit.

      .

    1. The code isn't going back to the way it was So otherwise you'll be stuck on an old version forever...

      In reply to:

      PS. I will stay with 144 for a while...

    1. So, underscores are not quite as good as spaces. They’re a compromise of language, readability, and semantics, but they’re the best we’ve got. Better than dashes, CamelCase, plus+signs, or anything else. So use them.
    1. The product may not be compatible with routers or gateways with firmware that has been altered, is based on open source programs, or is non-standard or outdated

      It what way? Why not? Wouldn't it just connect to them with standard Wi-Fi protocols like any other device?

    1. Just FYI, there is a nice way to "expect a change" in RSpec. You don't have to use it, what you have is fine, just thought I'd share. expect { widget.paper_trail.update_columns(name: "Bugle") }.to(change { widget.versions.length }).from(1).to(2)
    1. Wait, I'm still interested in a solution to this problem/need! (no activity doesn't necessarily = no interest. I totally understand if the maintainers just aren't interested in implementing this and would rather someone submit a PR... but would it have been any different if I'd pinged this thread every 5 months to show continued interest? )

      no activity doesn't = no interest

    1. If you want to restore the old behavior (thus not reaching level AA), you can apply the following diff: -<Tooltip> +<Tooltip disableInteractive> # Interactive tooltips no longer need the `interactive` prop. -<Tooltip interactive> +<Tooltip>

      How would you even apply this "diff"? I assume this is supposed to just be a hint for what you should look for and either manually or automatically do a global search and replace for (no search and replace tool that I know of accepts a diff instead of search and replace strings, but I guess they are functionally the same thing).

  4. www.kickstarter.com www.kickstarter.com
    1. make you more prepared for spontaneous things in life, like when you get asked a question in the middle of nowhere, your brain usually freezes up and can't think of an answer. This game captures that entirely.

      to capture the essence/feeling of something

  5. Nov 2021
    1. trying to counter the antivaccine movement predicted that antivaxxers would publicize and weaponize reports of death and adverse events after COVID-19 vaccines to give the impression that the vaccines are dangerous

      That's ironic. That's exactly what the vaccine-pushers are doing: over-reporting the danger of the Covid virus.

    1. In effect, the $ syntax we've seen above will actually setup a subscription to the store. And the subscription will be cancelled when the component is destroyed. If the store is subscribed by multiple components, the store will be disposed only when the last component unsubscribes (it will be reinitialized, if a new subscription is made). This is very handy to manage the lifecycle of disposable things in your code.
    1. Personally, I prefer an event-based communication, but I don't think it's actually better. The only problem with props is that it can cause problems if badly managed, but normally, both of them are ok. In real life, I would opt for storage.
    1. Finally, I think Actions are great for animations, because you will definitely need to apply the same logic to many different elements. One of my favorite examples are FLIP animations, where a change in DOM position can be animated. For example shuffling a list of items. I will not dive deep into the topic in this article: I've written about some techniques in this article about FLIP animations in React and in this article about how to create spring animations with Web Animation API. Although they are not about Svelte, at the end of the day it all boils down to manipulating the HTML element directly. And Svelte Actions are a great place to do it.
    1. To match against an ID or selectors that do not follow standard CSS syntax (by using a colon or space inappropriately, for example), you must escape the character with a backslash ("\"). As the backslash is also an escape character in JavaScript, if you are entering a literal string, you must escape it twice (once for the JavaScript string, and another time for querySelector()):
    1. export interface TasksListSpecifics { 0: ('parallel' | 'sequential'); } export type TasksList = (string[] & TasksListSpecifics); Or more compact: export type TasksList = (string[] & { 0: ('parallel' | 'sequential'); }); The trick is to add your more specific properties on top of array of string type (Array<string>).
    1. the name union comes from type theory. The union number | string is composed by taking the union of the values from each type. Notice that given two sets with corresponding facts about each set, only the intersection of those facts applies to the union of the sets themselves.