- Mar 2021
-
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
- neutral/unbiased/agnostic
- JavaScript
- good idea
- everyone has different preferences
- +0.9
- separation of concerns
- competition in open-source software
- runtime environment
- software project created to address shortcomings in another project
- programming languages: choosing the best language for the job
- good point
- avoid giving partiality/advantage/bias to any specific option
- reaction / reacting to
- level playing field
- non-technical reasons
- everyone has different background/culture/experience
- neutral ground
- JavaScript: as a process VM
- software preferences are personal
- what is important/necessary for one person may not be for another
- annotation meta: may need new tag
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
- good point
- complicated/intricate
- work: doing what you love
- boring
- doing what you love: leaving what's boring to you for others
- complicated
- bookkeeping
- receiving money: is it worth the hassle/responsibility of bookkeeping?
- system architecture/design diagram/illustration
- good explanation
- unfun
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
- good point
- advantages/merits/pros
- calling something what it actually is (semantic labeling)
- semantic meaning
- consistency across all platforms
- example
- conveys more information (semantic)
- good example
- semantic markup
- reasonable defaults
- simple explanation
- be specific
- definition
- semantically correct
- good explanation
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
- welcome/good change
- finally / at last
- community-driven development
- knowledge commons (information/data/content)
- I agree
- non-free content
- free content
- I'm glad they did it this way
- focus on the user
- differences of opinion/perspective are good
- annotation meta: inherit same annotation/tags
- documentation
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
- reminder
- open-source software: not contributing new code back to project
- neutral/dispassionate/impartial/objective wording
- loophole/escape hatch
- proprietary software
- annotation meta: may need new tag
- wording designed to be more palatable/pleasing/inoffensive
- well-written
- good point
- software licensing
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
- ActiveModel: errors: merging errors
- JavaScript
- ruby
- good idea
- expected behavior
- good analogy
- use case
- _ is to _ (analogy)
- comparison
- good example
- active_interaction
- good point
- reasonable behavior
- unclear
- misleading
- 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)
- ActiveRecord
- confusing
- polymorphism
- reasonable defaults
- important point
- interesting idea
- useful
- error/exception handling
- undefined vs. null
- good explanation
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
- what comes to mind (what one thinks of; meaning) when they hear something
- Wine
- programming to an interface
- good advice
- +0.9
- different way of thinking about something
- good example
- implementation detail
- software design
- focus on _what_ it should do, not on _how_ it should do it (implementation details; software design)
- important distinction
- good point
- change is inevitable (needs, requirements, ...)
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
- describe the ideal hypothetical solution
- doing something without knowing why/how it works
- "makes me happy when ..."
- less than ideal / not optimal
- can we do even better?
- don't settle for/accept something that's not as good as it can be
- actually consider / think about how it _should_ (ideally) be
- intentional/well-considered decisions
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
- simple
- good point
- form objects
- _-specific logic
- good solution
- side effects
- optimistic
- isolation (programming)
- irreversible
- self-contained
- planned feature
- good
- important point
- atomicity of operations (all or nothing; transaction)
- reusability
- unpolished/unfinished
- abstractions
- 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
- quotable
- what programmers are like
- creativity
- good analogy
- funny because it's true
- frequently encountered (common) problem
- big change/rewrite vs. continuous improvements / smaller refactorings
- contrast
- programming
- maintainability
- naming
- good point
- good problem to have / problem you want to have
- surprising
- naming: the importance of good names
- creative
- expectations
- the activity of _
- becomes/gets easier with practice/experience
- refactoring: rename
- cache invalidation is hard
- scalability
- why is it important? / why does it matter?
- software development
- technical problems
- requires/demands creativity
- non-technical problems
- creative people
- funny because it's unexpected
- problem you are definitely going to have
- relentless
- well-written
- naming things is hard
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
- nondeterministic
- life in general
- good analogy
- computers
- where it shines / best application
- deterministic
- difficult/hard problem
- generalized explanation
- hard things in computer science
- good point
- good explanation
- cache invalidation is hard
- cache invalidation
- trade-offs
- how good/perfect does it really need to be?
- knowledge
- good question
- main/key/central/essential/core thing/point/problem/meat
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?
-
-
atomiks.github.io atomiks.github.io
-
This is a dynamic value because of hybrid devices which can use a mix of mouse and touch input.
-
You may want the tippy to appear at a different location from its trigger (event listeners) target. For example:
-
-
developer.mozilla.org developer.mozilla.orgz-index1
-
stackoverflow.com stackoverflow.com
-
if you set text-decoration: underline for all links then you will have to set text-decoration: none for special links which you don't need an underline.
-
-
material.io material.ioDialogs1
-
Avoid apologies (“Sorry for the interruption”), alarm (“Warning!”), or ambiguity (“Are you sure?”)
-
-
www.wnycstudios.org www.wnycstudios.org
-
we had to change society
yep
-
-
stackoverflow.com stackoverflow.com
-
For example, we might request some data from a stock exchange API, and along with our usual API parameters, we give it a callback, like ?callback=callThisWhenReady. The web service then wraps the data with our function and returns it like this: callThisWhenReady({...data...}). Now as soon as the script loads, your browser will try to execute it (as normal), which in turns calls our arbitrary function and feeds us the data we wanted.
-
-
discourse.ubuntu.com discourse.ubuntu.com
-
It’s all very well telling Canonical what to do, but someone needs to pay those developers for their time. It’s not free.
-
Repeatedly posting in this thread that there are problems, won’t actually get anything fixed.
-
The best place to let the developers know, and track those bugs is in the bug tracker. There are hundreds of forums online, all over the place in many languages. We can’t be expected to read all of them. Anyone with a launchpad ID (thus, anyone who has an account on this discourse instance) has the capability to file a bug. I’d strongly recommend doing so, for each specific issue. Taking just a few minutes to do that will help tremendously.
-
Just saying “snaps are slow” is not helpful to anyone. Because frankly, they’re not. Some might be, but others aren’t. Using blanket statements which are wildly inaccurate will not help your argument. Bring data to the discussion, not hearsay or hyperbole.
-
Progress is made of compromises, this implies that we have to consider not only disadvantages, but also the advantages. Advantages do very clearly outweigh disadvantages. This doesn’t mean it perfect, or that work shouldn’t continue to minimize and reduce the disadvantages, but just considering disadvantages is not the correct way.
-
Only folks who help package Chromium get to decide how Chromium gets packaged. This gives anyone two options: You can get involved and help package Chromium so you have a voice in the decision-making, or not.
-
Get back to Chromium : how its evolution will be handled by Debian ? How its cousin-sister-child projects will be handled ( vivaldi, brave, electron… ) ?
Tags
- hasty generalization
- get involved
- bug reports
- +0.9
- the needs of the many outweigh the needs of the few
- progress requires compromises
- discussion
- be specific
- "me too"
- compromise
- good point
- don't just complain; help improve/fix things
- software performance
- unhelpful
- helpful
- discussion without action
- progress
- Snap
- faulty generalization
- dichotomous thinking
- trade-offs
- focus on ways/what you can improve
- not adding to discussion
- improving one's process
- having a voice in decision-making
- do pros outweigh/cover cons?
- good question
- constant evolution/improvement of software/practices/solutions
Annotators
URL
-
-
www.alfiekohn.org www.alfiekohn.org
-
They may skim books for what they’ll “need to know.” They’re less likely to wonder, say, “How can we be sure that’s true?” than to ask “Is this going to be on the test?”
This is completely true! As a student we honestly do not care about anything, as long as our grade is an A. I hate that it is true, because sometimes as a student, I just want to really learn for a second. Although it is nearly impossible when pressured is applied based on a letter grade that may or may not affect one's life. This class is really helping realize that it is not me, is that pressure kills the beauty of learning.
-
-
-
Explained: Reason for the “The following packages have been kept back” error and how it was fixed The above suggested fix should solve the problem for you. But are you curious what caused the error and how was it fixed? Let me explain that to you. Normally, when you run the sudo apt update and sudo apt upgrade commands, it updates all the installed packages to their available newer versions. However, if the dependencies of an installed package have been changed such that it requires installation of new packages, the installed package won’t be upgraded with the system update and you’ll see package kept back error.
-
-
askubuntu.com askubuntu.com
-
but you're probably better off learning a bit more about APT and resolving the dependency issues "by hand" by installing and removing packages on a case-by-case basis. Think of it like fixing a car... if you have time and are handy with a wrench, you'll get some peace of mind by reading up and doing the repair yourself. If you're feeling lucky, you can drop your car off with your cousin dist-upgrade and hope she knows her stuff.
-
-
material.io material.io
-
Small components can set the size of their corner shape using a percentage of the absolute height of the component. This means the corner shape will change as the component height changes.
-
-
material.io material.ioButtons2
-
Dialogs use text buttons because the absence of a container helps unify the action with the dialog text. Align text buttons to the right edge for left-to-right scripts.
-
Text buttons are often embedded in contained components like cards and dialogs, in order to relate themselves to the component in which they appear. Because text buttons don’t have a container, they don’t distract from nearby content.
-
-
css-tricks.com css-tricks.com
-
The trouble with leaving the verb off is that if a user experiencing low or no vision is browsing with the aid of a screen reader, they may not be able to determine what the noun is for. Screen readers can scrape the current page and create lists by content type (headings, links, buttons, etc.) for easer navigation. Static text that is placed in visual proximity to the download links will not come along for the ride if accessed via this method. While it might seem redundant to show the word “download” over and over again, including it can go a long way to providing context for users navigating without visual aids, or who have zoomed the page’s content to the point where the layout may not communicate the visual relationship.
-
What if your download UI element isn’t just for a single static asset, but is actually generating a custom file when you press it? For example, if you have a list of files, you can check as many as you want, and pressing a download UI element zips those files together and then downloads that one file. In this case, we’d be using JS anyway, and the UI element is triggering more than just the link, it is ‘performing actions’, so a button would make sense, right?
-
One lesser-appreciated user-behaviour is when a user would like to choose an alternative download location. On a download link, your user can right-click -> “save link as…” and place the download directly into a folder of their choice. Handy if you want something to go directly to removable media, for example. On a download button, there’s no such option.
-
We can lay blame for this semantic drift squarely at the feet of trend. Designers and developers eager to try the latest and greatest invite ambiguity in with outstretched arms. Leadership chases perceived value to stay relevant.
-
Some may feel that the presence of the download attribute is redundant when applied to links the browser already knows to store. I disagree.
-