Keyhole surgery 100% successful

Part 1.

On Match 20th I had keyhole surgery to repair the aortic arch.

The lining had peeled off the wall. This happens when the lining develops a tear due to (in my case) childhood and later stress. Then, blood is pumped thru the tear and thus between the lining and the wall. Where the blood ought to go is called the 'true lumen' and when it's behind the lining and thus where is should not be - which is the bad news - , is called the 'false lumen'. So it's blood pressure in the false lumen which splits the lining off the wall. I just checked that original post and now realise I did not explain that at all.

Perl Weekly Challenge 053: Rotate Matrix and Vowel Strings

Rotate Matrix

Write a script to rotate the following matrix by given 90/180/270 degrees clockwise.
[ 1, 2, 3 ]
[ 4, 5, 6 ]
[ 7, 8, 9 ]

For example, if you rotate by 90 degrees then expected result should be like below

[ 7, 4, 1 ]
[ 8, 5, 2 ]
[ 9, 6, 3 ]

The easiest way to work with multidimensional data in Perl is PDL. Interestingly, I haven’t found a direct method to rotate a matrix in this way.

What I have found, though, was a method to transpose a matrix, which means to switch the columns and rows. The result for the sample input is

Rotation in R^2 - CY's take on PWC#053 Task 1

This is a part of Perl Weekly Challenge(PWC) #053 and the followings are related to my solution. If you want to challenge yourself on Perl, go to https://perlweeklychallenge.org, code the latest challenges, submit codes on-time (by GitHub or email) if possible, before reading my blog post.

Do tell me if I am wrong or you strongly oppose my statements!

Oh. Task #1 has been funner than what I thought. I would like to introduce the "advanced" version I coded; it requests a specific module to run; well, I write these codes while I am studying OO hence a package (or module?or class? Which word is more suitable?) exists).

I have supplied a simpler script on GitHub, where the idea is based on a spiral.
#the spiral for the simpler script
    3,  2,  1, 
    4,  X,  0, 
    5,  6,  7
- - - - - - - - - - - - - - -
The idea behind this so-called "advanced" version is based on linear transformations on plane. In words:

new_position_vector = ReverseTranslation(Rotation(Translation(old_position_vector))) .

Content inside xy.pm

Perl Weekly Challenge 53: Rotate Matrix and Vowel Strings

