
Machine Learning
02 Apr 2020  Education  Dougie
Coronavirus has seen many of us stuck indoors for potentially months so I’ve been taking advantage of the time trying out a course in Machine Learning.

Python List Comprehension
29 Mar 2020  Programming  Dougie
I’ve been spending time with Python recently and am beginning to really like some of the language’s features. List comprehension (listcomp) creates a list by evaluating an expression on each item in a given list, from left to right.

Rainbow Hat
28 Mar 2020  Programming  Dougie
Pimoroni’s Rainbow Hat offers a nice selection of inputs and outputs using a variety of protocols. This makes it a great way to experiment with Raspberry Pi, especially as Hardware Attached on Top (HAT) avoids the messiness of breadboards and shorting links!

Android Development
28 Mar 2020  Programming  Dougie
Having not developed anything in Java since finishing university, opening Android Studio seemed like looking at an alien language. While I’d love to say it all came flooding back, that wouldn’t be true. Downloading the source to my last app from Github really didn’t help either.

Using Threading rather than Thread
27 Mar 2020  Programming  Dougie
In an earlier post, I used Threads but the thread module in Python when I should be using threading. The documentation for threading says it builds upon the thread module (renamed _thread):

Rainbow Decorators Arguments Threads
26 Dec 2018  Programming  Dougie
Playing with Rainbow Hat I learned a few things about Python as a result I found out what a decorator is, the difference between args and kwargs and threads. I also learned that a lot of guides don’t understand either.

Passwordless Ssh
22 Dec 2018  Programming  Dougie
Passwordless SSH access is convenient, especially as everything is on my local network. I only really access the Pi remotely and you can configure it to use RSA keys. I’m on Ubuntu Linux so open a terminal and create an RSA key (if you don’t have one):
sshkeygen t rsa

Euler 19
06 Jul 2018  Euler  Dougie
Project Euler again, problem 19. How many Sundays fell on the first of the month in the twentieth century?

Euler 25
05 Jul 2018  Euler  Dougie
Project Euler problem 25 is to find the index of the first Fibonacci number of 1000 characters. I used the gmp library – I couldn’t find a way to get the length of a bigz data type so converted it to a string: ```python library(gmp)

Euler 17
29 Jun 2018  Euler  Dougie
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?

Euler 22
24 Jun 2018  Euler  Dougie
Project Euler again, this time Python. The problem is to sort a list of 5000 names alphabetically then give them a value. For example “COLIN” is 3 + 15 + 12 + 9 + 14 = 53 and is the 938th item – so its value is 49714 (53*938).

Euler 21
23 Jun 2018  Euler  Dougie
Project Euler problem 21 is to find the sum of all amicable numbers under 10000. An amicable number is:

Euler 13
21 Jun 2018  Euler  Dougie
Problem 13 is summing a list of fifty digit numbers. I used the gmp library and R to solve in 2 lines:

Euler 12
21 Jun 2018  Euler  Dougie
Today I’m trying problem 12  find the first triangular number with over 500 divisors. This is the first Project Euler problem I’ve really struggled to find a solution in a reasonable amount of time.

Euler 11
18 Jun 2018  Euler  Dougie
I’m beginning to like R. You can capture table data from a connection (a generalised file), one of which is the clipboard, to a data frame.