Spoiler Alert: This weekly challenge deadline is due in a few days from now (on September 22, 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: Valid Number
You are given a string, $str.
Write a script to find if it is a valid number.
Conditions for a valid number:
- An integer number followed by an optional exponent.
- A decimal number followed by an optional exponent.
- An integer number is defined with an optional sign '-' or '+' followed by digits.
Decimal Number:
A decimal number is defined with an optional sign '-' or '+' followed by one of the following definitions:
- Digits followed by a dot '.'.
- Digits followed by a dot '.' followed by digits.
- A dot '.' followed by digits.
All present, and this time the meeting actually ended on time.
We discussed the situation with the apostrophe package separator removal. We continue to keep an eye on things but it now feels close to inevitable that we will use a feature to disable it conditionally.
We briefly touched on the removal of smartmatch, where both the extent of the situation and our thoughts so far are much less clear.
Connected to all that, we discussed some general thoughts on how not to keep finding ourselves in the same situation with changes like this, but found we probably already have all the mechanisms we need.
We decided that the provisions of the PPC process are the right way for pre-PPC “Signature named parameters” to play out so it has now become PPC 0024 with status “Exploratory”.
We took another brief look at the closure memory leak which is now #22547 and resolved to prepare to put down a consensus next time we meet.
The schedule for this year's London Perl & Raku Workshop is now visible: https://act.yapc.eu/lpw2024/schedule. Please please please (please please) make a point to mark those talks that you plan to attend as this will allow us to tweak the schedule a bit if some talks are more heavily favourited than others.
The venue opens for attendees at 9am and we plan to start talks at 9:30am. Drinks will be available throughout the day, hence no need to have dedicated breaks there. Lunch will be at midday for an hour, there are plenty of options close to the venue to grab something to eat. If we receive a couple more sponsors we can have lunch at the venue, but currently that won't be possible.
There are a couple of spots left for talks, otherwise the schedule is full. Please don't let this put you off submitting a talk as it's possible some speakers may have to change their plan.
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on September 22, 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: Strong Password
You are given a string, $str.
Write a program to return the minimum number of steps required to make the given string very strong password. If it is already strong then return 0.
Criteria:
- It must have at least 6 characters.
- It must contain at least one lowercase letter, at least one upper case letter and at least one digit.
- It shouldn't contain 3 repeating characters in a row.
We discussed the recently reported closure memory leak in 5.40, which existed in older perls and was fixed in a way that caused other breakage instead, and we agreed that if it isn’t fixable we need to address it by at least providing guidance on how to code around it
We discussed the removal of apostrophe as a package separator, and agreed that it should likely be feature-guarded, but the verdict on the fallout is not yet in
We continued the discussion on how to simultaneously encourage low ecosystem churn while helping users enjoy all the latest goodies
We agreed on writing a few position paper articles to explain our thinking and the attitude we think a PSC should take
Hi All! Given the number of talks submitted to this year's London Perl & Raku Workshop we have decided to reserve a third room in the venue. This will give us a bit more room on the schedule for talks, which is good as the other two rooms are now 90% full.
However, we would also like to use this third room for something else. Its capacity is relatively low, 15 people including the person presenting, so we feel it might be suitable for use as a breakout room / mini hackathon(s) / birds of a feather; and we will probably reserve two large slots for this. If you have an idea of something you'd like to use the room for then please get in touch with us.
Another way we can make more space for talks is to opt for lunch at the venue, this will free up space for three more talks. To do that we need a couple more sponsors so if you would like to help with that then please have a look at the options here: https://act.yapc.eu/lpw2024/sponsoring.html
The London Perl and Raku Workshop will take place on 26th Oct 2024. Thanks to this year's sponsors, without whom LPW would not happen:
The following script leaks memory in perl v5.40, and it did not in v5.38:
use Scalar::Util 'weaken';
my $z;
{
my $x;
my $y;
my sub my_sub {
$x = shift;
return sub { $y };
};
my $subscriber = {};
$subscriber->{foo} = my_sub($subscriber);
weaken($z = $subscriber);
}
say 'leak = ', int defined $z;
It prompted me to take a serious look at the modules I have uploaded to CPAN and acknowledge that some of them are no longer valuable. Indeed as I reviewed one of them I was none too kind in my judgements against the author.
That made it quite easy for me to see how I can easily participate in CPAN day. I'm removing a couple of modules:
Business::Worldpay::Junior - I don't think this integration option even exists any more and I certainly haven't actively maintained this for years.
Net::UKDomain::Nominet::Automaton - Nominet withdrew the Automaton in 2015
Those are now scheduled for deletion on Monday next week.
I'll need to review some of the others and consider whether to open them up for anyone who is interested to take over as maintainer.
Sometimes the unexpected happens and must be shared with the world … this one is such a case.
Recently, I’ve started experimenting with Perl for workflow management and high-level supervision of low level code for data science applications. A role I’d reserve for Perl in this context is that of lifecycle management of memory buffers, using the Perl application to “allocate” memory buffers and shuttle it between computing components written in C, Assembly, Fortran and the best hidden gem of the Perl world, the Perl Data Language.
There at least 3 ways that Perl can be used to allocate memory buffers:
xe.com is a well known site for calculating the exchange value between the currencies of the world. However, there are times I’d prefer to query it from the command line. They have an API, but it’s not free, so I ended up writing a quick and dirty script that scrapes the web page and uses regexps to extract the data.
I know you’re not supposed to parse HTML with regexps, but sometimes, you can get away with it for a while. Also, this script is not that serious, so it can fail without hurting anything.
I created a function in Perl called pg_dt, that will convert PostgreSQL’s datetime values into Perl’s DateTime values and vice versa. This is useful both when you want to store DateTime values into the database, or want to convert the pg datetime/timestamp value from the database into a DateTime object value that Perl can use.
I really can’t seem to include code blocks in my posts on this platform (tried Preview with Markdown and Markdown With SmartyPants without success), so you can read the rest of this article on my blog.
The Dancer Core Team is happy to announce that Dancer2 1.1.1 is on its way to CPAN. This is a maintenance release that deals with the following issues:
[ BUG FIXES ]
* GH #1712: Fix use of send_as in templates (Andy Beverley)
[ DOCUMENTATION ]
* PR #1706: Document missing logging hooks and log format option;
fix typo in logging test (Jason A. Crome)
I have not been able to figure out how to run an async thread in the background while using a REPL like reply. The moment I run the main loop, it takes over the input from the REPL. Here's what a typical failed REPL session might look like.
Well, after taking a very long break inspired (to understate it a bit) by the pandemic, I’m back to attending in-person Perl events with my seventh YAPC. Or, The Perl Conference, I suppose, but it still feels like YAPC to me. As per usual, here are some reflections.
I remember when one one of my grandchildren helpfully decided reorganise a bookshelf whilst by himself. Upon being discovered, sitting in front of an empty shelf with books strewn all around him, his instinctive reaction made me feel proud to be his grandpa. He looked up and said, “Oh dear! Oh dear! what happened?”, as if this calamity had occurred spontaneously, astonishing him as much as the angry parent who was going to have to tidy it all up. It is hard to hide amusement when you watch your kids have to deal with their kids.
Advanced Disaster Management Strategy for Grandchildren and Programmers