Leaky Bucket is implemented similarly to Token Bucket where OVER_LIMIT is returned when the bucket is full. However tokens leak from the bucket at a consistent rate which is calculated as duration / limit. This algorithm is useful for metering, as the bucket leaks allowing traffic to continue without the need to wait for the configured rate limit duration to reset the bucket to zero.
- Sep 2023
 - 
            
Tags
Annotators
URL
 - 
  
 - 
            
documentation.mailgun.com documentation.mailgun.com
- 
  
A good analogy for your email reputation is your personal credit score. Obviously, a bad reputation will hurt you. However, not having a reputation will also hurt you. If ESPs don’t know you (or more specifically your IP and domain) they will assume the worst and filter you, at least initially. It’s tough to blame them given all the spam out there. Due to the importance of reputation, a significant portion of our discussion on best practices revolves around building and maintaining your email reputation.
 - 
  
We dream of a day when IP reputation does not matter and we can rely on domain reputation, but unfortunately we are not there yet.
 
 - 
  
 - 
            
www.mailgun.com www.mailgun.com
- 
  
These protocols work for both transactional (one to one) and marketing email (one to many or “bulk”).
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
split_part(email, '@', 2) AS domain
 
 - 
  
 - 
            
discussions.apple.com discussions.apple.com
- 
  
Essentially, @mac.com is legacy users and was in place from the debut of osX to late 2000s. It required a annual paid subscription to have an email address, lol. Then the short-lived mobileMe era happened, which lasted only a couple years before Apple retracted and replaced it with iCloud, a much more sweeping service. MobileMe was also a paid subscription and included primordial versions of photo sharing and web hosting, etc. The iCloud era starting in 2012 finally ushered in free email addresses and free operating system updates. That's when the business model of large tech companies turned more into user accumulation wars to see who can attract the most subscribers and retain them in their ecosystem of products.
 - 
  
The iCloud era starting in 2012 finally ushered in free email addresses and free operating system updates. That's when the business model of large tech companies turned more into user accumulation wars to see who can attract the most subscribers and retain them in their ecosystem of products.
 
 - 
  
 - 
            
www.reddit.com www.reddit.com
- 
  
I am glad you wrote that
 
 - 
  
 - 
            
www.reddit.com www.reddit.com
- 
  
You can no longer create accounts with Yahoo domains other than "@yahoo.com",
 - 
  
I'm curious: what is the reason for Yahoo discontinuing the "@ymail.com" domain?I'm aware that there's now a 2nd domain option available, "@myyahoo.com", and I recently took advantage of that to create a new address. But "@ymail.com" honestly looks more appealing to me than either of the "yahoo" iterations.
 
 - 
  
 - 
            
gitlab.com gitlab.com
- 
  
# This helper allows you to reliably highlight text within a given Element by # simulating mouse actions. # module Features module HighlightContentHelper def highlight_content(node) height = node.native.rect.height width = node.native.rect.width page.driver.browser.action .move_to(node.native, -(width / 2), -(height / 2)) .click_and_hold .move_by(width, height) .release .perform end
 
 - 
  
 - 
            
rubyreferences.github.io rubyreferences.github.io
- 
  
make_a_class::CONST = 42.tap { puts "Calculating the value" } # Prints: # In Ruby 3.1: # Calculating the value # Making a class # In Ruby 3.2: # Making a class # Calculating the value # Even simpler: NonExistentModule::CONST = 42.tap { puts "Calculating the value" } # Ruby 3.1: # Prints "Calculating the value" # raises "uninitialized constant NonExistentModule" (NameError) # Ruby 3.2: # just raises "uninitialized constant NonExistentModule" (NameError)
 - 
  
 
 - 
  
 - 
            
- 
  
But you can't configure Standard Ruby. You can take it or leave it. If this seems presumptive, constraining, and brusque: you're right, it usually does feel that way at first.
 - 
  
 
Tags
Annotators
URL
 - 
  
 - 
            
github.com github.com
- 
  
I'd suggest that you play around a little bit with a vanilla app. Create a brand new app without any additional files, just what rails new generates. See how bin/rails runner Models raises an error because there is no models directory in autoload_paths. Now, put config.autoload_paths += %W(#{config.root}/app) in config/application.rb and observe how bin/rails runner Models just returns a prompt. With the confidence of having that running, then transalate to your app.
 
 - 
  
 - 
            
