Programming Leftovers
-
Day 18: Something else - Raku Advent Calendar
Santa was absent-mindedly going through the Rakudo commits of the past weeks, after hearing about the new 2022.12 release of the Rakudo compiler. And noticed that there were no commits after that release anymore. Had all the elves been too busy doing other stuff in the Holiday Season, he wondered. But, in other years, the Raku core elves had always been very busy in December. He recalled December 2015 with a bit of a smile on his face: my, my, had the elves been busy then!
A little worried, he asked Lizzybel to come in again. “So, why is nobody working on Rakudo anymore”, he asked. “Ah, that!”, Lizzybel said. “Not to worry, we changed the default branch of Rakudo to ‘main'”, she said. “Why would you do that?”, Santa asked, showing a bit of grumpiness. “Was the old default branch not good enough?”. Lizzybel feared a bit of a long discussion (again), and said: “It’s the new default on Github, so us Raku core elves thought it would be a good idea to follow that, as many tools now assume ‘main’ as the default branch”.
“Hmmrph”, said Santa, while he switched to the ‘main’ branch’. “Wow!, more than 780 commits since the 2022.12 release, how is that possible?”, he exclamed. “Don’t the elves have nothing better to do in this time of the year?” he said, while raising his voice a bit. Lizzybel noticed his cheeks turning a little redder than usual.
“Ah that!”, said Lizzybel again.
-
PerlayStation Games Console (Part 1) | Saif [blogs.perl.org]
A few reddit posts ago I saw an interesting article about maze generation and game written in Perl. Game development, I fully believe, is key to intellectual engagement, provides amusement to developers and non developers, and highlights the capabilities of a programming language. This led to an brief exploration of other Perl arcade/action games; Such games such as construdo and deliantra show how complex games can be created. Frozen Bubble is another addictive Perl classic. As a non-developer, I find these games only demonstrate the chasm between my lack of coding agility and the cleverness of others.
-
SciPy Integrate
Many well-known mathematical procedures have built-in functions in Python’s SciPy scientific computing package. The scipy.integrate sub-package includes an integrator for ordinary differential equations as one of the integration techniques. This article will teach you how to utilize the “SciPy Integrate” to solve integration problems using the integration approach. We’ll talk about some related topics as well. These are SciPy integrate, trapezoid SciPy integrate quad, and SciPy integrate simpson. To help you comprehend and use the concepts on your own, we will go through these ideas in detail and with useful programming examples. So, let’s start.
-
CI Fuzz CLI: Open-source tool to test Java apps for unexpected behaviors - Help Net Security
CI Fuzz CLI leverages algorithms and automated instrumentation to dynamically generate millions of unusual inputs to test Java apps.
-
Array of Vectors in C++
C++ is a programming language that has strict syntax to be followed; we cannot skip even a semicolon while coding. Arrays are an important part of coding. Without arrays, programming would be very difficult. Arrays work as a container that contains the data of the same type in one place. Arrays have a fixed size; the size of an array cannot be changed automatically. Manually updating the size of an array is difficult, and this is now a problem. The solution to this problem is vectors which are known as dynamic arrays. That means that the size of arrays is flexible and we can insert more elements in an array after the initialization without worrying about the size. The arrays of vectors are like two-dimensional arrays that contain different columns and rows. We cannot change the number of rows but each row is a vector whose length can be changed. Each vector is a dynamic array of one dimension. Every index of the array is a vector whose elements are accessed using the iterators like for, foreach, etc.
The arrays of vectors make the data storage of similar types easy and flexible. These are mostly used when we don’t know the size of the array and when we are dealing with a two-dimensional array. Vectors are defined in STL which is the standard template library in the C++ programming language. Before using vectors, we have to import this library by including this piece of code in our program before the “namespace std”.
-
C++ string::npos
C++ is a language that is used to reinforce the basic programming concepts and improve the programmers’ logical thinking. In C++, we deal with arrays and strings since they are crucial to any programming language. In arrays, we store the same kind of data and a string is like an array of characters that is capable to store more than one character in it. To find the length of the array, we should know its size that we define at the time of initialization of the array. In the case of strings, we sometimes need to check the whole string to find a character or word. To find the string size, the len() function is used. But if we want to check the string or find a value, how can we find a character or word in a string? For that purpose, we use the “string::npos” method which is a constant static value. The “static” word reserves the memory for the variable and “constant” tells the compiler that this value cannot be changed until the program execution.
The “string::npos” is a static constant that has the highest value of -1 with a “size_t” element that tells the compiler on the size of a string and tells how the compiler checks the character until the “size_t” is met. When the required element matches the value of a string, the compiler automatically changes from -1 to 0 by incrementing 1. “Npos” means no position, it shows the position, and is initially set to -1. When an element is found, it is incremented.