Spoiler Alert: This weekly challenge deadline is due in a couple of days from now (on March 3, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.
Task 2: Sum of Values
You are given an array of integers, @int and an integer $k.
Write a script to find the sum of values whose index binary representation has exactly $k number of 1-bit set.
And now we’re trapped. There’s only one friend variable, constantly changing as we go through the loop, with the most likely result one of our friends will get half a dozen messages, while the other five receive nothing, to the annoyance of both groups.
Funny that Perl got this one right when not only many before didn’t but many since also haven’t.
In Go, as Ted says, they may even change the language to fix it; in Javascript, they already have.
I recently added Oracle Database support to SQL::Inserter (check it out if you'd like simple to use, high-performance inserting to SQL databases). I had not used an Oracle Database since my uni days 20 years ago, so I had to set one up to test it.
Even though Oracle provides a free development DB, the process is not as simple as Postgres/MySQL etc., so I thought I'd document it for future reference.
There are basically two ways you can go, with Oracle providing instructions either for a VirtualBox VM, or Docker. For the purposes of this article, we'll use VirtualBox. If you prefer Docker, you can follow Oracle's instructions and skip the next section.
Setting up the Oracle VM
Oracle provides instructions for setting up a VM with their latest 23c Database.
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on March 3, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.
Task 1: Count Even Digits Number
You are given a array of positive integers, @ints.
Write a script to find out how many integers have even number of digits.
Example 1
Input: @ints = (10, 1, 111, 24, 1000)
Output: 3
There are 3 integers having even digits i.e. 10, 24 and 1000.
Hey Dancers! We’re doing an advent calendar this year, and we’d love for you to contribute. Tell us your Dancer success story! Write about a project you worked on that used Dancer, a plugin you wrote, a plugin you love, anything.
December is coming fast, so get your ideas in now. Please reply to this post if you’d be interesting in helping with this year’s advent calendar.
The track would target academic and industrial STEM applications, and emulate in some way traditional science conference tracks; meaning the talks would be based on paper and poster submissions. If this came to pass, the Science Perl Committee would also follow up with the publishing of the papers in an official proceedings of this track. But we need your feedback!
Please complete and share the survey link so that we may convince the already overworked TPRC planning committee that it's worth the extra effort :-). You may also express support in the comments section below or email them directly to me so that I may forward them to the TPRF - oodler@cpan.org. There are ongoing discussions in the TPRF Slack also - see you there! A call for volunteers will be made at such a time that this proposal is accepted.
Warning: I wrote the program below and this blog post from an hospital bed in a heart intensive care unit. I think my mind is clear, but there may very well be a better way to solve the task. Also, I do not have the energy to port this Raku program to other languages, nor to provide lengthy explanations.
Task 2: Reduced Row Echelon
Given a matrix M, check whether the matrix is in reduced row echelon form.
A matrix must have the following properties to be in reduced row echelon form:
After a long time of work, the videos are finally available on Youtube. 20 presentations with a total of 14 hours of airtime review the three days of the workshop and you can watch the things you missed on site.
We would especially like to thank Lee Johnson, who made the recordings, and
the presenters, of course, without whom the workshop would not have taken place.
The support from our sponsors helps us make the workshop take place.
We are planning the German Perl Workshop 2024 again and are already in the final negotiations. As soon as we have a place and date fixed, we will update this post and also make a separate announcement.
Yes, it's true. Config::Tiny now allows you to assign an array of values to a key.
The docs have been updated to include a new section, ARRAY SYNTAX.
Various examples are documented there and in test files. Sample usage:
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on February 25, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.
Task 1: Smaller than Current
You are given a array of integers, @ints.
Write a script to find out how many integers are smaller than current i.e. foreach ints[i], count ints[j] < ints[i] where i != j.
On behalf of the Dancer Core Team, I am beyond excited to present you with Dancer2 1.0.0.
So how did we get here? Why now? I'll cover the specifics in a future blog post, but suffice it to say for now, we're stable, and we've been stable for a long time, but this was never reflected in our versioning. It's beyond time to commemorate that milestone.
If you're expecting big changes, you'll be disappointed that there aren't many on the technical side. Much of what's in this release involves adding some polish in spots, and smoothing out some jagged edges in others. Some important highlights include:
Hello everybody! Welcome back to the Weekly Challenge series, where today we're working on dates again. I like these challenges in particular, for some reason. In this case, we have a rather simple challenge except that it gives us less common date formats than usual.
The challenge gives us a year, month, week(day) of the month, and day of week. Now DateTime provides us with get operations to find WoM and DoW info, but it doesn't provide set operations. For that we need to do a little math. Here's the code below:
Module::CoreList is still somewhat awkward and manual to update around releases. We need better instructions and possibly some automation around the simpler
Pod’s new U<> format needs more documentation around its limited availability.
Test2::Suite sometimes spuriously fails in perl core; needs some poking
We should put out a call for bugfixes for a possible 5.38.1 release
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on February 18, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.
Task 2: Merge Strings
You are given two strings, $str1 and $str2.
Write a script to merge the given strings by adding in alternative order starting with the first string. If a string is longer than the other then append the remaining at the end.
A plenv plugin to add additional include directories to Perl.
This plugin sets the contents of file .perl-libdirs.
It hooks into plenv-exec command and every time you run perl
or any other command under plenv, plenv-libdirs uses the
.perl-libdirs files to set the PERL5LIB environment variable.
plenv-libdirs makes use of .perl-libdirs files
in the current working directory and every directory
between it and root.
Environment variable PERL5LIB has a list of paths separated (like in PATH)
by a colon on Unixish platforms and by a semicolon on Windows
(the proper path separator being given by the command perl -V:path_sep).
When plenv-libdirs collects the paths from .perl-libdirs files,
the order of the paths follows the order of the directories.
The longer the path to .perl-libdirs file, the higher precedence in PERL5LIB.
Sometimes one has to make compromises between speed of execution and memory, other times one may not have to be. While working towards a fairly (at least in my mind) complete solution to map Nanopore Sequencing files, I ran against the need to create and access fairly large hash of arrays (think of 1M - 100Mof keys), with each array itself consisting of a a fixed number of elements.
The hash of arrays is a fairly straightforward and fast data structure to create in Perl, the memory overhead can be substantial as the number of keys and values scale upwards. While in my application (at least as envisioned now!) the hash will be created, aggregated over (group by for those into python-pandas or r-data.table vernacular) and then discarded, there are use cases in which the data should be preserved to avoid the computational expensive part of generating them via approximate string matching in biological databases.
Paul volunteers to do the 5.39.9 release. We still need people for .10 and 5.40. The .10 release will be timed around PTS - so maybe we could do something “live” at the summit?
Mailing list was otherwise quiet so there weren’t many issues to discuss.
In absence of many other pressing issues, we spent some time thinking ahead to large-scale development work that might take place in the 5.41 series. We talked about “hooks” as a potential long-term thought to making a more powerful Magic-like structure, for implementing new features, attributes, etc..