You are given a string “123456789”. Write a script that would insert ”+” or ”-” in between digits so that when you evaluate, the result should be 100.
Only 100, Please, in Perl
For solving this task, we first use a recursive combine subroutine that generates all possible strings by inserting between the digits of the “123456789” string the + plus addition, the - subtraction operator, or the '' empty string (i.e. no operator). We then use the evaluate subroutine with each string to perform the various arithmetic operations and compute whether the total is 100.
The Hilton Houston North has been selected as the #TPCiH venue! #savethdates June 23-27, 2020. The 3-day tech conference goes from Wednesday, June 24 through Friday, June 26. Master-class tutorial sessions will be offered Tuesday, June 23 and Saturday, June 27 #perlcon #rakulang
Spoiler Alert: This weekly challenge deadline is due in a couple of days (January 19, 2020). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Challenge # 1: Olympic Rings
There are 5 rings in the Olympic Logo as shown below. They are color coded as in Blue, Black, Red, Yellow and Green.
We have allocated some numbers to these rings as below:Blue: 8Yellow: 7Green: 5Red: 9
The Black ring is empty currently. You are given the numbers 1, 2, 3, 4 and 6. Write a script to place these numbers in the rings so that the sum of numbers in each ring is exactly 11.
I'm already working on Part II, but here's Part I in all its glory: http://www.theperlfisher.com/index.php/2019/11/24/rewriting-legacy-code-for-raku/ - I'm writing OLE::Storage_Lite from the original Perl 5 source, and this article series is my thoughts on the process so far.
Write a program to encode text into binary encoded Morse code.
Before we can encode Morse code into its binary representation, we need to encode normal text into Morse code. As a former Woodcraft member, I was able to write the following lines by heart:
my %to_morse = qw( a .- b -... c -.-. d -.. e . f ..-. g --.
h .... i .. j .--- k -.- l .-.. m -- n -.
o --- p .--. q --.- r .-. s ... t - u ..-
v ...- w .-- x -..- y -.-- z --.. );
The encoding subroutine is straightforward: split each word into separate characters, then replace each with the value from the above hash.
Note that space is not present in the translation table, so it gets translated to an empty string, which creates the expected double slashes between words.
Well still in clean-up mode here in the Paws Pen trying to get the full t/10_response.t test case working.
I was having all sorts of fun with the 'GetBucketPolicy' action test. By fun I mean a good hour of frustration and cursing and gnashing of teeth as my real-time test script was working fine! I just could not get the test in 's3-get-bucket-policy.response.test.yml' to pass.
Then I stumbled on it.
This is the one very odd action on the AWS S3 API where it dose not return XML but returns JSON. Now I do handle this with this code
} elsif (exists($headers->{'content-type'})
and $headers->{'content-type'} eq 'application/json'
and $ret_class->can('_payload')){
$unserialized_struct->{$ret_class->_payload} = $content;
Spoiler Alert: This weekly challenge deadline is due in a couple of days (January 12, 2020). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Challenge # 1: Octal Number System
Write a script to print decimal number 0 to 50 in Octal Number System.
Platypus is getting an update. It’s not backward compatible, so you have to opt-in when you create the platypus instance. That makes it backward compatible for all the old code you may or may not have written. Please spread the word.
# old code:use FFI::Platypus;
my$ffi = FFI::Platypus->new;
# new code:use FFI::Platypus 1.00;
my$ffi = FFI::Platypus->new( api=> 1 );
You should generally write all new code using the new API so that you can take advantage of the newer features and design fixes. You may want to also consider upgrading your existing code to use the new API for the same reasons.
Spoiler Alert: This weekly challenge deadline is due in a couple of days (January 5, 2020). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Challenge # 1: Attractive Numbers
Write a script to display attractive number between 1 and 50.
A number is an attractive number if the number of its prime factors is also prime number.
The number 20 is an attractive number, whose prime factors are 2, 2 and 5. The total prime factors is 3 which is also a prime number.
First comment: we’re obviously interested only with proper prime factors, i.e. prime factors of a number other than 1 and the number itself.
Well today on paws I figured I would take a look and see what was outstanding in terms of code to fix. All that I could find was only really one thing and this boto fix well really a Kludge
/{Bucket}?action
/{Bucket}?action&id={Id}
where I add the id to the URI to get around a bug/problems when running this code on RestXmlCaller.pm;
$uri->query_form(%$qparams);
would scramble the URI so the call would fail.
What I would like to do is roll back the changes I have made for Boto and see if I can find a pure Perl solution to my problem.
Write a program that demonstrates using hash slices and/or array slices.
In the spirit of TIMTOWTDI I decided to write a single program that demonstrates both the tasks at the same time.
Let’s start with slices. Slices are parts of structures (arrays and hashes). Slicing has a special syntax by which you tell Perl which indices or keys you want to use to obtain a slice.
For example, consider the following array:
my @keys = qw( not_this_one
this_one
this_one_too
it_was_enough );
Naturally, we want to select the second and third one. We can use
$keys[1], $keys[2]
or
map $keys[$_], 1, 2;
but there’s a shorter and cleaner syntax for the same:
The LedgerSMB project aims to prevent small and mid-size businesses from getting locked-in by their accounting software vendor by providing free and open source accounting software, integrating invoicing, order processing, quotations and more (ERP). It's all Perl!
Having installed it myself, I found it very very fully featured. You can try out their demo and watch one of their numerous youtube intros and tutorials
The LedgerSMB development team has announced release 1.7.3.
This release contains the following fixes and improvements:
Spoiler Alert: This weekly challenge deadline is due in a couple of days (December 29, 2019). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Challenge # 1: Multiple Arrays Content
You are given two or more arrays. Write a script to display values of each list at a given index.
For example:
Array 1: [ I L O V E Y O U ]
Array 2: [ 2 4 0 3 2 0 1 9 ]
Array 3: [ ! ? £ $ % ^ & * ]
Seems I lied in my last post when I said there where no longer any boto changes for my S3 fixes. There is still one call 'GetBucketLocation' that is using a new bit I added to boto
"keep_root":true
I stumbled upon this when I added in a few fixed cases from another branch and when I ran the suite I
got;
ok 10052 - Call S3->GetBucketLocation from t/10_responses/s3-get-bucket-location.response
not ok 10053 - Can't test method access because something went horribly wrong in the call to GetBucketLocation # TODO t/10_responses/s3-get-bucket-location.response.test.yml
I missed this release but it's only a little over a month old, so its still news.
Sympa 6.2.48 is the newest stable version of Sympa 6.2.
Sympa is an electronic mailing list manager. It is used to automate list management functions such as subscription, moderation and management of archives. Sympa also manages sending of messages to the lists, and makes it possible to reduce the load on the system. Provided that you have enough memory on your system, Sympa is especially well adapted for big lists. For a list with 20 000 subscribers, it takes 5 minutes to send a message to 90% of subscribers, of course considering that the network is available. Check out the full list of features.