Subscribe to Craig Maloney feed
Updated: 47 min 22 sec ago

Day 16/100: More Shut the Box

Fri, 06/16/2017 - 23:19

Played a little more with the functional aspects of Scheme / Racket wit the Shut the Box program:

#lang racket (define tiles `(1 2 3 4 5 6 7 8 9)) (define (dice) (+ 1 (random 6))) (define (roll) (list (dice) (dice))) (define dice-roll (roll)) (define sum-roll (apply + dice-roll)) (define tilelist '(4 5)) (define (shut-tiles tilelist) (for ([i tilelist]) (if (index-of tiles i) (set! tiles (remove i tiles)) ("Tile already shut")))) (shut-tiles tilelist)
Categories: LugNut Blogs

Day 15/100: Pressing onward and onward

Thu, 06/15/2017 - 22:54

Spent a little more time with "Learning Web App Development" until I got to the point where I got frustrated with the book. Part of my frustration with the book is it doesn't make it clear what's changed in between sections. That and a lot of "I left this as an exercise for the reader". That's great and I'm sure it's a fantastic learning tool for some but if I'm learning these things then leaving it as an exercise means I have to figure things out. And if later sections build on those concepts then it means there's a gap between where you taught and where I may or may not have caught the concept. That really irritates me in books, especially ones where it's more about self study. Worse is when the sample code pretty much has everything in a "solved" state (which is cool if you got lost, but absolute rubbish if you got lost mid-chapter).

I don't know of a good way to fix this sort of issue but it's one that makes me start searching to see if there are other more cogent and coherent books on the subject.

Ever onward.

Categories: LugNut Blogs


Thu, 06/15/2017 - 08:53

I'm not sure when I first logged onto I'm pretty sure it was after my friend Greg Grossmeier signed on that I created my account "". I started following people that I knew in the FLOSS (Free / Libre Open Source Software) community. But I also started following other folks on there as well. The public stream moved at a ticker-tape crawl (not like the Twitter public stream which moved faster than you could read). But it was exciting to be part of something new. is a federated social network created by Evan Prodromou. What that means is each node of the network operates independently. So I could start my own instance at and build my own community of users. You could join any of the other instances out there and interact with the folks on that community of users. The federated part is that each of the users on these systems can then follow each other. So if Bob is at the instance I can follow

Also Statusnet, the software that powered and the other instances was released under the GPL license. That meant that anyone could hack on it and spin up their own version of the software.

At the time this was unheard of. Twitter was just hitting critical mass and having some growing pains trying to figure out their next move. And, as Twitter is wont to do they made some controversial decisions.

The first explosion of accounts came like a wave. Many folks hopped onto for a variety of reasons. Some were looking for the next big thing, some looking for what Twitter wasn't giving them. Some were just following Robert Scoble and Leo Laporte. Whatever the reason they were populating the instance and conversations blossomed.

Over time folks faded back to Twitter. tended to get these waves of people who checked out the service, but then realized they had different conversations on than they did on Twitter.

I remember Steve Gilmor co-organized a conference about and the future of social media. I remember watching the live-stream of the proceedings. Steve seemed more interested in ensuring that these services had "the firehose" like Twitter had. The firehose was the entire public stream of Twitter. had it, but each instance had its own public stream. So in order to get all of the traffic out there you'd have to poll each of the instances for their public feed.

It was a strange conference to look at, with multiple people having their own ideas of how social media would work. Steve seemed interested as a journalist for having a stream to research and investigate. Others were looking for how to monetize this technology.

I think we're still trying to wrestle with those questions.

But over time the instances grew quiet for various reasons. Folks migrated back to Twitter, and admins realized that administrating communities of people is hard work. went through a re-write to use a new protocol. Previously it used a protocol that is now known as OStatus. The new protocol is ActivityPub. ActivityPub was a better protocol than OStatus, but sadly it hasn't caught on.

Eventually Evan moved on to other endeavors and / was no longer his focus. There have been several attempts to keep the service running but as of this writing is down.

But what's great about the GPL is others can take the software and use it to build their own platforms. There are currently two major forks of the code / protocols. GNUSocial is closely related to the old StatusNet software. The other is Mastodon, which is a complete re-write of the code in Ruby.

Right now I'm seeing a migration of users from Twitter over to Mastodon. They all have their own reasons. For some the bullying on Twitter is unbearable. For others the racism. Whatever the reasons they're searching for alternatives.

It's like all over again. Maybe they'll stay and set up roots. Maybe they'll just pass through like the others.

Whatever the reasons I'm glad that still lives on.

