I have been in love with computers and everything related since I played my first game of Dangerous Dave back in the 90s.
Graduating with a master's degree in Biology, and a bachelor's in Pharmacy; I have been fortunate enough to dabble my hands in things ranging from copywriting to computer networks.
I love pixel art!
Nothing here yet.
The following article sums up what we follow, quite well! https://chris.beams.io/posts/git-commit/ Also do check out the past discussions we've had here on this topic: https://hashnode.com/post/do-you-have-a-spec-for-writing-git-commit-messages-cinngva27008wlt53116hepu0 https://hashnode.com/post/imperative-mood-vs-past-tense-which-one-do-you-prefer-when-writing-git-commit-messages-and-why-cjmiya6zv01ecpys1gstazeb7 https://hashnode.com/post/what-is-your-commit-message-for-personal-repositories-cizu9orw1008wsa53domvkrxc
Let me preface this answer by applauding all of the excellent answers in here! :) They cover the most important aspects, usual suspects if you may. I'll go ahead and split the aforementioned modes of communication into two main categories. 📘 Informational Communication Clarity Concision Thoroughness / Attention to Detail etc... 🤓 Behavioural Communication Confidence Empathy Friendliness/Respect etc... All formal communication, across both the verbal, and written channels — experientially speaking — fall into the above two buckets; either you are: communicating (a piece of | pieces of) information about something; or, you are responding (to some information you've received) with a particular behavioural imprint of yours Often, it's a mix of both! Sandeep 's answer, and Milica 's answer go into details on these modes of communication, and how/what they screen on these respective aspects. Understanding this distinction, and improving on the corresponding characteristics, is what I would characterise as — working towards "good communication skills"! 🌟 One of the tools that I want to leave here for an aspirant on their way to becoming better at their skill of communication (especially communication during interviews), is The S.T.A.R. Method . Hope this is of help! :-)
If you run the following command: curl -I http: / /mirror.pramati.com/ubuntureleases /18.04.1/ubuntu - 18.04 . 1 -desktop-amd64.iso ...you will get the following output: HTTP/1.1 200 OK Date : Wed, 10 Oct 2018 13:40:09 GMT Server : Apache Last-Modified : Wed, 25 Jul 2018 03:22:14 GMT ETag : "746dc000-571ca628f7985" Accept-Ranges : bytes Content-Length : 1953349632 Cache-Control : max-age=1209600, public Expires : Wed, 24 Oct 2018 13:40:09 GMT Content-Type : application/x-iso9660-image See the Accept-Ranges header? That means the server is willing to accept range requests . Browsers have the ability to ensure resumes, using the same concept only. Chrome maintains a temporary .crdownload file; with that information chrome can make a request for a range starting from the non-downloaded byte; on a pause & resume . Sometimes even though servers support range requests (another apt name for this is byte serving ), they do not send any Accept-Ranges header. The absence of this header is not an accurate indicator of the truth about the server's ability for byte range serving. Some clients assume that the server doesn't support byte serving in either or both of the two cases: Accept-Ranges header is absent Accept-Ranges header is equal to 'none' In summary, if the server truly doesn't support byte serving, then resumes of downloads on any clients, from that server, are really not possible!
I think Jason Knight's answers do get really offensive, and way out of the line at times; as j and Milica have mentioned, I and a few other people have called him out for it! I can also see how it can get infuriating to some (read: me), at times, when they think "Jason doesn't know what he is talking about (React vs. Accessibility; vDOM uses only innerHTML for diffs); yet he puts on this offensive blame game!" Having said that, I've also expressed to him multiple times that his knowledge, and corresponding contributions are deeply appreciated in this community. https://hashnode.com/post/what-teaches-the-computer-machine-code-cjcxbs546000qw0wudg4law3v/answer/cjcxxp6av0029z6wutx9o0es4 In this regard, I wouldn't want him banned; I still am always curious to read what he has to say! One solution I see to this problem, is to have a Block button on profiles (just like the Follow button); so the community has the power to have or not have the chance of engaging with profiles they choose, on an " individual " basis!
We're using FeathersJS for building big-scale eGovernance web applications. You're already ahead with a good list of pros. Apart from those, here is what I really, really like about FeathersJS: FeathersJS core in itself is really small/lightweight. The true power of FeathersJS comes from the (surprisingly) wonderful ecosystem around it. I am absolutely in awe of the thinking model for building APIs, as propagated by FeathersJS. You're no longer thinking CRUD routes for an entity; but a single service, which represents the said entity; and the CRUD methods for it. Service "hooks", which can intercept your request, response; before/after a service is hit, feel "just right!" As an aside – once you're a bit comfortable with FeathersJS, I would recommend a reading of the following article which sheds light on the inspiration behind its architecture (services, and hooks) — a mix of Functional, Aspect Oriented Programming! https://blog.feathersjs.com/api-service-composition-with-hooks-47af13aa6c01 Coming to the CONS you've mentioned, I would say they aren't really any cons. I want to re-iterate how brilliant the FeathersJS ecosystem is. You can look at feathers-swagger for auto-generating docs of services you would build. Similarly, do take a look at feathers-permissions for simple service level ACLs. You can also amp things up a bit with CASL https://blog.feathersjs.com/authorization-with-casl-in-feathersjs-app-fd6e24eefbff
Following are two different approaches to the solution for your question. The naive approach is what I landed at initially, and as you can see, it is a O(n^2) solution. Matt Strom has a better approach, betterNestify — based on it — is O(n) . const naiveNestify = input => { return input.reduceRight( (acc, ele, idx) => { // Make sure not to edit the objects in input const obj = Object.assign({}, ele); const childPos = obj. pos + 1 ; const newAcc = []; acc.forEach( e => { if (e. pos === childPos) { if (!obj.children) obj.children = []; obj.children. push (e); } else { newAcc. push (e); } }); return [obj, ...newAcc]; }, [] ); }; const betterNestify = input => { const root = { pos : 0 , children: [] }; const ancestors = [root]; for (let i = 0 ; i < input. length ; i++) { // Make sure not to edit the objects in input const curr = Object.assign({}, input[i]); const next = Object.assign({}, input[i + 1 ]); const numAncestors = ancestors. length ; ancestors[numAncestors - 1 ].children. push (curr); if ( next ) { if ( next . pos === curr. pos + 1 ) { curr.children = []; ancestors. push (curr); } else { const diff = curr. pos - next . pos ; ancestors. splice (numAncestors - diff, numAncestors); } } } return root.children; };
Hi, Preethi! So nice to see you on Hashnode. What are your approaches — personal curriculum, pair coding, specific "production" tasks which turn out to be educational — to mentor junior developers in an organisation? What (combination(s)) have you seen which work(s) best, if any? Are there any anecdotal events which you can share with us, in this regard? Thank you so much!
Both solutions given by Peter and Rahul should work fine, but they are O(n^2), or solutions with quadratic complexity — note the reduce / forEach inside map . If you want to find why their solutions are O(n^2), or about BigO notation in general, I recommend you to read this excellent discussion , especially the answers by Todd , and j Peter 's second solution would break for arrays with 0 as an element, because of division by 0 — array.reduce((a, b) => a * b) / element Having said all that, here is my crack at a better (well that's always subjective, I mean a O(n) :) solution to the above problem: const calculateDesiredArray = (arr) => { let zeroIndex = -1 ; let nonZeroProduct = 1 ; const arrLen = arr.length; const allZerosArray = Array. from ({ length: arrLen }, (v, i) => 0 ); for ( let i = 0 ; i < arrLen; i++) { const ele = arr[i]; if (ele !== 0 ) { nonZeroProduct *= ele; } else { if (zeroIndex !== -1 ) { // Encountered a second '0' // Because of more than 1 '0' element in the array... // ...all elements in the new array would be '0's return allZerosArray; } // Apart from the element in this index... // ...all other elements in the new array would be '0's zeroIndex = i; } } if (zeroIndex !== -1 ) { // There's a single '0' at this index // In this case all elements in the new array would be '0'... // ...except the element at the zeroIndex const desiredArray = allZerosArray; desiredArray[zeroIndex] = nonZeroProduct; return desiredArray; } // There are no '0's in the array const desiredArray = arr.map(ele => nonZeroProduct / ele); return desiredArray; };