Spoiler Alert: This weekly challenge deadline is due in a couple of days (September 13, 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.
Task 1: Fibonacci Sum
You are given a positive integer $N.
Write a script to find out the smallest combination of Fibonacci Numbers required to get $N on addition.
You are NOT allowed to repeat a number. Print 0 if none found.
Another great Perl software that I find very useful is Monitorix.
Monitorix is FOSS lightweight system monitoring designed to monitor as many services and system resources as possible.
The tl;dr is that it works really well for monitoring stand alone machines- which is what I used it for. It's tracks all sorts of metrics with minimal configuration by me, and with packages for most distros its trivial to install and update.
There are 50 people standing in a circle in position 1 to 50. The person standing at position 1 has a sword. He kills the next person i.e. standing at position 2 and pass on the sword to the immediate next i.e. person standing at position 3. Now the person at position 3 does the same and it goes on until only one survives.
Write a script to find out the survivor.
I tried two different approaches to the problem.
The first one uses an array of living people and a variable $sword that stores the index of the person holding the sword. In each iteration of the loop, the next person is removed from the array, and the sword is passed to the next person.
The “next person” has a special cyclic meaning: at the end of the array, the sword must return to the beginning. This is achieved by using the modulo operator %. Note that we use it twice, once to find the person to kill, and once to find the person to pass the sword to—and each case uses a different array size in the modulo operation, as killing a person changes the size of the array.
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on Aug. 16, 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.
Task #1: Prime Sum
I’ve written a Raku program to solve this task, but it is unfortunately a bit buggy: it works in most cases, but there are a few rare cases where it doesn’t find the minimum number of prime numbers whose summation gives you the target number. I certainly don’t want to publish here a program which I know to be faulty in some cases, and I no longer have time before the deadline to fix it. So, I’ll skip this task for now.
Short post this time because I got
nerd-sniped
looking at the data. The fun part is that you quickly
move from thinking about how to get your results to trying
to work out what they mean.
Forget why I started down this road. Right now, we
are seeking the answer to Lewis Carol's famous question,
How is a Porsche 914-2 like a Volvo 142E?
(well, that's what it was in the first draft)
A quick summary for those who have just joined us.
After introducing KBOS I should write about the most fundamental concept in this Perl syntax extension. In fact it's so basic, you could use it even without objects.
Spoiler Alert: This weekly challenge deadline is due in a few days from now (August 30, 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.
Task 1: Coins Sums
You are given a set of coins @C, assuming you have infinite amount of each coin in the set.
Write a script to find how many ways you make sum $S using the coins from the set @C.
While Mojo::ACME was a fun experiment, it has several shortcomings at this point and I’ve officially stopped using it. If someone is interested in maintaining it, and if I’m sufficiently convinced of your credibility since this is a security module after all, I can hand it over. Otherwise I will be marking it as deprecated soon.
Technically, I already announced it, but now I've renamed it. MooX::Pression is now called Zydeco.
Moops had a memorable name, and I think the naming really helped it gain a following. MooX::Pression was just meh. So now it's Zydeco. Zydeco is a fun word and pretty short to type. It's a musical genre that blends jazz, blues, and Louisiana French Creole, and it just seemed like a good fit for a module that takes what I feel are some of the coolest features of Perl programming, and blends them together under one syntax.
Also, practising what I preach, Zydeco now has its own website.
Spoiler Alert: This weekly challenge deadline is due in a few hours from now. 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: Majority Element
You are given an array of integers of size $N.
Write a script to find the majority element. If none found then print -1.
Majority element in the list is the one that appears more than floor(size_of_list/2).
Example 1:
Input: @A = (1, 2, 2, 3, 2, 4, 2)
Output: 2, as 2 appears 4 times in the list which is more than floor(7/2).
Example 2:
Input: @A = (1, 3, 1, 2, 4, 5)
Output: -1 as none of the elements appears more than floor(6/2).
Encouraged by Enkidu I decided to write a little about my unsuccessful trial to run PDL Book example on Windows. It all started in December 2019 as I decided to learn Perl and looked for a way to create SVM (Support Vector Machine) model with it as I am able to do similar tasks in R or Python. As a side effect and to my surprise I have found that there exists such a thing as Perl Data Language (PDL) that has many modules suited for data science.
Intrigued by PDL I have installed Strawberry Perl 5.30.1.1 PDL edition. I followed first steps from
PDL book
and tried to install PDL::Graphics::Simple. Just ran typical installation with cpan and got an error:
Well back on my PAWS run again. This one might be a rather short series as I am really just looking at one Action in the Kinesis API 'SubscribeToShard'. There is an open bug for this one up on github https://github.com/pplu/aws-sdk-perl/issues/371 and one I think I can fix up fairly eaisy.
First things first, a little word on Kinesis. Well in short it touted as a very scalable real time data-stream thingy that sings dances and basically makes you line much better. Myself I do not havea use for it but it is part of the system and there is a bug so in I go.
I first had to set things up on the AWS server side with some permission etc the usualal srtuff I also had to run a number of command top build up my Kineses system to a point where I can actually use the 'SubscribeToShard'
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on Aug. 16, 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.
Task 1: Min Sliding Window
You are given an array of integers @A and sliding window size $S.
Write a script to create an array of min from each sliding window.
Starting even before Moose, we (in the Perl 5 world) have a plethora of Modules extending the syntax of the language with Perl 6 and more in mind. The following article sums up not only my 2 and a half cents on the subject but also an attempt to implement it. It should be of interest to anybody thinking about programming in general.
The test suite for MooX::Pression used to run in 79 seconds on my laptop. Now it's at 10 seconds.
And no, I didn't cut out any tests — I switched from using Keyword::Declare to a combination of Keyword::Simple and PPR. (Keyword::Declare is a wrapper around Keyword::Simple and PPR, but I found out by using them directly, I could massively improve compile-time speed.)
MooX::Pression allows you to build classes and roles with multimethods, types, method signatures, and sweet, sweet, sugary syntax…
AgoraCart, a website shopping cart application built with Perl, was recently released to the public in November 2019. This release marks the first major version release for the f/OSS (free open source software) version of AgoraCart in about a decade.
I have avoided any spotlight in the Perl community after negative experiences early on but at the urging of Gabor Szabo over at PerlMaven.com, I realized that I should not care if I am not the normal Perl community member/developer. As a result, announcements on Perl type groups was skipped until now. So here's to new beginnings.