(If you would like to take a peek at Mastodon check out for more information. And follow me

Categories: LugNut Blogs

Day 14/100: Pressing onward

Wed, 06/14/2017 - 22:50

Today was mostly cleaning up other projects so I didn't get a whole lot of time to do actual coding. However I did get the opportunity to learn more about React / React Native / Redux at our local coding group so that was time well spent. Hoping to put some of this knowledge to good use soon.

Categories: LugNut Blogs

Day 13/100: The Water of Treading

Tue, 06/13/2017 - 23:06

Today didn't get a whole lot of code. Worked through the Learn Web App Development book some more, but most of today was spent on other things (anticipation of a fixed washer for starters).

Ever onward!

Categories: LugNut Blogs

Cat Negotiation 101

Tue, 06/13/2017 - 08:49

JoDee: I'd like to get Pixel back on a regular eating schedule.
Pixel: Fuck you, I'm a cat.

Me: Pixel, not now I'm in the middle of something.
Pixel: Fuck you, I'm a cat.

Us: Pixel, we'd like to have some bed to sleep on.
Pixel: Fuck you, I'm a cat.

This has been Cat Negotiation 101. Stay tuned for Cat Negotiation 102:

Us: Pixel, please don't...
Pixel: Fuck you, I'm a cat.

Categories: LugNut Blogs

Day 12/100: More Shut the Box in Racket

Mon, 06/12/2017 - 23:08

Spent a little more time today playing with racket and the "Shut the Box" implementation.

It's not much, but it's progress.

::: scheme (define tiles `(1 2 3 4 5 6 7 8 9)) (define die1 (+ 1 (random 6))) (define die2 (+ 1 (random 6))) (define roll (+ die1 die2)) (define tilelist '(4 5)) (define (shuttiles tilelist) (for ([i tilelist]) (if (index-of tiles i) (set! tiles (remove i tiles)) ("Tile already shut")))) (shuttiles tilelist)
Categories: LugNut Blogs

Day 11/100: Shut the Box in Racket

Sun, 06/11/2017 - 23:23

Today I had the brilliant idea to do my standard "Hello World" program in Scheme / Racket. So, I present to you the first bits of "Shut the Box" in Racket:

(define tiles `(1 2 3 4 5 6 7 8 9)) (define die1 (+ 1 (random 6))) (define die2 (+ 1 (random 6))) (define roll (+ die1 die2)) (define tilelist 4) (if (index-of tiles tilelist) (set! tiles (remove tilelist tiles)) ("Tile already shut"))

More later as I figure things out.

Categories: LugNut Blogs

Day 10/100: Yet more reading

Sat, 06/10/2017 - 22:45

I'm planning on doing a talk at our local user group (Michigan!/usr/group]) about Scheme / Guile / Racket and so I'm reading more to understand how deep I want to go with introducing the languages. So today was more about research than actual programming (though I did find some interesting examples in Racket that I was playing with).

Categories: LugNut Blogs

Day 9/100: More reading, no progress

Fri, 06/09/2017 - 22:37

Today was pretty well carved up so I didn't get a chance to do much other than read. Hopefully more progress tomorrow.

Categories: LugNut Blogs

Day 8/100: More reading

Thu, 06/08/2017 - 21:40

Spent part of the day working on shoring up my HTML / CSS skills. I feel like I have a large gap in my ability to put together good-looking sites, but I think part of it is that I compare my sites with some of the best in the business. These are folks that have done front-end development for over 20 years, or have an artistic background. Perhaps I need to be a little easier on myself and realize (as a friend in high school so eloquently put it) "your cat doesn't get fat overnight". Too true.

Also played more with Racket. Apparently Scheme / Racket are my comfort language during this. Played more with Realm of Racket a little more. Also read through some of the books that I got from the library. Good stuff.

Categories: LugNut Blogs

Day 7/100: Sitting with code

Wed, 06/07/2017 - 23:47

Today was a mixed bag. This afternoon I worked on some HTML code (nothing really to show yet) and then this evening I picked up some books from the library (Apparently you can hold 8 books at the library. Didn't feel like pushing that number higher). So I leafed through Realm of Racket at the coffee shop as well as the Functional JavaScript book and a Gamification book. Unfortunately the Gamification book was a bit of a turn-off (I'd rather make games and it didn't seem to have much insights outside of what I've read in other books about motivation) and the Functional JavaScript book concentrated on Underscore.js (which seems like it's less relevant in the age of ECMAScript 6).

So I have a stack of five books to peek through. Remember to support your local library. :)

Categories: LugNut Blogs

Day 6/100: Bugfixes and what-not

Tue, 06/06/2017 - 21:58

Today I worked a bit on some fixes for tootstream where I revised a pull request that I previously worked on. I also fixed a bug with the reply function that I found if you don't pass along an ID. Also worked a bit on playing with the Eloquent JavaScript book this afternoon. Overall a pretty productive day.

Categories: LugNut Blogs

Day 5/100: Let a little JQuery into your life

Mon, 06/05/2017 - 22:41

Day 5 saw me play a little with JavaScript and JQuery. I've been a little leery of adding JQuery to my repertoire because I always worry about learning a way to hide complexity and eventually having to unlearn it because it hid something useful or didn't fully abstract away something away. That and my friend Rick seemed to have an almost apoplectic reaction whenever someone mentioned JQuery. He tended to prefer YUI, which Yahoo! unfortunately killed off (likely because people actually enjoyed using it and that's something that Yahoo! can't have. So I girded my loins and resolved to let myself learn JQuery. And while there's the joke "How do I do X in JQuery (which is essentially something in JavaScript) it does appear to get out of the way.

Categories: LugNut Blogs

Day 4/100 No progress

Sun, 06/04/2017 - 21:07

Today I had a few other things going on, but also had the "you have all of these things that you'd like to do, so let's ruminate on how you're not doing any of them" phase. Hoping to play a little tonight with some more code tonight, but sometimes the muse doesn't want to visit when it's convenient.

Categories: LugNut Blogs

Day 3/100: More Scheme

Sat, 06/03/2017 - 19:42

Today was more reading of Structure and Interpretation of Computer Programs. Played a bit with recursion although the "Counting Change" problem is throwing me for a loop right now (no pun intended).

Didn't sit-down proper to work on coding today. I think part of this was some procrastination of other things (weekly review, etc.). In retrospect I'm not sure why this didn't take higher priority.

Categories: LugNut Blogs

Day 2/100: Scheming Guile

Fri, 06/02/2017 - 17:54

Today was a bit off as yesterday we had a car accident (we're fine, car is fine, just a fender bender) and took Pixel to the vet (she's fine). That bled into today with all of the joys of insurance wrangling and other business.

But during the downtime I played a bit with Scheme and Guile. I've taken a new fascination with Guile and Scheme because (I'm paraphrasing) JavaScript was initially supposed to be Scheme in the browser. So it makes a little sense to play with Scheme at the same time that I'm playing with JavaScript.

I've found the Guile Manual contains a very readable tutorial for Scheme. So I've been working through that.

Not much code to show (lots of playing in the REPL though). Hopefully I'll have more to show tomorrow.

Categories: LugNut Blogs

Day 1/100 Addendum

Thu, 06/01/2017 - 18:04

Came up with another way to do the RPN calculator by attaching functions in a JavaScript "dictionary":

// jshint esversion: 6 function add(p) { return p.x + p.y; } function multiply(p) { return p.x * p.y; } function subtract(p) { return p.x - p.y; } function divide(p) { return p.x / p.y; } function calculate(input) { let stack = []; let operand = {}; let n = {x: 0, y: 0}; operand['+'] = add.bind(null, n); operand['-'] = subtract.bind(null, n); operand['*'] = multiply.bind(null, n); operand['/'] = divide.bind(null, n); for (let i=0; i < input.length; i++) { element = parseFloat(input[i]); if (!Number.isNaN(element)) { stack.push(element); } else { if (input[i] in operand) { n.y = stack.pop(); n.x = stack.pop(); let result = operand[input[i]](); stack.push(result); } } } return stack; } console.log(calculate(['3','4','11', '+', '*', '22', '/','.'])); // 2.04545 console.log(calculate(['2', '2', '+', '.'])); // 4 console.log(calculate(['2', '+', '.'])); // error, too few items on the stack
Categories: LugNut Blogs

Day 1 / 100: RPN Calculator in JavaScript

Thu, 06/01/2017 - 11:30

Day 1: Decided to play around with a RPN calculator in JavaScript (command-line for now). Right now it reads a pre-parsed array of values (eventually I want to get it so it will take in either string input, or perhaps a simple 4-function graphical calculator. But today I'm starting small.).

Here's the code:

::: javascript // jshint esversion: 6 function addition(a, b) { return a + b; } function multiply(a, b) { return a * b; } function subtract(a, b) { return a - b; } function divide(a, b) { return a / b; } function calculate(input) { let stack = []; for (let i=0; i < input.length; i++) { element = parseFloat(input[i]); if (!Number.isNaN(element)) { stack.push(element); } else { if (input[i] === '+') { let b = stack.pop(); let a = stack.pop(); stack.push(addition(a, b)); } if (input[i] === '*') { let b = stack.pop(); let a = stack.pop(); stack.push(multiply(a, b)); } if (input[i] === '/') { let b = stack.pop(); let a = stack.pop(); stack.push(divide(a, b)); } if (input[i] === '-') { let b = stack.pop(); let a = stack.pop(); stack.push(subtract(a, b)); } } } return stack; } console.log(calculate(['3','4','11', '+', '*', '22', '/','.'])); // 2.04545 console.log(calculate(['2', '2', '+', '.'])); // 4 console.log(calculate(['2', '+', '.'])); // error, too few items on the stack
Categories: LugNut Blogs

100 day Programming Challenge

Wed, 05/31/2017 - 15:56

I've decided to do a variant of the 100 day coding challenge. The variant I'm going to commit to is working an hour (or more) on coding. This includes projects and what-not, but also includes taking credit for working on training, reading books, or what-not. Anything that keeps me motivated to work on coding counts.

I'll post coder. I'll link to projects in my Github account. I'll talk about what I'm reading and what's kicking my butt. But it'll all be related to code and coding. I'll be working outside of my comfort zone. I'll post about my failures. I'll be brutally honest with where my head is right now.

I think it's going to be a challenge, but I also think it will be interesting to see what happens.

And I hope it'll be fun.

You can follow along if you want. Let's support each other. Let's make this work.

Who's with me?

Categories: LugNut Blogs