Spoiler Alert: This weekly challenge deadline is due in several days (October 4, 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: Smallest Positive Number Bits
You are given unsorted list of integers @N.
Write a script to find out the smallest positive number missing.
As I started learning Perl I found out that there is a collection of Perl modules for bioinformatics tasks and it is called BioPerl. Intrigued I decided to try to use it for a simple task as it would help me in learning Perl. So the next question was: what task should I choose? Maybe download file with biological sequences, parse it and filter according some criteria? Thinking about this further I made a choice. I will work with sequences of infamous coronavirus which is more precisely named as SARS-CoV-2!
Spikes of coronaviruses – why are they so important?
Spoiler Alert: This weekly challenge deadline is due in a couple of days (September 27, 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: Count Set Bits
You are given a positive number $N.
Write a script to count the total number of set bits of the binary representations of all numbers from 1 to $N and return $total_count_set_bit % 1000000007.
As we take another lap around the k-Means race trace,
the Porsche 914-2 and Volvo 142E
are still neck and neck.
This time we'll try a straight-forward normalisation
that linearly scales all values to the range [0,1]
and see if they still end up in the same cluster.
I think in my last post I said this is going to be a very short series well I think I am wrong on that count.
When I last posted on the Kinesis 'SubscribeToShard' action I discovered that it is returning a 'application/vnd.amazon.eventstream' and that lead me down a very deep rabbit hole that got me well sidetracked.
Well to start out I had to figure out what AWS was returning when it was sending 'vnd.amason.eventstream' I eventually found that here Event Stream Encoding
Ok time to take the way-back machine to my first play-dates with computers, assembling GIS data from an Amdahl mainframe that was spooling a 9inch tape directly to my Unitron 2000
over a 330 baud modem, Then taking the various bits, and putting them back together so I could draw pretty maps on this;
There are signatures in Raku, core Perl 5, Moose, Dios and lot of other modules. With KBOS I tried to find out how optimal signatures would look like to me. My objectives are: 3. easy to parse with the eye, 2. concise syntax and 1. delegates as much work as possible into the background so I have to write the least amount of code.
Spoiler Alert: This weekly challenge deadline is due in a few days (September 20, 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: Leader Element
You are given an array @A containing distinct integers.
Write a script to find all leader elements in the array @A. Print (0) if none found.
An element is leader if it is greater than all the elements to its right side.
Hi. The current version of perlmodules.net was made in 2013/2014 with AngularJS, it is hard to update and so I’m starting a remake of the site.
Apart from an aesthetic makeover, it will be built with Vue.js/nuxt.js in order to allow the site to be indexed by all search engines. New features and ways of viewing the data may be added.
It will still use Mojolicious, but will use PostgreSQL instead of (the current site’s) MySQL, DBIx::Class instead of Rose::DB::Object, plus also Minion, RxJS, and will be open-sourced.
Help from the community will be very welcome. If anyone wants to join the discussion, please join our IRC channel, at irc://irc.freenode.net/#perlmodules.net
Looking back at my last month performance, I get mixed feelings. I feel bad that I only submitted 7 Pull Requests. It is not that I didn't try to up the number. I noticed some of my past Pull Request disappearing from GitHub. It is affecting my Pull Request Stats. I keep all contributions record under my GitHub profile. It gives me sense of accomplishments.
The best part of last month was that I finally started taking part in The Weekly Challenge. Not only just code contributions but also blogged about it. It was possible because of help by fellow Team PWC member, Ryan Thompson.
What am I looking forward in the month of March? Well, I am looking forward to celebrate the completion of one year of "Perl Weekly Challenge" on 25th March 2020.
In my last report, I mentioned about my Dad's health. I am happy to announce that he is doing better and no longer dependent on others.
Let's take a quick look through last month main activities.
*{; no strict 'refs'; \*{ "${pkg}::type" } } = sub () { $type };
push @{; no strict 'refs'; \@{ "${pkg}::ISA" } }, __PACKAGE__;
# ... and so on
I really don’t feel like I have anything to add but I suppose it may not be obvious that the point of this exercise is to surgically limit the lifting of the refs stricture to just the desired symbolic dereference (without leaking it even as far as any other part of the expression) – in the most compact form possible.
I also suppose I ought to expand on it by way of explanation for the less travelled in the dustier corners of Perl 5 syntax:
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.
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.
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.
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.