- 
  
Root directories are recommended not to be nested; however, Zeitwerk provides support for nested root directories since in frameworks like Rails, both app/models and app/models/concerns belong to the autoload paths. Zeitwerk identifies nested root directories and treats them as independent roots. In the given example, concerns is not considered a namespace within app/models. For instance, consider the following file: app/models/concerns/geolocatable.rb should define Geolocatable, not Concerns::Geolocatable.
 
 - 
  
 - 
            
github.com github.com
- 
  
Should any one stumble upon this issue @tenderlove reverted commit a8bf129 in a71350c which is in v5.0.0.beta1 and later.
 - 
  
I agree with this statement so much. We should absolutely be failing hard rather than forcing people to debug thread safety issues at runtime. I can't think of anything more infuriating than debugging an issue that happens "sometimes".
 - 
  
The problem is that in the case where an app is multi-threaded, and we don't switch off autoload, the case would be that it probably won't blow up, but random stuff will mysteriously sometimes fail in weird ways. So ask yourself this, what would you rather want, option 1) where you can get an exception at runtime, or option 2) where you get random, unpredictable, weird, hard to explain, difficult to debug bugs at runtime. Personally, I'm going to choose option 1. The downside of thread-safety issues is so much worse than the downside of the possibility of an exception. The way you're handling it makes it sound as though thread-safety is not important, as though Rails is still optimizing for the single-threaded case. That seems like a huge step back.
 
 - 
  
 - 
            
- 
  
What can we do to undo this commit?
 - 
  
However one of these paths is quite often lib which could lead to unintended consequences due to the 'junk drawer' nature of this directory.
 
 - 
  
 - Aug 2023
 - 
            
stackoverflow.com stackoverflow.com
- 
  
async is a concurrency technique. If you need concurrency, async is required for node to work properly (not "better"). If you don't have concurrency, you don't need async. The point is you need to actually understand what async does for you and why. It's not inherently "better" for no reason and you don't need to memorize it as a "best practice". If the OP is writing a command line utility to alter a JSON file then exit, async complicates the code for no reason as the concurrency is not required.
 - 
  
The question is also not about error handling and if the file write fails, exiting with a stack trace is reasonable default behavior because there's not much you can do to recover from that.
 - 
  
async vs. sync depends exactly on what you are doing in what context. If this is in a network service, you need async. For a command line utility, sync is the appropriate paradigm in most simple cases, but just knee-jerk saying "async is better" is not correct. My snippet is based on the OP snippet for context.
 
 - 
  
 - 
            
github.com github.com
- 
  
Speed is great but if it doesn't conform to the specification, that's not a great case for using it for future development
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
If you want to mimic a more production like situation you might use this workflow: Create a package of your submodule locally: cd /path/to/your/module npm pack This will create a .tgz file of your package in /path/to/your/module Install the local package of the submodule in your application: cd /path/to/your/application npm install /path/to/your/module/<YourModule>-<YourModulesVersion>.tgz
 
 - 
  
 - 
            
ajv.js.org ajv.js.org
- 
  
Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization.
 
 - 
  
 - 
            
www.npmjs.com www.npmjs.comajv1
- 
  
We value conscious curation of our library size, and balancing performance and functionality. To that end, we cannot accept every suggestion. When evaluating pull requests we consider:
 
 - 
  
 - 
            
hirok.io hirok.io
- 
  
While this works, it’s not a great developer experience. In development, we don’t always know ahead of time all the packages that need to be linked. Or keep track of the previously linked packages.This confusing behavior compounds to the poor usability and predictability of npm link.
 - 
  
footguns
 - 
  
npx link is a tool I developed as a safer and more predictable alternative to npm link.
 
 - 
  
 - 
            
ajv.js.org ajv.js.org
- 
  
Serializing the data with a function specialized to your data shape can be more than 10x compared with JSON.stringify.
 
 - 
  
 - 
            
- 
  
@exodus/schemasafe can also function in a linter mode, collecting all schema errors instead of throwing on the first one.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
Active job instances include ActiveSupport::Rescuable which means you can use rescue_from in a job in the same way you can in a controller.
 
 - 
  
 - 
            
github.com github.com
- 
  
