Day 50/100: Halfway point

Craig Maloney - Thu, 07/20/2017 - 22:10

So it looks like I'm at the halfway point of this experiment. Frankly I wish I had more to show for it. True, I've done a few major-ish programs but most of this has been reading and learning, not actual programming.

I'm still keeping with it, but I'm disappointed with the progress so far. Hoping to change that in the next 50 days.

Categories: LugNut Blogs

Day 49/100: Playing with ideas

Craig Maloney - Wed, 07/19/2017 - 23:07

Spent most of the day playing around with some ideas that I've had percolating in my head. Nothing major but part of it was playing with a game idea that I've had for a while now and seeing if I could make it work. Part of that was modeling the data in a SQLite database. But I also got a little side-tracked in looking at Guile's Fibers support and concurrency in general.

Categories: LugNut Blogs

Day 48/100: Reading and working with CSS

Craig Maloney - Tue, 07/18/2017 - 20:00

Spent the day playing working fighting in mortal hand-to-hand combat with CSS on a Wordpress site. Finally gave up after things weren't working the way I thought they should and didn't want to get too far into the weeds to get what I wanted.

Funnily enough I got mostly there by removing some of the old styling in a table, but that's another story for another time.

Categories: LugNut Blogs

Day 47/100: JavaScript Allonge

Craig Maloney - Mon, 07/17/2017 - 23:28

Did a little reading of the excellent JavaScript Allonge today. Today was taken up with working on fixing bugs for a website and releasing the next Open Metalcast Episode. Hoping to get some more quality programming time tomorrow.

Categories: LugNut Blogs

Day 46/100: Playing with CodeWars some more

Craig Maloney - Sun, 07/16/2017 - 22:52

Played around with CodeWars and some of the problems on there. Here's one of the solutions I came up with for a question to determine an outlier in the array (eg: one of the elements would be either odd or even).

function findOutlier(integers){ let odd = integers.filter(function(n) {return (n%2) !== 0;}); let even = integers.filter(function(n) {return (n%2) === 0;}); if (odd.length < even.length) { return odd[0]; } else { return even[0]; } }
Categories: LugNut Blogs

Day 45/100: Everything but

Craig Maloney - Sat, 07/15/2017 - 00:45

Unfortunately today was taken up with everything but programming. Did a little reading but nothing of consequence. Again. Argh!

Categories: LugNut Blogs

Day 44/100: Reading is fundamental

Craig Maloney - Fri, 07/14/2017 - 21:48

Spent more time reading than programming. Am still trying to figure out what the next project will be.

Categories: LugNut Blogs

Day 43/100: Playing a little bit with Godot

Craig Maloney - Thu, 07/13/2017 - 22:55

Played a little bit with the Godot Engine today, but still getting my feet wet with it. Nothing really to show for it right now. More tomorrow and this weekend.

Categories: LugNut Blogs

Day 42/100: Figuring out what's next

Craig Maloney - Wed, 07/12/2017 - 21:13

Today I was playing around with Guile 2.2 and thinking about a new project with Godot Engine. I need to look at some of the tutorials for Godot to get my bearings.

Categories: LugNut Blogs

Day 41/100: Tonight: The Presentation

Craig Maloney - Tue, 07/11/2017 - 13:38

Tonight I shall finally present the Scheme presentation that I've been working on. (And there was much rejoicing). This afternoon I worked more on cleaning up the slides. Hopefully it'll be recorded so you can see the end result.

Categories: LugNut Blogs

Day 40/100: Some more slides

Craig Maloney - Mon, 07/10/2017 - 22:37

Still more slides for the presentation. Also downloaded some tutorials from GDQuest for the Godot Engine to see how that works.

Categories: LugNut Blogs

Day 39/100: More slidea dn lambda calculus

Craig Maloney - Sun, 07/09/2017 - 22:42

Putting more spit and polish on my slides for the MUG Meeting (July 11th is when the presentation is). Did some reading on Lambda Calculus just so I can speak somewhat intelligently about it and how it relates to Scheme.

Categories: LugNut Blogs

Day 38/100: eqv? in guile

Craig Maloney - Sat, 07/08/2017 - 22:58

Was working more on my slides when I ran into something a little curious with the implementation of guile.

