10,000 Matching Annotations
  1. Nov 2023
    1. BTW to improve the reliability of that test I believe you would need a sleep (smaller, e.g. of 0.1) between the Thread.new and assert M.works?, otherwise it's likely the M.works? runs first and then the other thread will see the constant is autoloading and wait, and anyway that thread does not check what is defined on M. For the test to fail it needs to be the Thread.new running first and defining the constant but not yet the method, before the main thread keeps running and call the method.
    2. This is a shell script that essentially does the same as the flaky test: #!/bin/sh cat <<EOS > m.rb module M sleep 0.5 def self.works? true end end EOS ruby -I. <<EOS autoload :M, "m" t = Thread.new { M } p M.works? EOS rm m.rb

      Same thing in another language....

    1. The first example needs a custom inflection rule: loader.inflector.inflect("max_retries" => "MAX_RETRIES") Otherwise, Zeitwerk would expect the file to define MaxRetries.

      Potential problem. What if you need it both ways? A constant named MAX_RETRIES within a certain namespace, but also a higher-level MaxRetries class? Guess you'd have to work around it, probably by just defining MAX_RETRIES inside its parent module...

    1. If this were to occur in a "child" thread, with a waiting parent inside the Executor, it would cause an unavoidable deadlock: the reload must occur before the child thread is executed, but it cannot be safely performed while the parent thread is mid-execution.
    1. Shifting the left display down below approximately 50 % of the height extension of the primary monitor (i.e. compromising the physical set-up, but still keeping the secondary display to the left of the primary display) generated a behavior correctly opening windows on the primary display.

      a variation of this worked for me too

    1. This is a fully tactile experience. No decks of cards to shuffle, no score tracks, no fiddly cubes, no confusing rules or nuances. Just a fluid set up, play and pack down experience with beautiful components.
    1. In-app custom credentials templates are now supported. When a credentials file does not exist, rails credentials:edit will now try to use lib/templates/rails/credentials/credentials.yml.tt to generate the credentials file, before falling back to the default template. This allows e.g. an open-source Rails app (which would not include encrypted credentials files in its repo) to include a credentials template, so that users who install the app will get a custom pre-filled credentials file when they run rails credentials:edit.
    1. The url_for helpers now support a new option called path_params. This is very useful in situations where you only want to add a required param that is part of the route's URL but for other route not append an extraneous query param.
    1. ActiveRecord::Base.serialize no longer uses YAML by default. YAML isn't particularly performant and can lead to security issues if not used carefully. Unfortunately there isn't really any good serializers in Ruby's stdlib to replace it. The obvious choice would be JSON, which is a fine format for this use case, however the JSON serializer in Ruby's stdlib isn't strict enough, as it fallback to casting unknown types to strings, which could lead to corrupted data. Some third party JSON libraries like Oj have a suitable strict mode.
    1. ActiveRecord::Base.normalizes declares an attribute normalization. The normalization is applied when the attribute is assigned or updated, and the normalized value will be persisted to the database. The normalization is also applied to the corresponding keyword argument of query methods, allowing records to be queried using unnormalized values.

      Guess I don't need to use mdeering/attribute_normalizer gem anymore...

    1. I stand by what I said and I do not believe it is off-topic. Nevertheless, I realize it is your forum and if you want to silence and exclude people because something we say does not fit in your worldview, then I am certainly willing to accept this and remove myself from the forum. In the big picture, I will not be shut up or bullied and I think you owe me an apology as nothing I have said or done warrants your actions.
    2. But I do question why lib and not something in app is the common suggestion for classes/modules who do not fall into the default set of folders (models, controllers, jobs, etc). Is it just because it's what we've been doing for so long? To me feels like we're trying to shoehorn the lib folder into further being a kitchen sink (now holding rake tasks and miscellaneous classes), rather than just saying "your Ruby classes/modules go somewhere in app because they're application code".
    3. So then they put it into lib only to find that they have to manually require it. Then later realize that this also means they now have to reboot their server any time they change the file (after a painfully long debugging time of "why what aren't my changes working?", because their lib folder classes are now second-class citizens). Then they go down the rabbit hole of adding lib to the autoload paths, which burns them because rake tasks then all get eager loaded in production. Then they inevitably realize anything inside app is autoloaded and make an app/lib per Xavier's advice.
    4. I think the symmetry of the naming between lib and app/lib will lead a fresh Rails developer to seek out the answer to “Why are there two lib directories?", and they will become illuminated. And it will prevent them from seeking the answer to “How do I autoload lib?” which will start them on a rough path that leads to me advising them to undo it.
    5. Everything has a place so do better and find it. There is a certain belief that everything within app should be organized into functionally-named directories and any files placed in app/lib actually belongs in app/services or app/interactors or app/models or someplace if the developers just tried harder. The implication is that developers are bad developers if they don’t yet know what kind of constant they have and where its forever home should be. I reject this. Over the lifespan of an application, there will be constants that have not yet found their functional kin, if those kin ever come to exist at all; sometimes you simply need some code and a place to put it. app/lib can be the convention for where those constants can live temporarily or as long as necessary. Autoloading is really nice, let’s treat them to it.
    6. It is confusing that app/lib is named similarly to lib . I agree, but it is not uncommon to have directories with the same name and similar function nested under different contexts. I believe developers can handle this complexity. Most similarly, Linux has lib and usr/lib . Within a new Rails app, there are many such directories that are manageable: app/assets and lib/assets (sometimes even vendor/assets too) app/javascript and vendor/javascript storage and tmp/storage config and app/assets/config app/controllers and app/javascript/controllers
    1. Please note that you should also ignore subdirectories that are not meant to be namespaces. For example: Rails.autoloaders.main.ignore('lib/tasks', 'lib/assets') Otherwise, Zeitwerk would define a Tasks constant, but that is not your intention (and could potentially conflict with a genuine Tasks constant).
    2. Another alternative that would feel a lot better would be app/my_app in the same way I do lib/my_app, and then app/my_app/my_file.rb would define MyApp::MyFile, like normal. That would be fine, preferable, even. But how do I tell Zeitwerk that?
    1. I'm assuming some of the goals are to make it clear where to put new files (and to stay within current Rails conventions). We already have a few non-standard app folders in our project, such as app/services, app/queries, etc. and we put some non-ActiveRecord classes in app/models. If we are going to move files, it might make sense to first define where files should go, and then move each file to the appropriate place. This might be more of a reorganization project, than copying over a folder.
    1. Besides the security concerns related to potential XSS vulnerabilities, keeping the token in memory has a big downside regarding user experience as the token gets dropped on page reloads. The application must then obtain a new token, which may trigger a new user authentication. A secure design should take user experience into account.
    1. But rather than do all that work to identify the running pod, why not run the backup using the deployment? (That's what I've always done) kubectl exec deployments/gitlab --namespace gitlab -- gitlab-rake gitlab:backup:create
    1. It was an intentional decision to make the items in the dropdown of content editor span two lines instead of one. The reason being that sometimes the text can get too long and the dropdown spans the entire width of page which isn't ideal. Also, a slimmer dropdown looks better on mobile devices.
    1. Implement restrictive defaults (potentially allowing an explicit bypass) I understand that easy usability and rich out-of-the-box functionality is likely essential to this library's appeal to its users. Nevertheless I'd like to propose making the authorization properties ransackable_[attributes/associations/etc.] empty sets by default, forcing the developer to explicitly define whitelists for their use case. To soften the usability blow, a new ransack_unsafe(params[:q]) or ransack_explicit(params[:q], ransackable_attributes='*', ransackable_associations=(:post, :comment)) method could be introduced to offer developers a shorthand to bypass or override the whitelists for specific queries (after they've had to read a warning about why these methods can be dangerous).
    1. Postbox is Thunderbird for Mac.6ShareReportSavelevel 2TheRealKenJeong · 2 yr. agoThis is a good app. It started off as a reskinned Thunderbird client but has branched off somewhat. It's different enough at this point that it no longer supports plug-ins, but over t ime, it's assumed most functionality of the more popular plug-ins anyway.

      If it really is based on Thunderbird code, then how are they able to sell it on https://www.postbox-inc.com/store/pricing and not make the source code available for free?

    1. Please contact Google for support on Gmail. This really isn't an action that has anything to do with your Mac. You can access all of your mail online in a web browser. What you would like to do isn't an action of the Mail app which is simply a client but would be managed by the ISP, in your case Google.
    1. An identifier embodies the information required to distinguish what is being identified from all other things within its scope of identification. Our use of the terms "identify" and "identifying" refer to this purpose of distinguishing one resource from all other resources, regardless of how that purpose is accomplished (e.g., by name, address, or context).
  2. Oct 2023
    1. But when they ask, 'Does spelling count?' we tell them that in writing, as in life, everything counts. For academic writers, as for writers in a wide variety of fields (business, journalism, education, etc.), correctness in both content and expression is vital.
    2. In this book, grammar refers to the manner in which the language functions, the ways that the blocks of speech and writing are put together. Usage refers to using specific words in a manner that will be thought of as either acceptable or unacceptable. The question of whether or not to split an infinitive is a consideration of grammar; the question of whether one should use literally in a nonliteral sense is one of usage."
    3. Rules of proper usage are tacit conventions. Conventions are unstated agreements within a community to abide by a single way of doing things--not because there is any inherent advantage to the choice, but because there is an advantage to everyone making the same choice. Standardized weights and measures, electrical voltages and cables, computer file formats, the Gregorian calendar, and paper currency are familiar examples.
    1. Not much to say except I'm really annoyed by the critics sometimes. This movie is solid. Has a vintage old-time feel to it. Well acted. Deals with the problems of the times (racism, bullying, war, alcoholism, death) in a dramatic, humorous and clever way.Great story. Whole family loved it. They dealt with faith in a reasonable way. They pulled heartstrings without being saccharine. The critics are just so dead-set on hating any movie that deals with faith, especially the Christian faith.
    1. The term "Hobson's choice" is often used to mean an illusion of choice, but it is not a choice between two equivalent options, which is a Morton's fork, nor is it a choice between two undesirable options, which is a dilemma. Hobson's choice is one between something or nothing.
    1. Instead of centralized services, which, Dorsey now regrets creating with Twitter, it's distributed so that anyone can build an interface to display the data and activity flowing underneath. It's also designed so that your identity and information is easily transferable to any other platform that supports the protocol (Authenticated Transfer Protocol).
    1. transitive verb

      It's hard for me to see the difference between the transitive and intransitive forms of this verb.

      Is that the transitive form can/must be used with a noun following it, like "presume something", while the intransitive form cannot be followed by a noun, but can (and often is) followed by a prepositional phrase, "presume that something"? Pretty subtle difference, but I guess it's there...

    1. The main usage difference is that dependency can be used in a second sense as a "concrete" noun to mean a person or thing which depends on something/someone else. But note that in the programming context it's not uncommon to see it used to mean a software resource upon which some piece of software depends (i.e. - reversing the need/provide relationship).

      Is that really true? Can dependency refer to a person or thing which depends on something/someone else?? I'm only used to it the other way.

    2. I think that "dependency" is usually the thing that you depend on, whereas dependence is the state of depending on it. But there are certainly cases where you could use either interchangeably.
    3. There are certainly cases where you can use dependency and cannot use dependence: for example "The UK's overseas dependencies", or "This software releases has dependencies on Unix and Java". So if the dependent things are discrete and countable, it should definitely be "dependency".
    1. I think "dependence" and "dependency" are like "competence" and "competency". Both are nouns. Yet, "dependence" emphasizes the quality of being dependent. So, it may also be abstract. Whereas, "dependency" focuses on the state of being dependent. It is likely to be concrete.

      This seemed reasonable at first, but I'm not convinced it's the best explanation.

      The conclusion at https://oneminuteenglish.org/en/dependence-or-dependency/ was a bit clearer, although mostly the same:

      Just remember that “dependence” is the quality and “dependency” is the state of having to rely on someone or something else.

      https://ell.stackexchange.com/questions/41528/differences-between-dependence-and-dependency/41561#41561 disagrees with the claim that "state" makes it likely to be concrete. And I like how it clarifies state as "state/condition" (condition is a lot clearer to me):

      Dependence and dependency can both be used in the state/condition of being dependent sense. By definition, all words referencing such "states" are abstract nouns, so I don't see any justification for OP's abstract/concrete distinction in that sense.

    1. Just remember that “dependence” is the quality and “dependency” is the state of having to rely on someone or something else.

      While I agree with this... What's the difference between a quality and a state?

    1. they're not wrong, but they don't teach what you don't know you don't know, whereas the one I link to makes this critical unknown unknown become a known unknown and then a known known. I didn't know you had a 1) local branch, 2) locally-stored remote-tracking branch, and 3) remote branch until I read that answer. Prior to that I thought there was only a local branch and remote branch. The locally-stored remote-tracking branch was an unknown unknown. Making it go from that to a known known is what makes that answer the best.
    1. I just want to tell you how wonderfully helpful, thorough, and precise your reviews are. I really appreciate them, and finding this review has led me to read others of yours. I don't think I've ever read a better review. Thank you!
  3. Sep 2023
    1. One thing for the impatient: after the program displays number of messages in both accounts, it seems that it has hung up. But it does something in the background and one has to wait a longer while before it starts displaying info about copied messages.
    1. Good feedback is always welcome! and bad feedback is very often welcome It may sounds crazy but I do reply personally to every single email message I receive, so don't hesitate to spend time writing to me about your email problems, you're sure to get my attention and my time.

      personally replies to every single email message they receive

    1. Kamatera is a very good option to run a mail server because They don’t block port 25, so you can send unlimited emails (transactional email and newsletters) without spending money on SMTP relay service. Kamatera doesn’t have any SMTP limits. You can send a million emails per day. The IP address isn’t on any email blacklist. (At least this is true in my case. I chose the Dallas data center.) You definitely don’t want to be listed on the dreaded Microsoft Outlook IP blacklist or the spamrats blacklist. Some blacklists block an entire IP range and you have no way to delist your IP address from this kind of blacklist. You can edit PTR record to improve email deliverability. They allow you to send newsletters to your email subscribers with no hourly limits or daily limits, whatsoever. You can order multiple IP addresses for a single server. This is very useful for folks who need to send a large volume of emails. You can spread email traffic on multiple IP addresses to achieve better email deliverability.
    1. If you are watching this show with non-Chinese subtitles you are massively missing out. The Chinese dialogue is written with the skill of a bard. The language is sophisticated, succinct, elegant and poetic - as beautiful as the visuals. In comparison, the English subtitles were dull and prosaic, an abominable shadow of the original dialogue, using the vocabulary of a primary school student. It's as if the varying shades of blue - cerulean, sapphire, teal, indigo were translated into "blue, blue, blue, blue". I was truly disappointed by the English subtitles
    1. Besides that ffscreencast can act as an ffmpeg command generator. Every available option can also just show the corresponding ffmpeg command instead of executing it. Non-ffmpeg commands, such as how the camera resolution is pulled and others can also be shown instead of being executed.
    1. Exclude and include rules are resolved relative to the root of the transfer, but finding rule files (e.g. --exclude-from='exclude-list') is done relative to the working directory of the rsync process (which it inherits from the process that ran it).