- Mar 2021
-
www.quora.com www.quora.com
-
A business with a low barrier to entry would be those people in poor countries who “wash” your windscreen at traffic lights. A bucket, a cloth, some water and you are in business. A business with a high barrier to entry might be airlines: planes are expensive, staff with the right skills hard to find, the necessary permits to fly hard to obtain.
-
-
en.wikipedia.org en.wikipedia.org
-
The hierarchical structure of semantic fields can be mostly seen in hyponymy.
Good explanation about semantic fields.
I assume the same or an even stronger statement can be made about semantic classes (which to me are like more clear-cut, distinct semantic fields), then? 
-
-
en.wikipedia.org en.wikipedia.org
-
Some types exist as descriptions of objects, but not as tangible physical objects. One can show someone a particular bicycle, but cannot show someone, explicitly, the type "bicycle", as in "the bicycle is popular."
-
The sentence "they drive the same car" is ambiguous. Do they drive the same type of car (the same model) or the same instance of a car type (a single vehicle)?
-
-
en.wikipedia.org en.wikipedia.org
-
For example within nouns there are two sub classes, concrete nouns and abstract nouns.
-
-
en.wikipedia.org en.wikipedia.org
-
For instance, in basketball there are many words that are specific to the sport. Free throw, court, half court, three pointer, and point guard are all terms that are specific to the sport of basketball. These words make very little sense when used outside of the semantic domain of basketball.
But this example seems so different than the first example they gave, "rain", which seems more like a semantic field — a group of very related or nearly synonymous words.
-
-
en.wikipedia.org en.wikipedia.org
-
Every woman talked to a student. This has two interpretations. Under one reading, every woman talked to the same student (the class president, for example), and here the noun phrase a student is specific. Under the second reading, various students were talked to. In this case, a student is non-specific.
-
-
en.wikipedia.org en.wikipedia.org
-
However, if the distinctions between the two concepts appear to be superficial, intentional conflation may be desirable for the sake of conciseness and recall
-
-
commons.wikimedia.org commons.wikimedia.org
-
en.wikipedia.org en.wikipedia.org
-
Dictionary writers list polysemes under the same entry; homonyms are defined separately.
This describes how you can tell which one it is by looking at the dictionary entry.
-
Polysemy is thus distinct from homonymy—or homophony—which is an accidental similarity between two words (such as bear the animal, and the verb to bear); while homonymy is often a mere linguistic coincidence, polysemy is not.
-
-
trailblazer.to trailblazer.to
-
Note how a handful of default steps lead into six standardized termini, allowing to plug protocols into different adapters. Imagine replacing your self-written API adapter with a canonical JSON-API adapter, for example.
-
endpoint Diagram::Operation::Create do |ctx, **| redirect_to diagram_path(ctx[:diagram].id) end.Or do |ctx, **| render :form end
-
-
www.positivelypositive.com www.positivelypositive.com
-
Just? The meaning of the word is the reason we used the word.
-
-
sandradodd.com sandradodd.com
-
It means "You're about to talk about words, but words don't matter."
-
-
askubuntu.com askubuntu.com
-
vim-athena doesn't depend on or use any version of GTK+. If you use sudo apt-get build-dep vim-athena, it probably will install GTK+ and GNOME related libraries, because the vim-athena binary package is built from the same source package as vim and other vim-providing packages. In any case, you shouldn't need to build from source, as the binaries provided by vim-athena are already built against Athena and not against GTK+ or other graphical toolkits.
-
If you built vim against Qt rather than GTK+ and python-complete still isn't working, that suggests the problem isn't actually a consequence of trying to link to both GTK+2 and GTK+3.
-
-
stackoverflow.com stackoverflow.com
-
I have VIM on Mac & CentOS. So, I see people are writing about -xterm_clipboard, -lua, ... Is there an simple way to install it all? or we have to enable options one-by-one and compile/recompile it?
I had similar question... how to get --servername support.
-
-
askubuntu.com askubuntu.com
-
This is the only answer that does not require manually parsing the .desktop file, so it's the most sane (and safe) approach.
-
-
gitlab.gnome.org gitlab.gnome.org
-
Sorry you’re surprised. Issues are filed at about a rate of 1 per day against GLib. Merge requests at a rate of about 1 per 2 days. Each issue or merge request takes a minimum of about 30 minutes (across at least 2 people) to analyse, put together a fix, test it, review it, fix it, review it and merge it. I’d estimate the average is closer to 3 hours than 30 minutes. Even at the fastest rate, it would take 3 working months to clear the backlog of ~1000 issues. I get a small proportion of my working time to spend on GLib (not full time).
-
This issue hasn’t been deemed a high enough priority to be fixed yet. It will be addressed one day, I’m sure. There are many issues in GLib which many people on the internet think are important.
-
-
gitlab.gnome.org gitlab.gnome.org
-
The commit message should always have some explanation, see https://wiki.gnome.org/Git/CommitMessages.
-
-
forum.garudalinux.org forum.garudalinux.org
-
Does running nsgcepa by itself not then run the .desktop which in turn runs that command?
-
-
stackoverflow.com stackoverflow.com
-
I don't use remote editing much so vim-dirvish is powerful enough to manage my workflow (It's actually faster than netrw ~ the author claims 2x, I feel it's faster than that - it's really instantaneous ⚡) very useful on large codebase/repositories
-
-
askubuntu.com askubuntu.com
-
XDG stands for X Desktop Group aka freedesktop.org
-
-
github.com github.com
-
Or even a simple 1-liner in the Contract that references an AR Model so you don't have to rewrite the validations again in that contract, or have to choose between writing the validations once either in the contract there or in the AR Model?
-
-
medium.com medium.com
-
After all, that’s why it’s in one repository to begin with right?
-
-
blog.izs.me blog.izs.me
-
It is about balancing the twin needs of writing good software, and writing any software at all.
-
-
tobeagile.com tobeagile.com
-
Have you ever played the game 20 questions? Most of us have played that game at one point in our lives. One person thinks of something that could be an animal, vegetable, or mineral and then they answer yes/no questions that are asked of them. The point of the game is to ask as few questions as possible in order to accurately guess what the person is thinking. This is how I think of the unit tests that I write the specified behavior as I’m doing test-first development. I ask what are the fewest tests that I need to write in order to assert the behavior I want to create.
-
-
www.chevtek.io www.chevtek.io
-
Write modules that do one thing well. Write a new module rather than complicate an old one.
.
-
-
news.ycombinator.com news.ycombinator.com
-
Essentially we're trying to figure out when it's appropriate for "my" code to become "everyones" code, and if there are steps in between. ("Standard library", for example.)
-
here is my set of best practices.I review libraries before adding them to my project. This involves skimming the code or reading it in its entirety if short, skimming the list of its dependencies, and making some quality judgements on liveliness, reliability, and maintainability in case I need to fix things myself. Note that length isn't a factor on its own, but may figure into some of these other estimates. I have on occasion pasted short modules directly into my code because I didn't think their recursive dependencies were justified.I then pin the library version and all of its dependencies with npm-shrinkwrap.Periodically, or when I need specific changes, I use npm-check to review updates. Here, I actually do look at all the changes since my pinned version, through a combination of change and commit logs. I make the call on whether the fixes and improvements outweigh the risk of updating; usually the changes are trivial and the answer is yes, so I update, shrinkwrap, skim the diff, done.I prefer not to pull in dependencies at deploy time, since I don't need the headache of github or npm being down when I need to deploy, and production machines may not have external internet access, let alone toolchains for compiling binary modules. Npm-pack followed by npm-install of the tarball is your friend here, and gets you pretty close to 100% reproducible deploys and rollbacks.This list intentionally has lots of judgement calls and few absolute rules. I don't follow all of them for all of my projects, but it is what I would consider a reasonable process for things that matter.
-
-
www.sitepoint.com www.sitepoint.com
-
JavaScript needs to fly from its comfy nest, and learn to survive on its own, on equal terms with other languages and run-times. It’s time to grow up, kid.
-
As to opinions about the shortcomings of the language itself, or the standard run-times, it’s important to realize that every developer has a different background, different experience, different needs, temperament, values, and a slew of other cultural motivations and concerns — individual opinions will always be largely personal and, to some degree, non-technical in nature.
Tags
- what is important/necessary for one person may not be for another
- reaction / reacting to
- avoid giving partiality/advantage/bias to any specific option
- neutral/unbiased/agnostic
- runtime environment
- good point
- JavaScript
- neutral ground
- everyone has different preferences
- competition in open-source software
- JavaScript: as a process VM
- programming languages: choosing the best language for the job
- annotation meta: may need new tag
- non-technical reasons
- level playing field
- everyone has different background/culture/experience
- good idea
- +0.9
- software preferences are personal
- separation of concerns
- software project created to address shortcomings in another project
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
Suppose an administrator creates a forum using open source forum software, and then heavily modifies it by adding new features and options. This process requires extensive modifications to existing code and deviation from the original functionality of that software.
-
cannot be run on any modern day computer or computer simulator, as it was developed during the days when LISP and PLANNER were still in development stage, and thus uses non-standard macros and software libraries which do not exist anymore
-
-
www.inuse.se www.inuse.se
-
A product’s onceability is, to a certain extent, linked to its usefulness. If it is really useful, we will certainly go to considerable lengths to repair it.
-
-
github.com github.com
-
Sure, you have a few extra newlines and semicolons, but the minifier will remove them anyway so no harm.
-
-
github.com github.com
-
This semi-colon is added to prevent changing the code behaviour (the famous line ending with parentheses, etc) Most people will use a JS minifier If they don't, a single extra character is unlikely to change much If I'm right about all the above: Why don't we simply always add a semi-colon regardless of what the file ends with?
-
-
forum.paradoxplaza.com forum.paradoxplaza.com
-
If you think that for every problem there is a simple and easy solution, either you don't understand what is a problem or you don't understand what is a solution.
-
-
github.com github.com
-
Thanks for posing that question @SamSaffron
-
-
github.com github.com
-
When should I use link, vs dir, vs. tree?
-
-
github.com github.com
-
Here's the four case: foo.js Load/Require dependencies Concatenate dependencies foo.js.map Load foo.js Currently grabs metadata[:map] from asset to build an asset, need to move that generation somewhere else to accomplish de-coupling map generation foo.debug.js Load foo.js Load foo.js.map Add comment to end of foo.js with path to foo.js.map foo.source.js The raw file on disk, the map file will need to point to source files.
-
Money could be good if it is spent to provide some of the above things. Money on it's own is hard because then it means I would have to spend time book-keeping and managing instead of programming.
Tags
- work: doing what you love
- receiving money: is it worth the hassle/responsibility of bookkeeping?
- system architecture/design diagram/illustration
- unfun
- complicated/intricate
- boring
- good point
- bookkeeping
- complicated
- doing what you love: leaving what's boring to you for others
- good explanation
Annotators
URL
-
-
-
There's no release of sprockets 4 so there's nothing to revert. Master branch is a WIP. I would recommend using Sprockets 3.
-
-
github.com github.com
-
Yes, it's true that it returns a single file, but with the more robust caching in 4.0 it works well enough in my experience.
Tags
Annotators
URL
-
-
opalrb.com opalrb.com
-
Opal is a Ruby to JavaScript source-to-source compiler. It comes packed with the Ruby corelib you know and love. It is both fast as a runtime and small in its footprint.
-
-
docs.openfaas.com docs.openfaas.com
-
OpenFaaS® makes it easy for developers to deploy event-driven functions and microservices to Kubernetes without repetitive, boiler-plate coding.
-
-
hyperstack.org hyperstack.org
-
we used `backticks` to jump into native Javascript to use moment.js
In regular Ruby, `` executes in a shell, but obviously there is no shell of that sort in JS, so it makes sense that they could (and should) repurpose that syntax for something that makes sense in context of JS -- like running native JavaScript -- prefect!
-
Hyperstack gives you full access to the entire universe of JavaScript libraries and components directly within your Ruby code.Everything you can do in JavaScript is simple to do in Ruby; this includes passing parameters between Ruby and JavaScript and even passing Ruby methods as JavaScript callbacks.There is no need to learn JavaScript, all you need to understand is how to bridge between JS and Ruby.
-
-
www.codetriage.com www.codetriage.com
-
Before a bug can be fixed, it has to be understood and reproduced. For every issue, a maintainer gets, they have to decipher what was supposed to happen and then spend minutes or hours piecing together their reproduction. Usually, they can’t get it right, so they have to ask for clarification. This back-and-forth process takes lots of energy and wastes everyone’s time. Instead, it’s better to provide an example app from the beginning. At the end of the day, would you rather maintainers spend their time making example apps or fixing issues?
-
-
math.stackexchange.com math.stackexchange.com
-
I'd say an equation is anything with an equals sign in it; a formula is an equation of the form A= stuffA= stuffA={\rm\ stuff} where AAA does not appear among the stuff on the right side.
-
An equation is meant to be solved, that is, there are some unknowns. A formula is meant to be evaluated, that is, you replace all variables in it with values and get the value of the formula.
-
The key idea is that the equation captures not just the ingredients of the formula, but also the relationship between the different ingredients.
-
In your case, "mpg = distance/gallons" is best understood as "a formula in the form of an equation", which means that in this instance the two words are interchangeable.
-
-
stackoverflow.com stackoverflow.com
-
The :empty selector refers only to child nodes, not input values. [value=""] does work; but only for the initial state. This is because a node's value attribute (that CSS sees), is not the same as the node's value property (Changed by the user or DOM javascript, and submitted as form data).
-
The selector [value=""] tests whether the element has the value attribute in markup and has the empty string as its value.
-
-
stackoverflow.com stackoverflow.com
-
Semantically correct usage of elements means that you use them for what they are meant to be used for.
-
It means that you're calling something what it actually is.
-
Another example: a list (<ul> or <ol>) should generally be used to group similar items (<li>). You could use a div for the group and a <span> for each item, and style each span to be on a separate line with a bullet point, and it might look the way you want. But "this is a list" conveys more information.
-
The classic example is that if something is a table, it should contain rows and columns of data. To use that for layout is semantically incorrect - you're saying "this is a table" when it's not.
-
Knowing what your elements are lets browsers use sensible defaults for how they should look and behave. This means you have less customization work to do and are more likely to get consistent results in different browsers.
Tags
- semantic markup
- simple explanation
- conveys more information (semantic)
- good example
- be specific
- consistency across all platforms
- advantages/merits/pros
- semantically correct
- definition
- semantic meaning
- good point
- reasonable defaults
- example
- good explanation
- calling something what it actually is (semantic labeling)
Annotators
URL
-
-
www.the-art-of-web.com www.the-art-of-web.com
-
Website: <input type="url" name="website" required pattern="https?://.+"> Now our input box will only accept text starting with http:// or https:// and at least one additional character
-
-
-
With these JavaScript techniques, the display of server validation errors could be a lot simpler if you expect most of your users to have JS enabled. For example, Rails still encourages you to dump all validation errors at the top of a form, which is lulzy in this age of touchy UX. But you could do that minimal thing with server errors, then rely on HTML5 validation to provide a good user experience for the vast majority of your users.
-
-
www.kickstarter.com www.kickstarter.com
-
Design SHOGI pieces have been redesigned with new iconography to indicate the piece’s movement.
-
Shogi is a classic game. I know many people who want to play Shogi, but the Kanji on the pieces makes it too hard to master. I have designed this Shogi with icons so anybody can learn it easily.
-
-
trailblazer.to trailblazer.to
-
Why don’t we put the “create user” task onto the failure track, and in case of successfully persisting the new user, we deviate back to the happy path?
-
To implement such an activity, we only need to rewire the second step’s failure output to a new terminus.
-
Since you can reference outputs by their semantic, you as a modeller only connect conceptual termini to ongoing connections!
-
it’s a bit as if the following wiring is applied to every task added via #step
-
Visualized, our new composed structure would look as follows.
-
Suppose that the validate task was getting quite complex and bloated. When writing “normal” Ruby, you’d break up one method into several. In Trailblazer, that’s when you introduce a new, smaller activity.
-
-
blog.mozilla.org blog.mozilla.org
-
Our new feature, Total Cookie Protection, works by maintaining a separate “cookie jar” for each website you visit. Any time a website, or third-party content embedded in a website, deposits a cookie in your browser, that cookie is confined to the cookie jar assigned to that website, such that it is not allowed to be shared with any other website.
-
-
trailblazer.to trailblazer.to
-
The absence of a method name here is per design: this object does only one thing, and hence what it does is reflected in the class name.
-
- Feb 2021
-
steamcommunity.com steamcommunity.com
-
To whom did you sell your keys and at what kind of rates? https://steamcommunity.com/id/playa131 for example resells them and might be the source for DIG's purchases.
-
Do you have collaborators who could have generated keys and sold them on their own? DIG's Steam keys and other stores' Steam keys must have some source, after all. Keys don't generate themselves, and only your accounts should be able to request them.This particular game was in Bunch Keys Indie Wizardry Bundle. I assume you had a proper contract for that. Maybe DIG or an intermediary bought 50-200 copies of it?
-
It isn't stealing because you or an associate must have generated and given them the keys in some way or another?Ideally you would ask a DIG bundle buyer to show you their key for your game, so you can figure out what key request batch it came from, and then you can scratch your head and wonder who you gave those keys to and what journey they took afterwards.
-
-
github.com github.com
-
URI::MailTo::EMAIL_REGEXP
First time I've seen someone create a validator by simply matching against
URI::MailTo::EMAIL_REGEXP
from std lib. More often you see people copying and pasting some really long regex that they don't understand and is probably not loose enough. It's much better, though, to simply reuse a standard one from a library — by reference, rather than copying and pasting!!
-
-
trailblazer.to trailblazer.to
-
step :policy, before: :create_model
-
the validate task gets removed, assuming the Admin won’t need a validation
-
step Subprocess(Memo::Validate), Output(:invalid_params) => Track(:failure)
-
While you could nest an activity into another manually, the Subprocess macro will come in handy.
-
The Track() function will snap the output to the next task that is “magnetic to” the track’s semantic.
-
step :charge_creditcard, Output(:failure) => End(:declined)
-
step :charge_creditcard, Output(:failure) => End(:success) end This reconnects both outputs to the same end, always ending in a - desirable, yet unrealistic - successful state.
-
step :find_provider, Output(UsePaypal, :paypal) => Track(:paypal)
-
-
github.com github.com
-
Version HEAD now
-
Tree Navigation
-
-
github.com github.com
-
Regardless of origin, allow/deny are simply clearer terms that does not require tracing the history of black/white as representations of that meaning. We can simply use the meaning directly.
-
-
www.theregister.com www.theregister.com
-
Allowlist, not whitelist. Blocklist, not blacklist. Goodbye, wtf. Microsoft scans Chromium code, lops off offensive words
-
-
trailblazer.to trailblazer.to
-
-
While you could program this little piece of logic and flow yourself using a bunch of Ruby methods along with a considerable amount of ifs and elses, and maybe elsif, if you’re feeling fancy, a Trailblazer activity provides you a simple API for creating such flow without having to write and maintain any control code. It is an abstraction.
-
-
sobolevn.me sobolevn.me
-
Let’s start with the same number dividing example, which returns 0 when the error happens. Maybe instead we can indicate that the result was not successful without any explicit numerical value?
-
-
en.wikipedia.org en.wikipedia.org
-
despite initially appearing to be an appropriate and effective response to a problem, has more bad consequences than good ones
-
-
indonesie.universiteitleiden.nl indonesie.universiteitleiden.nl
-
Soldaat in Indonesië
this is nonsense
Tags
Annotators
URL
-
-
www.metacritic.com www.metacritic.com
-
It seems like such a beautiful little visual novel and while I wasn’t expecting a masterpiece of localisation based on its low price, I was expecting to be able to read it. But that just cannot be done. Developers from Japan, China, Taiwan, Indonesia, and every other emerging game development centre through Asia-Pacific, listen to me carefully: You can have the most beautiful aesthetics and a heartwarming concept for your game. If the localisation isn’t going to be good, though, do not bother with an English release, because it is going to get reviews like this one. Make “invest in proper translation” your big resolution for 2021. I do not want to play any other games like Lily in the Hollow - Resurrection ever again.
-
-
dry-rb.org dry-rb.org
-
In other words, once you've used Maybe you cannot hit nil with a missing method. This is remarkable because even &. doesn't save you from omitting || "No state" at the end of the computation. Basically, that's what they call "Type Safety".
-
-
jrsinclair.com jrsinclair.com
-
The .chain() method allows us to switch over to the left track if an error occurs. Note that the switches only go one way.
-
-
english.stackexchange.com english.stackexchange.com
-
This text wound up founding the discipline which we today call "metaphysics", and one way to describe what this subject encompasses is that it covers things at a level of abstraction above physics.
-
-
trailblazer.to trailblazer.to
-
I work with crazy geniuses who share many of my opinions (not all, and that’s good).
-
What this means is: I better refrain from writing a new book and we rather focus on more and better docs.
I'm glad. I didn't like that the book (which is essentially a form of documentation/tutorial) was proprietary.
I think it's better to make documentation and tutorials be community-driven free content
Tags
- annotation meta: inherit same annotation/tags
- documentation
- free content
- knowledge commons (information/data/content)
- finally / at last
- welcome/good change
- non-free content
- focus on the user
- I'm glad they did it this way
- differences of opinion/perspective are good
- community-driven development
- I agree
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
In the telecommunications industry, on a conceptual level, value-added services add value to the standard service offering, spurring subscribers to use their phone more and allowing the operator to drive up their average revenue per user.
-
-
2019.trailblazer.to 2019.trailblazer.to
-
note that TRB source code modifications are not proprietary
In other words, you can build on this software in your proprietary software but can't change the Trailblazer source unless you're willing to contribute it back.
loophole: I wonder if this will actually just push people to move their code -- which at the core is/would be a direction modification to the source code - out to a separate module. That's so easy to do with Ruby, so this restriction hardly seems like it would have any effect on encouraging contributions.
Tags
- LGPL
- neutral/dispassionate/impartial/objective wording
- wording designed to be more palatable/pleasing/inoffensive
- annotation meta: may need new tag
- proprietary software
- reminder
- open-source software: not contributing new code back to project
- good point
- software licensing
- well-written
- loophole/escape hatch
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
Why then sending the SIGINT manually to the shell doesn't kill the child, e.g. 'kill -2 <shell-pid>' doesn't do anything to a child process while Ctrl-C kills it?
-
-
stackoverflow.com stackoverflow.com
-
The idea of the script is this: most of the important logic runs in a subshell which is piped through tee and to a logfile, so I don't have to tee every single line of the main logic to get it all logged.
-
-
github.com github.com
-
There are times where it is useful to know whether a value was passed to run or the result of a filter default. In particular, it is useful when nil is an acceptable value.
Yes! An illustration in ruby:
main > h = {key_with_nil_value: nil} => {:key_with_nil_value=>nil} main > h[:key_with_nil_value] => nil main > h[:missing_key] # this would be undefined in JavaScript (a useful distinction) rather than null, but in Ruby it's indistinguishable from the case where a nil value was actually explicitly _supplied_ by the caller/user => nil # so we have to check for "missingness" ("undefinedness"?) differently in Ruby main > h.key?(:key_with_nil_value) => true main > h.key?(:missing_key) => false
This is one unfortunate side effect of Ruby having only
nil
and no built-in way to distinguish betweennull
andundefined
like in JavaScript. -
def edit account = find_account! @account = UpdateAccount.new( account: account, first_name: account.first_name, last_name: account.last_name) end
-
Record filters allow you to require an instance of a particular class (or one of its subclasses) or a value that can be used to locate an instance of the object. If the value does not match, it will call find on the class of the record. This is particularly useful when working with ActiveRecord objects.
-
> RecordInteraction.run!(encoding: 'ascii') => #<Encoding:US-ASCII>
Makes use of the fact that you can do:
main > Encoding.find('ascii') => #<Encoding:US-ASCII>
and that
If the value does not match, it will call
find
on the class of the record. -
If ActiveModel deals with your nouns, then ActiveInteraction handles your verbs.
It's a good analogy, but I think it's misleading/confusing/unclear/incorrect, because parts of ActiveInteraction are ActiveModel, so I guess ActiveInteraction deals with your nouns too?
-
ActiveInteraction also supports merging errors. This is useful if you want to delegate validation to some other object. For example, if you have an interaction that updates a record, you might want that record to validate itself. By using the #merge! helper on errors, you can do exactly that.
-
Inside the interaction, we could use #find instead of #find_by_id. That way we wouldn't need the #find_account! helper method in the controller because the error would bubble all the way up. However, you should try to avoid raising errors from interactions. If you do, you'll have to deal with raised exceptions as well as the validity of the outcome.
What they're referring to:
Account.find('invalid')
will raise an error butAccount.find_by(id: 'invalid')
will not. -
For this one we'll define a helper method to handle raising the correct errors. We have to do this because calling .run! would raise an ActiveInteraction::InvalidInteractionError instead of an ActiveRecord::RecordNotFound. That means Rails would render a 500 instead of a 404.
True, but why couldn't it handle this for us?
Tags
- library/framework should provide this (standard solution) rather than everyone having to write their own slightly different solution (even if it is easy enough to write yourself)
- good example
- unclear
- comparison
- important point
- reasonable behavior
- confusing
- good analogy
- _ is to _ (analogy)
- good point
- JavaScript
- ruby
- good explanation
- undefined vs. null
- use case
- active_interaction
- ActiveRecord
- interesting idea
- useful
- expected behavior
- good idea
- polymorphism
- misleading
- ActiveModel: errors: merging errors
- reasonable defaults
- error/exception handling
Annotators
URL
-
-
-
{a: 1, b: 2, c: 3, d: 4} => {a:, b:, **rest} # a == 1, b == 2, rest == {:c=>3, :d=>4}
equivalent in javascript:
{a, b, ...rest} = {a: 1, b: 2, c: 3, d: 4}
Not a bad replacement for that! I still find javascript's syntax a little more easily readable and natural, but given that we can't use the same syntax (probably because it would be incompatible with existing syntax rules that we can't break for compatibility reasons, unfortunately), this is a pretty good compromise/solution that they've come up with.
-
-
jointoucan.com jointoucan.com
-
What we do collect:The translated words you encounter so that we know what words you are exposed to and can serve up appropriate vocabulary quizzes.Any vocabulary quizzes you see and the results of those quizzes so that we can keep track of how well you know each vocabulary concept.Anonymized (not linked to anyone's particular account) web page URLs, whether translations show up on them, and whether any bugs or errors occur on those pages so that we can better detect any broad issues affecting our user base.
Tags
Annotators
URL
-
-
github.com github.com
-
def initialize(attributes=nil) self.assign_attributes(attributes) end
-
-
en.wikipedia.org en.wikipedia.org
-
Uses
-
The central ideas of this design pattern closely mirror the semantics of first-class functions and higher-order functions in functional programming languages. Specifically, the invoker object is a higher-order function of which the command object is a first-class argument.
-
-
github.com github.com
-
describe '.validate(context, filters, inputs)' do let(:inputs) { {} } let(:filter) { ActiveInteraction::Filter.new(:name, {}) } let(:interaction) do
-
-
www.infoworld.com www.infoworld.com
-
Does that make it so? Not for me. Were it simply a matter of words, I wouldn't write another word on the matter. But there are two distinct concepts behind these terms, concepts engendered separately and best understood separately.
-
-
en.wikipedia.org en.wikipedia.org
-
In a rule-based system, a metarule is a rule governing the application of other rules.
-
The modern sense of "an X about X" has given rise to concepts like "meta-cognition" (cognition about cognition), "meta-emotion" (emotion about emotion), "meta-discussion" (discussion about discussion), "meta-joke" (joke about jokes), and "metaprogramming" (writing programs that manipulate programs).
-
-
davefleet.com davefleet.com
-
If you think you’ve conveyed something but the other person hears something completely different, is that their fault or yours?
-
-
www.velaction.com www.velaction.com
-
People often hear what they think should be said, not the words that are actually spoken. This comes from the tendency of people to think faster than they talk. A listener makes assumptions about what they expect because their minds race ahead. This can be especially problematic when you misinterpret what your boss said.
-
-
softwareengineering.stackexchange.com softwareengineering.stackexchange.com
-
The more important point comes from a program design perspective. Here, "programming to an interface" means focusing your design on what the code is doing, not how it does it. This is a vital distinction that pushes your design towards correctness and flexibility.
-
My understanding of "programming to an interface" is different than what the question or the other answers suggest. Which is not to say that my understanding is correct, or that the things in the other answers aren't good ideas, just that they're not what I think of when I hear that term.
-
If the program was important enough, Microsoft might actually go ahead and add some hack to their implementation so the the program would continue to work, but the cost of that is increased complexity (with all the ensuing problems) of the Windows code. It also makes life extra-hard for the Wine people, because they try to implement the WinAPI as well, but they can only refer to the documentation for how to do this, which leads to many programs not working as they should because they (accidentally or intentionally) rely on some implementation detail.
-
Say you have software to keep track of your grocery list. In the 80's, this software would work against a command line and some flat files on floppy disk. Then you got a UI. Then you maybe put the list in the database. Later on it maybe moved to the cloud or mobile phones or facebook integration. If you designed your code specifically around the implementation (floppy disks and command lines) you would be ill-prepared for changes. If you designed your code around the interface (manipulating a grocery list) then the implementation is free to change.
-
It's more like providing an Employee object rather than the set of linked tables you use to store an Employee record. Or providing an interface to iterate through songs, and not caring if those songs are shuffled, or on a CD, or streaming from the internet. They're just a sequence of songs.
Tags
- software design
- Wine
- important distinction
- good example
- focus on _what_ it should do, not on _how_ it should do it (implementation details; software design)
- +0.9
- good point
- good advice
- what comes to mind (what one thinks of; meaning) when they hear something
- programming to an interface
- different way of thinking about something
- change is inevitable (needs, requirements, ...)
- implementation detail
Annotators
URL
-
-
www.merriam-webster.com www.merriam-webster.com
-
The word home, for instance, has a denotation of “the place (such as a house or apartment) where a person lives,” but it may additionally have many connotations (such as “warmth,” “security,” or “childhood”) for some people.
-
-
en.wikipedia.org en.wikipedia.org
-
Encapsulation is used to hide the values or state of a structured data object inside a class, preventing direct access to them by clients in a way that could expose hidden implementation details or violate state invariance maintained by the methods.
-
-
-
As I reported in #10, error keys get duplicated and we should namespace them. This code behaves right like AR::Base accept_nested_attributes
Tags
Annotators
URL
-
-
github.com github.com
-
class ConferencesController def create conference = Conference.new @conference_form = ConferenceForm.new(conference) @conference_form.submit(conference_params) if @conference_form.save redirect_to @conference_form, notice: "Conference: #{@conference_form.name} was successfully created." } else render :new end end end
Tags
Annotators
URL
-
-
-
It makes me happy to see people actually think about things and not just accept a shitty API.
Tags
- doing something without knowing why/how it works
- don't settle for/accept something that's not as good as it can be
- actually consider / think about how it _should_ (ideally) be
- less than ideal / not optimal
- can we do even better?
- describe the ideal hypothetical solution
- intentional/well-considered decisions
- "makes me happy when ..."
Annotators
URL
-
-
-
For now I feel ActiveForm is still a bit early to transition to a gem as there are still things to improve and work out. One day I'll invest more time into making it extendable and release it as a gem. For now I feel it's an unnecessary complexity.
If he's like most of us, though, this means it will never happen...
-
we get the benefit of isolating request specific logic without cramming it into a ActiveRecord model that will be used in multiple controllers/actions
request-specific logic
-
I typically save everything I can first, and then call the side-effects afterwards. If the side-effects fail I can handle them elsewhere and retry when necessary.
-
I've been over the use case for form objects in this post on moving away from fat models but wanted to go into more detail on how and why I use them here. I really believe in the utility of these objects; their ability to abstract and isolate logic in a simple and effective manner is unmatched, IMO.
Tags
- optimistic
- side effects
- simple
- reusability
- _-specific logic
- self-contained
- atomicity of operations (all or nothing; transaction)
- good solution
- important point
- abstractions
- good
- form objects
- irreversible
- good point
- isolation (programming)
- unpolished/unfinished
- planned feature
- good explanation
Annotators
URL
-
-
-
DSLs can be problematic for the user since the user has to manage state (e.g. am I supposed to call valid? first or update_attributes?). This is exactly why the #validate is the only method to change state in Reform.
-
-
github.com github.com
-
Top level architecture
-
class UsersController < ApplicationController def create success = -> (response, time) { redirect_to root_path, notice: "#{response} - at: #{time}" } failure = -> { render :new } Workflow::CreateUser.call(params[:name], success: success, failure: failure) end end
-
-
www.convinceandconvert.com www.convinceandconvert.com
-
Have you ever been emailed something from a company and tried to reply only to be frustrated with a failed-to-send message response? A no-reply email frustrates your customers.Instead, use a dedicated email to send out your messages and to keep business emails in a central location so you can answer customer concerns quickly and decisively. This level of customer service will help develop your reputation as a company that cares about its customers.
-
-
developer.android.com developer.android.com
-
An intent filter is an expression in an app's manifest file that specifies the type of intents that the component would like to receive. For instance, by declaring an intent filter for an activity, you make it possible for other apps to directly start your activity with a certain kind of intent. Likewise, if you do not declare any intent filters for an activity, then it can be started only with an explicit intent.
-
-
www.conversioner.com www.conversioner.com
-
Great pricing plan names that illustrate the type of plan you’re about to choose – from simple “hammering” for quick storage to the full blown “crane” offering unlimited storage.
-
-
-
100vw is 100% of the viewport width not accounting for scrollbars (unless the root element has anything other than overflow: auto set, but auto is the default value). Thus, when the page content overflows the viewport vertically, the browser renders the vertical scroll bar, which reduces the visible viewport area by a few pixels. But the 100vw value doesn't update to account for this, so the selected div retains the same width as before the vertical scrollbar appeared. This results in the horizontal scroll bar rendering.
-
-
hilton.org.uk hilton.org.uk
-
Unlike naming children, coding involves naming things on a daily basis. When you write code, naming things isn’t just hard, it’s a relentless demand for creativity. Fortunately, programmers are creative people.
-
If we renamed things more often, then it probably wouldn’t be so hard to name them in the first place.
-
This is funny because it’s unexpected. Cache invalidation sounds like a hard thing, while naming sounds more straightforward. The joke works because it violates our expectation that hard things should be technical. It’s also funny because it’s true.
-
Scalability is the problem you want to have, and sooner rather than later, but maintainability is the problem you’re definitely going to have, sooner or later.
-
Naming matters for both idealogical and practical reasons.
Tags
- problem you are definitely going to have
- scalability
- big change/rewrite vs. continuous improvements / smaller refactorings
- funny because it's unexpected
- good analogy
- creative
- good point
- naming things is hard
- cache invalidation is hard
- relentless
- naming
- non-technical problems
- software development
- the activity of _
- expectations
- creative people
- becomes/gets easier with practice/experience
- refactoring: rename
- good problem to have / problem you want to have
- why is it important? / why does it matter?
- contrast
- funny because it's true
- programming
- maintainability
- what programmers are like
- surprising
- naming: the importance of good names
- frequently encountered (common) problem
- well-written
- technical problems
- requires/demands creativity
- creativity
- quotable
Annotators
URL
-
-
www.reddit.com www.reddit.com
-
Space: Suppose we had infinite memory, then cache all the data; but we don't so we have to decide what to cache that is meaningful to have the cache implemented (is a ??K cache size enough for your use case? Should you add more?) - It's the balance with the resources available.
-
Time: Suppose all your data was immutable, then cache all the data indefinitely. But this isn't always to case so you have to figure out what works for the given scenario (A person's mailing address doesn't change often, but their GPS position does).
-
-
www.quora.com www.quora.com
-
So the hard and unsolvable problem becomes: how up-to-date do you really need to be?
-
After considering the value we place, and the tradeoffs we make, when it comes to knowing anything of significance, I think it becomes much easier to understand why cache invalidation is one of the hard problems in computer science
the crux of the problem is: trade-offs
-
the 2 hardest problems in computer science are essentially the 2 hardest problems of life in general, as far as humans and information are concerned.
-
The non-determinism is why cache invalidation — and that other hard problem, naming things — are uniquely and intractably hard problems in computer science. Computers can perfectly solve deterministic problems. But they can’t predict when to invalidate a cache because, ultimately, we, the humans who design and build computational processes, can’t agree on when a cache needs to be invalidated.
-
you began by first finding out if your crush was already in a relationship. If so, you then did what you could in your power to have the most most up-to-date information on their relationship status. The downside of outdated data is self-evident: you want to move in at the first sign of the current relationship dissolving.
Tags
- knowledge
- nondeterministic
- generalized explanation
- difficult/hard problem
- trade-offs
- good analogy
- good point
- cache invalidation is hard
- life in general
- cache invalidation
- good explanation
- good question
- deterministic
- where it shines / best application
- computers
- main/key/central/essential/core thing/point/problem/meat
- how good/perfect does it really need to be?
- hard things in computer science
Annotators
URL
-
-
www.honeybadger.io www.honeybadger.io
-
Now let me ask you, do you write JS for a single page application differently from a "traditional" web application? I sure hope you do! In a "traditional" application, you can get away with being sloppy because every time the user navigates to a new page, their browser destroys the DOM and the JavaScript context. SPAs, though, require a more thoughtful approach.
-
-
www.reddit.com www.reddit.com
-
Not to mention 80% of our sales are laptops and desktops running, you guessed it, a Linux desktop. So, unlike Red Hat and Canonical, we live or die based on how good that experience is.
-
the most productive environment possible for people that use their computer to create.What is a productive environment?How do you measure productivity in an operating system environment?How do you compare YOUR distribution to other distributions when it comes to productivity?Is the way in which 'people that use their computer to create' (creators) the same across all professions and activities?Does a photographer have the same requirements for a productive environment as a software engineer?Why do you think your distribution will be the best for delivering a productive environment than any other Linux distribution?
-
-
www.reddit.com www.reddit.com
-
Think about how much you want to customize the desktop environment(DE), and whether you know how to do so. Pick a distro that has the DE you like.
-
When people talk about "beginner distros" they mean distros that are no hassle to get started, it doesnt mean they are somewhat inferior or less capable.
-
-
-
Jan 2021. I use a small, dedicated enterprise grade SSD as a swap drive. These enterprise drives can be bought for as little as $80 for 240GB right now, and are 3D nand with load leveling and other valuable improvements for swap. By using the drive only for swap, you pretty much guarantee it won’t affect your expensive terabyte level data drive should it fail, and you still get the performance of SSD. Estimates for very heavy use are about 2 1/2 years.
-
-
css-tricks.com css-tricks.com
-
justify-content Sometimes the total size of your grid might be less than the size of its grid container. This could happen if all of your grid items are sized with non-flexible units like px. In this case you can set the alignment of the grid within the grid container.
-
-
alistapart.com alistapart.com
-
The first problem is that if you ever remove an item, there will be a big black block in the layout. Maybe that’s OK, but more likely it isn’t. The second problem is that grid containers do not, by default, shrink-wrap their items. Instead, they fill out the parent element, as block boxes do. Both of these problems are illustrated in Figure 6.
-
#ttt > * { border: 1px solid black; border-width: 0 1px 1px 0; display: flex; /* flex styling to center content in divs */ align-items: center; justify-content: center; } #ttt > *:nth-of-type(3n) { border-right-width: 0; } #ttt > *:nth-of-type(n+7) { border-bottom-width: 0; }
-
-
codepen.io codepen.io
-
css-tricks.com css-tricks.com
-
Your grid areas can only be rectangles (like the left), not arbitrary polygons (like the right).
-
-
developer.mozilla.org developer.mozilla.org
-
.box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1; grid-row-end: 3; } .box2 { grid-column-start: 1; grid-row-start: 2; grid-row-end: 4; }
-
-
stackoverflow.com stackoverflow.com
-
If you're creating an actual, informational web page, stick to frameless HTML, CSS and unobstrusive JavaScripts and keep in mind that the page should still be usable with scripting disabled.
-
-
stackoverflow.com stackoverflow.com
-
Then recently I was shopping at the John Lewis website, and they brought up the Verified By Visa page in an iframe - wonderful! I'm still looking at the John Lewis site, and all that's happening is I'm being asked for my Verified By Visa password - no problem. Although as a web developer I know that there's no technical difference between that and a plain old redirect-there-redirect-back, the user experience is so much better!
-
-
medium.com medium.com
-
hilarious sarcasm
-
I’m harvesting credit card numbers and passwords from your site. Here’s how.
-
-
-
The "World Population", "Born with No Access to the Gospel Today", "Deaths without Christ Today" counters are sobering.
Tags
Annotators
URL
-
- Jan 2021
-
www.pnas.org www.pnas.org
-
Science’s culture of critique discourages groupthink, countermands the effects of human biases, and protects knowledge, not only by rewarding a dispassionate stance toward the subject and institutionalizing organized skepticism but also by fostering competition among scientists able to replicate and hence challenge each other’s work.
Great aspirations, but how well are they actually achieved in practice/reality?
Tags
Annotators
URL
-
-
blog.linuxmint.com blog.linuxmint.com
-
We can certainly explain the issues snap cause without using political or religious arguments. We did so in the documentation I linked to above.
-
-
unix.stackexchange.com unix.stackexchange.com
-
For the future, you should: Install LTS (Long-term support) versions as they have an 8-year life span (with Extended Security Maintenance) or 5 years without. The current LTS version is Ubuntu 18.04.1 LTS Bionic Beaver released on July 26, 2018 with an EOL in April 2023. OR Carefully watch the EOL of the interim / development releases and upgrade frequently.
-
-
api.rubyonrails.org api.rubyonrails.org
-
config.action_mailer.register_preview_interceptor :css_inline_styler
That's probably the same hook that https://github.com/fphilipe/premailer-rails ties into, for it says:
Emails are only processed upon delivery, i.e. when calling
#deliver
on the email, or when previewing them in rails.
-
-
github.com github.com
-
Previewing You can create a controller that gets the email and then renders the body from it.
mailer preview
-
-
github.com github.com
-
The following Sankey flow diagram shows the current glyph sets included:
-
-
developer.mozilla.org developer.mozilla.org
-
The background-origin CSS property sets the background's origin: from the border start, inside the border, or inside the padding.
-
-
css-tricks.com css-tricks.com
-
Try out the different border-image-repeat values in this demo
-
-
github.com github.com
-
Very good guidelines, with several of them useful for any programming languages. Links to interesting
node.js
packages.
-
-
en.wikipedia.org en.wikipedia.org
-
Content is like water
-
-
www.ncbi.nlm.nih.gov www.ncbi.nlm.nih.gov
-
cellular data recorders offer the capacity to measure biologically relevant signals15,16,17,18,19 in places that are otherwise difficult to access, such as inside the body20,21, and over time22
-
-
-
Maybe $$slots like $$props? My use case is that I'd like to wrap a slot's content in an element that applies styling that I'd like absent without the slotted content. Something like this: {#if $$slots.description} <div class="description"> <slot name="description"></slot> </div> {/if}
-
It isn’t always guaranteed to be a single root element, in that case it could return an array of elements?
-
-
svelte.dev svelte.dev
-
github.com github.com
-
Basically the typescript compiler emits no code for interfaces, so webpack can not find them in the compiled module; except when a module consists of only interfaces. In that case the module will end up completely empty and then webpack will not investigate the exports.
-
-
github.com github.com
-
I want to make some add-ons or wrappers on components e.g BigButton.svelte <script> import Button from './Button.svelte' </script> <Button fz="16" h="64" {...$$props}> <slot slot="prepend" name="prepend" /> <slot /> <slot slot="append" name="append" /> </Button>
-
-
github.com github.com
-
I don't know what I'd expect this to do, if not create an infinite loop. You're asking Svelte to do something before every update, and one of the things you're asking it to do is to flush any pending changes and trigger an update.
-
-
svelte.dev svelte.dev
Tags
Annotators
URL
-
-
svelte.dev svelte.dev
-
beforeUpdate(async () => { console.log('the component is about to update'); await tick(); console.log('the component just updated'); });
-
-
en.wikipedia.org en.wikipedia.org
-
In other words, programs that send messages to other machines (or to other programs on the same machine) should conform completely to the specifications, but programs that receive messages should accept non-conformant input as long as the meaning is clear.
-
-
stackoverflow.com stackoverflow.com
-
The use:action method seems cleaner, but aside from that, are there any underlying differences between these two methods that would make one preferred over the other in certain situations?
-