|| minted == hinted
Unnecessary check.
|| minted == hinted
Unnecessary check.
You have to completely comprehend your idea in order to fully realize it.
def compare_state_dict(dict1, dict2): # compare keys for key in dict1: if key not in dict2: return False for key in dict2: if key not in dict1: return False for (k,v) in dict1.items(): if not torch.all(torch.isclose(v, dict2[k])) return False return True
Comparing two pytorch dicts
Since the reader was able to shape hand and finger as he or she saw fit, we can sometimes recognise a particular reader within a single manuscript, or even within the books of a library. The charming hands function as a kind of fingerprint of a particular reader, allowing us to assess what he or she found important about a book or a collection of books.
I've heard the word "hand" as in the phrase "an operator's hand" used in telegraphy to indicate how an experienced telegraph operator could identify the person at the other end with whom they were communicating by the pace and timbre of the code. I've particularly heard reference to it by code breakers during wartime. It's much the same sort of information as identifying someone by their voice on the phone or in a distinctive walk as seen at a distance. I've also thought of using this idea in typing as a means of secondary confirmation for identifying someone while they input a password on a keyboard.
I wonder if that reference predates this sort of similar "hand" use for identifying someone, if this may have come first, or if they're independent of each other?
Aside to global and local scope there is also something one could call a “block” scope. This is not an “official” type of scope, but it does exist. Block scope was introduced to JavaScript as a part of the ES6 specification. It was introduced along with two new types of variables let and const.
In javascript prettier-ignore ignores the next block, so what I did was just make the next few lines a block.
Using a flag to disable prettier for a line, the next line or until I activate it again (ESLint like syntax). // prettier-disable border: { sep: "║", topLeft: "╔", topMid: "╦", top: "═", topRight: "╗", midLeft: "╠", midMid: "╬", mid: "═", midRight: "╣", botLeft: "╚", botMid: "╩", bot: "═", botRight: "╝" }, // prettier-enable
git commit -e --file=$(git rev-parse --git-dir)/COMMIT_EDITMSG;
Copy and pastethe module’s code into your system and make whatever changes you find nec-essary.This is usually the right thing to do for a small component
conda env update --prune --quiet --name $envname --file "$envfile"
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.kernel_name=python3 --output output.ipynb <path_to_ipynb>
asfvaerv
erwerf
erver
If you want more, you can do so by directly specifying TextMate theme color rules
code
{
"editor.tokenColorCustomizations": {
"[Noctis]": {
"textMateRules": [
{
"scope": "markup.list",
"settings": { "fontStyle": "" }
},
{
"scope": "text.markdown.notes.tag",
"settings": { "fontStyle": "italic" }
}
]
}
}
}
Inspect the scope using the command "Developer: Inspect Editor Tokens and Scopes"
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"
hyper-parameters, i.e., parameters external to the model, such as the learning rate, the batch size, the number of epochs.
the interesting thing here is that there are comments that say which concern depends on which.
This works nicely wherever we show authors, but after we deploy to production, the folks from other parts of the world won’t get notified anymore about their songs. Mistakes like these are easy to make when using concerns.
body script, body style {
This doesn't work well with scripts (and style elements) injected by the Hypothesis bookmarklet or the Wayback Machine's toolbar. On that note, it's pretty poor hygiene on their part to (a) inject this stuff in the body to begin with, and (b) not include at the very least a class attribute clearly defining the origin/role of the injected content. As I described elsewhere:
set the class on the injected element to an abbreviated address like
<style class="example.org/sidebar/2.4/injected-content/">
. And then drop a page there explaining the purpose and requirements (read: assumptions) of your injected element. This is virtually guaranteed not to conflict with any other class use (e.g. CSS rules in applied style sheets), and it makes it easier for other add-ons (or the page author or end user) to avoid conflicts with you.
* Monospace fonts always render at 80% of normal body text for some * reason that I don't understand but is still annoying all the same.
Dealing with it this way is a mistake. The only reasonable thing to do is to tell the user to adjust their browser's default font settings or deal with it. (This seems to only affect Firefox's default UA stylesheet/preferences, not Chrome.)
Check out how the most recent iteration of the w2g streamline "client" https://graph.5apps.com/LP/streamline approaches styling.
this._figureElement = this._page.querySelector("script");
Better to use querySelectorAll
and then filter based on figure designation (e.g. nodeValue.startsWith(" (Fig. 1) ")
).
document
Unused!
(Caller should also probably look more like:
let system = new SystemB(document);
system.attach(document.querySelectorAll("script"))
... where the querySelectorAll
return value's role is to act as a list of document figures, for the reasons described elsewhere https://hypothes.is/a/-n-RYt4WEeu5WIejr9cfKA.)
Useful advice for commenting code.
I only allowed smaller closures in the code and refactored the rest into separate top-level functions. This is a deliberate move against the common practice of js programmers. Why? Because I noticed closures make code harder to read.
This compatibility simply means that you can have a .githooks folder at the root of your project, where you can organize your individual hooks into folders.
We’ve broken our project up into three different types of packages: apps which are preact apps intended to be bundled and deployed somewhere, modules which are plain npm packages for node/browsers and do not bundle their dependencies, and workers which are either Worker or ServiceWorker scripts entirely bundled up with no imports or exports. We don’t have to keep these three types of packages separated, but it helps us navigate around.
Johnson, Khari. ‘AI Could Soon Write Code Based on Ordinary Language’. Wired. Accessed 21 June 2021. https://www.wired.com/story/ai-write-code-ordinary-language.
Rather than write new tooling we decided to take advantage of tooling we had in place for our unit tests. Our unit tests already used FactoryBot, a test data generation library, for building up test datasets for a variety of test scenarios. Plus, we had already built up a nice suite of helpers that we coud re-use. By using tools and libraries already a part of the backend technology’s ecosystem we were able to spend less time building additional tooling. We had less code to maintain because of this and more time to work on solving our customer’s pain points.
It also makes it hard to centralize type coercions and default values.
On the security side I think code injection is still a danger. If someone does smuggle js into your js app they'll be able to read your CSRF cookie and make ajax requests using your logged-in http session, just like your own code does
That means if an attacker can inject some JavaScript code that runs on the web app’s domain, they can steal all the data in localStorage. The same is true for any third-party JavaScript libraries used by the web app. Indeed, any sensitive data stored in localStorage can be compromised by JavaScript. In particular, if an attacker is able to snag an API token, then they can access the API masquerading as an authenticated user.
You can find code to generate test fixtures
I am not sure if this is an improvement. To me it does not seem very pretty. Of course I am biased since I also prefer () in method definitions if they have arguments; although I think it is fine that ruby does not mind omitting the (). For my brain, I like the () for visual separation.
One of the consequences (although arguably not the primary motivation) of DRY is that you tend to end up with chunks of complex code expressed once, with simpler code referencing it throughout the codebase. I can't speak for anyone else, but I consider it a win if I can reduce repetition and tuck it away in some framework or initialisation code. Having a single accessor definition for a commonly used accessor makes me happy - and the new Object class code can be tested to hell and back. The upshot is more beautiful, readable code.
new tag?:
( user_id int , user_name varchar , last_activity timestamptz )
o help us meet this vision, the frontend should use GraphQL in preference to the REST API for new features.
A litmus test on whether an option belongs to adapter config or kit config, would be to ask whether the option becomes irrelevant when you switch the adapter to static.
'set-cookie': response.headers.get('set-cookie')
You can see the implementation here: https://github.com/sveltejs/sapper/blob/339c417b24e8429d3adc9c9f196bf159a5fce874/runtime/src/server/middleware/get_page_handler.ts#L137
select * from users
We can preview the data, and since that looks good, let's add a table to the canvas to display it. When we do this, it helpful pre-fills the data from our last query.
Code is law, and that code is misogyny.
Darren Dahly on Twitter. (n.d.). Twitter. Retrieved 1 May 2021, from https://twitter.com/statsepi/status/1385127211699691520
Article D511-51Création Décret n°2009-553 du 15 mai 2009 - art.La commission académique est présidée par le recteur ou son représentant. Elle comprend en outre cinq membres : 1° Un inspecteur d'académie, directeur des services départementaux de l'éducation nationale ; 2° Un chef d'établissement ; 3° Un professeur ; 4° Deux représentants des parents d'élèves. Les membres autres que le président sont nommés pour deux ans par le recteur ou son représentant. Un suppléant est nommé dans les mêmes conditions pour chacun des membres de la commission, à l'exception de son président. Pour la désignation des représentants des parents d'élèves, le recteur recueille les propositions des associations représentées au conseil académique de l'éducation nationale.Décret n° 2009-627 du 6 juin 2009 article 1 : Les dispositions réglementaires instituant les commissions administratives à caractère consultatif dont la liste est annexée au présent décret sont prorogées pour une durée de cinq ans (Commission académique d'appel).
MJML comes out of the box with a set of standard components to help you build easily your first templates without having to reinvent the wheel.
A bit of a tour through the Ruby source code seems necessary as the documentation is a bit thin.
:structured - Lumberjack::Formatter::StructuredFormatter - crawls the object and applies the formatter recursively to Enumerable objects found in it (arrays, hashes, etc.).
CSS seems like the right place to put visual information. On the other hand, few would argue that image "src" should not be specified as an attribute and the height/width seem as tied to the binary image data as the "src" is.
Data Feminism | Code of Conduct
Bugs The man page is longer than the program.
I assume "the program" is referring to this file:
https://core.tcl-lang.org/expect/file?name=example/unbuffer&ci=trunk
, which compared to the source for man page, is in fact much smaller (about 1/2 the length).
This repository contains the source code for:
Yes, autoexpect is a good tool, but it is used just to automatically create TCL-expect scripts, by watching for user. So it’s can be equal to writing expect-scripts by hand.
You probably want to use the --return option, if your version of script has it, to preserve the child process' exit code.
first sighting: this file referenced by https://hyp.is/ZD-z8px8Eeue0ws8rEMsrw/gist.github.com/cowboyd/1642793
“Who cares? Let’s just go with the style-guide” — to which my response is that caring about the details is in the heart of much of our doings. Yes, this is not a major issue; def self.method is not even a code smell. Actually, that whole debate is on the verge of being incidental. Yet the learning process and the gained knowledge involved in understanding each choice is alone worth the discussion. Furthermore, I believe that the class << self notation echoes a better, more stable understanding of Ruby and Object Orientation in Ruby. Lastly, remember that style-guides may change or be altered (carefully, though!).
“It is less clear that way” — that is just arbitrary, even uninformed. There is nothing clearer about def self.method. As demonstrated earlier, once you grasp the true meaning of it, def self.method is actually more vague as it mixes scopes
I wish to define methods within the class they belong to. Using class << self demonstrates that approach clearly — we are defining methods within the actual singleton class scope.
When we usedef self.method, though, we are defining a method across scopes: we are present in the regular class scope, but we use Ruby’s ability to define methods upon specific instances from anywhere; self within a class definition is the Class instance we are working on (i.e. the class itself). Therefore, usingdef self.method is a leap to another scope, and this feels wrong to me.
Similarly to fashion, code style reflects our credo as developers, our values and philosophy.
Yet, it certainly is important to make the proper choices when picking up style. Similarly to fashion, code style reflects our credo as developers, our values and philosophy. In order to make an informed decision, it’s mandatory to understand the issue at stake well. We all have defined class methods many times, but do we really know how do they work?
Quelques textesArticle R. 421-46 du code de l’éducation«Le comité d'éducation à la santé et à la citoyenneté réunit, sous la présidence du chefd'établissement, les personnels d'éducation, sociaux et de santé de l'établissement et desreprésentants des personnels enseignants, des parents et des élèves, désignés par le chefd'établissement sur proposition des membres du conseil d'administration appartenant à leurscatégories respectives, ainsi que les représentants de la commune et de la collectivitéterritoriale de rattachement au sein de ce conseil. En fonction des sujets traités, il peutassocier à ses travaux toute personne dont il estime l'avis utile»
If you look at the source code you'll see that they're exactly the same thing.
Read the code! No, really. I wrote this code to be read.
Il peut opposer un refus à la tenue d'une réunion ou à la participation de personnalités extérieures lorsque celles-ci sont de nature à porter atteinte au fonctionnement normal de l'établissement ou à contrevenir aux principes du service public de l'enseignement.
When bullshit is legitimized and codified, itspreads more easily and is likely to be moreinfluential. This in turn fosters the future produc-tion of more bullshit.
This is not a fork. This is a repository of scripts to automatically build Microsoft's vscode repository into freely-licensed binaries with a community-driven default configuration.
almost without a doubt, inspired by: chromium vs. chrome
In King County, pollution makes ZIP codes predictors of your health | Crosscut. (n.d.). Retrieved 5 March 2021, from https://crosscut.com/video/new-normal/king-county-pollution-makes-zip-codes-predictors-your-health
Si un élève mineur est entendu en tant que témoin, il doit être accompagné de son représentant légal.(Art. D511-31)
Effacement des sanctions et amnistieLes sanctions, même assorties du sursis à leur exécution, sont inscrites au dossier administratif de l'élève. L'avertissementest effacé du dossier administratif de l'élève à l'issue de l'année scolaire, le blâme et la mesure de responsabilisationsont effacés du dossier administratif de l’élève à l’issue de l’année suivant celle qui a suivi le prononcé de la sanction. Les autres sanctions, hormis l'exclusion définitive, sont effacées du dossier administratif de l'élève à l’issue de la deuxième année suivant celle du prononcé de la sanction.Toutefois, un élève peut demander(même s’il est mineur)l'effacement des sanctions inscrites, y compris l’exclusion définitive, dans son dossier administratif lorsqu'il change d'établissement(art R511-13).Les sanctions, y compris l’exclusion définitive, sont effacées du dossier administratif de l'élève au terme de sa scolarité dans le second degré (art R511-13).
Les nouvelles dispositions émanant du décret n°2019-906 prévoient que le Conseil d’Administration de l’établissement doit désormais établir, à partir des enquêtes trimestriellessur les sanctions, un rapport relatif au fonctionnement pédagogique et des conditions matérielles de fonctionnement dont une partie est consacrée au bilan des décisions rendues en matière disciplinaire, élaboré à partir du registre des sanctions de l’établissement, et des suites données par le chef d’établissement aux demandes écrites de saisine du conseil de discipline émanant d’un membre de la communauté éducative
Le règlement intérieur doit désormais prévoir les mesures de prévention, de responsabilisation et d’accompagnement pour les élèves ayant fait l’objet d’une exclusion temporaire (article R 421-5):«... prévoit les modalités de mise en œuvre des mesures de prévention, de responsabilisation et d'accompagnement, notamment lorsqu'elles font suite à la réintégration d'un élève exclu temporairement pour des faits de violence.»
There’s several benefits to splitting code into multiple packages, whether it be a library, micro-services or micro-frontends.
he goes on to talk about third party problems and how you're never guaranteed something is written correctly or that even if it is you don't know if it's the most optimal solution
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.
Software that is not currently being used gradually becomes unusable as the remainder of the application changes.
Infrequently used portions of code, such as document filters or interfaces designed to be used by other programs, may contain bugs that go unnoticed. With changes in user requirements and other external factors, this code may be executed later, thereby exposing the bugs and making the software appear less functional.
Microlibraries are easier to understand, develop and test. They make it easier for new people to get involved and contribute. They reduce the distinction between a “core module” and a “plugin”, and increase the pace of development in D3 features.
If you don't mind putting the sourcemap url in the minified JS
While I understand orgs wanting not to expose their unminified source, it's security through obscurity (meaning it's not adding any real security).
The only place I can find it is in the sprockets-rails gem. javascript_include_tag calls this: def find_debug_asset(path) if asset = find_asset(path, pipeline: :debug) raise_unless_precompiled_asset asset.logical_path.sub('.debug', '') asset end end
Les élèves accompagnés dans le cadre de ces dispositifs sont comptabilisés dans les effectifs scolarisés.
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
Instead of one big code pile, activities will gently enforce a clean, standardized way for organizing code.
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.
traditional tracking devices such as radio frequency identification (RFID) and bar codes remain relevant
To understand this helper, you should understand that every step invocation calls Output() for you behind the scenes. The following DSL use is identical to the one [above]. class Execute < Trailblazer::Activity::Railway step :find_provider, Output(Trailblazer::Activity::Left, :failure) => Track(:failure), Output(Trailblazer::Activity::Right, :success) => Track(:success)
Non-blocking suggestion: This is a little more elegant, if you prefer this syntax:
Another thing I don’t like: our asset behavior is decoupled from the assets. If you’re mucking around in your app/assets folder, then you have to first know that such a config exists, and then hunt it down in a totally different config folder. It would be nice if, while we’re working in asset land, we didn’t have to mentally jump around.
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.
An activity is a high-level concept to structure code flow
Whether this is the life-cycle of a <user> entity or just a sign-up function, it has to be defined and coded somewhere.
Trailblazer strikes when it comes to organizing business code.
The DSL has a weaker control over the program’s flow — we can’t have conditions unless we add a special step
In functional programming, a monad is an abstraction that allows structuring programs generically
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.
Trailblazer extends the conventional MVC stack in Rails. Keep in mind that adding layers doesn't necessarily mean adding more code and complexity. The opposite is the case: Controller, view and model become lean endpoints for HTTP, rendering and persistence. Redundant code gets eliminated by putting very little application code into the right layer.
Check yourself some shell-sources.
If interested, you can check the plain old /bin/sh signal handling in the source code here.
time run_with_timeout 3 sleep_and_exit 1 7; echo $?
it propagates (Option -p) the returnlevel ($?) so you may use it for your purpose.
ActiveInteraction plays nicely with Rails. You can use interactions to handle your business logic instead of models or controllers.
Why is all this interaction code better? Two reasons: One, you can reuse the FindAccount interaction in other places, like your API controller or a Resque task. And two, if you want to change how accounts are found, you only have to change one place.
Pretty weak arguments though...
I like the clarity of this approach instead of stuffing it in initialize.
Code of Ethics
I do think it's a common pattern that should be solved, and I am probably going to try and solve it as a Gem as opposed to simply writing code that we use in our code base
First of all, we want names to exhibit truth and beauty: to be the right names, and to make our code clean and beautiful. At least, this is what we want to think about our code, but naming’s importance is far more practical.
‘Programs are meant to be read by humans and only incidentally for computers to execute.’
2.L’article 40 du code de procédure pénaleL’article 40 du code de procédure pénale, déjà évoqué, dispose que «toute autorité constituée, tout officier public ou fonctionnaire qui, dans l’exercice de ses fonctions, acquiert la connaissance d’un crime ou d’un délit est tenu d’en donner avis sans délai au procureur de la République et de transmettre à ce magistrat tous les renseignements, procès-verbaux et actes qui y sont relatifs». Cet article a donc pour effet de délier du secret professionnel les officiers publics ou les fonctionnaires en leur imposant de dénoncer au procureur de la République les crimes ou délits dont ils ont acquis la connaissance dans l’exercice de leurs fonctions. Cetteobligation de dénonciation s’impose à tous les fonctionnaires et concerne toutes les infractions. Un médecin de PMI, un médecin scolaire ou un médecin hospitalier peut donc être concerné par cette obligation. Cependant, le non-respect de cette obligation de dénonciation n’est pas pénalement sanctionné, ce qui en limite considérablement la portée.
This is a store we can’t audit, which contains software nobody can patch. If we can’t fix or modify software, open-source or not, it provides the same limitations as proprietary software.
The code is far simpler and easier to understand/verify
’article 434-3 du code pénal prévoit que « toute personne ayant eu connaissance de privations, de mauvais traitements ou d’atteintes sexuelles infligés à un mineur de 15 ans s’expose à des sanctions pénales s’il n’en informe pas les autorités judiciaires ou administratives »
reviewing code takes energy!
the lighting is suitable
The technology's racism means that dark-skinned students may need a lot of suitable lighting.
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 must be called during the component's initialisation (but doesn't need to live inside the component; it can be called from an external module).
Monaco is what VScode, and CodeSandBox, use for code editing. It's obviously one of the best code editors in the world. It's always been on my want-to-try-list and this is the perfect proejct.
A Svelte component that monitors an element enters or leaves the viewport/parent element. Performant and efficient thanks to using Intersection Observer under the hood. Can be used in multiple projects including lazy loading images, infinite scrolling, playing/pausing the video when in the viewport, tracking user behaviour firing link pre-fetching and animations and many many more.
It's a generic abstraction for the logic and styling of elements that pop out from the flow of the document and float next to a reference element, overlaid on top of the UI.
By abstracting the cleanup process in the cleanUp function, the three callbacks — timeout, success, and error listener — look exactly the same. The only difference is whether they resolve or reject the promise.
Keep your patches colocated with the code that depends on them.
Treating the web as a compile target has a lot of implications, many negative. For example “view source” is a beloved feature of the web that’s an important part of its history and especially useful for learning, but Svelte’s compiled output is much harder to follow than its source. Source maps, which Svelte uses to map its web language outputs back to its source language, have limitations.
For example, an event handler callback that can be used to handle both fullscreenchange and fullscreenerror might look like this:
// DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
I wish I understood what they meant and why this is necessary
in which business logic (JavaScript) is collocated with styles (CSS) and markup (HTML-like templating syntax).
Refactoring at scale is challenging and a significant investment, so communicating the progress is important both from a business perspective but also as a motivational effect to developers. In this case we used a combination of complexity trend visualizations and Code Health Metric as shown in the preceding example.
[[refactoring at scale]]
also, should RFCs include working code (basics for the IETF work)?
In my opinion, deleting a user is not a function executed by an item on itself but is a function done by the holder of the array. So in your case you would be better of moving the deleteUser up to App.
A resource route maps a number of related requests to actions in a single controller.
they're in the svelte compiler: https://github.com/sveltejs/svelte/blob/master/src/compiler/compile/nodes/Element.ts#L668 (search for the warning text)
Note that you can also use dynamic partials, that conditionally select the partial to render based on the value in the JSON.
When you’re implementing a bad plan yourself, instead of having a mentor bail you out by fixing it, a few really useful things happen:You learn many more details about why it was a bad idea. If someone else tells you your plan is bad, they’ll probably list the top two or three reasons. By actually following through, you’ll also get to learn reasons 4–1,217.You spend about 100x more time thinking about how you’ll avoid ever making that type of mistake again, i.e., digesting what you’ve learned and integrating it into your overall decision-making.By watching my mistakes and successes play out well or badly over the course of months, I was able to build much more detailed, precise models about what does and doesn’t matter for long-term codebase health. Eventually, that let me make architectural decisions with much more conviction.
There's a benefit to embarking on a challenge without a more experienced authority to bail you out.
(I would add that the experience is more visceral, it activates more modalities in your brain, and you remember it much more clearly.)
These types of experiences result in what the author calls more "detailed, precise models". For me they result in a sort of intuition.
Decode of jq command:
ORWG Virtual Meeting 08/09/2020 https://www.youtube.com/playlist?list=PLOA0aRJ90NxvXtMt5Si5ukmR9LYfvDueB (n.d.)
If you don't like to create an extra function and remove the items 'inline'
we update the validation schema on the fly (we had a similar case with a validation that needs to be included whenever some fetch operation was completed)
export const validationSchema = {
field: {
account: [Validators.required.validator, iban.validator, ibanBlackList],
name: [Validators.required.validator],
integerAmount: [
Able to update this schema on the fly, with:
React.useEffect(() => {
getDisabledCountryIBANCollection().then(countries => {
const newValidationSchema = {
...validationSchema,
field: {
...validationSchema.field,
account: [
...validationSchema.field.account,
{
validator: countryBlackList,
customArgs: {
countries,
},
},
],
},
};
formValidation.updateValidationSchema(newValidationSchema);
});
}, []);
What would happen if we get the list from a rest api when the form component is mounted? That's an interesting topic, you can add a rule once a component has been mounted and update the associated validation schema.
Ok, I have seen that there are lot of built-in and third party validations, but sooner or later I will face a validation rule not covered by this buffet. Can I build a custom one? Of course you can!
exec(params) do load path end
So the command being wrapper must be a Ruby file, because this will use load
to load its source into the interpreter (rather than executing it in a shell (we're already in a shell)).
This simplifies maintenance and keeps things clean by allowing related code to be grouped before inclusion elsewhere.
withindex.js, we have a single source of truth, giving fine grained control on what we expose to the outside world.
import statements will become much smaller, as we will be importing stuff from less files. For example AbstractNode.js has only on import statement now, where it had two before.
The reason that this solves our problem is: we now have full control over the module loading order. Whatever the import order in internal.js is, will be our module loading order.
Here are few, real-life commits of refactorings that make use of this solution:
The crux of this pattern is to introduce an index.js and internal.js file.
Yeah I see what you're saying. In my case, I had a group of classes that relied on each other but they were all part of one conceptual "module" so I made a new file that imports and exposes all of them. In that new file I put the imports in the right order and made sure no code accesses the classes except through the new interface.
Replaced nested `require` statements with `import` declarations for the sake of a leaner bundle. This entails adding empty imports to three files to guarantee correct ordering – see https://github.com/styled-components/styled-components/pull/100
In some cases, I could also create a component without any <script> tag at all. So in that way, I could actually bulk up the logic in one place if I could get some help from the #with block.
Separately, I wondered about having a central registry of warnings, since they're a bit scattered around at the moment. That way, we could check that someone wasn't trying to ignore a non-existent warning.
centralized
The false promise of your source code repository is that everything it contains is “good.” To complete your task, just find something that does something similar, copy, modify, and you’re done. Looking inside the same repository seems like a safety mechanism for quality but, in fact, there is no such guarantee.
What makes it good or bad is the quality of the code being multiplied.
For years, I’ve shared with friends and clients what I call the bunny theory of code. The theory is that code multiplies when you’re not looking, not unlike bunnies that tend to multiply when you’re not looking.
Anyone who’s ever worked with me knows that I place a very high value on what ends up checked-in to a source code repository.
nzaka's theory of bunny code is relevant here
Yes, you can embed loops in it and compose lots of small repeated JSX snippets, but that almost never happens in practice because mixing the turing complete of javascript with the markup of HTML eliminates the readability of JSX so that it is actually harder to parse than a solution like hyperscript (the syntactical approach taken by virtual-dom).
The problem is that not all tooling supports adding new dependencies from a transform. The first step is figuring out how this can be done idiomatically in the current ecosystem.
the actual upgrade path should be very simple for most people since the deprecated things are mostly edge cases and any common ones can be codemodded
Why not just use that instead of inventing a syntax that's not part of ECMAScript?
code is read much more often than it is written.
However, know when to be inconsistent -- sometimes style guide recommendations just aren't applicable.
The limits are chosen to avoid wrapping in editors with the window width set to 80, even if the tool places a marker glyph in the final column when wrapping lines.