Category Archives: Technology

2017-06-18 Update

Not much going on. I am still working slowly through Simply Scheme. I am at a point where they want you to diagram some functions. Like diagramming sentences in junior high.

There was an article on Bloomberg about quantum computing (Hacker News page here). That started me doing a lot of surfing about quantum computing. IBM has the IBM Quantum Experience, which allows you to try quantum programs on their quantum cloud.

There is a wiki about QC called Quantiki. One page is a page with a list of simulators. One of them is a page called Quantum Playground. I found a couple in Java: one by a guy who goes by the name ardeleanasm, and one called JavaQuil. JavaQuil is a port of pyQuil, an API for a project called Forest, which is another QC cloud. It is run by a company called Rigetti Computing.

You’re welcome.

Thoughts On Native, GPU, Groovy, Java and Clojure














but I think that is more keystrokes than in Java.













You’re welcome.

No Longer Using aTunes

First off, that is not a typo: I really meant aTunes and not iTunes.

For the past few years, I have used an application called aTunes to fetch and listen to podcasts. One reason is I am pro-Java, and I generally prefer to use Java technologies where and when I can. Another is that it is NOT something from Apple. I have always found it strange that lot of people in technology will say they are pro-open source, and they don’t trust Microsoft or other big corporations and think are they too smart to let The Man tell them what to do, yet they will buy anything from Apple without question. I like to strive for consistency.

aTunes has not been updated for a couple of years. I know that the makers of the JDK strive for backwards compatibility, but I think at some point it might be best to use something that is maintained. Plus I had a hard time getting aTunes to work the last few times I tried it. I think I had to go a couple of versions back on one of my laptops.

There is another music player written in Java called Jajuk, but that has not been updated for a while either.

I did some digging, and I found a multi-platform music player called Clementine. So far I like it.

So far, I am still using jEdit, but I am getting more into emacs lately. There is an emacs Meetup here in Austin. For a long time it met around noon, but now it meets in the evening.

You’re welcome.

Image of aTunes from Wikipedia, image of Clementine from Wikipedia. Images assumed allowed under Fair Use.

Notes On Using Emacs Buffers

A few keyboard commands to use multiple buffers in Emacs:

You’re welcome.

Going Through “Functional Programming in Java”

I am starting to go through “Functional Programming in Java” by Venkat Subramaniam. I need to learn more about the stuff that is in JDK 8. We are still on JDK 6 where I work, but I think we will go to JDK 7 soon.

I think a lot of the new features in JDK 8 are similar to stuff that has been in Groovy for a long time.

There is an interesting paragraph in the Foreword by Brian Goetz:

The Java 8 design was heavily influenced by the core principles of functional programming: functions as values, immutability, and statelessness. We didn’t do this because functional programming is trendy or cool; we did this because programs that are expressed as stateless transformations on immutable data, rather than as modification of mutable data structures, tend to be easier to read and maintain and less error-prone, and to parallelize more gracefully.

You’re welcome.

Is the Lisp Curse Lifting?

One question about Lisp is if it is as wonderful as its advocates say, why isn’t is used more?

One hypothesis is the Lisp Curse (see here, here, here, here, here). In essence, it comes down to “Not Invented Here” on steroids. Once you get proficient with Lisp, one person can do things more quickly with Lisp than entire teams using other languages. So one result is that there are very few commonly used libraries in Lisp (Common Lisp, Scheme, etc).

You might find a library that does 80% of what you want, but its creator won’t help you, so you just make your own custom library. And now there are two libraries that do almost the same thing. Repeat this for a few decades.

I first heard about this from Neal Ford at a talk on Clojure or general functional programming either at a No Fluff Just Stuff conference or a Ruby/Rails conference. He said that Clojure might be the Lisp that gains traction because it is on the JVM, and can thus use Java libraries.

Then I found out about Quicklisp, a “library manager for Common Lisp” that lists 1,200 libraries for every major implementation of Common Lisp. (Also, see this page on the Common Lisp wiki.)

Recently, I read about Roswell, a launcher for Common Lisp. What sdkman does for the Groovy ecosystem and rvm does for Ruby, it looks like Roswell does the same for Common Lisp. It can manage multiple installations of two implementations of Common Lisp, Steel Bank Common Lisp and Clozure Common Lisp. (Now that sound has three meanings in programming. Are you saying “closure“, “Clojure”, or “Clozure”? We need some closure on this issue.)

One things that Roswell does that sdkman and rvm do not is that it runs on Windows as well as Linux and other Unix-based systems.

I am still just getting started with Clojure and Lisp, but it looks like I showed up at an interesting time.

