Closure in JavaScript – Explained with Examples

In this article, we are going to talk about closures in JavaScript. I’ll walk you through the definition of a closure, a simple day-to-day fetch utility closure example, and some of the advantages and disadvantages of using closures. Table of Contents * Prerequisites * What are

Today’s best deals: Apple gift cards, Amazon Kids tablets, and more

Today’s best deals: Apple gift cards, Amazon Kids tablets, and more

Enlarge (credit: Ars Technica)

It’s time for another Dealmaster! Our latest roundup of the best tech deals from around the web includes a couple of useful offers on Apple gift cards.

Over at Amazon, you can get a bonus $5 store credit when you buy a $50 Apple gift card. The offer applies to both digital and physical versions of the gift card; you’ll have to use the code “APPLEDEAL” at checkout to see the deal if you opt for the former, or “APPLEAPRIL” if you go for the latter. Either way, Amazon says it’ll apply the credit to your account within three days of your purchase. It’ll then automatically be used the next time you buy something on the site sold by Amazon itself.

The promo credit in Amazon’s deal doesn’t stack, so if you wanted more “Apple money,” note that Target is running a similar promotion that gives a $10 store credit when you buy a $100 Apple gift card there. This deal only applies to the digital version of the gift card, though.

Read 3 remaining paragraphs | Comments

Ancient Peruvian was buried with tools for cranial surgery

Ancient Peruvian was buried with tools for cranial surgery

(credit: Sican National Museum)

Archaeologists recently unearthed an unusual tomb in a temple complex at the Huaca Las Ventanas archaeological site near Lambaeque, in northern Peru. The site belonged to the Sican culture, one of the several complex societies that flourished prior to the rise of the Inca Empire (around 1400 CE) in northern Peru. The tomb reveals that the Sican—like several other Indigenous cultures spanning the length of Peru and about 4,000 years of history—practiced a type of cranial surgery called trepanation.

The surgeon’s tomb

Trepanation is the delicate art of cutting or drilling a hole in a person’s skull. It sounds brutal, but it can help relieve pressure on the brain from inflammation or bleeding, such as might occur after a head injury. Modern surgeons sometimes use a similar procedure, called a craniotomy, to relieve pressure from bleeding under the membrane that surrounds the brain.

Of course, modern craniotomies are guided by CT scans and MRIs. Ancient surgeons just had to go by sight and feel, which makes their success rates pretty remarkable. Archaeologists in Peru have found the remains of about 800 trepanation patients from the last 4,000 years, and the majority of them show signs of bone healing around the edges of the hole—which means they survived serious head trauma and cranial surgery to treat it.

Read 14 remaining paragraphs | Comments

Python .zip() – Zip Function in Python

When you use the zip() function in Python, it takes two or more data sets and “zips” them together. This returns an object containing pairs of items derived from the data sets. It groups these items in the order of their indexes. Let me break it down a bit

Calif. lawyer resigns “in protest,” points to Newsom “interference” in Activision case

Calif. lawyer resigns “in protest,” points to Newsom “interference” in Activision case

Enlarge (credit: Aurich Lawson | Getty Images)

One of the main lawyers in California’s ongoing discrimination and harassment case against Activision Blizzard has resigned, citing “interference” by the office of Governor Gavin Newsom.

Bloomberg reports that Melanie Proctor, the assistant chief counsel for California’s Department of Fair Employment and Housing (DFEH), said in a resignation email Tuesday that Newsom’s office “repeatedly demanded advance notice of litigation strategy and of next steps in the litigation.” That interference, which Proctor says increased with her agency’s “wins” in state court, “mimick[ed] the interests of Activision’s counsel,” Proctor wrote.

The resignation letter noted that Chief Counsel Janette Wipper previously combatted this interference by “attempt[ing] to protect” the agency’s autonomy to prosecute, but Proctor alleges that her efforts directly led to Wipper being “abruptly terminated.” In response, Proctor filed her own resignation notice on Wednesday—which she claims is “in protest of the interference and Janette’s termination.”

Read 9 remaining paragraphs | Comments

Learn CRUD Operations in JavaScript by Building TODO APP

Today we’re gonna learn how to do CRUD Operations in JavaScript by making a Todo App. Let’s get started 🔥 This is the app we’re making today: * Live preview [https://crud-application-al9am9v2v-joyshaheb.vercel.app/] * GitHub Repository [https://github.com/JoyShaheb/CRUD-Application] You can watch this tutorial on YouTube as well if you like 🎥

Razer-designed Linux laptop targets AI developers with deep-learning emphasis

Lambda Tensorbook open

Enlarge (credit: Lambda)

Razer is primarily known for its gaming PCs and peripherals, but the company has also been known to dip its toes into the productivity space from time to time. The Razer x Lambda Tensorbook announced Tuesday sees Razer stepping even further out of its comfort zone. Made in collaboration with Lambda, the Linux-based clamshell focuses on deep-learning development.

Lambda, which has been around since 2012, is a deep-learning infrastructure provider used by the US Department of Defense and “97 percent of the top research universities in the US,” according to the company’s announcement. Lambda’s offerings include GPU clusters, servers, workstations, and cloud instances that train neural networks for various use cases, including self-driving cars, cancer detection, and drug discovery.

Dubbed “The Deep Learning Laptop,” the Tensorbook has an Nvidia RTX 3080 Max-Q (16GB) and targets machine-learning engineers, especially those who lack a laptop with a discrete GPU and thus have to share a remote machine’s resources, which negatively affects development.

Read 7 remaining paragraphs | Comments

Find the soul