These are some answers to the Week 53 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a couple of days (March 29, 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: Rotate Matrix

Write a script to rotate the following matrix by given 90/180/270 degrees clockwise.

[ 1, 2, 3 ]
[ 4, 5, 6 ]
[ 7, 8, 9 ]

For example, if you rotate by 90 degrees then expected result should be like below:

[ 7, 4, 1 ]
[ 8, 5, 2 ]
[ 9, 6, 3 ]

BLOG: The Weekly Challenge #053

https://perlweeklychallenge.org/blog/weekly-challenge-053

Back to Paws

It has been a little while since I played with my little PAWS and yes like many of us these days I have been just a little distracted, trip planned, trip changed, trip canceled etc etc etc.

Anyway to recap where I left off I was just getting the 'SubscribeToShard' action to work with a HTTP stream to work, after a fashion anyway. Then I got side tracked a little playing about with the problem of testing if the stream was correctly sending data down the pipe and if I was decoding it correctly.

As a byproduct of getting to the bottom of that I finally figured out what the PAWS 'Paginators' are for and I guess how to use them.

I noticed the odd "NextToken" tag in some of the Boto Json files as well most of the services have a ''paginators-1.json' definition file as well and looking at the Kinesis pod I see that there paginators listed.

PAGINATORS
Paginator methods are helpers that repetitively call methods that return partial results

Tree as a tool for enumeration - CY's take on PWC#053 Task 2

This is a part of Perl Weekly Challenge(PWC) #053 and the followings are related to my solution. If you want to challenge yourself on Perl, go to https://perlweeklychallenge.org, code the latest challenges, submit codes on-time (by GitHub or email) if possible, before reading my blog post.

Do tell me if I am wrong or you strongly oppose my statements!

( The first task is simple.
Not much to say about this task.
4-3 = 1; 4-2 =2; 4-1 = 3.
(Honestly I haven't coded on it. :P) )

Here for the second task.

Somehow, it looks like those base-10 special property tasks, e.g. multiples consisting of 1's and 0's(#49), stepping numbers(#052), gapful number(#047) or colourful numbers(#051). Like those base-10 tasks, the possible brute-force way is: list out all possible combinations or permutations, and then exclude unfit candidates (equivalently, only print suitable candidates).

Comparing coronavirus SARS-CoV-2 spike protein sequences with BioPerl

Continuing from extraction of coronavirus spike protein sequences I decided to compare them and see if any mutations could be found. To do this I needed to align sequences to each other and get multiple sequence alignment. There are many tools that might be used and I have chosen MUSCLE as it is fast, easy to use and accurate enough. However, other tools such as MAFFT or T-Coffee should also work well and could give more accurate alignments in more complicated cases than the one I was dealing with.

Let’s gain some MUSCLE

For analysis of multiple sequence alignment (MSA) I chose BioPerl module Bio::Tools::Run::Alignment::Muscle. I found out that in order to install this module I need some dependencies. This worked for me with Perl v5.30 PDL edition on Windows:
cpanm -n XML::DOM::XPath cpanm Bio::DB::EUtilities Bio::Tools::Run::Alignment::Muscle
Next I installed MUSCLE

BLOG: The Weekly Challenge #052

https://perlweeklychallenge.org/blog/weekly-challenge-052

Perl Weekly Challenge 52: Stepping Numbers and Lucky Winner

These are some answers to the Week 52 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Task 1: Stepping Numbers

Write a script to accept two numbers between 100 and 999. It should then print all Stepping Numbers between them.

A number is called a stepping number if the adjacent digits have a difference of 1. For example, 456 is a stepping number but 129 is not.

Just to make things slightly clearer, I would say that all adjacent digits should have an absolute difference of 1, so that 542, 454, or 654 are also stepping numbers.

Stepping Numbers in Perl

Given that the range is quite small, we can use a brute force approach on all numbers between the input values: check for every number in the range whether it fits the definition.

Perl Weekly Challenge 052: Stepping Numbers & Lucky Winner

Stepping Numbers

Write a script to accept two numbers between 100 and 999. It should then print all Stepping Numbers between them.

A number is called a stepping number if the adjacent digits have a difference of 1. For example, 456 is a stepping number but 129 is not.

The naive approach would be to iterate over all the numbers from 100 to 999 and check the difference between each adjacent digits.

PTS 2020 Cancelled

The Perl Toolchain Summit (PTS) won't be happening this year. It had been planned for Vienna, so we're hoping that PTS 2021 will be held in Vienna.

We had wondered about delaying it, or seeing whether there's interest in a virtual PTS, but right now we all have much more important things to worry about. When the time is right, we'll see what makes sense.

In the meantime, stay safe, and look after yourselves, your loved ones, and your neighbours.

Philippe, Laurent, Thomas, & Neil

Enter the Matrix ... with PDL

We interrupt this k-Means broadcast to bring you an important message about threading (the PDL kind, not the Perl kind - darn those overloaded terms!)

The Assignment

Take two vectors, x and y, and create a matrix C from a function of the values of each element pair, such that

KBOS methods

After scopes, types and signatures we got all the prerequisites to talk about the syntax and semantics of KBOS methods. Unless you want to contribute to Kephra or write a plugin, you may never use them, but please join me in the thought experiment - maybe we get a littler smarter.

()

$ perl -Mstrict -we'$_ = time; print "$_\n"'
1583887020

<.<

$ perl -Mstrict -we'$_ = CORE::time; print "$_\n"'
1583887039

>.>

$ perl -Mstrict -we'$_ = time - CORE::time; print "$_\n"'
0

-_- ...

$ perl -Mstrict -we'BEGIN{*CORE::GLOBAL::time=sub{42}} $_ = time - CORE::time; print "$_\n"'
42

(┛◉Д◉)┛彡┻━

$ perl -Mstrict -we'BEGIN{*CORE::GLOBAL::time=sub{42}} $_ = time() - CORE::time; print "$_\n"'
-1583886770


🧑🔬

$ alias deparse='perl -Mstrict -MO=Deparse,-p -we'

$ deparse 'BEGIN{*CORE::GLOBAL::time=sub{42}} $_ = time - CORE::time; print "$_\n"'
BEGIN { $^W = 1; }
use strict;
sub BEGIN {
(*CORE::GLOBAL::time = sub {
42;
}
);
}
($_ = time((-time))); # !!!
print("$_\n");
-e syntax OK

$ deparse '$_ = time - CORE::time; print "$_\n"'
BEGIN { $^W = 1; }
use strict;
($_ = (time - time)); # O.o
print("$_\n");
-e syntax OK

$ deparse 'BEGIN{*CORE::GLOBAL::time=sub{42}} $_ = time() - CORE::time; print "$_\n"'
BEGIN { $^W = 1; }
use strict;
sub BEGIN {
(*CORE::GLOBAL::time = sub {
42;
}
);
}
($_ = (time() - time)); # ✓
print("$_\n");
-e syntax OK


🤔

No Paws in this post (well maybe a litte)

Well back to the PAWs game again. This is one group of actions that has really got me distracted.

In my last post I manged to get 'SubscribeToShard' to work with my stream decoder though it is really just beta code for now. What first go me distracted was reading along in the Amazon doc I saw a bit about streaming an audio file.

Well the last time I worked on this sort of stream was in the dieing days of the last century??

This got me thinking and I went downstairs and dusted off my good old 2201 and fired it up thinking it might come in useful. Next I had to find some 'C' code and files I had from that time that I think I had on on 3.5 floppy in my upstairs closet.

Well I found the disks and once my HP Pavilion booted up I found that the disks where sill readable and still compiled. Well step one and two done.

Extracting coronavirus SARS-CoV-2 spike protein sequences with BioPerl

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?

  k-Means
k-Means-er

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.

KBOS signatures

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.

perlmodules.net remake

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

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.