Getting Started With The Spark Java Framework

I published a post last week showing how to use Grails to create a website on the Raspberry Pi.  After some feedback and conversations about whether this was “overkill” for a simple Raspberry Pi website I decided to revisit the topic and see how I could simplify things a bit without sacrificing the power of Groovy and Pi4J. I’ve done a bit of digging and discovered the Spark Java framework.

Remote Deployment For IntelliJ IDEA Community Edition

I’ve been using IntelliJ IDEA Community Edition on my personal machine to work with some of the demos that I’ve been using for my series on using Groovy to program on the Raspberry Pi.  One of the features I’ve missed most from Ultimate Edition is the ability to remotely deploy to the Pi to keep the code in sync.  I’ve worked around it by using SCP every time I change something, but it’s a bit tedious to do that every time, so I sought out additional options and found the Source Sync plugin.  It’s pretty easy to install and so far I’ve found that it works pretty much identically to the Remote Deploy feature in Ultimate Edition (with the exception that it doesn’t provide feedback that it is syncing).  I’ll use this plugin going forward so if you plan on following along with the series it would be a good idea to install it!
\

Brain Teaser: Find The Missing Number

When I first saw this challenge I thought it would be a lot more difficult than it turned out to be.  Here is the challenge:

Here’s a list with numbers from 1-250 in random order, but it’s missing one number. How will you find the missed number?

https://objectstorage.us-ashburn-1.oraclecloud.com/n/idatzojkinhi/b/img.recursive.codes/o/wouldnt-say-ive-been-missing-it.jpg

I generated the list of numbers on the fly each time:

// first, create the list 
List listWithNumbersInRandomOrder = (1..250).toList()

// randomize it
Collections.shuffle(listWithNumbersInRandomOrder, new Random(System.nanoTime()))

// remove 1 of the items
Integer removed = listWithNumbersInRandomOrder.remove(0)

// have we removed one?
assert listWithNumbersInRandomOrder.size() == 249

But if you’d rather work from a static set, here’s a list for you:

A Closer Look At Sorting Algorithms

As I mentioned in a previous post, sorting algorithms typically play a large role in programming interviews.  Those who follow the traditional path into the programming world and obtain a CIS degree are typically exposed to algorithms.  Those among us who follow a less traditional path into this world are less familiar with them.  

https://objectstorage.us-ashburn-1.oraclecloud.com/n/idatzojkinhi/b/img.recursive.codes/o/no-idea.jpg\

I decided to take a deeper dive into sorting algorithms and implement some of them to see:

A Groovy Alternative To Java 8 Streams and Collectors

I recently read this article over at DZone about using Java 8 Streams and Collectors to manipulate and perform calculations on a list of integers.  I don’t intend to get in a pissing match about which language is better, but my immediate thought was how much easier (and cleaner) it is to perform these tasks in Groovy.  Collections in Groovy have long been a shining example of how Groovy enhances Java with convenience methods for common tasks.  Here’s a recreation of all the examples in the DZone

Beginners Guide To Linux

Curious about getting into Raspberry Pi or just Linux in general but you’re not sure where to start?  This post is for you.  It’s not intended to be a comprehensive guide, rather a gentle intro into the Linux world.  I’m not a Linux expert, but I know from experience that it can be an intimidating platform to get started in.  I want this post to show you what you need to know to get started with Linux.