ring Antibody-labeled Gold Nanoparticles Based Resonance Rayleigh Scattering Detection of S100B By pubs.rsc.org Published On :: Anal. Methods, 2024, Accepted ManuscriptDOI: 10.1039/D4AY00335G, Papertiantian Wang, yonghui Wang, junbo LiTraumatic brain injury (TBI) is a sudden brain injury due to an external force that causes a large number of deaths and permanent disabilities every year. S100B has been recognized...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Three-dimensional hotspot structures constructed from nanoporous gold with a V-cavity and gold nanoparticles for surface-enhanced Raman scattering By pubs.rsc.org Published On :: Anal. Methods, 2024, Advance ArticleDOI: 10.1039/D4AY00348A, PaperYang Xu, Yan Wu, Jianjun Wei, Yuanyu Zhao, Peili XueA nanoporous gold V-shaped resonant cavity (NPGVRC) structure constructed with plasmonic resonance coupling effect. The NPGVRC has excellent SERS performance and 3D hotspot properties.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Monolith stationary phases prepared via cyclic anhydride ring-opening polymerization as tunable platforms for chromatographic applications By pubs.rsc.org Published On :: Anal. Methods, 2024, Accepted ManuscriptDOI: 10.1039/D4AY00251B, PaperAhmad Aqel, Ayman Ghafr, A. Yacine Badjah-Hadj-Ahmed, Zeid Abdullah ALOthmanPolymer monolithic stationary phases were prepared based on a cyclic anhydride as a reactive and tunable platform via ring-opening post-polymerization using primary amines; octadecylamine and benzylamine. The characterization techniques indicated...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Design, synthesis, inhibitory activity, and molecular simulations study for D-glucose-conjugated thioureas containing pyrimidine ring as multitarget inhibitors against α-amylase, α-glucosidase, DDP-4, and PTP1B in Type 2 diabetes mellitus By pubs.rsc.org Published On :: RSC Med. Chem., 2024, 15,3395-3417DOI: 10.1039/D4MD00334A, Research ArticleVu Ngoc Toan, Do Son Hai, Hoang Thi Kim Van, Nguyen Minh Tri, Duong Ngoc Toan, Nguyen Thi Thanh Mai, Nguyen Dinh ThanhD-Glucose-conjugated thioureas from 2-aminopyrimidines had inhibitory activity against α-amylase, α-glucosidase, DPP-4, PTP1B. The cytotoxicity, inhibitory kinetics, and molecular simulations of the most potent inhibitors 8k, 8j, 8f, and 8h were studied.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Exploring apoptotic induction of malabaricone A in triple-negative breast cancer cells: an acylphenol phyto-entity isolated from the fruit rind of Myristica malabarica Lam. By pubs.rsc.org Published On :: RSC Med. Chem., 2024, 15,3558-3575DOI: 10.1039/D4MD00391H, Research ArticlePothiyil S. Vimalkumar, Neethu Sivadas, Vishnu Priya Murali, Daisy R. Sherin, Madhukrishnan Murali, Anuja Gracy Joseph, Kokkuvayil Vasu Radhakrishnan, Kaustabh Kumar MaitiMalabaricone A isolated from Myristica malabarica induces apoptosis in triple-negative breast cancer cells through intrinsic and extrinsic pathways, which is validated through in vitro and in silico studies and resembles a potent phyto-entity.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Exploring 7β-amino-6-nitrocholestens as COVID-19 antivirals: in silico, synthesis, evaluation, and integration of artificial intelligence (AI) in drug design: assessing the cytotoxicity and antioxidant activity of 3β-acetoxynitrocholestane By pubs.rsc.org Published On :: RSC Med. Chem., 2024, Advance ArticleDOI: 10.1039/D4MD00257A, Research Article Shahabuddin, Uzma, Mohammad Azam, Mehtab Parveen, Nurul Huda Abd Kadir, Kim Min, Mahboob AlamIn light of the ongoing pandemic caused by SARS-CoV-2, effective and clinically translatable treatments are desperately needed for COVID-19 and its emerging variants.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Synthesis and biological evaluation of novel D-ring fused steroidal N(2)-substituted-1,2,3-triazoles By pubs.rsc.org Published On :: RSC Med. Chem., 2024, Advance ArticleDOI: 10.1039/D4MD00297K, Research ArticleBranislava Tenjović, Sofija Bekić, Andjelka Ćelić, Edward Petri, Julia Scholda, Florian Kopp, Marija Sakač, Andrea NikolićIn this study, a series of 13 new D-ring fused steroidal N(2)-substituted-1,2,3-triazoles were synthesized, characterized and evaluated for their biological activities.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Medicinal chemistry-based perspective on thiophene and its derivatives: Exploring the structural insights to discover plausible druggable leads By pubs.rsc.org Published On :: RSC Med. Chem., 2024, Accepted ManuscriptDOI: 10.1039/D4MD00450G, Review ArticleShikha Thakur, Devendra Kumar, shivani jaiswal, Kapil Kumar Goel, Pramod Rawat, Vivek Srivastava, Sonia Dhiman, Hemant R Jadhav, Ashish Ranjan DwivediThiophene is a privileged pharmacophore in medicinal chemistry owing to its diversified biological attributes. The thiophene moiety has been ranked 4th in US FDA drug approval of small drug molecules,...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring S-MGBs bearing amidine tail groups are potent, selective antiplasmodial agents By pubs.rsc.org Published On :: RSC Med. Chem., 2024, Advance ArticleDOI: 10.1039/D4MD00619D, Research Article Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Marina Perieteanu, Tayner Rodriguez Garzon, Leah M. C. McGee, Abedawn I. Khalaf, Colin J. Suckling, Rebecca Beveridge, Vicky M. Avery, Fraser J. Scott25 S-MGBs, including those bearing an amidine tail group, were investigated for their antiplasmodial, in vitro activity against 3D7 and Dd2 strains of P. falciparum. Several potent, and selective, hit compounds were identified.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Will decide on sharing stage with actor Vijay in consultation with VCK leaders: Thirumavalavan By www.thehindu.com Published On :: Tue, 05 Nov 2024 17:44:09 +0530 Mr. Thirumavalavan told reporters in Tiruchi that the book release event was not something that was planned recently, and that he had consented to take part in it almost a year ago Full Article Tamil Nadu
ring Ernakulam Express to stop at Muthupettai during Kandhoori festival By www.thehindu.com Published On :: Thu, 07 Nov 2024 18:51:18 +0530 Full Article Tiruchirapalli
ring HR&CE plans to bring properties around the Vennaimalai Temple under tenants list By www.thehindu.com Published On :: Thu, 07 Nov 2024 19:36:32 +0530 The HR&CE department has cleared 34 properties around the Balasubramanyaswamy Temple at Vennaimalai in Karur district as per the High Court orders Full Article Tiruchirapalli
ring Students and agriculture officials grapple with logistical, technical issues during digital crop survey By www.thehindu.com Published On :: Sat, 09 Nov 2024 20:32:48 +0530 Full Article Tiruchirapalli
ring 567: Full Stack Dev, Load Bearing Developer, and Being Zod Curious By shoptalkshow.com Published On :: Mon, 29 May 2023 09:00:16 +0000 What do you do if your computer dies? Chris applies to work at Luro, Dave applies at CodePen, Dave's Zod curious, TypeScript, sorting out a 10MB blog post, and how much do you miss jQuery? Full Article All Episodes full stack Jquery Zod
ring 581: DevRel, Musical Mics, Social Sharing, and 100 Years of WordPress By shoptalkshow.com Published On :: Mon, 04 Sep 2023 08:25:38 +0000 Dave calls a quick Luro branding meeting, some thoughts on DevRel, Chris tries to figure out musical instrument mics, follow up on WordPress from a previous episode, Chris' journey through the social graph options, 100 year hosting with WordPress, and the introduction of a new segment: Happy Project Share Time. Full Article All Episodes guitar happy project share time Luro social graph Wordpress
ring 608: Can WordPress Kill Your Resume, Fav Parts of Web Dev, Exploring HTMX, and more! By shoptalkshow.com Published On :: Mon, 25 Mar 2024 07:55:38 +0000 We're opening up the ShopTalk mailbag and answering your questions, including does WordPress on your resume kill your job chances, what are our fav and least fav parts of web dev, our thoughts on HTMX, and what is it like to use pnpm instead of npm. Full Article All Episodes HTMX npm pnpm Wordpress
ring 621: Setting Up Prettier and Linting, Comparing Colors, and Accessibility Overlays By shoptalkshow.com Published On :: Mon, 24 Jun 2024 08:05:22 +0000 We've got follow up on Cloudflare and Cara from last episode, a question about setting up Prettier and auto linting, a cool tool from a listener on comparing colors, a question about using tooling like Craft or more user friendly apps like Webflow when working with clients, and our takes on accessibility overlays. Full Article All Episodes Accessibility prettier webflow
ring 622: Website Rendering, Updating Software, and Edge Gets Faster By shoptalkshow.com Published On :: Mon, 01 Jul 2024 08:26:04 +0000 We're talking website rendering, server side rendering, Astro's server islands, perf hits for navigation elements, updating software because the docs aren't available for older versions, and a new Microsoft Edge was released. Full Article All Episodes microsoft edge rendering server islands
ring Ferrari's Leclerc fined for swearing By www.rediff.com Published On :: Stewards at the Brazilian race summoned Leclerc on Friday, acting on a report from the governing FIA's media delegate and after reviewing a written transcript. Full Article
ring The secret sauce behind ITC’s enduring restaurant brands By www.thehindubusinessline.com Published On :: Sun, 20 Oct 2024 10:45:54 +0530 The promise of an unchanged, consistent menu and supreme culinary artistry has drawn food lovers to ITC’s tables for decades Full Article Marketing
ring How Jio is powering Reliance’s media, entertainment biz By www.thehindubusinessline.com Published On :: Sun, 27 Oct 2024 14:46:07 +0530 Despite a late entry into telecom, digital services, and media, Reliance has raced to the top Full Article Corporate File
ring Haryana Congress to move court over ‘violations’ by BJP during Assembly poll By www.thehindu.com Published On :: Wed, 06 Nov 2024 12:43:15 +0530 Panel to gather information from party’s candidates about various violations Full Article Delhi
ring Leaves taken by doctors during RG Kar protest to be adjusted against their official quota: AIIMS Delhi By www.thehindu.com Published On :: Fri, 08 Nov 2024 01:12:12 +0530 Full Article Delhi
ring Delhi cop Nidhin Valsan’s inspiring journey from arresting cancer to Ironman finish line By www.thehindu.com Published On :: Fri, 08 Nov 2024 02:05:22 +0530 Diagnosed with stage 4 non-Hodgkin’s lymphoma in 2021, IPS officer Nidhin Valsan resurrected himself by competing the Ironman triathlon and writing his memoir because he hopes to be a good influence on other cancer patients Full Article Delhi
ring Delhi | The DAG is hosting an exhibition that celebrates MF Husain and his enduring legacy By www.thehindu.com Published On :: Sat, 09 Nov 2024 15:44:19 +0530 An exhibition in New Delhi’s DAG covers pivotal moments of legendary artist and painter MF Husain’s artistic journey Full Article Art
ring One dead, one injured in two firing incidents in Delhi within 10 minutes By www.thehindu.com Published On :: Sat, 09 Nov 2024 16:49:04 +0530 The two incidents of firing in northeast Delhi leave one dead and one injured; three suspects apprehended by police Full Article Delhi
ring ARRL VEC Services Update During Systems Disruption By www.arrl.org Published On :: Wed, 30 Oct 2024 14:43:00 -0500 Updated 10/30/2024ARRL previously reported that we are responding to a serious incident involving access to our network and headquarters-based systems. Several services have been affected, including those administered by the ARRL Volunteer Examiner Coordinator (ARRL VEC).Exam Registrations and Materials. ARRL Volunteer Examiners (VEs) should continue to submit exam registrations and material re... Full Article
ring ARRL Recognizes University of Scranton During Amateur Radio Station Dedication By www.arrl.org Published On :: Thu, 31 Oct 2024 13:06:00 -0500 The University of Scranton in Pennsylvania has a new amateur radio station, W3USR. A dedication was held at the university’s Loyola Science Center on Friday, October 25, 2024, led by Dr. Nathaniel Frissell, W2NAF, an associate professor of physics and electrical engineering, and club advisor for the University of Scranton Amateur Radio Club.The new W3USR University of Scranton Amateur Radio Sta... Full Article
ring Strategies for an enduring legacy By www.thehindubusinessline.com Published On :: Sun, 01 Nov 2020 21:05:00 +0530 How firms can thrive in an era of social tension, economic nationalism and tech revolution Full Article Books
ring Exploring India’s diversity By www.thehindubusinessline.com Published On :: Sun, 13 Jun 2021 20:47:19 +0530 A corporate honcho’s reflections on business and beyond Full Article Books
ring Booming Digital Stars: 11 Inspiring Journeys from India’s Creator Economy By www.thehindubusinessline.com Published On :: Sat, 19 Mar 2022 15:26:08 +0530 Lessons from the exciting success stories of social media influencers Full Article Business Economy
ring Tobacco Board authorises 100 million kg crop size for Karnataka during 2024-25 By www.thehindu.com Published On :: Mon, 18 Mar 2024 11:07:46 +0530 Registration process for upcoming crop season will commence on March 27 Full Article Agriculture
ring Eyebrows raised as Central team visits Anantapur to assess rabi drought during rainy kharif By www.thehindu.com Published On :: Wed, 19 Jun 2024 20:31:59 +0530 The team choosing mandals like Vidapanakallu and Vajrakarur which received excessive rain in June, draws flak from farmers and district officials alike; farmers worry as to how to present their drought woes to the officials who are visiting their fields which are now rain-fed and green Full Article Andhra Pradesh
ring BJP protecting SEBI chairperson Madhabi Puri Buch from answering to PAC: Congress By www.thehindu.com Published On :: Sat, 26 Oct 2024 23:00:46 +0530 Leader of the Opposition in the Lok Sabha Rahul Gandhi said Ms. Buch was being protected from giving answers to Parliament, from resigning as SEBI chief and from an investigation into her alleged links with the Adani Group companies. Ms. Buch had skipped the PAC meeting citing personal reasons Full Article India
ring Tamil Nadu airport infrastructure: Excitement in the air — preparing the ground for take off By www.thehindu.com Published On :: Sun, 10 Nov 2024 00:54:18 +0530 Air travel in Tamil Nadu could see a boom over the next few years as significant infrastructure development is in the offing at airports in tier 2 cities across the State. With the State government keen on ensuring distributed growth, strengthening the aviation infrastructure could be a stimulus to the regional economic development as enhanced air connectivity is expected to help attract investment, trade, and tourism Full Article Tamil Nadu
ring Three engineering students drown in Cauvery river in Namakkal By www.thehindu.com Published On :: Sun, 10 Nov 2024 16:01:40 +0530 Jedarpalayam police registered a case and are investigating Full Article Coimbatore
ring Heavy rainfall forecast for Chennai, neighbouring districts till November 15 By www.thehindu.com Published On :: Mon, 11 Nov 2024 19:11:40 +0530 Chennai district collector has declared holiday for schools on November 12 owing to rain Full Article Chennai
ring Chennai and neighbouring districts to witness heavy rains till November 15 By www.thehindu.com Published On :: Tue, 12 Nov 2024 15:08:56 +0530 On Nov. 12, RMC, Chennai, upgraded its weather warning to orange alert, indicating a possibility of rainfall of very heavy intensity for 24 hours ending 8.30 a.m. on Nov. 13 in Chennai, Tiruvallur, and Chengalpattu districts Full Article Chennai
ring Carboxymethyl cellulose-stabilized calcium phosphate particles for injectable hydrogel-based bone tissue engineering By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00670D, PaperPiyaporn Srisura, Yuwaporn Pinyakit, Umphan Ngoensawat, Pongsakorn Yuntasiri, Khoiria Nur Atika Putri, Theerapat Chanamuangkon, Waranyoo Phoolcharoen, Varol Intasanta, Voravee P. HovenCarboxymethyl cellulose-stabilized calcium phosphate particles well-dispersed in aqueous solution can be integrated into an injectable hydrogel made of methacrylated hyaluronic acid which is a promising material for bone regeneration applications.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Random field reconstruction of three-phase polymer structures with anisotropy from 2D-small-angle scattering data By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8493-8504DOI: 10.1039/D4SM00721B, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Stephen Kronenberger, Nitant Gupta, Benjamin Gould, Colin Peterson, Arthi JayaramanWe present a computational method to analyze 2D small-angle scattering data from three-phase soft materials systems with structural anisotropy and output representative real-space structures of the three phases.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Rolling and ordering of micro rods in shear flow induced by rod wall interactions By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00999A, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Martin Wittmann, Igor M. Kulić, Antonio Stocco, Juliane SimmchenWe use experiments and theoretical models to investigate the rolling and translational motion of rod-shaped micro particles close to a solid wall in the presence or absence of shear flow.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Pickering emulsions for stimuli-responsive transdermal drug delivery: effect of rheology and microstructure on performance By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8621-8637DOI: 10.1039/D4SM00993B, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Simona Migliozzi, Yiting He, Maryam Parhizkar, Yang Lan, Panagiota AngeliElucidating the impact of microgels attributes on the microstructure, rheology and functionality of Pickering emulsions.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Influence of counterion type on the scattering of a semiflexible polyelectrolyte By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8610-8620DOI: 10.1039/D4SM00874J, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Anish Gulati, Jack F. Douglas, Olga Matsarskaia, Carlos G. LopezUnderstanding the influence of counterion and backbone solvation on the conformational and thermodynamic properties of polyelectrolytes in solution is one of the main open challenges in polyelectrolyte science.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Light scattering study of algal floc growth and structure: alum vs. polymeric plant-derived flocculant By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00837E, PaperTemitope Orimolade, Ngoc-Tram Le, Lyle Trimble, Bandaru Ramarao, Sitaraman KrishnanAlgal flocculation using alum shows dynamic fractal restructuring over time, while Moringa oleifera protein induces faster densification, enhancing floc strength.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Thin free-standing liquid films manipulation: device design to turn on/off gravity in flow regimes for thickness map control and for material structuring By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00951G, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Paolo Iaccarino, Zhe Wang, Andrea Marfuggi, Simone Russo, Vincenzo Ferraro, Giuseppe Vitiello, Sara Coppola, Ernesto Di MaioWe design a device to control liquid film drainage, able to switch between viscous-capillary and viscous-gravity regimes to stabilize thickness and modify particle arrangement, offering potential for film studies and 2D structure fabrication.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Ring-shaped nanoparticle assembly and cross-linking on lipid vesicle scaffolds By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM01010H, Communication Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Gizem Karabiyik, Aldo Jesorka, Irep GözenWe show the assembly and cross-linking of carboxylate-modified polystyrene nanoparticles into flexible circular, ring-shaped structures with micrometer sized diameters around the base of surface-adhered giant lipid vesicles.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Pairing-specific microstructure in depletion gels of bidisperse colloids By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00811A, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Rony A. Waheibi, Lilian C. HsiaoWe report the ensemble-averaged and pairing-specific network microstructure formed by short-range depletion attractions in bidisperse hard sphere-like colloidal systems.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ring Five Interesting Ways to Use Array.reduce() (And One Boring Way) By 24ways.org Published On :: Wed, 18 Dec 2019 12:00:00 +0000 Chris Ferdinandi turns the heat down low and lets the sauce reduce while we take a look at how to add spice to our source with a sprinkling of Array.reduce(). Just a little ingenuity with the humblest of functions. Of all the modern array methods, the one I had the hardest time wrapping my head around was Array.reduce(). On the surface, it seems like a simple, boring method that doesn’t do much. But below its humble exterior, Array.reduce() is actually a powerful, flexible addition to your developer toolkit. Today, we’re going to look at some cool things you can do with Array.reduce(). How Array.reduce() works Most of the modern array methods return a new array. The Array.reduce() method is a bit more flexible. It can return anything. Its purpose is to take an array and condense its content into a single value. That value can be a number, a string, or even an object or new array. That’s the part that’s always tripped me up – I didn’t realize just how flexible it is! The syntax The Array.reduce() accepts two arguments: a callback method to run against each item in the array, and a starting value. The callback also accepts two arguments: the accumulator, which is the current combined value, and the current item in the loop. Whatever you return is used as the accumulator for the next item in the loop. On the very first loop, that starting value is used instead. var myNewArray = [].reduce(function (accumulator, current) { return accumulator; }, starting); Let’s look at some examples to make this all tangible. 1. Adding numbers together Let’s say you had an array of numbers that you wanted to add together. Using Array.forEach(), you might do something like this: var total = 0; [1, 2, 3].forEach(function (num) { total += num; }); This is the cliche example for using Array.reduce(). I find the word accumulator confusing, so in this example, I’m calling it sum, because that’s what it is. var total = [1, 2, 3].reduce(function (sum, current) { return sum + current; }, 0); Here, we pass in 0 as our starting value. In the callback, we add the current value to the sum, which has our starting value of 0 on the first loop, then 1 (the starting value of 0 plus the item value of 1), then 3 (the sum value of 1 plus the item value of 2), and so on. Here’s a demo. 2. Combining multiple array methods into Array.map() and Array.filter() into a single step Imagine you had an array of wizards at Hogwarts. var wizards = [ { name: 'Harry Potter', house: 'Gryfindor' }, { name: 'Cedric Diggory', house: 'Hufflepuff' }, { name: 'Tonks', house: 'Hufflepuff' }, { name: 'Ronald Weasley', house: 'Gryfindor' }, { name: 'Hermione Granger', house: 'Gryfindor' } ]; You want to create a new array that contains just the names of wizards who are in Hufflepuff. One way you could do that is by using the Array.filter() method to get back just wizards whose house property is Hufflepuff. Then, you’d use the Array.map() method to create a new array containing just the name property for the remaining wizards. // Get the names of the wizards in Hufflepuff var hufflepuff = wizards.filter(function (wizard) { return wizard.house === 'Hufflepuff'; }).map(function (wizard) { return wizard.name; }); With the Array.reduce() method, we can get the same array in a single pass, improving our performance. You pass in an empty array ([]) as the starting value. On each pass, you check to see if the wizard.house is Hufflepuff. If it is, you push it to the newArr (our accumulator in this example). If not, you do nothing. Either way, you return the newArr to become the accumulator on the next pass. // Get the names of the wizards in Hufflepuff var hufflepuff = wizards.reduce(function (newArr, wizard) { if (wizard.house === 'Hufflepuff') { newArr.push(wizard.name); } return newArr; }, []); Here’s another demo. 3. Creating markup from an array What if, instead of creating an array of names, we wanted to create an unordered list of wizards in Hufflepuff? Instead of passing an empty array into Array.reduce() as our starting value, we’ll pass in an empty string ('') and call it html. If the wizard.house equals Hufflepuff, we’ll concatenate our html string with the wizard.name wrapped in an opening and closing list item (li). Then, we’ll return the html to become the accumulator on the next loop. // Create a list of wizards in Hufflepuff var hufflepuffList = wizards.reduce(function (html, wizard) { if (wizard.house === 'Hufflepuff') { html += '<li>' + wizard.name + '</li>'; } return html; }, ''); Add an opening and closing unordered list element before and after Array.reduce(), and you’re ready to inject your markup string into the DOM. // Create a list of wizards in Hufflepuff var hufflepuffList = '<ul>' + wizards.reduce(function (html, wizard) { if (wizard.house === 'Hufflepuff') { html += '<li>' + wizard.name + '</li>'; } return html; }, '') + '</ul>'; See it in action here. 4. Grouping similar items in an array together The lodash library has a groupBy() method takes a collection of items as an array and groups them together into an object based on some criteria. Let’s say you want an array of numbers. If you wanted to group all of the items in numbers together based on their integer value, you would do this with lodash. var numbers = [6.1, 4.2, 6.3]; // returns {'4': [4.2], '6': [6.1, 6.3]} _.groupBy(numbers, Math.floor); If you had an array of words, and you wanted to group the items in words by their length, you would do this. var words = ['one', 'two', 'three']; // returns {'3': ['one', 'two'], '5': ['three']} _.groupBy(words, 'length'); Creating a groupBy() function with Array.reduce() You can recreate that same functionality using the Array.reduce() method. We’ll create a helper function, groupBy(), that accepts the array and criteria to sort by as arguments. Inside groupBy(), we’ll run Array.reduce() on our array, passing in an empty object ({}) as our starting point, and return the result. var groupBy = function (arr, criteria) { return arr.reduce(function (obj, item) { // Some code will go here... }, {}); }; Inside the Array.reduce() callback function, we’ll check to see if the criteria is a function, or a property of the item. Then we’ll get its value from the current item. If there’s no property in the obj with that value yet, we’ll create it and assign an empty array as its value. Finally, we’ll push the item to that key, and return the object as the accumulator for the next loop. var groupBy = function (arr, criteria) { return arr.reduce(function (obj, item) { // Check if the criteria is a function to run on the item or a property of it var key = typeof criteria === 'function' ? criteria(item) : item[criteria]; // If the key doesn't exist yet, create it if (!obj.hasOwnProperty(key)) { obj[key] = []; } // Push the value to the object obj[key].push(item); // Return the object to the next item in the loop return obj; }, {}); }; Here’s a demo of the completed helper function. Special thanks to Tom Bremer for helping me make some improvements to this one. You can find this helper function and more like it on the Vanilla JS Toolkit. 5. Combining data from two sources into an array Remember our array of wizards? var wizards = [ { name: 'Harry Potter', house: 'Gryfindor' }, { name: 'Cedric Diggory', house: 'Hufflepuff' }, { name: 'Tonks', house: 'Hufflepuff' }, { name: 'Ronald Weasley', house: 'Gryfindor' }, { name: 'Hermione Granger', house: 'Gryfindor' } ]; What if you had another data set, an object of house points each wizard has earned. var points = { HarryPotter: 500, CedricDiggory: 750, RonaldWeasley: 100, HermioneGranger: 1270 }; Imagine you wanted to combine both sets of data into a single array, with the number of points added to each wizard’s data in the wizards array. How would you do it? The Array.reduce() method is perfect for this! var wizardsWithPoints = wizards.reduce(function (arr, wizard) { // Get the key for the points object by removing spaces from the wizard's name var key = wizard.name.replace(' ', ''); // If the wizard has points, add them // Otherwise, set them to 0 if (points[key]) { wizard.points = points[key]; } else { wizard.points = 0; } // Push the wizard object to the new array arr.push(wizard); // Return the array return arr; }, []); Here’s a demo combining data from two sources into an array. 6. Combining data from two sources into an object What if you instead wanted to combine the two data sources into an object, where each wizard’s name was the key, and their house and points were properties? Again, the Array.reduce() method is perfect for this. var wizardsAsAnObject = wizards.reduce(function (obj, wizard) { // Get the key for the points object by removing spaces from the wizard's name var key = wizard.name.replace(' ', ''); // If the wizard has points, add them // Otherwise, set them to 0 if (points[key]) { wizard.points = points[key]; } else { wizard.points = 0; } // Remove the name property delete wizard.name; // Add wizard data to the new object obj[key] = wizard; // Return the array return obj; }, {}); Here’s a demo combining two data sets into an object. Should you use Array.reduce() more? The Array.reduce() method has gone from being something I thought was pointless to my favorite JavaScript method. So, should you use it? And when? The Array.reduce() method has fantastic browser support. It works in all modern browsers, and IE9 and above. It’s been supported in mobile browsers for a long time, too. If you need to go back even further than that, you can add a polyfill to push support back to IE6. The biggest complaint you can make about Array.reduce() is that it’s confusing for people who have never encountered it before. Combining Array.filter() with Array.map() is slower to run and involves extra steps, but it’s easier to read. It’s obvious from the names of the methods what they’re supposed to be doing. That said, there are times where Array.reduce() makes things that would be complicated more simple rather than more complicated. The groupBy() helper function is a good example. Ultimately, this is another tool to add to your toolkit. A tool that, if used right, can give you super powers. About the author Chris Ferdinandi helps people learn vanilla JavaScript. He believes there’s a simpler, more resilient way to make things for the web. Chris is the author of the Vanilla JS Pocket Guide series, creator of the Vanilla JS Academy training program, and host of the Vanilla JS Podcast. His developer tips newsletter is read by thousands of developers each weekday. He’s taught developers at organizations like Chobani and the Boston Globe, and his JavaScript plugins have been used used by Apple and Harvard Business School. Chris Coyier, the founder of CSS-Tricks and CodePen, has described his writing as “infinitely quote-worthy.” Chris loves pirates, puppies, and Pixar movies, and lives near horse farms in rural Massachusetts. He runs Go Make Things with Bailey Puppy, a lab-mix from Tennessee. More articles by Chris Full Article Code javascript
ring Bring home the medals By www.thehindu.com Published On :: Wed, 31 Aug 2016 16:28:12 +0530 Fashion designer Ritu Beri wonders if privatisation is the key to India performing better at global sporting events Full Article Metroplus
ring String theory By www.thehindu.com Published On :: Wed, 26 Oct 2016 14:20:51 +0530 Vidhya Maghanath Sunder designed jewellery as a hobby, but the response she got for her creations convinced her to look at it as a serious business venture Full Article Metroplus