615 Matching Annotations
  1. Aug 2022
    1. The instructions here for "Postman Collection" might be useful on the portal, but are they too complex? Is there anything we can do (such as purchase a Postman team license) to streamline this part of the work? Ask the ProServ Team.

    1. Beyond memory leaks, it's also really useful to be able to re-run a test many times to help with tracking down intermittence failure and race conditions.
    1. It's a great way to test various limits. When you think about this even more, it's a little mind-bending, as we're trying to impose a global clock ("who is the most up to date") on a system that inherently doesn't have a global clock. When we scale time down to nanoseconds, this affects us in the real world of today: a light-nanosecond is not very far.
    2. Which of these to use depends on the result you want. Note that by the time you get the answer, it may be incorrect (out of date). There is no way to fix this locally. Using some ESP,2 imagine the remote you're contacting is in orbit around Saturn. It takes light about 8 minutes to travel from the sun to Earth, and about 80 to travel from the sun to Saturn, so depending on where we are orbitally, they're 72 to 88 minutes away. Any answer you get back from them will necessarily be over an hour out of date.
    3. When we have our git rev-parse examine our Git repository to view our origin/HEAD, what we see is whatever we have stored in this origin/HEAD. That need not match what is in their HEAD at this time. It might match! It might not.
    4. Exaggeration of System Parameters
  2. Jun 2022
  3. May 2022
    1. The shared context worked though thanks! RSpec.shared_context "perform_enqueued_jobs" do around(:each) { |example| perform_enqueued_jobs { example.run } } end RSpec.configure do |config| config.include_context "perform_enqueued_jobs" end

      use case for around

    1. 1/ It fits into existing spec based testing infrastructure nicely, including running on travis, code coverage using SimpleCov, switching between generating a profile (RubyProf), a benchmark (Benchmark::IPS) or normal test run. 2/ Some of my benchmarks do have expect clauses to validate that things are working before invoking the benchmark.

      Answering the question:

      I don't understand the point of putting it in a spec. What does that gain you over using benchmark-ips the normal way?

    2. I just wanted to mention there was, IMHO, a valid use case for this. It helps add to the validity of the ticket and the design of the feature.
    1. DICER1 syndrome is an autosomal-dominant,pleiotropic, tumor-predisposition disorder arisingfrom pathogenic germline variants in DICER1, whichencodes an endoribonuclease integral to processingmicroRNAs

      DICER1 is the gene name. PubMed ID, HGCNCID, and Variant: I can't find Inheritance Pattern: autosomal-dominant The disease entity: DICER1 syndrome The type of mutation: germline. Zygosity: not known. Family Information: a family was used, DICER1 carriers, and non DICER1 variant used, some of the family members had tumors from DICER1 Case Information: mean age is 34, the range of age is 18.6 to 43 years, male, and female used, ethnicity can't find Case Presenting HPO: cancer testing, chemotherapy, radiotherapy gnomeAD: 9.2,8.3.2 Mutation type: Pleiotropic, loss of function, missense

  4. Apr 2022
    1. They coincide in most cases, but they don't if there are series of consecutive uppercase letters as in "HTMLParser"
    1. Let's imagine your project talks to databases, supports several, and has adapters for each one of them. Those adapters may have top-level require calls that load their respective drivers: # my_gem/db_adapters/postgresql.rb require "pg" but you don't want your users to install them all, only the one they are going to use.
    2. There are project layouts that put implementation files and test files together.
    3. Let's suppose that your gem decorates something in Kernel:
    1. if Rails.application.config.reloading_enabled? Rails.autoloaders.main.on_unload("Country") do |klass, _abspath| klass.expire_redis_cache end end
    2. If your application decorates classes or modules from an engine,
    3. Some projects want something like app/api/base.rb to define API::Base, and add app to the autoload paths to accomplish that.
    4. By default, app/models/concerns belongs to the autoload paths and therefore it is assumed to be a root directory. So, by default, app/models/concerns/foo.rb should define Foo, not Concerns::Foo.
    1. To drive this point home:

      I sometimes get people who balk at my characterization of GitHub-style anti-wikis as being inferior to, you know, actual wikis. "You can just use the GitHub UI to edit the files", they'll sometimes say.

      A case study: a couple days ago, I noticed that the lone link in the current README for Jeff Zucker's solid-rest project is a 404. I made a note of it. Just now, I reset my GitLab password, logged in to solid/chat, and notified Jeff https://gitter.im/solid/chat?at=611976c009a1c273827b3bd1. Jeff's response was, "I'll change it".

      This case is rich with examples of what makes unwikis so goddamn inefficient to work with. First, my thought upon finding the broken link was to take note of it (i.e. so that it can eventually be taken care of) rather than fixing it immediately, as would have been the case with a wiki. More on this in a bit. Secondly, my eventual action was still not something that directly addressed the problem—it was to notify someone else† of the problem so that it might be fixed by them, due to the unwiki nature of piles of Git-managed markdown. Thirdly, even Jeff's reflex is not to immediately change it—much like my reaction, his is to note the need for a fix himself and then to tell me he's going to change it, which he will presumably eventually do. Tons of rigamarole just to get a link fixed‡ that remains broken even after having gone through all this.

      † Any attempt to point the finger at me here (i.e. coming up short from having taken the wrong action—notifying somebody rather than doing it myself) would be getting it wrong. First, the fact that I can't just make an edit without taking into account the myriad privacy issues that GitHub presents is materially relevant! Secondly, even if I had been willing to ignore that thorn (or jump through the necessary hoops to work around it) and had used the GitHub web UI as prescribed, it still would have ended up as a request for someone else to actually take action on, because I don't control the project.

      ‡ Any attempt to quibble here that I'm talking about changing a README and not (what GitHub considers) a wiki page gets it wrong. We're here precisely because GitHub's unwikis are a bunch of files of markdown. The experience of changing an unwiki page would be rife with the same problems as encountered here.

    1. I am not looking for model based after commits on update/create/etc, I want to be able to dynamically define a block that will be executed only if the current (top-most) transaction passes:
    2. This would work if your transaction only wraps a single model's save operation. I need to wrap at least Node + Version + Attachment

      looking for a callback that you can register to happen after current transaction is committed, not just after_commit of model -- though actually, that might fire precisely when current transaction is committed, too (except that it might only get triggered for nested transactions, not the top-most transaction), so it could maybe go there ... but I think the problem is just that it doesn't belong there, because it's not specific to the model...

      I guess the OP said it best:

      I am not looking for model based after commits on update/create/etc, I want to be able to dynamically define a block that will be executed only if the current (top-most) transaction passes:

    1. You want the front page to show a few hundred posts along with the top three comments on each post. You’re planning on being very popular, so the front page will need to be very fast. How do you fetch that data efficiently from postgresql using Activerecord?
    2. Making one Comment query per Post is too expensive; it’s N+1 queries (one to fetch the posts, N to fetch the comments). You could use includes to preload all the comments for all the posts, but that requires hydrating hundreds of thousands of records, even though you only need a few hundred for your front page. What you want is some kind of GROUP BY with a LIMIT on each group — but that doesn’t exist, either in Activerecord nor even in postgres. Postgres has a different solution for this problem: the LATERAL JOIN.
    1. Let's say the user is in the process of selecting some files. The names don't indicate anything. So she has to listen and select.
    1. When a web page is viewed on a screen with a large physical size (assuming a maximised browser window), the author might wish to include some less relevant parts surrounding the critical part of the image. When the same web page is viewed on a screen with a small physical size, the author might wish to show only the critical part of the image.
  5. Mar 2022
    1. This has cropped up in particular when trying to create a copy of a store object when the store changes (which is a common use case with forms where you don't want to mutate the global store until the form is saved).

      Exactly! This is more or less the same kind of use case I tend to have: intentionally having/wanting a stale/out-of-date copy of a (reactive) object.

    1. Dr Dan Goyal. (2022, March 15). What’s been happening This Week in Covid? The schism between reality and policy grew even wider this week... Omicron B.2 sent cases soaring and stock markets sinking! #TheWeekInCovid [Tweet]. @danielgoyal. https://twitter.com/danielgoyal/status/1503699425427968001

    1. This is particularly useful in cases where you want to separate your data migrations from your schema migrations or where you have multiple steps in your migration process that must have other steps invoked throughout.
    1. If you need to ensure migrations run in a certain order with regular db:migrate, set up Outrigger.ordered. It can be a hash or a proc that takes a tag; either way it needs to return a sortable value: Outrigger.ordered = { predeploy: -1, postdeploy: 1 } This will run predeploys, untagged migrations (implicitly 0), and then postdeploy migrations.
    2. class PreDeployMigration < ActiveRecord::Migration tag :predeploy end
    3. This is especially useful for zero downtime deploys to Production environments.
  6. Feb 2022
    1. This is especially useful for UI library components, as it is generally unknown which events will be required from them for all desired use cases. For example, if a Button component only forwards a click event, then no use case that requires the mouseover or the keypress event can be used with it.
    1. Deepti Gurdasani. (2022, January 29). Going to say this again because it’s important. Case-control studies to determine prevalence of long COVID are completely flawed science, but are often presented as being scientifically robust. This is not how we can define clinical syndromes or their prevalence! A thread. [Tweet]. @dgurdasani1. https://twitter.com/dgurdasani1/status/1487366920508694529

  7. Jan 2022
    1. Can Windows/Linux not rename a file while it’s open, show a folder’s size, or rename a document from within its app window?

      Case study in equivocation.

    1. Olson, S. M., Newhams, M. M., Halasa, N. B., Price, A. M., Boom, J. A., Sahni, L. C., Pannaraj, P. S., Irby, K., Walker, T. C., Schwartz, S. P., Maddux, A. B., Mack, E. H., Bradford, T. T., Schuster, J. E., Nofziger, R. A., Cameron, M. A., Chiotos, K., Cullimore, M. L., Gertz, S. J., … Randolph, A. G. (2022). Effectiveness of BNT162b2 Vaccine against Critical Covid-19 in Adolescents. New England Journal of Medicine, 0(0), null. https://doi.org/10.1056/NEJMoa2117995

    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.
    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.
  8. Dec 2021
    1. John Burn-Murdoch. (2021, November 25). Five quick tweets on the new variant B.1.1.529 Caveat first: Data here is very preliminary, so everything could change. Nonetheless, better safe than sorry. 1) Based on the data we have, this variant is out-competing others far faster than Beta and even Delta did 🚩🚩 https://t.co/R2Ac4e4N6s [Tweet]. @jburnmurdoch. https://twitter.com/jburnmurdoch/status/1463956686075580421