19,634 Matching Annotations
  1. Aug 2023
    1. If I find time between work and personal life I'll try to weigh in here, but those two things are keeping me pretty busy at the moment :)
    2. just stopping by to say thanks for including me as an author on the commit. That's nice of you!
    1. If you are using UUIDs instead of integers as the primary key on your models, you should set Rails.application.config.generators { |g| g.orm :active_record, primary_key_type: :uuid } in a config file.
    1. – Tyler Rick
    2. I make a file named: app/models/active_storage/attachment.rb. Because it's in your project it takes loading precedence over the Gem version. Then inside we load the Gem version, and then monkeypatch it using class_eval: active_storage_gem_path = Gem::Specification.find_by_name('activestorage').gem_dir require "#{active_storage_gem_path}/app/models/active_storage/attachment" ActiveStorage::Attachment.class_eval do acts_as_taggable on: :tags end The slightly nasty part is locating the original file, since we can't find it normally because our new file takes precedence. This is not necessary in production, so you could put a if Rails.env.production? around it if you like I think.
    3. I assume that the ActiveStorage::Attachment class gets reloaded dynamically and that the extensions are lost as they are only added during initialization. You’re correct. Use Rails.configuration.to_prepare to mix your module in after application boot and every time code is reloaded: Rails.configuration.to_prepare do ActiveStorage::Attachment.send :include, ::ActiveStorageAttachmentExtension end
    1. Since DigitalOcean will ignore it, you can set it to whatever value you’d like. The value unused in the example code makes it clear that you’re not using it.
    1. application/xml: data-size: XML very verbose, but usually not an issue when using compression and thinking that the write access case (e.g. through POST or PUT) is much more rare as read-access (in many cases it is <3% of all traffic). Rarely there where cases where I had to optimize the write performance existence of non-ascii chars: you can use utf-8 as encoding in XML existence of binary data: would need to use base64 encoding filename data: you can encapsulate this inside field in XML application/json data-size: more compact less that XML, still text, but you can compress non-ascii chars: json is utf-8 binary data: base64 (also see json-binary-question) filename data: encapsulate as own field-section inside json
    1. I believe the final policy shall contain robust rationale and, in the best way possible, avoids the perception of rAIcial discrimination
    2. Overall, because the average rate of getting correct answers from ChatGPT and other generative AI technologies is too low, the posting of answers created by ChatGPT and other generative AI technologies is substantially harmful to the site and to users who are asking questions and looking for correct answers.
    3. The primary problem is that while the answers which ChatGPT and other generative AI technologies produce have a high rate of being incorrect, they typically look like the answers might be good and the answers are very easy to produce.
    1. The method name is generated by replacing spaces with underscores. The result does not need to be a valid Ruby identifier though — the name may contain punctuation characters, etc. That's because in Ruby technically any string may be a method name. This may require use of define_method and send calls to function properly, but formally there's little restriction on the name.
    1. Auto-update aside, you might also have found it hard to find a Chrome binary with a specific version. Google intentionally doesn’t make versioned Chrome downloads available, since users shouldn’t have to care about version numbers—they should always get updated to the latest version as soon as possible. This is great for users, but painful for developers needing to reproduce a bug report in an older Chrome version.
    2. Due to there being no good way to solve these issues, we know that many developers download Chromium (not Chrome) binaries instead, although this approach has some flaws. First, these Chromium binaries are not reliably available across all platforms. Second, they are built and published separately from the Chrome release process, making it impossible to map their versions back to real user-facing Chrome releases. Third, Chromium is different from Chrome.
    3. Auto-update: great for users, painful for developersOne of Chrome’s most notable features is its ability to auto-update. Users are happy to know they’re running an up-to-date and secure browser version including modern Web Platform features, browser features, and bug fixes at all times.However, as a developer running a suite of end-to-end tests you might have an entirely different perspective:You want consistent, reproducible results across repeated test runs—but this may not happen if the browser executable or binary decides to update itself in between two runs.You want to pin a specific browser version and check that version number into your source code repository, so that you can check out old commits and branches and re-run the tests against the browser binary from that point in time.None of this is possible with an auto-updating browser binary. As a result, you may not want to use your regular Chrome installation for automated testing. This is the fundamental mismatch between what’s good for regular browser users versus what’s good for developers doing automated testing.
    1. rendered.should have_selector("#header") do |header| header.should have_selector("ul.navlinks") end Both of which silently pass - however, capybara doesn't support a :content option (it should be :text), and it doesn't support passing blocks to have_selector (a common mistake from Webrat switchers).
  2. Jul 2023
    1. Unlike Turkophobic reviews I know real history behind WW1, Armenian gangs (most famous ones Henchak and Dashnak) killed lots of people and rob their neighbors. My mom side ancestors came from Van and I heard stories about Armenian neighbors came to rob them when their husbands went to war.Turkey suggested Armenia for a joint historians board for so-called Armenian Genocide research and opening state archives. Armenia denied their proposition.Let me explain this to you: you don't accept historians to decide, you praise (millions of) so-called Armenian Genocide supporter films without historical proof and if you see one film which just picture real situation it is propaganda. You say it is a propaganda because it conflicts with your propaganda.
    2. You say it is a propaganda because it conflicts with your propaganda.
    1. # if contract is passed use contract.start_date as date # Date.current otherwise # if date is given, the block is ignored. date { @overrides[:contract]&.start_date || Date.current }
    1. I know it might suck a little, but it sounds like the way to do it. As a thought though, if you're struggling with your tests it is usually a sign you'll struggle with it down the track and you should be redesigning the APIs. I can't see an alternative way of doing it, but you might be able to with the knowledge of the domain.

      ugly/messy/less-than-ideal

    1. I would say it's text when interpreted as text/plain it's human readable. Otherwise it's binary. That is, binary = for machines only.
    2. Of course there are perversions like XMI and Microsoft's new formats.
    3. the subversion FAQ http://subversion.tigris.org/faq.html#binary-files has = " ... if any of the bytes are zero, or if more than 15% are not ASCII printing characters, then Subversion calls the file binary. This heuristic might be improved in the future, however."
    4. I couldn't find a definition of text except that text means absence of binary data. This is weak - so I would follow your definition - A text file is a file which can be read by a human.
    5. I think the only purpose of this is to detain programmers from doing anything a non-Microsoft way.

      Probably not really...

    6. The distinction doesn't refer to the files _contents_ but how to the file is _treated_ when it is being read or written. In "rb"/"wb" modes files are left how they are, in "r"/"w" modes Windows programmers get line ends "\r\n" translated into "\n" what disturbs file positions and string lengths.
    7. Dividing files into "text" and "binary" is the archetype misdesign in the operating system you use
    1. The XMI schema also extends the XML schema so that definitions of objects can be stored. This provives a way to hold a UML model.
    2. XMI is a standard which defines how to serialise object instances. Although XML is a very good way to store information in a tree structured way, it is not object oriented. XMI extends XML to make it object oriented.
    1. The representation of objects in terms of XML elements and attributes.
    2. The standard mechanisms to link objects within the same file or across files.
    3. XMI describes solutions to the above issues by specifying EBNF production rules to create XML documents and Schemas that share objects consistently.
    4. Object identity, which allows objects to be referenced from other objects in terms of IDs and UUIDs.
    1. Conceptual data model: describes the semantics of a domain, being the scope of the model. For example, it may be a model of the interest area of an organization or industry. This consists of entity classes, representing kinds of things of significance in the domain, and relationship assertions about associations between pairs of entity classes. A conceptual schema specifies the kinds of facts or propositions that can be expressed using the model. In that sense, it defines the allowed expressions in an artificial 'language' with a scope that is limited by the scope of the model.
    2. "Data models for different systems are arbitrarily different. The result of this is that complex interfaces are required between systems that share data. These interfaces can account for between 25-70% of the cost of current systems".
    3. The term data model can refer to two distinct but closely related concepts
    4. A data model can sometimes be referred to as a data structure, especially in the context of programming languages.
    5. Sometimes it refers to an abstract formalization of the objects and relationships found in a particular application domain
    6. A data model[1][2][3][4][5] is an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real-world entities.
    1. Ruby 2.5+ If your substring is at the beginning of in the end of a string, then Ruby 2.5 has introduced the methods for this: delete_prefix for removing a substring from the beginning of the string delete_suffix for removing a substring from the end of the string
    1. I understand Duo follows the spec and attempts to make life easier by giving users the full 30 seconds, but unfortunately service providers don’t honor that recommendation, which leads to lockouts and a bunch of calls to our 1st line teams. You can’t tell users to stop using {platform}, but we can tell them to switch TOTP providers.
    1. The threat is that you're posting a secret key to a third party which violates a dozen of security best practices, nullifies the assumption of the key being "secret" and most likely violates your organization's security policy. In authentication all the remaining information can be guessed or derived from other sources - for example Referrer header in case of Google - and this is precisely why secrets should be, well, secret.
    1. The lawsuit against OpenAI claims the three authors “did not consent to the use of their copyrighted books as training material for ChatGPT. Nonetheless, their copyrighted materials were ingested and used to train ChatGPT.”
    1. One federal judge in the Northern District of Texas issued a standing order in late May after Schwartz’s situation was in headlines that anyone appearing before the court must either attest that “no portion of any filing will be drafted by generative artificial intelligence” or flag any language that was drafted by AI to be checked for accuracy. He wrote that while these “platforms are incredibly powerful and have many uses in the law,” briefings are not one of them as the platforms are “prone to hallucinations and bias” in their current states.

      Seems like this judge has a strong bias against the use of AI. I think this broad ban is too broad and unfair. Maybe they should ban spell check and every other tool that could make mistakes too? Ultimately, the humans using the tool shoudl be the ones responsible for checking the generaetd draft for accuracy and the ones to hold responsible for any mistakes; they shouldn't simply be forbidden from using the tool.

    2. New York-based startup DoNotPay created an AI-based way for people to contest traffic tickets—a user would wear smart glasses that would feed it information to say in court generated by AI—but before the creator could introduce it in court, he said he got threats from multiple bar associations about “unauthorized practice of law,”
    3. he had used ChatGPT to conduct legal research for the court filing that referenced the cases and that the artificial intelligence tool assured him the cases were real.
    1. a = A.arel_table b = B.arel_table c = C.arel_table a .join(b) .on(a[:id].eq(b[:a_id])) .join(c, Arel::Nodes::OuterJoin) .on(b[:id].eq(c[:b_id])).to_sql
    1. But there is no absolute reason to use JOIN LATERAL (...) ON TRUE because you could just write it as a CROSS JOIN LATERAL instead
    2. If you want to return a NULL-extended row in the case where the lateral join returns no rows, then you would use LEFT JOIN LATERAL (...) ON TRUE. Any condition other than TRUE is not necessary, as you could have just wrote it into the subquery itself
    1. The way to do this with Capybara is documented on StackOverflow but, unfortunately, the answer there is buried in a little too much noise. I decided to create my own tiny noise-free blog post that contains the answer. Here it is:
    2. I commonly find myself wanting to assert that a certain field contains a certain value.
    1. How we arrived in a post-truth era, when “alternative facts” replace actual facts, and feelings have more weight than evidence.Are we living in a post-truth world, where “alternative facts” replace actual facts and feelings have more weight than evidence? How did we get here? In this volume in the MIT Press Essential Knowledge series, Lee McIntyre traces the development of the post-truth phenomenon from science denial through the rise of “fake news,” from our psychological blind spots to the public's retreat into “information silos.”What, exactly, is post-truth? Is it wishful thinking, political spin, mass delusion, bold-faced lying? McIntyre analyzes recent examples—claims about inauguration crowd size, crime statistics, and the popular vote—and finds that post-truth is an assertion of ideological supremacy by which its practitioners try to compel someone to believe something regardless of the evidence. Yet post-truth didn't begin with the 2016 election; the denial of scientific facts about smoking, evolution, vaccines, and climate change offers a road map for more widespread fact denial. Add to this the wired-in cognitive biases that make us feel that our conclusions are based on good reasoning even when they are not, the decline of traditional media and the rise of social media, and the emergence of fake news as a political tool, and we have the ideal conditions for post-truth. McIntyre also argues provocatively that the right wing borrowed from postmodernism—specifically, the idea that there is no such thing as objective truth—in its attacks on science and facts.McIntyre argues that we can fight post-truth, and that the first step in fighting post-truth is to understand it.
    1. Please do not use the issue tracker for personal support requests. Stack Overflow or GitHub Discussions is a better place for that where a wider community can help you!
    2. Please consider adding a branch with a failing spec describing the problem.
    3. File an issue if a bug is caused by Ransack, is new (has not already been reported), and can be reproduced from the information you provide.
    1. args: [:parent, :ransacker_args] do |parent, args|
    2. Arel::Nodes::InfixOperation.new('->>', parent.table[:properties], 'link_type')
    3. A timestamp like 2019-07-18 01:21:29.826484 will be truncated to 2019-07-18. But for your Rails application 2019-07-18 01:21:29.826484 is 2019-07-17 22:21:29.826484 at your time zone (GMT -03:00). So it should be truncated to 2019-07-17 instead.So, you should convert the timestamp to your current Rails time zone before extracting the date.
    1. Rails' default approach to log everything is great during development, it's terrible when running it in production. It pretty much renders Rails logs useless to me.

      Really? I find it even more annoying in development, where I do most of my log viewing. In production, since I can't as easily just reproduce the request that just happened, I need more detail, not less, so that I have enough clues about how to reproduce and what went wrong.

    2. Lograge is an attempt to bring sanity to Rails' noisy and unusable, unparsable and, in the context of running multiple processes and servers, unreadable default logging output.
    1. But in almost all English sentences containing »there is«, these words do not mean »in this place is« but »it exists«. But the German words »da ist« do not have the meaning »it exists«. They only mean »in this place is«.
    1. This lets your test express a concept (similar to a trait), without knowing anything about the implementation: FactoryBot.create(:car, make: 'Saturn', accident_count: 3) FactoryBot.create(:car, make: 'Toyota', unsold: true) IMO, I would stick with traits when they work (e.g. unsold, above). But when you need to pass a non-model value (e.g. accident_count), transient attributes are the way to go.

      traits and transient attributes are very similar

      traits are kind of like boolean (either has it or doesn't) transient attribute flags

    1. You can also use the ActiveAdmin::FormBuilder as builder in your Formtastic Form for use the same helpers are used in the admin file:

      .

    2. semantic_form_for [:admin, @post], builder: ActiveAdmin::FormBuilder

      semantic_form_for [:admin, @post], builder: ActiveAdmin::FormBuilder

    1. We all like games with a wide variety of resources, but most board games or card games never seem to have all that many.  So let's do a comparison with popular games out there.
    1. Making MoneySerializer reloadable would be confusing, because reloading an edited version would have no effect on that class object stored in Active Job.
    2. There, the module object stored in MyDecoration by the time the initializer runs becomes an ancestor of ActionController::Base, and reloading MyDecoration is pointless, it won't affect that ancestor chain.
    1. Shareable Code

      For a second there, I thought this website was promoting open source and was actually sharing the (source) code for their website...

      But alas, it's actually for sharing a different kind (QR) of code instead...

  3. www.kickstarter.com www.kickstarter.com
    1. Buyer pays actual shipping charges instead of artificially raising prices so that they can have "free shipping".

      Pitched as a positive when buying multiple copies (unfortunately, few buyers will have any need or desire to do so).

  4. Jun 2023
    1. I’ve heard-suggested that ActiveSupport, which does a ton of monkey-patching of core classes, would make potentially-nice refinements. I don’t hold this opinion strongly, but I disagree with that idea. A big value proposition of ActiveSupport is that it is “omnipresent” and sets a new baseline for ruby behaviors - as such, being global really makes the most sense. I don’t know that anyone would be pleased to sprinkle using ActiveSupport in all their files that use it - they don’t even want to THINK about the fact that they’re using it.
    2. Refinements themselves present a significant hurdle to adoption by virtue of their limitations and overall introduction of conceptual complexity. So it’s a tough sell to recommend this for anything outside of personal projects or places with incredibly strong esoteric Ruby knowledge (like, say, hidden away within Rails).
    3. Let’s check out what the refinement approach looks like and why I consider it the best way to implement conversion wrappers.
    4. under the name “conversion functions.” These exist in Ruby’s standard library - for example Array() is one that you’re likely to see in real code.
    5. in the 10 years since they have been a part of Ruby, real life usages are astonishingly rare.
    1. What I do care about, though, is that we might start to accept and adopt opinions like “that feature is bad”, or “this sucks”, without ever pausing to question them or explore the feature ourselves.
    2. Please – make a little time to explore Ruby. Maybe you’ll discover something simple, or maybe something wonderful.
    3. If we hand most, if not all responsibility for that exploration to the relatively small number of people who talk at conferences, or have popular blogs, or who tweet a lot, or who maintain these very popular projects and frameworks, then that’s only a very limited perspective compared to the enormous size of the Ruby community.
    4. I think we have a responsibility not only to ourselves, but also to each other, to our community, not to use Ruby only in the ways that are either implicitly or explicitly promoted to us, but to explore the fringes, and wrestle with new and experimental features and techniques, so that as many different perspectives as possible inform on the question of “is this good or not”.
    5. If you’ll forgive the pun, there are no constants in programming – the opinions that Rails enshrines, even for great benefit, will change, and even the principles of O-O design are only principles, not immutable laws that should be blindly followed for the rest of time. There will be other ways of doing things. Change is inevitable.
    1. Using Time.now (which returns the wall-clock time) as base-lines has a couple of issues which can result in unexpected behavior. This is caused by the fact that the wallclock time is subject to changes like inserted leap-seconds or time slewing to adjust the local time to a reference time. If there is e.g. a leap second inserted during measurement, it will be off by a second. Similarly, depending on local system conditions, you might have to deal with daylight-saving-times, quicker or slower running clocks, or the clock even jumping back in time, resulting in a negative duration, and many other issues. A solution to this issue is to use a different time of clock: a monotonic clock.
    1. Certainly you could adapt the code to round rather than truncate should you need to; often I find truncation feels more natural as that is effectively how clocks behave.

      What do you mean exactly? Compared clocks, or at least reading of them. What's a good example of this? If it's 3:55, we would say 3:55, or "5 to 4:00", but wouldn't probably say that it's "3".

    1. If you develop a pure frameworkless Ruby application or embed Ruby and don't need any of the listed integrations, you can depend on the airbrake-ruby gem and ignore this gem entirely.
    1. Random::Formatter#from_set(set, n = 16) (or Random::Formatter#from_set(n = 16, set: …))
    2. I think that alphabet is still the right word here, as it’s sort of the "term of art" for this sort of thing, although set is probably a good name as well.
    1. What I have seen is situations where things were made horribly complicated to get around protections for which there was no need, and to try to guard the consistency of data structures that were horribly over-complicated and un-normalized.
    2. Are protected members/fields really that bad? No. They are way, way worse. As soon as a member is more accessible than private, you are making guarantees to other classes about how that member will behave. Since a field is totally uncontrolled, putting it "out in the wild" opens your class and classes that inherit from or interact with your class to higher bug risk. There is no way to know when a field changes, no way to control who or what changes it. If now, or at some point in the future, any of your code ever depends on a field some certain value, you now have to add validity checks and fallback logic in case it's not the expected value - every place you use it. That's a huge amount of wasted effort when you could've just made it a damn property instead ;) The best way to share information with deriving classes is the read-only property: protected object MyProperty { get; } If you absolutely have to make it read/write, don't. If you really, really have to make it read-write, rethink your design. If you still need it to be read-write, apologize to your colleagues and don't do it again :) A lot of developers believe - and will tell you - that this is overly strict. And it's true that you can get by just fine without being this strict. But taking this approach will help you go from just getting by to remarkably robust software. You'll spend far less time fixing bugs.

      In other words, make the member variable itself private, but can be abstracted (and access provided) via public methods/properties

    3. Public and/or protected fields are bad because they can be manipulated from outside the declaring class without validation; thus they can be said to break the encapsulation principle of object oriented programming.
    4. When you lose encapsulation, you lose the contract of the declaring class; you cannot guarantee that the class behaves as intended or expected.
    5. Using a property or a method to access the field enables you to maintain encapsulation, and fulfill the contract of the declaring class.
    6. It actually depends on if your class is a data class or a behaviour class.

      first time I've come across this idea of data class vs. behavior class

    7. Exposing properties gives you a way to hide the implementation. It also allows you to change the implementation without changing the code that uses it (e.g. if you decide to change the way data are stored in the class)
    8. it still strikes me as something people believe in the abstract, rather than know from hard experience. I've always found that if you look behind/under widely held beliefs, you can find useful gems.
    9. Python essentially doesn't have private methods, let alone protected ones, and it doesn't turn out to be that big a deal in practice.
    10. Anything that isn't explicitly enforced by contract is vulnerable to misunderstandings. It's doing your teammates a great service, and reducing everyone's effort, by eliminating ambiguity and enforcing information flow by design.
    11. Far more preferable is to minimize data structure so that it tends to be normalized and not to have inconsistent states. Then, if a member of a class is changed, it is simply changed, rather than damaged.
    12. They are based on defensive coding carried to extremes.
    13. Another point is that properties are good in that you can place breakpoints in them to capture getting/setting events and find out where they come from.
    14. They sound like "argument by prestige". If MSDN says it, or some famous developer or author whom everybody likes says it, it must be so.
    15. you nailed it! A consumer should only be able to set an object's state at initialization (via the constructor). Once the object has come to life, it should be internally responsible for its own state lifecycle. Allowing consumers to affect the state adds unnecessary complexity and risk.
    16. to clarify, I am distinguishing between properties as representing state and methods representing actions
    17. As soon as you make a member not-private, you are stuck with it, forever and ever. It's your public interface now.
    18. also to clarify, by immutable I mean externally immutable - that is, consumers cannot affect the state. The class can internally affect its own state
    19. Making a property writable adds an order of magnitude in complexity. In the real world it's definitely not realistic for every class to be immutable, but if most of your classes are, it's remarkably easier to write bug-free code. I had that revelation once and I hope to help others have it.
    1. Have you ever: Been disappointed, surprised or hurt by a library etc. that had a bug that could have been fixed with inheritance and few lines of code, but due to private / final methods and classes were forced to wait for an official patch that might never come? I have. Wanted to use a library for a slightly different use case than was imagined by the authors but were unable to do so because of private / final methods and classes? I have.
    2. Conversely, I've never in 16+ years of professional development regretted marking a method protected instead of private for reasons related to API safety
    3. Let me preface this by saying I'm talking primarily about method access here, and to a slightly lesser extent, marking classes final, not member access.
    4. Typical control-freak opinion.
    5. I just wanted to tweak Java's BufferedReader to handle custom line delimiters. Thanks to private fields I have to clone the entire class rather than simply extending it and overriding readLine().
    6. Practically speaking, if you can't think of a reason why it would be dangerous then theres more to be gained by opting for extensibility.
    7. Also, people prefer association over inheritance so protected as default is difficult to perceive
    8. I'm not saying never mark methods private. I'm saying the better rule of thumb is to "make methods protected unless there's a good reason not to".
    9. Marking methods protected by default is a mitigation for one of the major issues in modern SW development: failure of imagination.
    10. If it's dangerous, note it in the class/method Javadocs, don't just blindly slam the door shut.
    11. I can't count the number of times I've been wrong about whether or not there will ever be a need to override a specific method I've written.
    12. It often eliminates the only practical solution to unforseen problems or use cases.
    13. When a developer chooses to extend a class and override a method, they are consciously saying "I know what I'm doing." and for the sake of productivity that should be enough. period.
    14. member access

      I assume this is making a disctinction between methods (member functions) and member/instance variables

    15. Been disappointed, surprised or hurt by a library etc. that was overly permissive in it's extensibility? I have not.
    16. The old wisdom "mark it private unless you have a good reason not to" made sense in days when it was written, before open source dominated the developer library space and VCS/dependency mgmt. became hyper collaborative thanks to Github, Maven, etc. Back then there was also money to be made by constraining the way(s) in which a library could be utilized. I spent probably the first 8 or 9 years of my career strictly adhering to this "best practice". Today, I believe it to be bad advice. Sometimes there's a reasonable argument to mark a method private, or a class final but it's exceedingly rare, and even then it's probably not improving anything.

    Tags

    Annotators

    URL

    1. It is a type of class attribute (or class property, field, or data member).
    1. The main thing to note here is that in the derived class, we need to be careful to repeat the protected modifier if this exposure isn’t intentional.
    2. Derived classes need to follow their base class contracts, but may choose to expose a subtype of base class with more capabilities. This includes making protected members public:
    3. TypeScript offers special syntax for turning a constructor parameter into a class property with the same name and value. These are called parameter properties

      Doesn't this violate their own non-goal #6, "Provide additional runtime functionality", since it emits a this.x = x run-time side effect in the body that isn't explicitly written out in the source code?

    4. Member Visibility
    1. The major use case of Reflect is to provide default forwarding behavior in Proxy handler traps. A trap is used to intercept an operation on an object — it provides a custom implementation for an object internal method. The Reflect API is used to invoke the corresponding internal method. For example, the code below creates a proxy p with a deleteProperty trap that intercepts the [[Delete]] internal method. Reflect.deleteProperty() is used to invoke the default [[Delete]] behavior on targetObject directly.
    1. Reflection adds the ability to reverse-engineer classes, interfaces, functions, methods and extensions. Additionally, they offers ways to retrieve doc comments for functions, classes and methods.
    1. What's the structure of the URL of a shared link?https://chat.openai.com/share/<conversation-ID>

      I've never seen a website document something like this before... especially as part of a FAQ.

      How/why is this information helpful to people?

    2. If I continue the conversation after I create a shared link, will the rest of my conversation appear in the shared link?No. Think of a shared link as a snapshot of a conversation up to the point at which you generate the shared link. Once a shared link is created for a specific conversation or message, it will not include any future messages added to the conversation after the link was generated. This means that if you continue the conversation after creating the shared link, those additional messages will not be visible through the shared link.
    3. The conversation will no longer be accessible via the shared link, but if a user imported the conversation into their chat history, deleting your link will not remove the conversation from their chat history.
    4. Are shared links public? Who can access my shared links?Anyone who has access to a shared link can view and continue the linked conversation. We encourage you not to share any sensitive content, as anyone with the link can access the conversation or share the link with other people.
    5. Shared links offer a new way for users to share their ChatGPT conversations, replacing the old and burdensome method of sharing screenshots.
    1. Depends on the style guide you follow for your project. The popular Ruby Style Guide says to "Avoid using Perl-style special variables (like $:, $;, etc. ). They are quite cryptic and their use in anything but one-liner scripts is discouraged."
    2. When I first got started with Ruby, I obviously thought that $LOAD_PATH was better. But once you've graduated from beginner status, I'd only use $LOAD_PATH if I was trying to make my code more readable to a beginner. Meh its a trade off.
    3. The Ruby load path is very commonly seen written as $: , but just because it is short, does not make it better. If you prefer clarity to cleverness, or if brevity for its own sake makes you itchy, you needn't do it just because everyone else is. Say hello to ... $LOAD_PATH ... and say goodbye to ... # I don't quite understand what this is doing... $:
    1. typical use would be to reference a json or jsonb column laterally from another table in the query's FROM clause.
    2. Writing json_populate_record in the FROM clause is good practice, since all of the extracted columns are available for use without duplicate function calls.
    1. Debug mode allows you to see only the data generated by your device while validating analytics and also solves the purpose of having separate data streams for staging and production (no more separate data streams for staging and production).

      good to know.

      Seems to contradict their advice on https://www.optimizesmart.com/using-the-ga4-test-property/ to create a test property...

    1. They create a lot of useful content on there site, which they are happy for users to copy and paste for use elsewhere. They wanted to know how often this was happening, on which pages, and what text.
    1. To use the tool, you need the following access: Viewer role for the Universal Analytics property Editor role for the Google Analytics 4 property After you've installed and activated the Google Sheets add-on (below), follow these steps: Import audience definitions from your Universal Analytics property to a Google Sheet. Decide how you want to export audiences from your Google Sheet to your Google Analytics 4 property (e.g., using the existing definition or modifying the definition first in the tool, then exporting). Export your audiences from the Google Sheet to your Google Analytics 4 property.

      Seems simple enough. With a lot of power/flexibility to make any changes in between the import and export steps.