The point of acts_as_paranoid is keeping old versions around, not really destroying them, so you can look at past state, or roll back to past version. Do you consider the attached file part of the state you should be able to look at? If you roll back to past version, should it have it's attachment there too, in the restored version?
 - 
  
I think the problem with after_destroy is that it is triggered before the database commits. This means the change may not yet be seen by other processes querying the database; it also means the change could be rolled back, and never actually commited. Since shrine deletes the attachment in this hook, that would mean it might delete the attachment prematurely, or even delete the attachment when the record never ends up destroyed in the database at all (in case of rollback), which would be bad. For shrine's logic to work as expected here, it really does need to be triggered only after the DB commit in which the model destroy is committed.
 
 - 
  
 - 
            
- 
  
extensible plugin system.
 - 
  
Modular design – the plugin system allows you to load only the functionality you need
 - 
  
 - 
  
Shrine was heavily inspired by Refile and Roda. From Refile it borrows the idea of "backends" (here named "storages"), attachment interface, and direct uploads. From Roda it borrows the implementation of an extensible plugin system.
 
 - 
  
 - 
            
- 
  
4. Too much couplingAnother issue I had with this is the coupling that it might introduce in your code. I do understand that our community in general is not very much interested in dealing with coupling and I am not an expert at this either, but I do get a feeling that this suppress method would lead to some very bad usages.For instance, why does the Copyable module needs to know about a class named Notification?
 
 - 
  
 - 
            
www.red-gate.com www.red-gate.com
- 
  
In these other tests we do not care what was passed to the Load method so specify a “don’t care” with It.IsAny.
 - 
  
Michael Sorens is passionate about productivity, process, and quality. Besides working at a variety of companies from Fortune 500 firms to Silicon Valley startups, he enjoys spreading the seeds of good design wherever possible, having written over 100 articles, more than a dozen wallcharts, and posted in excess of 200 answers on StackOverflow.
 
 - 
  
 - 
            
en.wikipedia.org en.wikipedia.org
Tags
Annotators
URL
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
As you say, you can use after_add and after_remove callbacks. Additionally set after_commit filter for association models and notify "parent" about change. class User < ActiveRecord::Base has_many :articles, :after_add => :read, :after_remove => :read def read(article) # ;-) end end class Article < ActiveRecord::Base belongs_to :user after_commit { user.read(self) } end
 - 
  
As you say, you can use after_add and after_remove callbacks. Additionally set after_commit filter for association models and notify "parent" about change. class User < ActiveRecord::Base has_many :articles, :after_add => :read, :after_remove => :read def read(article) # ;-) end end class Article < ActiveRecord::Base belongs_to :user after_commit { user.read(self) } end
 
 - 
  
 - 
            
itsfoss.com itsfoss.com
- 
  
 - 
  
It may seem like Testing is some sort of beta, unstable version but that’s not entirely true. Debian Testing is the next Debian stable version. The actual development branch is the Debian Unstable (also known as Sid). Debian Testing lies somewhere in between the unstable and stable branch where it gets the new features before the stable release.
 
 - 
  
 - 
            
github.com github.com
- 
  
ActiveStorage has a different approach than what is suggested by @dhh here. The idea there seems to be to rule out a default and to explicitly set ActiveStorage::Current.url_options or by include ActiveStorage::SetCurrent. I don't understand why and asked about it in the Rails Forum. Maybe someone here can point out why we don't use a sensible default in ActiveStorage?
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
Because Active Storage gem does not specify AWS SDK as its dependency, it’s quite possible you updated Active Storage while leaving AWS SDK behind (happened to me).
 - 
  
You probably solved not because of using aws-sdk gem instead of aws-sdk-s3 but simply because you updated the SDK. I’m sure just updating the aws-sdk-s3 would solved too.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
Since this is the first search result of 'rails gcs cors' issue, I want to say that the sample file in guide guides.rubyonrails.org/… is different from OP's.
 
 - 
  
 - 
            
www.npmjs.com www.npmjs.com
- 
  
well-written
 
 - 
  
 - 
            
pragmaticstudio.com pragmaticstudio.com
 - 
            
blog.commutatus.com blog.commutatus.com
- 
  
Although it is possible to manually craft all the necessary HTTP requests to get the signed keys and manually upload the file to the storage backend, thankfully we don’t have to. Rails already provides us with the @rails/active_storage package, which greatly simplifies the process.
 - 
  
 
 - 
  
 - 
            
