Python Parse JSON – How to Read a JSON File

JSON (JavaScript Object Notation) is a popular way to structure data. It’s used to exchange information between a web application and the server. But how do you read a JSON file in Python? In this article, I will show you how to use the json.loads() and json.load() methods to

CSS Button Style – Hover, Color, and Background

In this article you’ll see how to style a button using CSS. My goal here is mostly to showcase how different CSS rules and styles are applied and used. We won’t see much design inspiration nor will we discuss ideas for styling. Instead, this will be more of an overview

For Loop in Java + forEach Loop Syntax Example

A loop in programming is a sequence of instructions that run continuously until a certain condition is met. In this article, we will learn about the for and forEach loops in Java. Syntax for a for loop in Java Here is the syntax for creating a for loop: for (initialization;

How to Use CSS Overview in Chrome Dev Tools

If you’re a web developer, you probably appreciate a well-designed and attractive website. And you might see a color scheme or font on a specific website that you want to incorporate into your blog or web app. But you’ll need a browser extension to see the website’s color scheme

What Can Money Heist Teach Us About Cybersecurity?

I was watching the TV series, La Casa De Papel (Money Heist), on Netflix a few weeks ago. I realized that the story of the gang can reveal some best practices we should use while dealing with the security of the products we build. Beware – this text contains spoilers.

Battery-powered trains are picking up speed

Battery-powered trains are picking up speed

Enlarge (credit: Wabtec)

Battery-electric power is commonplace in cars and trucks and is being tested in planes, helicopters, and container ships. Now, battery power is coming to trains, in place of the diesel-fueled generators that have powered locomotives for more than a century.

Last week, Union Pacific Railroad agreed to buy 20 battery-electric freight locomotives from Wabtec and Progress Rail. The deal, which drew praise from President Biden, is worth more than $100 million. The battery-electric locomotives initially will be used to sort train cars in rail yards in California and Nebraska.

Battery-electric locomotives have already begun rolling on California tracks. As part of a demonstration with the Pacific Harbor Line, Progress Rail, a Caterpillar company, began operating battery-electric locomotives in the ports of Los Angeles and Long Beach late last year.

Also last year, Wabtec tested its FLXdrive locomotives on 18 trips between Barstow and Stockton, California, under a $22 million grant from the California Air Resources Board. The battery-electric locomotive sat between two traditional diesel locomotives, pulling as much as 430,000 pounds. Wabtec CTO Eric Gebhardt says the combination saved an average of 11 percent on fuel and emissions. Wabtec says its next-generation battery locomotive will nearly triple its energy storage capacity to 7 megawatt-hours, nearly 100 times the capacity of a Tesla Model 3. That could cut emissions by up to 30 percent, Gebhardt says.

Switching to battery-electric power will reduce greenhouse gas emissions and improve local air quality. Diesel locomotives spew particulate matter and other toxic pollutants, accounting for an estimated 1,000 premature deaths and $6.5 billion in health costs a year in the US. A spokesperson for the California Air Resources Board says replacing diesel locomotives will “undoubtedly have a positive health impact to nearby communities” and will represent “a step forward in the long-standing environmental justice concerns of communities living near rail yards in our state.”

Last fall, researchers from Lawrence Berkeley National Laboratory and UCLA’s Institute of the Environment and Sustainability predicted that retrofitting traditional diesel locomotives with battery power could save railroads $94 billion in fuel costs over 20 years, after buying the batteries, and would keep tons of pollutants out of the air. Trains in the US are especially well-suited for retrofitting with battery power because most locomotives use a diesel generator but have electric motors.

“This is the beauty. Because they already are electric, if someone decides to do it they can do it in a month,” says coauthor Amol Phadke, who studies heavy-duty electric vehicles and grid-scale battery storage. “All you’re doing is adding a railcar which has a huge amount of batteries on it.”

Taking battery, diesel, and electricity prices into account, the researchers estimate that adding a car with a 14-MWh battery to a train with four diesel locomotives could cut fuel costs in half. Getting battery-electric locomotives into service quickly is a big deal, since traditional diesel locomotives can operate for more than 20 years, Phadke says.

A startup that came out of stealth last month has another idea: Parallel Systems wants to move freight using self-driving, battery-powered, autonomous rail vehicles. The trains would assemble automatically and travel with no conductor, no locomotive, and no train whistle. Should Parallel Systems succeed, fully autonomous self-driving could come to rails before roads.

Parallel Systems was founded in January 2020 by a group of ex-SpaceX executives and is largely still a concept. Parallel Systems CEO Matt Soule envisions platoons of rail vehicles that resemble giant Roombas carrying 10 to 50 shipping containers, but that’s based on modeling and simulations, since the company has so far built only two rail vehicles. A second-generation rail vehicle is due later this year.

Soule says Parallel is trying to develop software that will work with existing railroads and incorporate necessary safety features. “We’re not replacing trains,” he says. “This is about shifting more truck miles to rail.”

Each of these battery-electric approaches brings the promise of a cleaner environment, lower fuel costs for railways, and fewer premature deaths from air pollution, but they lack the same thing that has hindered adoption of electric cars: charging stations.

Wabtech and BNSF Railway built the first battery-electric locomotive charging station in a train yard in Stockton as part of the test run last year. That used a 400-kilowatt plug, but later models of Wabtec’s FLXdrive will charge using pantograph technology, reaching down with an arm to touch a contact at the top of the locomotive.

Union Pacific says its battery-electric locomotives initially will operate only in rail yards to test performance in extreme cold and heat. The railroad will develop charging stations in partnership with the American Association of Railways, which is developing standards with representatives of railroads and locomotive makers. A spokesperson for the group says the standards won’t favor a specific method of charging.

A Wabtec spokesperson says the company can provide plug-in charging, but charging from the top of locomotives will be easier. Parallel Systems is developing a charging pad that connects beneath rail vehicles and sits between train tracks.

The Lawrence Berkeley Lab–UCLA study says building charging stations will account for a substantial portion of the initial costs. Freight trains typically travel 1,000 miles or more, but stops for crew changes every 150 miles or so provide an opportunity to charge batteries. One advantage in building charging stations for locomotives: they don’t have to be in cities, which could help lower costs. “These charging facilities can be anywhere,” Phadke says.

Another possible advantage: the potential to capture energy as heavy, miles-long freight trains rumble down a hill. The Wabtec trial last year traveled 350 miles through the heart of California without recharging, because regenerative braking recharged batteries roughly 20 percent when going downhill.

The system is similar to the braking systems that charge the batteries of hybrid cars, Gebhardt says, noting that trains are pulling far more weight behind them. He thinks regenerative braking may reduce the number of charging stations needed for battery-electric locomotives.

The US Department of Energy’s Advanced Research Projects Agency–Energy last year launched a locomotives initiative, which is collecting models for predicting costs, performance, and greenhouse gas emissions for alternative-energy locomotives operated by major railroads. Bob Lodeux, the program director, says software can help reduce fuel use and emissions from traditional locomotives. Over time, he says, coordinating more activity among ships, trucks, and trains will be critical to decarbonizing the entire supply chain.

This story originally appeared on wired.com.

Read on Ars Technica | Comments

The oldest hominin fossil ever found in the Levant

The oldest hominin fossil ever found in the Levant

Enlarge (credit: Barash et al 2022)

When the first members of our species ventured out of Africa, they walked into a world that earlier hominins, such as Homo erectus, had first explored a million years earlier. According to a recent study of a 1.5 million-year-old vertebra, those earlier hominins may have expanded beyond Africa in several waves—each following different environments and equipped for different ways of life.

Taking a second look

Anthropologists found a single vertebra from the lower back of a hominin child who died 1.5 million years ago. Mixed with the fossilized bones of hippos, mammoths, giraffes, saber-toothed tigers, and warthogs, the bone had sat among the remains of Pleistocene fauna since the 1966 excavation that unearthed it. But when University of Tulsa anthropologist Miriam Belmaker, a co-author on the recent study, looked through the animal fossils as part of another recent study (an effort to narrow down the age of the site), she recognized the vertebra as belonging to a member of our genus, Homo.

And the fact that the pieces of the vertebra hadn’t all fused together into a single hard, bony piece meant that it came from a child who hadn’t yet finished growing and maturing. They were probably somewhere between 6 and 11 years old when they died.

Read 16 remaining paragraphs | Comments

This fossilized fish skull is filled with feces

View of the fossilized skull of an extinct species of stargazer fish, showing preserved fecal pellets in the brain.

Enlarge / View of the fossilized skull of an extinct species of stargazer fish, showing preserved fecal pellets in the brain. (credit: Calvert Marine Museum)

A fossilized cranium of an extinct species of stargazer fish was stuffed with tiny fecal pellets known as coprolites, according to a recent paper published in the journal Rivista Italiana di Paleontologia e Stratigrafia. The skull is the first in the fossil record to be completely filled with fecal pellets. This is a joint study by paleontologists at the University of Pisa in Italy and the Calvert Marine Museum in Maryland. Together, the researchers proposed that tiny scavenging worms ate their way into the dead fish’s skull and pooped out the pellets.

Around 1824, British fossil hunter Mary Anning (recently portrayed by Kate Winslet in the 2020 film Ammonite) was the first to notice the presence of so-called “bezoar stones” in the abdomens of ichthyosaur skeletons. When she broke open the stones, she often found the fossilized remains of fish bones and scales. A geologist named William Buckland took note of Anning’s observations five years later and suggested that the stones were actually fossilized feces. He dubbed them coprolites.

Coprolites aren’t quite the same as paleofeces, which retain a lot of organic components that can be reconstituted and analyzed for chemical properties. Coprolites are fossils, so most organic components have been replaced by mineral deposits like silicate and calcium carbonates. It can be challenging to distinguish the smallest coprolites from eggs, for example, or other kinds of inorganic pellets, but they typically boast spiral or annular markings, and, as Anning discovered, often contain undigested fragments of food.

Read 9 remaining paragraphs | Comments

Spotify removes 70 Joe Rogan episodes as he faces heat over use of n-word

Spotify's Joe Rogan Experience podcast seen on the screen of a smartphone.

Enlarge (credit: Getty Images | Cindy Ord )

Spotify on Friday removed 70 Joe Rogan Experience episodes from 2020 and previous years. Meanwhile, Rogan issued an apology after video showed him saying the n-word on various podcast episodes.

The new episode removals weren’t related to the COVID misinformation that led Neil Young, Joni Mitchell, and others to ask for their music to be pulled from Spotify, which caused a backlash from angry fans. But it was the second big round of Rogan episode removals since Spotify signed the podcast host.

“Previously, Spotify had pruned 43 ‘JRE’ episodes from the catalog after the company added Rogan’s show in September 2020 under a $100 million exclusive distribution pact. Those included segments with right-wing figures such as Infowars’ Alex Jones, Gavin McInnes and Milo Yiannopoulos and also episodes with comedians,” according to Variety.

Read 18 remaining paragraphs | Comments

Find the soul