Spoiler Alert: This weekly challenge deadline is due in a day or so (November 8, 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: Triplet Sum
You are given an array of real numbers greater than zero.
Write a script to find if there exists a triplet (a,b,c) such that 1 < a+b+c < 2. Print 1 if you succeed otherwise 0.
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:
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
Spoiler Alert: This weekly challenge deadline is due in a few days (November 1, 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: Reverse Integer
You are given an integer $N.
Write a script to reverse the given integer and print the result. Print 0 if the result doesn’t fit in 32-bit signed integer.
The number 2,147,483,647 is the maximum positive value for a 32-bit signed binary integer in computing.
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:
Now I have a todo list command-line script. I want to have a to-do list for my wikipedia editing activities, a to-study list for math I want to study sparely, a to-study-or-to-code in computer programming and maybe a to-read list for books.
The current format of the todo list script is roughly like this:
C:\Users\user>todo.pl h
Spoiler Alert: This weekly challenge deadline is due in a couple of days (October 25, 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: Words Length
You are given a string $S with 3 or more words.
Write a script to find the length of the string except the first and last words ignoring whitespace.
Example 1:
Input: $S = "The Weekly Challenge"
Output: 6
Example 2:
Input: $S = "The purpose of our lives is to be happy"
Output: 23
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.
Different people have come to an interest or develop a skill for different reasons. Nowadays, lots people are learning Python, R, JavaScript, Java, etc. for job hunting as data scientists or software engineers...
Beginner's Enthusiasm in Programming
For me, solitaires (games) always attract me. Programming has been felt like a solitaire . (Some people must disagree with me on this line. They are lucky. And I also want myself can grow as strong as a contributor to the opensource programming community.) Testing. Possible modifications. I learnt LOGO programming language in the primary school. As I can remember, while I was in junior high school, I lost my sleep one night just because of thinking using LOGO to write a Chinese Chess program! (The workload would be too much... LOGO is derived from LISP, I know. Ha.)
Given an array @L of integers. Write a script to find all unique triplets such that a + b + c is same as the given target T. Also make sure a <= b <= c.
One such triplet for target 0 i.e. -10 + 2 + 8 = 0.
I hadn’t checked the wiki page before writing my solution; and I hadn’t changed the solution after I read it. Therefore, it presents the naive and inefficient solution that iterates over all the possible triplets (but not starting from 0 in the inner loops to avoid checking the same triplet several times).
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.
Write a script to find the frequency of all the words.
It should print the result as the first column of each line should be the frequency of the the word followed by all the words of that frequency arranged in lexicographical order. Also sort the words in the ascending order of frequency.
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).