I learned yesterday that my yoga teacher, Judi Rice, passed away on December 12, 2014. She trained with BKS Iyengar, and I first met her when she taught yoga classes at the University of Louisville in the 1990s, and later continued to take lessons from her. She even allowed me to take a “yoga vacation” to Sayulita, Mexico with her, her students, and other teachers in 2009 when I wasn’t training with her. Though I no longer live in Louisville I think of her often, and she has been a big influence on me.

From my Haskell notes: “Anything that is a type ‘IO something’ is an I/O action. You can create it, store it, and nothing will happen (nothing will happen until it's invoked).”

“What you seek is within you.” ~ Ram Dass (I think that quote comes from Ram Dass. I heard it today while listening to the audio version of his book, Polishing The Mirror.)

She stood in front of me crying, her body shaking, her hands clenched. “I don’t know how to love someone ... so duck,” she said, sobbing.

“What?,” I said, ducking.

She looked at me funny. “What are you doing?,” she asked.

“I’m ducking.”


“You said ‘duck.’”

“Duck? No, I didn’t say ‘duck,’ I said, I don’t know how to love someone so dark,” she said, now crying and laughing at the same time.

(A little flash fiction inspired by me mis-hearing the lyrics of a song by Marian Call. Needs improvement, I know, but I’m traveling today, and that’s all I’ve got.)

Here’s an example of how to generate Play Framework CRUD code -- including a controller, model, routes file, and views -- in about a minute with Cato:

Welcome to the main page for my Cato application. Here’s what the marketing department wrote about Cato:

“Cato is a free, open source, template-based, database-driven, GUI app that lets you generate text -- source code, configuration files, etc. -- for any programming language or tool, based on the tables in your database.”

If you know what the code generator does in Ruby on Rails, Cato works just like that, but it’s not specific to any programming language or framework.

Here’s a quick example of how to capitalize each word in a String using Scala:

scala> "employee salary".split(' ').map(_.capitalize).mkString(" ")
res2: String = Employee Salary

The way this works is that you split the given String into “words” with split, which creates an Array[String]; then capitalize each word in the array with map; then convert the array back to a String.

“Brain and brain, what is brain?” From a Star Trek episode titled, Spock’s Brain. This is how I feel when I try to write code first thing on a Monday morning.

December 8th is recognized as the day of Buddha’s enlightenment. Tonight that makes me think of this scene from Haven. :) (I’ll meditate more tomorrow.)

This code shows how to create a Java FlowLayout that flows left and has horizontal spacing of ten pixels and vertical spacing of five pixels:

FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT, 10, 5);

Here’s what the FlowLayout constructor arguments look like:

FlowLayout(int align, int horizontalSpacing, int verticalSpacing);

FlowLayout 'align' property definitions

The align property can be any of these:

If you want to set your Java JScrollPane scrollbars to always scroll, both horizontally and vertically, this code shows the solution:

Another nice thing about functional programming is that you should be able to use tools to visualize the heck out of your software applications. Since functions should just be, “data in, data out,” tools like this may be helpful and accurate in “visualizing” your application. (On a somewhat related note, ScalaCheck can provide automated property-based testing of your Scala/FP code.)

At least on Mac OS X, if you want to copy text from one source and paste it into Gimp inside a Gimp text tool text region, you’ll find that this doesn’t work with the usual Control-V (Command-V on the Mac) keystroke. In short, the secret solution is to right-click inside the text tool area and select “Paste” from the popup menu. I have no idea why the normal copy and paste approach doesn’t work in Gimp, but I do know that this approach works, at least with Gimp 2.8 on Mac OS X.

I’ve been thinking about getting a new tablet recently, and after looking at the Nexus 9 yesterday, I have to say that I like Google’s latest UI design. Android 5 looks good, and this image from Google+ is also pleasant enough to look at.

“I kind of roll up my sleeves and go get it done.” ~ Jim McElwain, former head football coach, Colorado State

I saw a small photo in a recent issue of Yoga Journal, and thought it was so beautiful that I made this “fake oil painting” from the photo. (Click the photo to see it in its full size.) Whenever I get lazy in a pose I think of this photo as a form of inspiration. The caption on the photo said, “It was the morning of my grandfather’s funeral, and I needed a little yoga. I headed out to a lake in Brown County, Indiana.” ~ Kalee Thompson, Athens, Georgia

“Fear is the path to the dark side. Fear leads to anger, anger leads to hate, hate leads to suffering.” ~ Yoda

“Are you okay?”, a store manager asked an older man in her store, “you look really pale, white.” It sounded like she knew the man, and knew he was more pale than usual.

“I’m okay, I just haven’t eaten today.”

“Why not?”

“I don’t have any money.”

“You can have some of my sandwich, it should be here in a few minutes.”

“That’s okay, I’m not hungry. But I am high!”, he said.

“Don’t pound a screw with a hammer (use a screwdriver). FP is great for data flow problems, OOP works great for GUIs. Find the middle way."

I’ve read a lot of irrational claims about how functional programming helps with concurrency, but if a compiler can do what this says, at least it’s a clear, rational example of how FP can help with concurrency. It’s taken from an article titled, Functional programming for the rest of us.