- Mar 2021
-
github.com github.com
-
I agree about lack of maintenance. It's probably because people use more and more Webpack.
-
But I can describe a simple reproduction case to demonstrate the developer inconvenience (can provide a sample app if it's helpful).
Tags
- shift in preference
- sprockets
- switching/migrating to something different
- providing an example app (minimal reproducible example)
- abandoning/migrating away from
- falling out of favor
- unfortunate that this is no longer maintained
- webpack
- switching/migrating from Sprockets to Webpack (Rails)
- minimal reproducible example
Annotators
URL
-
-
www.codetriage.com www.codetriage.com
-
If you end up finding and fixing a bug in your code, consider re-reading the documentation and seeing if that behavior of the library is unclear. Consider sending a documentation PR.
-
If you want the issue fixed as fast as possible, then you should try to help the maintainers as much as possible. Make an example app! Even if it takes extra time for you, it will ultimately lead to your issues getting fixed faster.
-
Finally: Give a link to the example app to a maintainer (usually through an issue).
-
An example app is an application that is designed to reproduce a bug or demonstrate an issue.
-
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?
Tags
- opportunity to improve/fix something
- good explanation
- providing an example app (minimal reproducible example)
- help them help you
- avoid wasting maintainers' time so they have more time to work on important things
- answer the "how?"
- wasteful/inefficient use of resources
- valuing people's time
- minimal reproducible example
Annotators
URL
-
-
math.stackexchange.com math.stackexchange.com
-
What is the difference between equation and formula?
-
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.
-
I think that over time the distinction is lost. My math teacher, 35 years ago stated "formulas are used in chemistry, in math we have equations". To this day, the word 'formula' in math seems wrong, but I'd accept it's used commonly.
-
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.
-
An equation is any expression with an equals sign, so your example is by definition an equation. Equations appear frequently in mathematics because mathematicians love to use equal signs. A formula is a set of instructions for creating a desired result. Non-mathematical examples include such things as chemical formulas (two H and one O make H2O), or the formula for Coca-Cola (which is just a list of ingredients). You can argue that these examples are not equations, in the sense that hydrogen and oxygen are not "equal" to water, yet you can use them to make water.
-
-
-
Using these attributes will show validation errors, or limit what the user can enter into an <input>.
-
Rails still encourages you to dump all validation errors at the top of a form, which is lulzy in this age of touchy UX
-
The HTML5 form validation techniques in this post only work on the front end. Someone could turn off JavaScript and still submit jank data to a form with the tightest JS form validation.To be clear, you should still do validation on the server.
-
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.
-
-
Dave Rupert has a good solution that uses an input's invalid event. Instead of using the :invalid pseudo selector, he adds a CSS class to the input when it becomes invalid. We will extend this approach by removing the CSS class when the element becomes valid again.
-
The input is required and initially empty, so on page load the input is :invalid and border is red. :( :(The input is :invalid until you type a legit email address, so it is red when typing. :( :(Ok, so the :invalid pseudo selector is kind of useless. Ideally we would not show an error up front or the whole time they are typing, just when they submit something unacceptable.
Tags
- reference
- old way of doing things
- HTML: constraint validation
- can we do even better?
- rails: the Rails way
- unfortunate defaults
- validation: server-side: need it even if you have client-side validation
- see content below
- arbitrary limitations leading to less-than-ideal workarounds
- good enough
- validation: server-side
- unfortunate
Annotators
URL
-
-
-
-
Last week, I shared how to check if an input is empty with CSS. Today, let’s talk about the same thing, but with JavaScript.
-
We don’t want to invalidate the input if the user removes all text. They may need a moment to think, but the invalidated state sets off an unnecessary alarm.
-
-
stackoverflow.com stackoverflow.com
-
The valueAsNumber IDL attribute represents the value of the element, interpreted as a number. On getting, if the valueAsNumber attribute does not apply, as defined for the input element's type attribute's current state, then return a Not-a-Number (NaN) value.
-
Your expectations are reasonable considering the property name, but
-
-
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).
-
If you would like to make “empty” include values that consist of spaces only, you can add the attribute pattern=.*\S.*.
-
You can use the :placeholder-shown pseudo class. Technically a placeholder is required, but you can use a space instead.
-
Semantically this is wrong.
-
There is (currently) no CSS selector for detecting directly whether an input control has a nonempty value, so we need to do it indirectly, as described above.
-
Generally, CSS selectors refer to markup or, in some cases, to element properties as set with scripting (client-side JavaScript), rather than user actions. For example, :empty matches element with empty content in markup; all input elements are unavoidably empty in this sense. The selector [value=""] tests whether the element has the value attribute in markup and has the empty string as its value. And :checked and :indeterminate are similar things. They are not affected by actual user input.
-
The selector [value=""] tests whether the element has the value attribute in markup and has the empty string as its value.
Tags
- missing feature leading to less-than-ideal workarounds
- semantically correct
- HTML: constraint validation
- HTML
- important point
- limitations leading to workarounds
- CSS: pseudo class
- missing feature
- not:
- good explanation
- CSS
- HTML: constraint validation: pattern
- CSS: selectors
- good example
- important distinction
- DOM: properties vs. attributes
Annotators
URL
-
-
feedback.dekudeals.com feedback.dekudeals.com
Tags
Annotators
URL
-
-
store.steampowered.com store.steampowered.com
-
One word for each aspect of this game. Story - N/A.Gameplay - Excellent.Graphics - Minimal.Sound - Splendid.Music - Elegant.Overall - Delightful.
-
-
store.steampowered.com store.steampowered.com
-
If you plan on using a gamepad with big picture mode I made a config that works perfectly so check it out.
-
There are myriads of platformers around, it's an oversaturated market, and just like industrial designer Karim Rashid said about there being no excuse by this point to make an uncomfortable chair, there's no excuse by this point to make a boring patformer.
-
-
css-tricks.com css-tricks.com
-
Positively indicate valid input values Let users know a field has been entered correctly. The browser can give us this information through the :valid CSS selector:
-
-
it does require some CSS trickery to get everything just right
-
Assuming wonderful support, this is how the logic would play out…
-
But there doesn’t appear to be a simple way to test for :placeholder-shown.
-
You can’t use @supports for selectors, only property/values (e.g. @supports (display: flex))
first sighting CSS: @supports
-
We’re not really using placeholder in our demo, but a value of a single space works:
-
:placeholder-shown is super useful for us here! It’s basically the secret selector for testing if an input currently has a value or not.
-
You’d think :empty would be it, but it’s not. That’s for matching things like <p></p>… container elements with nothing inside them. Inputs are no-content elements already.
-
Sub trick!
-
You don’t need to do any tricky cursor stuff, because it’s all semantically wired up already.
-
always use real <label for="correct_input"> elements. Just that alone is a UX consideration all too many forms fail on
-
Placeholders are suggestions for valid input, like putting “Tulsa” in an input labeled “City”.
-
I’d say if the form is short and an obvious pattern (like sign up or log in), you could use the placeholder visual pattern, but use real labels instead.
-
If they click the area taken up by the label, it will activate the input. If they click the input, it will activate the input. Both correct.
-
You can do and impressive amount of form validation with just HTML attributes. You can make the user experience pretty clean and clear with CSS selectors.
Tags
- distinction
- semantically correct
- taken to its logical conclusion
- recommended option/alternative
- first sighting
- UI: labels
- clever
- form design: validation feedback
- clever solution
- best practices
- feature detection
- fun wording
- semantic markup
- trickery
- subitem/subcase/subcategory/subheading
- limitations leading to workarounds
- missing feature
- forms
- it's just plain/pure HTML/CSS
- tricky
- HTML: label
- how to do it correctly and avoid common mistakes/pitfalls
- easy to falsely assume
- explanation
- CSS
- tutorial
- excellent technical writing
- easy to confuse (mix up)
- CSS: @supports
- form design: validation error display
- advantages/merits/pros
- definition
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
When you code in a semantic way, you basically give meaning to the data you're describing.
-
Usually when people are talking about code being semantically correct, they're referring to the code that accurately describes something.
-
HTML elements have meaning. "Semantically correct" means that your elements mean what they are supposed to.
-
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.
-
Browsers can correctly apply your CSS (Cascading Style Sheets), describing how each type of content should look. You can offer alternative styles, or users can use their own; as long as you've labeled your elements semantically, rules like "I want headlines to be huge" will be usable.
-
Screen readers for the blind can help them fill out a form more easily if the logical sections are broken into fieldsets with one legend for each one. A blind user can hear the legend text and decide, "oh, I can skip this section," just as a sighted user might do by reading it.
-
Mobile phones can switch to a numeric keyboard when they see a form input of type="tel" (for telephone numbers).
-
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.
-
All of this semantic labeling helps machines parse your content, which helps users.
-
-
Fits the ideal behind HTML HTML stands for "HyperText Markup Language"; its purpose is to mark up, or label, your content. The more accurately you mark it up, the better. New elements are being introduced in HTML5 to more accurately label common web page parts, such as headers and footers.
-
Yes, but honestly, and no offense intended, but I don't see the harm in these type questions, nor why some people are offended when they are asked. If I owed a website, I wouldn't mind it because it just creates more pages that can be indexed. I see it as helping the website. But, I did look and didn't see a simple answer. Again, no offense is intended. I've just never understood the complaints.
Tags
- simple explanation
- what's wrong with _?
- semantically correct
- duplicate question/issue/post
- be specific
- politeness
- calling something what it actually is (semantic labeling)
- explicit meaning
- semantic markup
- good point
- example
- why are people bothered/offended by this?
- web: accessibility
- semantic meaning
- good explanation
- conveys more information (semantic)
- explanation
- fundamental principles/paradigm of the Web
- reasonable defaults
- consistency across all platforms
- use meaningful names (programming)
- good example
- advantages/merits/pros
- definition
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
Currently, there is no way to style those little validation tooltips.
-
-
tylergaw.com tylergaw.com
-
Brass tacks:
-
Demos; Style 01, Style 02, Style 03 and the code.
-
-
tylergaw.com tylergaw.com
-
The source for all versions is available on GitHub.
-
My collection (this isn’t all of it) grows at a comical pace.
-
Having them in a physical form is good for my soul.
-
This is a non-exhaustive list of other things I love;
-
Spending an hour digging through bins in a record store is one of my favorite ways to clear my head. And then spend too much money.
-
Designing and writing code get me money so I can have food so they get a lot of my attention.
-
I get asked a lot which I want to do more; design or write code? I answer, “yes.”
-
Being a better designer makes me a better engineer and being a better engineer makes me a better designer.
-
;
:
-
;
:
-
There are plenty of words and acronyms you can put in front of “Designer”. Product, Web, Graphic, UX, UI, IA, etc. The lines between each are blurry, and the titles go in and out of fashion. Depending on the project and team I’m working alongside, I practice them all to varying degrees. I prefer to call myself; “A Designer.”
-
Tags
- transparency
- finding time for what you love doing
- not:
- source repository for personal web site
- typo
- design (general)
- "what I like"
- mutually exclusive
- collecting
- collecting more books/etc. than you will ever be able to read/etc.
- "what I like to do"
- preferring to have them in physical form (books, …)
- funny
- fun wording
- bio
Annotators
URL
-
-
bugs.chromium.org bugs.chromium.org
-
This is a huge disadvantage to all web developers. Why can't we at least have the ability to turn validation messages off? Why do we have to re-implement a validation system when you already have one in place, but all we want is the validation aspect and not the built in messaging? By taking away the ability to style elements that CHROME adds to the browser window, it is hurting developers professional appearance. We just want to use Chrome's WONDERFUL validation system with our own error messages. Either let us style them, or let us hide them, but don't make us re-invent the wheel just because you don't want our code to be "browser specific". Writing a new validation system just for Chrome is going to be much more "browser (chrome) specific" code than setting "::-webkit-validation-bubble, ::-webkit-validation-bubble * { display: none; }. This isn't just an annoyance, it's a huge disadvantage to any developer who wants to easily utilize Chrome's built in validation. I usually brag about how wonderful Chrome is, but I'm starting to think it's heading in another direction...
-
-
-
-
-
girliemac.com girliemac.com
-
the client form validation is the one I like a lot, because, for example, by adding required attribute to an input, I don’t need to write any additional JavaScript to warn a user, when the user submits a form without filling out the required fields
-
There are numerous user interface state pseudo-classes. You’ve probably already known :hover, :active etc. According to this W3C Candidate Doc, there are additional pseudo-classes defined, such as :valid, invalid, in-range, out-of-range, required, optional, read-only and read-write.
-
-
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
-
-
stackoverflow.com stackoverflow.com
-
The document.evaluate() method evaluates an XPATH query/expression. So you can pass XPATH expressions there, traverse into the HTML document and locate the desired element.
-
Array.from(document.querySelectorAll('div')) .find(el => el.textContent === 'SomeText, text continues.');
-
-
stackoverflow.com stackoverflow.com
-
The TreeWalker API gives you only the #text Nodes, and then you do what you want with them.
first sighting: TreeWalker 
-
You could also use the NodeIterator API, but TreeWalker is faster
-
All those 'modern' and 'super-modern' querySelectorAll("*") need to process all nodes and do string comparisons on every node.
-
the fastest solution because the main workload is done by the Browser Engine NOT the JavaScript Engine
-
[...document.querySelectorAll("*")].filter(e => e.childNodes && [...e.childNodes].find(n => n.nodeValue?.match("❤")))
-
Super modern one-line approach with optional chaining operator
-
Possibly use Array.prototype.filter.call instead of allocating a new array.
-
function contains(selector, text) { var elements = document.querySelectorAll(selector); return [].filter.call(elements, function(element){ return RegExp(text).test(element.textContent); }); }
-
-
developer.mozilla.org developer.mozilla.org
-
stackoverflow.com stackoverflow.com
-
This only works provided each element has a label. It will not work if you put the attribute on the element itself, because <input> elements cannot have :after pseudo elements.
-
label:after { content: attr(data-invalid); ... }
-
This question was asked over a year ago, but it's a good question that I recently encountered as well...
-
var applicationForm = document.getElementById("applicationForm"); if (applicationForm.checkValidity()) { applicationForm.submit(); } else { applicationForm.reportValidity(); }
-
-
webdevtrick.com webdevtrick.com
-
:placeholder-shown
-
-
stackoverflow.com stackoverflow.com
-
Does there exist a Unicode new-line, which I could copy-paste? (PLEASE NOTE, I DON'T ASK ABOUT THE CODE, like U+000D or whatever is considered as new line. I want the "copyable" output, like the above space (which I have put above in brackets and can be copied). So, if there is, please paste it in your answer, so I could copy it, like you copy the unicode space above from brackets.
-
-
www.html5rocks.com www.html5rocks.com
-
-
Therefore client side validation should always be treated as a progressive enhancement to the user experience; all forms should be usable even if client side validation is not present.
-
It's important to remember that even with these new APIs client side validation does not remove the need for server side validation. Malicious users can easily workaround any client side constraints, and, HTTP requests don't have to originate from a browser.
-
Since you have to have server side validation anyways, if you simply have your server side code return reasonable error messages and display them to the end user you have a built in fallback for browsers that don't support any form of client side validation.
-
workaround
-> work around
-
Validating forms has notoriously been a painful development experience. Implementing client side validation in a user friendly, developer friendly, and accessible way is hard. Before HTML5 there was no means of implementing validation natively; therefore, developers have resorted to a variety of JavaScript based solutions.
Tags
- missing feature leading to less-than-ideal workarounds
- HTML: constraint validation
- good tutorial
- validation: server-side: need it even if you have client-side validation
- typo
- graceful degradation / progressive enhancement
- HTML5
- difficult/hard problem
- validation: server-side
- introduction/primer
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
stackoverflow.com stackoverflow.com
-
I used this in the console to find the file and the line of the error (took it from this answer): JS_PATH = "app/assets/javascripts/**/*.js"; Dir[JS_PATH].each do |file_name| puts "\n#{file_name}" puts Uglifier.compile(File.read(file_name)) end
Didn't work for me because it was actually a .coffee file.
So I tried something similar with this:
main > Dir["*/assets/javascripts/**/*.coffee"].each { |file_name| puts "\n#{file_name}"; Sprockets::CoffeeScriptProcessor.(filename: file_name, data: File.read(file_name), cache: {}); } app/assets/javascripts/bootstrapped.js.coffee NoMethodError: undefined method `config' for nil:NilClass from /home/tyler/.gem/ruby/2.7.1/gems/sprockets-4.0.2/lib/sprockets/source_map_utils.rb:40:in `format_source_map'
but it wasn't as trivial to provide the necessary environment that Sprockets wants.
But that's okay, when better_errors paused on the exception, I just jumped to the
block in Sprockets::CoffeeScriptProcessor.call sprockets (4.0.2) lib/sprockets/coffee_script_processor.rb, line 24
frame and evaluated
input[:filename]
to figure out which file had failed.
Obviously this information should be part of the error message itself though!!
-
I know this is old, but I got the same error and I came here from Google, so in case someone does too, this was my solution:
-
-
github.com github.com
-
afarkas.github.io afarkas.github.ioWebshim4
-
If set to true the UI of all input widgets (number, time, month, date, range) are replaced in all browsers (also in browser, which have implemented these types). This is useful, if you want to style the UI in all browsers.
-
Webshim is opinionated, that a developer should always solve a problem the HTML5 way.
-
Webshim is also more than a polyfill, it has become a UI component and widget library. Webshim enables a developer to also enhance HTML5 capable browsers with more highly customizable, extensible and flexible UI components and widgets.
And now that it's deprecated (presumably due to no longer needing these polyfills), not only do the polyfills go away (no longer maintained), but also these unrelated "extras" that some of us may have been depending on are now going away with no replacement ...
If those were in a separate package, then there would have been some chance of the "extras" package being updated to work without the base webshims polyfills.
In particular, I was using
$.webshims.addCustomValidityRule
which adds something that you can't do in plain HTML5 (that I can tell), so it isn't a polyfill... -
-
-
html.spec.whatwg.org html.spec.whatwg.org
-
Fires an invalid event at the element
First time I've seen/heard it said that an event is fired at some target. But it sure makes sense, since it matches how "fire" is used in other senses (like shooting a gun).
-
-
stackoverflow.com stackoverflow.com
-
answered May 9 '13 at 15:29 alexander farkas
-
-
stackoverflow.com stackoverflow.com
-
You can't just use arbitrary pseudo selectors and expect it work. It's like me trying to speak Spanish in Japan and expecting japanese people to understand what I'm saying
-
-
mychartwa.providence.org mychartwa.providence.org
-
We’re doing our part to be more transparent and get data into the hands of patients quicker. Starting October 25, 2020, we’ll be releasing test results, visit notes and summaries immediately. Your provider may take up to three to five days to review your results and contact you to discuss abnormal results. Learn more here.
-
-
github.com github.com
-
markdown-it is the result of the decision of the authors who contributed to 99% of the Remarkable code to move to a project with the same authorship but new leadership (Vitaly and Alex). It's not a fork.
-
var md = require('markdown-it')('commonmark');
first sighting: require(...)(...)
How would that work with import? Not as fluidly but...
import markdownIt from 'markdown-it' let md = markdownIt('commonmark')
-
-
+ adds syntax extensions
-
Configurable syntax! You can add new rules and even replace existing ones.
-
Community-written plugins and other packages on npm.
Tags
- distinction
- nice API
- first sighting
- forking
- open-source software: transferring project to new maintainer
- configurable
- interesting approach/solution
- Markdown
- not:
- controversial
- easily extensible with plugins/extensions
- extension API
- disagreement
- syntax extensions
- CommonMark
- change of leadership
- javascript libraries
- competition in open-source software
Annotators
URL
-
-
code.visualstudio.com code.visualstudio.com
-
runtimes (such as .NET and Unity)
Tags
Annotators
URL
-
-
store.steampowered.com store.steampowered.com
-
-
Starting the Game is a game about a non-experienced gamer who is trying to download, crack and play a game.
-
-
store.steampowered.com store.steampowered.com
-
Playing it now, I realise that the game isn't necessarily any easier - I'm just more patient.
Tags
Annotators
URL
-
-
store.steampowered.com store.steampowered.com
-
i need to write review so i get my badge
-
-
store.steampowered.com store.steampowered.com
-
Posting an issue on the discussion boards for a three year old game, yesterday, I wasn't holding my breath for a reply. Earlier, this morning, a dev. responded, stating they'd look at fixing it, and it was just a few hours before it were sorted!
-
-
boardgamegeek.com boardgamegeek.comDawn1
-
Players try to build a village together. As the game goes on each player secretly chooses whether they want to go for a coop victory or a single-player win.
-
-
boardgamegeek.com boardgamegeek.com
-
Dawn - March 15 Dawn on Titan - March 15
-
-
www.kickstarter.com www.kickstarter.com
-
We often are too busy. We spend our days occupied by a multitude of worries. One day, I realized that my time left in this life was getting shorter and shorter. For the first time, I felt regret and wondered, “Where did my time go?”
-
-
www.kickstarter.com www.kickstarter.com
-
Try before you buy Here's a link to the game on Tabletopia: Judean Hammer on Tabletopia
-
-
stackoverflow.com stackoverflow.com
-
// A general key transform method. Pass it a function that accepts the old key and returns // the new key. // // @example // obj = transformKeys(obj, (key) => ( // key.replace(/\b(big)\b/g, 'little') // )) export function transformKeys(source, f) { return Object.entries(source).reduce((o, [key, value]) => { o[f(key) || key] = value return o }, {}) } // Provide an object that maps from old key to new key export function rekeyObject(source, keyMap) { transformKeys(source, key => keyMap[key]) }
-
function objectMap(source,keyMap) { return Object.entries(keyMap).reduce((o,[key , newKey]) => { o[newKey]=source[key] return o;},{}) }
-
Here's another plain ES2015/2017 version
-
You really don't need underscore/lodash for this ... nowadays anyways
-
I realize the question was asked 9 years ago, but this question is (still) ranked highly in search results and I came across it today
-
-
reedbarger.com reedbarger.com
-
Replacing map / filter with a single reduce
-
-
github.com github.com
-
Recursively transform object keys with a custom key transform strategy
-
-
stackoverflow.com stackoverflow.com
-
not all answers pass this tests
-
function isObject(o) { return o instanceof Object && o.constructor === Object; }
-
An array is from a logical point of view not an object - although JavaScript handles and reports them as such. In practice however, it is not helpful to see them equal, because they are not.
-
In case you need to verify that object is instance of particular class you have to check constructor with your particular class
-
Arrays are definitely objects. Not sure why you think objects can't have a length property nor methods like push, Object.create(Array.prototype) is a trivial counterexample of a non-array object which has these. What makes arrays special is that they are exotic objects with a custom [[DefineOwnProperty]] essential internal method, but they are still objects.
-
arrays are not objects from a logical point of view. I'm speaking about program logic. It is sometimes necessary to check if an array is a "real" array and definitely not an "real" object. That's what Array.isArray() is for. Imagine you have a function which accepts an object or an array of objects.
-
function isObject (item) { return (typeof item === "object" && !Array.isArray(item) && item !== null); }
-
-
What's a primitive?
-
What's an object (i.e. not a primitive)?
-
-
github.com github.com
Tags
Annotators
URL
-
-
trailblazer.to trailblazer.to
-
In production, you will never trigger one specific callback or a particular validation, only. Your application will run all code required to create a Song object, for instance. In Trailblazer, this means running the Song::Create operation, and testing that very operation with all its side-effects.
-
There’s no need to test controllers, models, service objects, etc. in isolation
-
Run the complete unit with a certain input set, and test the side-effects. This differs to the Rails Way™ testing style, where smaller units of code, such as a specific validation or a callback, are tested in complete isolation. While that might look tempting and clean, it will create a test environment that is not identical to what happens in production.
-
Integration tests for controllers: These Smoke tests only test the wiring between controller, operation and presentation layer.
-
Unit tests for operations: They test all edge cases in a nice, fast unit test environment without any HTTP involved.
-
Internally, it creates and returns a fresh, subclassed activity (via patching) whilst replacing the step for given :id. Be advised that this does not change the original activity class.
-
This helper allows you to mock any step within a given or deeply nested activities.
-
To skip processing inside :load_user and use a mock instead, use mock_step.
Tags
- testing: integration tests
- unnecessary
- subclassing/inheritance
- testing: philosohy of testing
- testing: avoid unnecessarily testing things in too much isolation, in a different way than the code is actually used (should match production)
- testing: tests should resemble the way your software is used
- rails: the Rails way
- isolation (programming)
- the Trailblazer way
- testing: test the side effects
- testing: smoke tests
- testing: avoid testing implementation details
- testing: fast test suite
- testing: mocking
- object-oriented programming
- testing: unit tests
Annotators
URL
-
-
store.steampowered.com store.steampowered.com
-
Meta gaming at its finest.
-
Make It Indie! is an indie game about making an indie game.
-
-
www.kickstarter.com www.kickstarter.com
-
www.kickstarter.com www.kickstarter.com
-
She asked me if I could create international universal design Shogi set for foreign Shogi fans.
-
Design SHOGI pieces have been redesigned with new iconography to indicate the piece’s movement.
-
Redesigning the pieces was very difficult work, because traditional pieces have 4 specialties below.
-
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.
-
If you want to try playing to see how these pieces work in the game, you can playtest it on the Iishogi.org site (https://lishogi.org/). Last year the Iishogi designer asked me to register the Design SHOGI pieces on their site. This Iishogi.org is a free to play Shogi website. I was willing to give them permission to use them. You are free to play and switch pieces design from the piece variation section. If you register your ID, then you can play vs the A.I. easily. You can learn how the Design SHOGI pieces work there.
-
-
boardgamegeek.com boardgamegeek.comShogi1
-
I am only interested in the universal designed Shogi, like https://www.kickstarter.com/projects/logygames/design-shogi
-
-
www.kickstarter.com www.kickstarter.com
-
-
Why Kickstarter? Where else am I going to get the money to manufacture my game? No seriously, if you have a better place I can get this kind of money, please send me a message and I will do that immediately.
-
-
github.com github.com
-
It can also be included as individual modules, i.e. Hashie::Extensions::MethodReader, Hashie::Extensions::MethodWriter and Hashie::Extensions::MethodQuery.
-
The MethodAccess extension allows you to quickly build method-based reading, writing, and querying into your Hash descendant.
-
-
github.com github.com
-
-
Using ::delegates works exactly like the Forwardable module in Ruby, with one bonus: It creates the accessors in a module, allowing you to override and call super in a user module or class.
-
Uber::Option implements the pattern of taking an option, such as a proc, instance method name, or static value, and evaluate it at runtime without knowing the option's implementation.
-
-
github.com github.com
-
supermodel
Tags
Annotators
URL
-
-
guides.rubyonrails.org guides.rubyonrails.org
-
These methods should be used with caution, however, because important business rules and application logic may be kept in callbacks. Bypassing them without understanding the potential implications may lead to invalid data.
-
-
trailblazer.to trailblazer.toTrailblazer10
-
Using multiple termini has three magnificent, beautiful advantages.
-
When nesting an activity with multiple outcomes, you can wire each terminus to a different route.
-
It is much easier to track what is going on within the activity. Instead of transporting additional state via ctx, you expose the outcome via an additional end event.
Note: It's only super easy to see what's going on if you have the benefit of a diagram.
-
You may communicate more than a binary outcome of an activity. For instance, a controller endpoint activity could have end events for success and failure, but also for “not authorized”, or “validation failed”. You’re not limited to a binary setup here.
-
we head straight into an additional terminus, or end event as it’s called in BPMN
no
-
For example, an output using Track(:create) will snap to the next possible task that is “magnetic to” :create. That’s how tracks or paths are created.
-
Semantics are mostly relevant for nesting
-
Having a closer look, you will see that putting “create user” on the failure track probably isn’t such a great idea, as it will also get invoked when #validate errors-out. It’s a good idea to introduce a new, separate path for handling new users.
-
Instead of connecting an output to a particular task, you can also choose to let it connect to a track. A track is created by taking a task’s output, retrieving its semantic, and then connecting it to the next available task that is “magnetic to” this semantic.
-
Having an understanding of higher level abstractions, such as tasks, activities and the historical code path taken, its debugging trace is much closer to how you, as an engineer, think about your code.
Tags
- magic values
- easy to understand
- easy to follow/read/understand
- Business Process Model and Notation
- not:
- non-binary
- higher level of abstraction
- terminus/end event
- debugging tools
- trailblazer-activity: wiring/outputs/tracks
- trailblazer-activity: wiring/outputs: semantic
- conflation
- fun wording
- nesting
- advantages/merits/pros
- state management
Annotators
URL
-
-
github.com github.com
-
MIT License. Copyright 2020 Rafael França, Carlos Antônio da Silva. Copyright 2009-2019 Plataformatec.
-
Responders don't use valid? to check for errors in models to figure out if the request was successful or not, and relies on your controllers to call save or create to trigger the validations.
-
-
trailblazer.to trailblazer.to
-
or even configure its taskWrap
-
Please note that the I/O DSL is only providing the most-used requirements. Feel free to use the low-level taskWrap API to build your own variable mapping with different scoping techniques.
-