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.
Work on the Rakudo.js grant has been completed and now I'm add the stage where community feedback is needed. It would be super grateful for Your feedback. You can provide it in blog comments on this post.
The final grant status update is available HERE
November was the quietest month for me. I would give credit to the book Why We Sleep, gifted by Neil Bowers. I haven't finished reading the book yet but whatever I read so far made a big difference. A very big THANK YOU to Neil. I no longer do late nights, technically that means no work after midnight for me. However I do wake up early on weekends and finish the pending work. One more change, I noticed that I don't visit MetaCPAN very often. Earlier I used to checkout every 30 minutes during the day. But now I do it once every couple of days. Having done 160 Pull Requests in October, then doing only 51 Pull Requests in November feels so light. In fact I reached my monthly target of 50+ Pull Requests in the third week of November. Last one week was relaxing, I made conscious efforts not to look for Pull Request.
Today's post proves that test suite, even one that uses canned data, requests and responses, is a very valuable asset to have about.
As I was charging though some 80 action calls copying the requests from my successful unit tests into my t/09_request.t test cases I ran into the odd real bug.
The first one I ran into was to do with the 'PutBucketLogging' action; My real unit test case would work with no problem but as I transferred this real world unit test into canned test cases I got a fail on some of the composed XML.
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.
You want to get to know your data, questions like,
can they be broken down into a simple set of classes.
You don't know what these classes might be, so your
task is clustering and you reach for one of the
oldest clustering algorithms around k-means.
k-means is popular because it's simple to understand,
converges fast, works in higher dimensions
and gives you an answer.
It's also usually the wrong choice unless you've
already got nicely clustered data just waiting for you
to guess k, the most appropriate number of clusters
to answer your question. But it is a decent warm up
exercise in becoming friends with your data set.
I ending up in my last post with a test that was running but most of the tests where failing.
ok 1 - Call S3->CreateBucket from /home/scolesj/aws-sdk-perl/t/09_requests/s3-create-bucket.request
ok 2 - Got content eq from result
…
ok 11 - Got method eq PUT from result
I had a look at the request object I was getting back
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.
I didn't notice much public discussion, but in the last month, Perl 5
development has moved to Github. The logistics of the move were mostly handled
by Todd Rinaldo although I'm sure there were other people helping.
The change involved moving the main development repository from
perl5.git.perl.org to https://github.com/Perl/perl5,
moving the issues from rt.perl.org to Github issues, renaming them in the
process, and fixing the code that used the hostnames or URLs for decisions.
Goodness Paws 30 and I am at least code compete as far as running through all of the different action found on S3. Now that leads me to a very important part.
I now have to do a little bit of back peddling and come up with a test suite for all the now fixed S3 actions. 90% of the bugs and fixes I have done so far on S3 have been for requests to the server not checking responses form the server.
Following on with this it makes sense that I test how things are sent to the server as well. I had a peek about in the test suite and except for a few of the basic actions there are no tests on request calls.
Spoiler Alert: This weekly challenge deadline is due in a couple of days (December 22, 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.
Task # 1: Guest House
A guest house had a policy that the light remain ON as long as the at least one guest is in the house. There is guest book which tracks all guest in/out time. Write a script to find out how long in minutes the light were ON.
Some time ago I have created a small web project about Perl programming language. The site where you can execute Perl code online — PerlBanjo.com. (blog post about the release)
Today I'm happy to announce the new small project about Perl. This is the place with interactive coding tasks. You solve the task, enter the solution, system run it and tell you if it accept your submission. (PerlBanjo.com is used as a backend to run Perl code)
Now there are only several tasks. The source code for all the all tasks is hosted on GitHub, so anybody can propose a fix for the task or create the new task.
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
Create a script to accept a 7 digits number, where the first number can only be 1 or 2. The second and third digits can be anything 0-9. The fourth and fifth digits corresponds to the month i.e. 01,02,03…,11,12. And the last 2 digits represents the days in the month i.e. 01,02,03….29,30,31. Your script should validate if the given number is valid as per the rule and then convert into human readable format date.
Rules:
1) If 1st digit is 1, then prepend 20 otherwise 19 to the 2nd and 3rd digits to make it 4-digits year.
2) The 4th and 5th digits together should be a valid month.
3) The 6th and 7th digits together should be a valid day for the above month.
For example, the given number is 2230120, it should print 1923-01-20.
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.