(eqv? "5" "5")

Apparently in certain versions of guile this returns #f (2.0.9). However in later versions (2.0.13) this returns #t. It also returns #t in Racket. I'm not 100% sure what's going on (I think it has something to do with how strings are handled in the earlier versions, and how they do comparisons) but it was interesting to me to see that even in later implementations of the same Scheme interpreter there was disagreement over how certain bits were handled.

I'll likely hand-wave this as part of the presentation, but it was interesting nonetheless.

Categories: LugNut Blogs

Day 37/100: Nothing to report

Craig Maloney - Fri, 07/07/2017 - 22:57

Worked a little more on my slides, but didn't get to any programming of note.

Categories: LugNut Blogs

Day 36/100: More and more slides

Craig Maloney - Thu, 07/06/2017 - 23:10

Still more work on the slides. Added bits about scheme types. More fun times.

Categories: LugNut Blogs

Day 35/100: More Slides

Craig Maloney - Wed, 07/05/2017 - 23:12

Wrote up more slides for my talk. Did a quick demo of them to explain what scheme was and realized I might need to go a little more basic. Apparently not everyone knows what a Lisp is (shock! horror!) Ah well.

Categories: LugNut Blogs

Day 34/100: July 4th - no progress

Craig Maloney - Tue, 07/04/2017 - 23:51

Today was July 4th so I didn't get a chance to sit down and do any coding. Hopefully tomorrow will offer better opportunities to code.

Categories: LugNut Blogs

Day 33/100: Busy day / Closures

Craig Maloney - Mon, 07/03/2017 - 23:35

Today was a bit busier than I thought it would be. I did some playing around with trying to better understand closures. I think I understand them a little better but one of things I'm having trouble with is figuring out how something magically becomes a closure.

Take this for instance:

(define (make-serial-number-generator) (let ((current-serial-number 0)) (lambda () (set! current-serial-number (+ current-serial-number 1)) current-serial-number))) (define entry-sn-generator (make-serial-number-generator))

I understand that in this case a new instance of the procedure make-serial-number-generator needs to be wrapped in entry-en-generator otherwise it won't work properly (it gets reset each time). However:

(define counter (let ((count 0)) (lambda (x) (set! count (+ x count)) count)))

This doesn't need the wrapping and I can use (counter 3) to increment the counter by 3. Worse, I can't seem to replicate the need for the generator wrapper.

So confused.

Any help on what the difference is would be appreciated. Thanks!

Categories: LugNut Blogs

Day 32/100: More work on slides and closures

Craig Maloney - Sun, 07/02/2017 - 22:49

Today I did a little more work on my slides for the MUG presentation, but I also read some more of the (excellent) manual. The section on Closures really helped me understand better what was going on.

For those playing along at home, a closure is when a function is called in such a way that the local state is preserved. So, for example:

(define (silly-function x) (let ((y (/ x 2))) y))

This defines a lexical scope for y where y does not exist outside of the scope of the function. If I did the following:

(define y "moo") (silly-function 8) => 4 y => "moo"

"y" is not overwritten.

What makes closure so powerful is best described in this example (taken from the Guile documentation):

(define (make-serial-number-generator) (let ((current-serial-number 0)) (lambda () (set! current-serial-number (+ current-serial-number 1)) current-serial-number))) (define entry-sn-generator (make-serial-number-generator)) (entry-sn-generator) => 1 (entry-sn-generator) => 2 ...

In this case current-serial-number is initialized with 0 and the lambda function turns the function into a variable. Since the function as a whole is saved as a variable you can assign it to another variable and that variable holds the address of the instantiated function. So when you call that variable as a function it looks up the address of the function, brings up the current state of where it left off, and then (in this case) increments the value of current-serial-number.

Simple, no?

I'm pretty sure I'm not explaining this right, but I'll hopefully explain it better for the slides. Closure is one of the important concepts of JavaScript and it's nice to see a clear example of this in Scheme.


Categories: LugNut Blogs

Day 31/100: More work on slides

Craig Maloney - Sat, 07/01/2017 - 23:38

Did some more work on my slides for the MUG presentation, but that was it. Lost some momentum today. Going to find it tomorrow.

Categories: LugNut Blogs