- 
  
Now this is where the magic of our activestorage library from node package manager comes in. At the top of our CreateAccount.js file we need to import a Component, DirectUpload, from this library…
 - 
  
Before we move on to uploading an image, let’s give our users the ability to logout
 - 
  
Letting the User Logout
log out
 
 - 
  
 - 
            
www.ruby-forum.com www.ruby-forum.com
- 
  
I ran into the same problem and never really found a good answer via the test objects. The only solution I saw was to actually update the session via a controller. I defined a new action in one of my controllers from within test_helper (so the action does not exist when actually runnning the application). I also had to create an entry in routes. Maybe there’s a better way to update routes while testing. So from my integration test I can do the following and verfiy: assert(session[:fake].nil?, “starts empty”) v = ‘Yuck’ get ‘/user_session’, :fake => v assert_equal(v, session[:fake], “value was set”)
 - 
  
I find the use of the term “session” within integration tests a bit unfortunate (open_session, etc), since there are also these session objects, which are however different. Maybe replace by “user_session” ?
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
It does, however, lack certain features (such as progress monitoring) that XMLHttpRequest provides.
 
 - 
  
 - 
            
evilmartians.com evilmartians.com
- 
  
TL;DR For classic Rails apps we have a built-in scope for preloading attachments (e.g. User.with_attached_avatar) or can generate the scope ourselves knowing the way Active Storage names internal associations.GraphQL makes preloading data a little bit trickier—we don’t know beforehand which data is needed by the client and cannot just add with_attached_<smth> to every Active Record collection (‘cause that would add an additional overhead when we don’t need this data).That’s why classic preloading approaches (includes, eager_load, etc.) are not very helpful for building GraphQL APIs. Instead, most of the applications use the batch loading technique.
 
 - 
  
 - 
            
engineering.universe.com engineering.universe.com
- 
  
def rating(like_count, angry_count) like_count * 2 - angry_count end
 - 
  
 
 - 
  
 - 
            
math.stackexchange.com math.stackexchange.com
- 
  
so a formula is like a dead equation?
 
 - 
  
 - 
            
evilmartians.com evilmartians.com
- 
  
 - 
  
To upload a file, a client must perform the following steps:Obtain the file metadata (filename, size, content type and checksum)Request direct upload credentials and a blob ID via API—createDirectUpload mutationUpload the file using the credentials (no GraphQL involved, HTTP PUT request).
 
 - 
  
 - 
            
www.countable.com www.countable.com
 - 
  
 - 
            
github.com github.com
- 
  
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 :)
 - 
  
just stopping by to say thanks for including me as an author on the commit. That's nice of you!
 
Tags
Annotators
URL
 - 
  
 - 
            
- 
  
let’s setup
let's set up
 - 
  
all setup
"all set up"
 - 
  
user’s will be able to
"users will"
 
 - 
  
 - 
            
www.flaticon.com www.flaticon.com
 - 
  
 - 
            
www.flaticon.com www.flaticon.com
Tags
Annotators
URL
 - 
  
 - 
            
edgeguides.rubyonrails.org edgeguides.rubyonrails.org
- 
  
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.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
– Tyler Rick
 - 
  
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.
 - 
  
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
 
 - 
  
 - 
            
www.digitalocean.com www.digitalocean.com
- 
  
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.
 
 - 
  
 - 
            
github.com github.com
- 
  
For lost googlers:
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
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
 
 - 
  
 - 
            
meta.stackoverflow.com meta.stackoverflow.com
- 
  
I believe the final policy shall contain robust rationale and, in the best way possible, avoids the perception of rAIcial discrimination
 - 
  
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.
 - 
  
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.
 
 - 
  
 - 
            
www.public.law www.public.law
- 
  
Law is code that belongs to all of us
 
 - 
  
 - 
            
edgeguides.rubyonrails.org edgeguides.rubyonrails.org
- 
  
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.
 
 - 
  
 - 
            
www.rootstrap.com www.rootstrap.com
Tags
Annotators
URL
 - 
  
 - 
            
- 
  
Factory :video_file do file { fixture_file_upload 'test.png', 'image/png' } end
 
 - 
  
 - 
            
