Tux Machines

Programming Leftovers

Posted by Roy Schestowitz on Dec 27, 2022

=> Firefox Money: Investigating the bizarre finances of Mozilla | Why don’t people just...?

Raku

2022.52 Antonovmas - Rakudo Weekly News

=> ↺ 2022.52 Antonovmas - Rakudo Weekly News

Anton Antonov was on a roll this week. Videos, blogs, and fun with Raku in these festive times.
[...]
A very quiet week, apart from the many blog posts, videos, new and updated modules :-). The nights are getting shorter again. Good news for many people in Ukraine who have no heating or water or electricity, and who are still fighting the Russian aggression.

Python

Python: Append to File - TecAdmin

=> ↺ Python: Append to File - TecAdmin

In Python, you can use the open() function to open a file in append mode, which allows you to add new content to the end of an existing file. Appending to a file is useful when you want to add additional information to a file without modifying or deleting the file’s original content.

Python: Write to File - TecAdmin

=> ↺ Python: Write to File - TecAdmin

Writing to a file in Python is a common operation that allows you to store data in a file for later use. Whether you are working with a simple text file or a more complex binary file, Python provides a number of ways to write data to a file.

Shell

Creating Bash Infinite Loop by Example Scripts

=> ↺ Creating Bash Infinite Loop by Example Scripts

Every loop has a finite lifespan and depending on the loop, it ends when the condition is either true or false. The bash infinite loop is simply a series of instructions that loops indefinitely. It has no ending condition, a condition that is never met, or a condition that stimulates a new iteration of the loop. The bash infinite loop can be created with the for, while, and until loops. With just a little modification to the infinite loop conventional syntax, we can implement the bash infinite loop scripts. Here, we are required to create a loop that executes the commands continuously until it is forcibly stopped from outside the program.

A Shell Script to Check Disk Space and Send Alert - TecAdmin

=> ↺ A Shell Script to Check Disk Space and Send Alert - TecAdmin

It is important to monitor the disk space on a Linux server to ensure that there is enough free space available for new files and applications. If the disk becomes full, it can cause issues such as system crashes, data loss, and other problems. To prevent these issues, you can use a shell script to monitor the disk space and send an alert when the available space falls below a certain threshold.
In this article, we will walk through the process of creating a shell script that monitors the disk space and sends an alert when the available space falls below a certain threshold. We will use the df command to check the available disk space and the mail command to send the alert.

Misc.

C++ Cmath Library

=> ↺ C++ Cmath Library

To make Mathematical problems stress-free for the programmer, C++ offers a library that contains all the functionalities we use in our routine to solve mathematical problems. The ‘cmath’ library contains logarithmic, exponential, hyperbolic, power, trigonometric, and many more.

Create Texts with a Markov Chain Text Generator... and what this has to do with ChatGPT! - Learning Machines

=> ↺ Create Texts with a Markov Chain Text Generator... and what this has to do with ChatGPT! - Learning Machines

I will share a secret with you: at the core of the latest craze, Large Language Models (LLMs), like GPT3, its brother ChatGPT, from OpenAI or PaLM from Google, lies a (sophisticated) function for predicting the next best word, phrase or sentence based on statistics! You will say, no way!?!
First, try an experiment with your smartphone: start some messenger or social media app and begin typing. Then tap on the suggested word in the middle above your keyboard on the display. Continue tapping and see how a sentence forms. This sentence is also based on statistics which word normally follows which other word, probably refined by your using your phone.
Not impressed yet, then consider the following simple algorithm, called a Markov chain algorithm. We won’t go into the mathematical details of why it is called that but just take it as a simple way to create texts based on simple statistics.

What is survival analysis? Examples by hand and in R - Stats and R

=> ↺ What is survival analysis? Examples by hand and in R - Stats and R

For the last post of the year, I would like to present a rather unknown (yet important) statistical method–survival analysis.
Although survival analysis is a branch of statistics, it is usually not covered in introductory statistics courses and it is rather unknown to the general public. It is mostly taught in biostatistics courses or advanced statistics study programs.
In this article, I will explain what is survival analysis, in which context and how it is used. I will explain the main tools and methods used by biostatisticians to analyze survival data and how to estimate and interpret survival curves.

Computing Win-Probability of T20 matches - Giga thoughts

=> ↺ Computing Win-Probability of T20 matches - Giga thoughts

I am late to the ‘Win probability’ computation for T20 matches, but managed to jump on to this bus with this post. Win Probability analysis and computation have been around for some time and are used in baseball, NFL, soccer hockey and others. On T20 cricket, the following posts from White Ball Analytics & Sports Data Science were good pointers to the general approach. The data for the Win Probability computation is taken from Cricsheet.

Any Time At All: tweet frequency around the clock - quantixed

=> ↺ Any Time At All: tweet frequency around the clock - quantixed

Please consider this a “supplementary analysis” to my previous post looking at the frequency of tweets from my personal account over the last 12 years.
I was curious about what times I was active on Twitter (measured by when I tweeted). Others might be interested in a solution to look at this in R.

Twitcher II: tweet frequency and top tweets - quantixed

=> ↺ Twitcher II: tweet frequency and top tweets - quantixed

To generate these plots, it was a case of loading in the data (as described previously). I am analysing data from @clathrin and not from my quantixed Twitter account.

AI learns to write computer code in ‘stunning’ advance | Science | AAAS

=> ↺ AI learns to write computer code in ‘stunning’ advance | Science | AAAS

A new artificial intelligence (AI) system called AlphaCode is bringing humanity one step closer to that vision, according to a new study. Researchers say the system—from the research lab DeepMind, a subsidiary of Alphabet (Google’s parent company)—might one day assist experienced coders, but probably cannot replace them.
“It’s very impressive, the performance they’re able to achieve on some pretty challenging problems,” says Armando Solar-Lezama, head of the computer assisted programming group at the Massachusetts Institute of Technology.

5 Upcoming Code Editors that May Challenge the Supremacy of Visual Studio Code [Ed: Loaded and misleading headline. Microsoft's proprietary spyware has no "supremacy", just hype from the likes of Sourav Rudra, a Microsoft apologist and habitual booster. Number 1 and 2 in this list are also Microsoft (or Microsoft-controlled forks), so a site called "It's FOSS" basically promotes several Microsoft things as 'alternatives' to Microsoft. Ankush Das and Abishek need to give Sourav Rudra the boot already.]

=> ↺ 5 Upcoming Code Editors that May Challenge the Supremacy of Visual Studio Code

=> gemini.tuxmachines.org

Proxy Information
Original URL
gemini://gemini.tuxmachines.org/n/2022/12/27/Programming_Leftovers.gmi
Status Code
Success (20)
Meta
text/gemini;lang=en-GB
Capsule Response Time
138.781667 milliseconds
Gemini-to-HTML Time
1.684954 milliseconds

This content has been proxied by September (3851b).