Latest Posts

It's because the dot (.) in regex is any character, while \. is literal dot. Try the following code: $matches = null; $input = '123456...'; preg_match('/(?\d+)(?\.+)/', $input, $matches); $numbers = $matches['nums']; $periods = $matches['periods']; $nums_only = preg_replace('/[^\d]/', '', $input);...

Invert key value in js object

JavaScript - jQuery - Ajax 10 1

You have to loop the array and for each item in the array check if an array for that value exists in the accumulator or not before adding it: const data = { "first":["de"], "second":["ab","de"], "third":["de"] } let result = Object.entries(data).reduce((acc, [key, arr]) => { // for each...

A promising new study, published in the journal Nature Immunology, is describing the discovery of a novel kind of immune cell with the ability to not only prevent the progressive neurological degeneration associated with diseases such as multiple sclerosis and ALS, but which may even regenerate and repair damaged cells. ...

Water has been discovered on the sunlit surface of the moon, NASA announced, an important revelation that indicates water may be distributed across the lunar surface – and not just limited to its cold, shadowed places such as the poles. ...

Reverse the characters added in text field

JavaScript - jQuery - Ajax 10 1

Try use and study the following code: Button function backwards(inp, rev) { const backwardsInput = inp.value.split('').reverse().join(''); rev.textContent = backwardsInput; }const bkinp = document.getElementById('backwards-input'); const bkbtn = document.getElementById('backwards-button'); const revtxt = document.getElementById('backwards-container'); bkbtn.addEventListener('click', ()=>{ backwards(bkinp, revtxt)}); ...

Solar pavements for energy supply

Remarkable News 11 0

A Hungarian tech company is taking small steps with recycled plastic waste to make solar panels built into pavements to power buildings and charge electronic devices in public places. ...

The attribute disabled sets without value (without ='true' ). You need just add this attribute into the options you want disabled. for setting this attribute on JavaScript with jQuery, you need to write something like this: $('option.dis').attr('disabled'); for check option to disabled: if ($('option.dis').prop('disabled') === true)...

You need to get two random numbers: - the first to decide which group to pick, - the second to pick an item from that. We generate a random number from 1 to 100. - A number from 1 to 20 would pick a random element from the...

Although there are electric rollerblades and skateboards, sometimes people just want a temporary boost while using their existing non-electric set of wheels. That's why Veelo was invented. Created by...

Scientists in Japan have produced a plastic with the highest heat resistance ever reported, and done so by using natural materials. This biomass-derived plastic therefore promises not just greater performance in some aspects than conventional plastics, but paves the way toward greener production for the omnipresent material. ...

Researchers have developed windows that can change color automatically when heated by sunlight, to keep buildings cool – and to top it off, they’re solar panels as well and generate electricity from sunlight. ...

As a storage solution for renewable energy, scientists see great potential in what are known as redox flow batteries, which hold energy in large tanks rather than compact electrode materials. A new design from Sweden’s Linköping University is a decidedly green version of this technology, swapping out scarce metals and...

Fat is best known for being an energy storage system, but now researchers have discovered that it plays a previously unknown role in defense against infection. A team from the Universities of Queensland and Barcelona found that cells can use fats to fight off bacteria. ...

Thoughts from my Inner

Spirituality 2306 20

Everything you see, hear, feel, ... everything you perceive is You, because everything you think is You; because your mind is YOU. Everything you do, you do to yourself....

NASA has chosen Nokia to build a 4G network on the moon as part of the space agency's Artemis programme, which aims to establish a sustainable human presence there. The...

Who is online

In total there are 6 users online :: 1 registered, 0 hidden and 5 guests (based on users active over the past 5 minutes)
Most users ever online was 329 on Wed Jan 22, 2020

Registered users: CommonCrawl [Bot]