Blogs

Cato - a template based, database driven source code generator

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.

How to define a default value for a method parameter that is a function

I was just reminded that functions are values just like Int, String, etc. Beyond the “typical” use cases, this is also true when it comes to supplying a default value for a function parameter that you’re passing into a method.

As some quick background, as I showed in the Scala Cookbook, you can define a method that provides default values for one or more of its parameters like this:

AlPad - A simple "scratchpad" editor

Over the course of a few hours this past week I created a little “scratchpad” text editor I named AlPad. It’s gone through several names, but since I’m just writing it for me, the name seems appropriate.

It’s not really correct to call AlPad an “editor”; it’s really just an app where I can keep a collection of miscellaneous notes I usually make when I’m working. It has very few features, just some ones I want and can implement easily:

Can Truvia (Stevia) make you lightheaded and dizzy?

Earlier this year I found that Truvia helped make me lightheaded and dizzy. I was going through a problem where I kept getting dizzy, and had passed out four times. The doctors never figured out what the problem was, even though I went through every heart test known to my cardiologist, finishing off with a TEE test. We knew I had thyroid cancer, but several doctors said that could not be the cause of being lightheaded and dizzy.

In short, here’s what I found through my own tests regarding Truvia (Stevia):

Setting a Scala application's command line parameters in Eclipse

I’ve been developing a new Scala application named Cato that requires some command-line parameters, and I just had to figure out how to configure Eclipse so my application would get those parameters. Doing this with Scala in Eclipse is different than configuring Java command line parameters in Eclipse, so I thought I’d share the recipe.

Fortunately it’s just a two-step process. First, click the drop-down icon next to the “Run” button and choose “Run Configurations”, as shown here:

Scala type examples (type aliases and type members)

At some point I want to write more about Scala type aliases and type members, but for today I just want to put a little reminder here for myself.

In the meantime, here are two images from stackoverflow that provide Scala type examples.

Using Scala type aliases

This first image is from this link, and discusses the difference between a type and a value:

Processing Scala command-line arguments with Argot, and passing command-line arguments through SBT

Argot is the name of a Scala library that lets you read command-line options/arguments from a Scala application. (Presumably it will work with Java and other JVM-based languages as well.)

I’m trying to use Argot with an application of mine named Cato, and when I had problems getting Argot to work -- and then needed to pass command-line arguments to my application through SBT -- I decided to write this quick little test code and article.

Bananas

(Introductory note: In the story that follows, the word “gate” is pronounced “gah-tay”.)

I was intently digging through the bananas in the grocery story, trying to find some that were to my liking, when I heard a woman’s voice say, “Excuse me, do you mind if I ask what that song is that you’re humming? It sounds familiar, but I can’t place it.”

An @impure annotation for Scala

As an experiment, I decided to create an @impure annotation for my current Scala project. The annotation is a “do nothing” annotation, so it doesn’t actually check the code in the way the @tailrec annotation works, for example.

What it does is serve to nag me. My plan is to put it on my Scala definitions when I create them. In theory it will bother me that they’re there, and then I’ll do something about them.

Syndicate content