text:
Q: Java - Regex String replacement I want to replace some parts of a String with Regex. It's the 192001Z part of the string I want to replace.
Code:
String met = "192001Z 17006KT 150V210 CAVOK 11/07 Q1004 NOSIG";
String regexZ = "[0-9].{5}Z";
met = met.replaceAll(regexZ, "${.now?string(\"ddHHmm\")}Z");

I get an error when I want to replace a part of the String with ${.now?string(\"ddHHmm\")}Z.
But when I e.g. replace ${.now?string(\"ddHHmm\")}Z with ThisNeedsToBeReplaced everything works just fine. So my guess is that something is wrong with the string I want to use to replace parts of my original string (met).
The error I receive is Illegal group reference.
Does anyone have an idea what's wrong with ${.now?string(\"ddHHmm\")}Z?

A: You need to use:
met = met.replaceAll("\\b\\d{6}Z\\b", "\\${.now?string(\"ddHHmm\")}Z");

*

*Correct regex to match 192001Z is \b\d{6}Z\b

*You need to escape $ in replacement as well otherwise it is considered a back reference e.g. $1, $2 etx.

redpajama_set_name: RedPajamaStackExchange


text:
technology News>
This bio-based material can boost battery charging in EVs, smartphones
By CNBCTV18.com | Dec 30, 2021, 03:23 PM IST (Published)
Researchers at the Japan Advanced Institute of Science and Technology have developed a carbon-based anode, which is a polymer synthesised from bio-based raw materials. The scientific process can lead to electric car batteries getting recharged in 15 minutes or less.
A group of Japan-based researchers have come up with a method of boosting the charging capacity of batteries in electric cars, a move that could result in more durable batteries for cars and even smartphones, AFP reported.
Problem with batteries
Despite an appetite for hybrid cars, sales of electric cars have not taken off in Japan. This is because these cars have a problem with range and availability of charging stations. The cost of electric cars is also very high as compared to fuel-based cars. Apart from this, there are problems related to the battery composition. Like many other batteries, those of electric cars use lithium-ion cells which have been linked to grave environmental concerns.
According to a report by The New York Times, the estimated recycling rate of lithium-ion batteries is around 5 percent in the US as compared to 99 percent for lead-acid batteries.
To ensure broader transition to electric vehicles (EV), researchers from the Japan Advanced Institute of Science and Technology (JAIST) have come up with a method of manufacturing anodes that can charge lithium-ion batteries at a faster pace.
Faster charging
JAIST researchers have developed a carbon-based anode, which is a polymer synthesised from bio-based raw materials. The anode is calcinated to increase its nitrogen content. The scientific process can lead to electric car batteries getting recharged in 15 minutes or less.
Can we use this on smartphones?
Even after 3,000 charge-discharge cycles at high rates, these batteries can retain nearly 90 percent of the initial capacity, durability tests have revealed. This capacity is much higher than that of graphite-based cells used in conventional lithium-ion batteries.
According to researchers, the polymer structure could be modified for enhanced performance of batteries that could be used in EVs and smartphones.
"Much shorter charging times will hopefully attract consumers to choose EVs rather than gasoline-based vehicles, ultimately leading to cleaner environments in every major city across the world," AFP quoted Noriyoshi Matsumi, lead researcher of the study published in Chemical Communications, as saying.
Meanwhile, research on other rechargeable batteries is being conducted across the world. In November, researchers from Ford and Purdue University in the US developed a new charging cable for electric cars. This small wire, which is awaiting patent, is likely to deliver more power than the current technology used to re-charge EVs, AP reported.
Read Also | Here's how much it costs to charge an EV in Delhi, Mumbai and Bengaluru
(Edited by : Thomas Abraham)
electric vehicle (EV)

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: The event in the fullcalendar is not added to the next year When I add an event for the current year, everything works. And when I add on any date of the next year, it is not added, and error in console:
plugins.bundle.js:54 Uncaught TypeError: Cannot set properties of undefined (setting 'tabIndex')
    at V (plugins.bundle.js:54:16706)
    at I (plugins.bundle.js:54:12928)
    at L.b.setDate (plugins.bundle.js:54:32849)
    at populateForm (calendar.js?80967:931:22)
    at handleNewEvent (calendar.js?80967:438:9)
    at t.select (calendar.js?80967:145:17)
    at e.trigger (fullcalendar.bundle.js:20:82181)
    at mr (fullcalendar.bundle.js:20:48529)
    at n.handlePointerUp (fullcalendar.bundle.js:20:188907)
    at e.trigger (fullcalendar.bundle.js:20:82181)

I did not find information on this error on the Internet. I tried to change the order import scripts, but it does not help. I am using fullcalendar with metronic template.