June 15, 2020, by The Digital Research Specialist Team

50 code challenges in 50 days

For the last few weeks, we have been posting a daily code challenge to the Research Software Network Team.

Today marks fifty working days since the first challenge.

It has been great to see the enthusiastic engagement with the challenges by colleagues from all stages of their careers. There have been really constructive conversations in response to the posts, with contributors sharing tips as well as links to articles or other resources. All in all, it has been a fantastic experience.

‘The mini coding challenges are an undemanding and even fun way of sharpening coding skills while also learning from, and sharing insights with, colleagues from differing programming backgrounds’

Andrew Warry, Bioinformatician, Sutton Bonington Campus

________________________________________________________________________

‘The discussions on the challenges have been good, with a nice varied selection of people from different backgrounds pitting in. The contributions in other languages I’m not familiar with have been interesting. I’ve certainly picked up one or two things I didn’t know. The challenges have ranged from finding the most suitable API calls to more algorithmic challenges, which have both been interesting. They have been good in terms of time, I don’t think any that I participated in have taken more than 15 mins to complete’

Dr Maurice Hendrix, Senior Research Software Engineer

Here are just a few of the solutions posted that illustrate the wide range of responses to the challenges:

  • A code snippet written in Rust, a safety-oriented language developed by Mozilla.
  • An R snippet using regular expressions to extract @ and # markers from tweets:
library(stringr)
tweet_tags <- function(tweet){
  print(str_match_all(tweet, "@([:alnum:]|_)+")[[1]][,1])
  print(str_match_all(tweet, "#([:alnum:]|_)+")[[1]][,1])
}
tweet_tags(tweet_txt)
  • This impressive data visualisation, created to show levels of internet connectivity in European countries over the last ten years:
  • Or this elegant Haskell snippet written by a Computer Science student, which returns the multiplicative persistence of an integer:
mulPersis :: Int -> Int
mulPersis = length . takeWhile ((/= 1) . length . show) . iterate mulDigits
  where mulDigits = product . map (read . pure) . show

University of Nottingham staff and students can find all of the challenges collated here. If you haven’t already attempted the challenges, we encourage you to have a go!

If you have questions about software engineering or would like to access training materials, please do join the Research Software Network Team (linked at the top of this blog) or get in touch with the Digital Research Service.

Posted in CollaborationSoftware Engineering