You’re welcome.

Thinking About Starting A Grails 3 Tutorial

I was at the Austin Groovy and Grails User Group this past week. The speaker was Ken Kousen. I am seeing a pattern with the No Fluff Just Stuff Speakers: they are all really smart guys who tell the same jokes year after year.

Ken Kousen said that he has run into some gotchas with Grails 3, and that the docs are not up to date. He said Grails 3 needs a book, and he doesn’t see one coming out any time soon. A lot of the Groovy and Grails authors either have just finished books and don’t want to go through the grinder again right away.

I have been thinking for a couple of years of making a Grails tutorial, sort of like a Hartl tutorial for Grails. Perhaps it is time to get it started. If I did this, it would only exist online.

I have also thought about making a quick Ratpack tutorial. It would be nice if there was a linear set of steps to make a CRUD app. It’s nice to know some theory, but sometimes I wish projects would make it easier to help newbies get through a “Hello, World”.

I have to think about it. I might be biting off more than I can chew.

You’re welcome.

When I Say “Groovy” or “Clojure”, I Mean “Groovy” or “Clojure”

Two languages that I am looking at these days (and would eventually like to work in) are Groovy and Clojure.

There is a site called Find Grails Jobs. Most of them are for jobs for which you would code in Groovy and/or in Grails.

But there are a few that are really Java jobs. They will mention a lot of Java technologies, and Groovy is mentioned as a “nice to have” way at the bottom. Are some firms hoping you will sneak Groovy into a Java shop? Or are they trying to pull a bit of a bait and switch? I think it might be the latter. I like Java, but I would prefer doing Groovy. If I want a Java job, I will look on a site about Java jobs.

There is no site devoted to Clojure jobs, but there is one called Functional Jobs. They have jobs for a lot of functional languages. So much for purity.

One ad said (and this is a direct quote): If you’re interested in functional languages like Scala, Swift, Erlang, Clojure, F#, Lisp, Haskell, and OCaml, then you’ll enjoy learning Flow.

First off: I tried googling a few combinations of “Flow”, “programming”, “language” and “software”. I could not find a page that appeared to be a home page for a language called “Flow”. I did find a few pages about “flow-based programming“, which I guess is like Dataflows in GPars.

But more to the point: If I am interested in Clojure, don’t tell me that I am interested in some other language that only exists at your company. If you feel that some obscure language is the best way to deliver your products, fine. But don’t tell me what I want. You decided to jump down the rabbit hole. You deal with it.

You’re welcome.

Grails and PostgreSQL

In addition to the Austin Groovy and Grails User Group, I also go to the  Austin Postgres Users Group.

At the last APUG meeting there was no set agenda or presentation. They just had a Q&A with whoever wanted to answer. The company that hosts the APUG is a heavy Postgres user.

I had a few questions. The basic thrust was: What are some things DBAs wish developers knew about databases or did differently?

One answer was that developers should learn to think in sets. If you need to change a bunch of records in the database, just run a query that will update them all at once. A lot of developers would get a query (with an ORM) that would put the objects into a list, then iterate through the list and update them one at a time. This would be a much heavier load on the database. Just run a query.

In GORM, you can call .withSession on your domain classes to get the Hibernate session, and use that to run queries.

Another suggestion was to deal with views instead of tables. I really do not have any knowledge about that WRT Grails.

The last thing that I remember is that you should not think that you are the only person who touches the database. Someone else will want to run queries, and perhaps add data to it. Many web frameworks (like Grails and Rails) have database constraints if you access the database through the web app. But outside the app, you are on your own.

One small project I will start is I will go through the Grails constraints (see here and here) and see how to create them in Postgres. I might do MySQL as well. There are a few that Grails will put in the database when it is generated by Grails, like uniqueness, foreign keys, and whether or not a field can be null. But for most of them, they only exist in Grails.



Error With ForkedTomcatServer in Grails

Recently I had an issue with just about all of the Grails apps on my machine.

When I tried to run them, I was getting this error:

The number for the jar file would be different for different versions of Grails.

What I finally did to get rid of the error was:

  1. Run “grails clean; grails compile; grails list-plugins”
  2. Comment out the line for the Tomcat plugin in BuildConfig.groovy
  3. Run “grails clean; grails compile; grails list-plugins” again
  4. Uncomment the line for the Tomcat plugin
  5. Run “grails clean; grails compile; grails list-plugins” again

Maybe the first “grails clean; grails compile” is unnecessary. But this seemed to work.

I have no idea what caused it. It happened with various versions of Grails. I had no problem with new Grails apps, or with apps downloaded from Github.

You’re welcome.