it

CodeSOD: Counting it All

Since it's election day in the US, many people are thinking about counting today. We frequently discuss counting here, and how to do it wrong, so let's look at some code from RK.

This code may not be counting votes, but whatever it's counting, we're not going to enjoy it:

case LogMode.Row_limit: // row limit excel = 65536 rows
    if (File.Exists(personalFolder + @"" + fileName + ".CSV"))
    {
        using (StreamReader reader = new StreamReader(personalFolder + @"" + fileName + ".CSV"))
        {
            countRows = reader.ReadToEnd().Split(new char[] { '
' }).Length;
        }
    }

Now, this code is from a rather old application, originally released in 2007. So the comment about Excel's row limit really puts us in a moment in time- Excel 2007 raised the row limit to 1,000,000 rows. But older versions of Excel did cap out at 65,536. And it wasn't the case that everyone just up and switched to Excel 2007 when it came out- transitioning to the new Office file formats was a conversion which took years.

But we're not even reading an Excel file, we're reading a CSV.

I enjoy that we construct the name twice, because that's useful. But the real magic of this one is how we count the rows. Because while Excel can handle 65,536 rows at this time, I don't think this program is going to do a great job of it- because we read the entire file into memory with ReadToEnd, then Split on newlines, then count the length that way.

As you can imagine, in practice, this performed terribly on large files, of which there were many.

Unfortunately for RK, there's one rule about old, legacy code: don't touch it. So despite fixing this being a rather easy task, nobody is working on fixing it, because nobody wants to be the one who touched it last. Instead, management is promising to launch a greenfield replacement project any day now…

[Advertisement] Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.




it

No green thumb? Start your hobbit garden the easy way!

Have you always wanted to delight hobbit passerby with a beautiful springtime flower display but don't feel confident in your green thumb? Then you're in luck! Kili is here to show you just how easy it is to plant and grow bulbs! Watch the new episode and read her tips below.

https://youtu.be/EfTKXG9ndSs

Bulb planting tips:

  • Plant bulbs in the autumn so that they have time to chill over winter.
  • Choose a spot with partial to full sun
  • Bulbs need soil that drains well (so they don't turn to mush after prolonged exposure to moisture), so amend clay soil with perlite or other substances to aid drainage
  • As a general rule, dig a hole twice as deep as the bulb is tall.
  • Plant bulbs in the autumn so that they have time to chill over winter.
  • After the flowers have finished, don't prune them off! Allow the plant to continue its lifecycle. The leaves will continue to create and store energy that the bulb will use the following spring! The will die away on their own in mid-to-late summer.

Happy Hobbit has brought Middle-earth to its viewers' daily lives since 2012! Learn more hobbity recipes, crafts, and more by watching new episodes and/or perusing the 10+ years worth of videos on their YouTube channel. ???? New episodes debut every other Saturday, so be sure you are subscribed to Happy Hobbit so that you don't miss out!

Get even more slow-living hobbit content by following Happy Hobbit on Instagram, Facebook, Twitter, and TikTok! If watching the show has left you with an appetite for more, know that Kili (Kellie) has a podcast where Tolkien is often mentioned called Forests, Folklore & Fantasy













it

What to expect at the COP16 biodiversity summit

Countries are convening in Colombia to debate how they will achieve wide-ranging targets to stem biodiversity loss and how they plan to pay for it




it

Can sensor technology stop a wildfire before it starts?

The US Department of Homeland Security is trialling chemical sensors that detect the first whiff of smoke in the air and alert fire crews while a potential blaze is still smouldering




it

Morphing red blood cells help bats hibernate - and we could do it too

Animals that hibernate need a way to keep their blood flowing as their body temperature drops, and it seems that the mechanical properties of red blood cells may be key




it

Amateur sleuth finds largest known prime number with 41 million digits

The largest prime number is now 16 million digits longer than the previous record found in 2018, thanks to an amateur hunter and his large collection of high-power graphics cards




it

Google tool makes AI-generated writing easily detectable

Google DeepMind has been using its AI watermarking method on Gemini chatbot responses for months – and now it’s making the tool available to any AI developer




it

DNA has been modified to make it store data 350 times faster

Researchers have managed to encode enormous amounts of information, including images, into DNA at a rate hundreds of times faster than was previously possible




it

Your gut bacteria are at war - and force their enemies to switch sides

Rival tribes of bacteria armed with poison darts are fighting it out in your gut, with armies of traitors often winning the day




it

This surprisingly creative trick helps children eat more fruit and veg

Weaving tales of magical fruit and vegetables into your children's stories may encourage them to eat healthy snacks




it

NASA is developing a Mars helicopter that could land itself from orbit

The largest and most ambitious Martian drone yet could carry kilograms of scientific equipment over great distances and set itself down on the Red Planet unassisted




it

Earth is now gaining less heat than it has for several years

The recent surge in warming led to fears that climate change may be accelerating beyond model projections, but a fall in how much heat Earth is gaining makes this less likely




it

Weird microbes could help rewrite the origin of multicellular life

Single-celled organisms called archaea can become multicellular when compressed, highlighting the role of physical forces in evolution




it

Meditation seems to improve our empathy for strangers

In a small study, women experienced more empathy for strangers who were experiencing pain after an eight-week meditation training programme




it

The world is falling far short of its goal to halt biodiversity loss

In 2022, countries pledged to halt biodiversity loss by protecting 30 per cent of the planet by 2030, but progress has been too slow thus far




it

Astronauts could hitch a ride on asteroids to get to Venus or Mars

Asteroids that regularly fly between Earth, Venus and Mars could provide radiation shielding for human missions to explore neighbouring planets




it

Michelangelo's 'The Flood' seems to depict a woman with breast cancer

The Renaissance artist Michelangelo had carried out human dissections, which may have led him to include women with breast cancer in some of his pieces




it

Spies can eavesdrop on phone calls by sensing vibrations with radar

An off-the-shelf millimetre wave sensor can pick out the tiny vibrations made by a smartphone's speaker, enabling an AI model to transcribe the conversation, even at a distance in a noisy room




it

One in 20 new Wikipedia pages seem to be written with the help of AI

Just under 5 per cent of the Wikipedia pages in English that have been published since ChatGPT's release seem to include AI-written content




it

There may be a cosmic speed limit on how fast anything can grow

Alan Turing's theories about computation seem to have a startling consequence, placing hard limits on how fast or slow any physical process in the universe can grow




it

The COP16 biodiversity summit was a big flop for protecting nature

Although the COP16 summit in Colombia ended with some important agreements, countries still aren’t moving fast enough to stem biodiversity loss




it

Heat can flow backwards in a gas so thin its particles never touch

A surprising reversal of our usual understanding of the second law of thermodynamics shows that it may be possible for heat to move in the “wrong” direction, flowing from a cold area to a warm one




it

Spraying rice with sunscreen particles during heatwaves boosts growth

Zinc nanoparticles, a common sunscreen ingredient, can make plants more resilient to climate change – in a surprising way




it

Ancient Mesopotamian clay seals offer clues to the origin of writing

Before Mesopotamian people invented writing, they used cylinder seals to press patterns into wet clay – and some of the symbols used were carried over into proto-writing




it

3D printing with light and sound could let us copy human organs

One day, doctors might be able to 3D print copies of your organs in order to test a variety of drugs, thanks to a new technique that uses light and sound for rapid printing




it

2024 is set to be the first year that breaches the 1.5°C warming limit

This year’s average global temperature is almost certain to exceed 1.5°C above pre-industrial times – a milestone that should spur urgent action, say climate scientists




it

More people are living with pain today than before covid emerged

Chronic pain has increased among adults in the US since 2019, which could be due to a rise in sedentary lifestyles or reduced access to healthcare amid covid-19 restrictions




it

Slick trick separates oil and water with 99.9 per cent purity

Oil and water can be separated efficiently by pumping the mixture through thin channels between two semipermeable membranes




it

DNA analysis rewrites the stories of people buried in Pompeii

Genetic analysis of five individuals preserved as plaster casts in the ruins of Pompeii contradicts established beliefs about the people and their relationships




it

Quantum Rubik's cube has infinite patterns but is still solvable

Allowing for moves that create quantum superpositions makes a quantum version of a Rubik’s cube incredibly complex, but not impossible to solve




it

Our only visit to Uranus came at an unusual time for the planet

Voyager 2 flew by Uranus in 1986, giving us our only up-close look at the planet – but unusual space weather just before the craft arrived has given us a misleading idea about the planet’s magnetic field




it

Lights on surfboards and wetsuits could deter shark attacks

Experiments show that illuminating the underside of a decoy seal reduces attacks by great white sharks, revealing a possible strategy to protect surfers and swimmers




it

Red kites and buzzards are being killed by misuse of rat poisons

Campaigners are calling for stricter controls on rodenticides after finding that birds of prey in England are increasingly being exposed to high doses of rat poison




it

Humanity has warmed the planet by 1.5°C since 1700

Most assessments of global warming use 1850-1900 as a baseline, but researchers have now established a new pre-industrial reference by using Antarctic ice cores to estimate the average temperature before 1700




it

Jets of liquid bounce off hot surfaces without ever touching them

Droplets of fluid have been known to hover above a hot surface, but a new experiment suggests the same can happen to tiny jets of liquid too




it

20 Of The Cutest Itty Bitty Kitties That Can Easily Fit In The Palm Of Your Hand (November 9, 2024)

Good morning, cat people, and welcome back to the most dangerous, spooky listicle that will shake you to your core and leave you trembling. Do not be fooled by the title. While it is indeed true that this listicle is full of itty bitty kitties that can fit in the palm of your hand, that does not mean that it is not dangerous. In fact, it's much more dangerous than you think. These teeny weeny kitties have incredible powers of meownipulation. They can make us do all kinds of things, whether we want to or not. 

They even force us to write this listicle every single week, showcasing the tiniest kittens - i.e. the biggest criminals of the week. Beware of their powers when you start scrolling down, because before you know it, you may end up walking to a shelter in search of your fourth kitten to adopt. Trust us, we have been there, continue with caution. 




it

21 Terrific Tweets by Cat Pawrents Benefitting From the Bond With Their Fluffy Feline Friend

Hello all you cat pawrents, how are you doing this Caturday? Do you want to tell us about your cat child? Do you wish you could chit-chat about your fluffy feline friend all day long? Do you think any other humble hooman would want to hear about your kitty cat? If you answered "Yes" to the first two questions - know that you are very much not alone. A lot, and we mean a lot of cat pawrents just wait for an opportunity to talk about their beloved cat children. And if you've wondered about the answer to the third question - it's always a loud, resounding, meowing "Yes". There will always be cat pawrents who want to hear everything about other pawrents' cats, because cats are ameowzing.

Some cat pawrents do it all the time - they tweet a lot about their lovely cats like the true feline fanatic fans they are - and it's a delight for every one of us to read about their experiences and adventures. Here are a few of the funniest, for your cat-filled viewing pleasure.




it

Celebrate Caturday in Style with 26 Moments from the Magical Life of Panko the Chonky Cat Child and All Her Hilarious Feline Friends

Spending Cautrday with a cat, let alone a clouder of cats is a truly special experience. There is almost a slight sense of religion to it in how regimented and celebratory the day is. There are specific feeding times for different kinds of treats, each one representing a different feline quality that we love and cherish. There are specific zoomie times that must be observed and much to our dismay there are the clawminal times that must be observed and not interfered with. So if you are spending your Caturday with cats, or simply want to see what it would be like we made this list to help you celebrate Caturday in style with marvelous moments from the magical life of Panko the chonky cat and all her hilarious feline friends.

From the cute kitten whose favorite part of Caturday is the fish smoothie feeding, to the clawminal catto who is all about the chaos of Caturday, to the flabbergasted feline who cannot believe that treat time is over and that he missed it due to indulging in too many zoomies.




it

25 Pawsitive Energy Meowtivation Memes of Fierce Felines for Fending off Fall Fatigue

Unfortunately, life offers a myriad of buzzkillers throughout the day. Sometimes they pounce on you with some alarming news, but most of the time they creep in, luring you to slouch on the couch like snoozy sirens, and you can't find the will to fight back. 

It can be the cold weather, a grouchy boss, or even current events - negative thoughts and low energy tend to spread like a bad odor.  
 

Well, that's just not going to happen, fellow I Can Has-ers! We got your back. All you need is an energy boost of fierce feline funnies, furrociously pumping their paws. True, there are plenty of meownching photos in our content menu. We don't deny it! For everything, there is a season, a time to munch, and a time to crunch. 
 

For days of gloomy clouds, boring work, or just when your boss doesn't get your priorities (cats first, obviously), our Paw Power Practice is just the thing for you. The method we developed is both refreshing AND as old as time: the secret is to laugh until your abs strengthen, and your frown is upside down. Feline Fitness Fun, Try it! Fending off fall fatigue has never been so easy.




it

Mommy's little helper




it

28 Fortunate Floofy Funny Felines in Furtastic Memes to Meownifest Purrfectly Pawesome Positivity

Hey, feline fam. We don't know about you, but after our Caturdays filled with feline activities and catnip craziness, we like to unwind with some cat memes to mentally prepare ourselves with pawsitivity for the week ahead. Mondays can turn even the brightest, sweetest feline into a cranky, grumpy cat - which is why we need to boost our mewd with feline funnies so we don't scratch somebody's eyes out tomorrow meowrning. It only happened once, and that was because they tried to talk to us before we had our coffee. We did warn them, to be fair.

With these fortunate floofy funny felines in furtastic memes, we expect to wake up with chirps of happiness and ek-ek-eks of excitement to start the day. Okay, that might be exaggerating a little bit, but it never hurts to meownifest good vibes! If not, we'll just call in sick and stay home with our cats all day. It's only the 10th time we've done it in the last month. Our boss will understand, right?