developer.chrome.com developer.chrome.com
- 
  
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.
 - 
  
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.
 - 
  
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.
 
 - 
  
 - 
            
github.com github.com
- 
  
It is not intended to piecewise load rspec-rails.
.
 
 - 
  
 - 
            
guides.rubyonrails.org guides.rubyonrails.org
- 
  
def prevent_delivery_to_guests if @user && @user.guest? mail.perform_deliveries = false end end
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
The Mailer is not the right place for business logic. When you use Sidekiq than your Job object should do the check before actually calling the Mailer.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
The Mailer, IMHO, is the wrong place for this logic. The mailer should do nothing but format and send messages. The logic to decide whether or not to send should be within the calling block of code.
 
 - 
  
 - 
            
github.com github.com
- 
  
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).
 
 - 
  
 - Jul 2023
 - 
            
stackoverflow.com stackoverflow.com
- 
  
expect(described_class.active).not_to include_any_of [records_not_to_be_included]
 
 - 
  
 - 
            
www.imdb.com www.imdb.com
- 
  
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.
 - 
  
You say it is a propaganda because it conflicts with your propaganda.
 
Tags
Annotators
URL
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
# 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 }
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
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
 
 - 
  
 - 
            
- 
  
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.
 - 
  
Of course there are perversions like XMI and Microsoft's new formats.
 - 
  
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."
 - 
  
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.
 - 
  
I think the only purpose of this is to detain programmers from doing anything a non-Microsoft way.
Probably not really...
 - 
  
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.
 - 
  
Dividing files into "text" and "binary" is the archetype misdesign in the operating system you use
 
 - 
  
 - 
            
euclideanspace.com euclideanspace.com
- 
  
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.
 - 
  
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.
 
 - 
  
 - 
            
- 
  
The representation of objects in terms of XML elements and attributes.
 - 
  
The standard mechanisms to link objects within the same file or across files.
 - 
  
XMI describes solutions to the above issues by specifying EBNF production rules to create XML documents and Schemas that share objects consistently.
 - 
  
Object identity, which allows objects to be referenced from other objects in terms of IDs and UUIDs.
 
 - 
  
 - 
            
en.wikipedia.org en.wikipedia.org
- 
  
an object-oriented approach to data modelling – where data is described in terms of classes, attributes, and associations
 - 
  
 
 - 
  
 - 
            
en.wikipedia.org en.wikipedia.org
- 
  
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.
 - 
  
"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".
 - 
  
The term data model can refer to two distinct but closely related concepts
 - 
  
A data model can sometimes be referred to as a data structure, especially in the context of programming languages.
 - 
  
Sometimes it refers to an abstract formalization of the objects and relationships found in a particular application domain
 - 
  
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.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
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
 
 - 
  
 - 
            
community.cisco.com community.cisco.com
- 
  
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.
 
 - 
  
 - 
            
github.com github.com
- 
  
We recommend using both an issuer label prefix and an issuer parameter, described below.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
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.
 
 - 
  
 - 
            
www.theguardian.com www.theguardian.com
- 
  
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.”
 
 - 
  
 - 
            
www.forbes.com www.forbes.com
- 
  
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.
 - 
  
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,”
 - 
  
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.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
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
 
 - 
  
 - 
            
dba.stackexchange.com dba.stackexchange.com
- 
  
But there is no absolute reason to use JOIN LATERAL (...) ON TRUE because you could just write it as a CROSS JOIN LATERAL instead
 - 
  
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
 
 - 
  
 - 
            
m.egwwritings.org m.egwwritings.org
Tags
Annotators
URL
 - 
  
 - 
            
www.codewithjason.com www.codewithjason.com
- 
  
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:
 - 
  
I commonly find myself wanting to assert that a certain field contains a certain value.
 
 - 
  
 - 
            
www.humblebundle.com www.humblebundle.com
- 
  
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.
 
 - 
  
 - 
            
activerecord-hackery.github.io activerecord-hackery.github.io
- 
  
If Arel does not have the predicate you are looking for, consider monkey patching it:
 
 - 
  
 - 
            
- 
  
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!
 - 
  
Please consider adding a branch with a failing spec describing the problem.
 - 
  
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.
 
 - 
  
 - 
            
- 
  
Is the column a boolean column? (i.e. what does User.columns_hash[:admin_created].type return?)
 
 - 
  
 - 
            
activerecord-hackery.github.io activerecord-hackery.github.io
- 
  
args: [:parent, :ransacker_args] do |parent, args|
 - 
  
Arel::Nodes::InfixOperation.new('->>', parent.table[:properties], 'link_type')
 - 
  
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.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
ActiveStorage::LogSubscriber.detach_from :active_storage
It's nice that it's that easy to "opt out" of the default provided log subscriber and (if desired) swap in your own custom one that does whatever you want.
 - 
  
 
 - 
  
 - 
            
github.com github.com
- 
  
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.
 - 
  
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.
 
 - 
  
 - 
            
github.com github.com
 - 
            
german.stackexchange.com german.stackexchange.com
- 
  
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«.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
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
 
 - 
  
 - 
            
activeadmin.info activeadmin.info
- 
  
You can also use the ActiveAdmin::FormBuilder as builder in your Formtastic Form for use the same helpers are used in the admin file:
.
 - 
  
semantic_form_for [:admin, @post], builder: ActiveAdmin::FormBuilder
semantic_form_for [:admin, @post], builder: ActiveAdmin::FormBuilder
 
 - 
  
 - 
            
www.metacritic.com www.metacritic.com
- 
  
I really feel the game is a strong 9 but I’m giving it a 10 to offset the trolls.
 
 - 
  
 - 
            
www.kickstarter.com www.kickstarter.com
- 
  
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.
 
 - 
  
 - 
            
guides.rubyonrails.org guides.rubyonrails.org
- 
  
Making MoneySerializer reloadable would be confusing, because reloading an edited version would have no effect on that class object stored in Active Job.
 - 
  
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.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
As this answer warns placing the include at the top level pollutes the Object namespace. Instead, I should have written
 
 - 
  
 - 
            
24-seven.churchcenter.com 24-seven.churchcenter.com
- 
  
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...
 
 - 
  
 - 
            
www.nintendolife.com www.nintendolife.com
- 
  
Due to specific circumstances, there may be some devices that are incompatible even if they meet the specification requirements above.
 
 - 
  
 - 
            
www.kickstarter.com www.kickstarter.comThiefdom1
- 
  
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).
 
 - 
  
 - Jun 2023
 - 
            
stackoverflow.com stackoverflow.com
- 
  
Excellent, underrated answer!
 - 
  
As far as I see the current version of arel gem is not support FROM keyword for the sql query. You can generate a query using the SET, and WHERE keywords only,
 
 - 
  
 - 
            
www.soulcutter.com www.soulcutter.com
- 
  
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.
 - 
  
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).
 - 
  
Let’s check out what the refinement approach looks like and why I consider it the best way to implement conversion wrappers.
 - 
  
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.
 - 
  
in the 10 years since they have been a part of Ruby, real life usages are astonishingly rare.
 
Tags
- familiarity
 - ubiquity
 - where it shines / best application
 - Ruby
 - Ruby: refinements
 - good question
 - monkey patching
 - education
 - unfamiliar
 - why isn't this more popular?
 - issues/factors hindering adoption
 - programming idiom
 - conversion (transform)
 - ruby: core extensions
 - why is nobody using this?
 
Annotators
URL
 - 
  
 - 
            
interblah.net interblah.net
- 
  
 - 
  
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.
 - 
  
Please – make a little time to explore Ruby. Maybe you’ll discover something simple, or maybe something wonderful.
 - 
  
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.
 - 
  
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”.
 - 
  
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.
 
Tags
- exploring
 - thinking/deciding/evaluating for yourself
 - community (for a project or product)
 - learning new things
 - it's up to you to decide
 - I agree
 - Ruby: refinements
 - newer/better ways of doing things
 - critical thinking
 - from different perspective/point of view
 - why isn't this more popular?
 - good point
 - differences of opinion/perspective are good
 - responsibility
 - self-learning
 - why is nobody using this?
 
Annotators
URL
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
Tags
Annotators
URL
 - 
  
 - 
            
about.me about.me
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
ON conflict (member_id) DO UPDATE SET
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
rank() OVER (ORDER BY
first sighting: rank
 
 - 
  
 - 
            
github.com github.com
- 
  
What is the Docker host filesystem owner matching problem?
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
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.
 
 - 
  
 - 
            
stackoverflow.com stackoverflow.com
- 
  
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".
 
 -