2018-02-25 Update: Call With The Purely Functional Guy

On the Groovy mail server: I am still unable to send to ProtonMail. I might just shelve it for the time being. I would like to get back to it in the future, but I would like to spend more time on Clojure and the Lisp family.

I will get around to installing iRedMail soon. I can’t run an old version of Apache James forever. I think iRedMail uses Postfix under the hood, which is what ProtonMail uses. Perhaps I will get it all working them.

I had my call with Eric Normand of Purely Functional. At one point we touched on ClojureScript. I have been under the impression that you have to deal with JavaScript to use ClojureScript. As the guy who wrote the Pollen DSL for Racket put it, Lisp makes me smarter, and pretty much any language ending in *Script seems to kill brain cells on contact. There seems to be a lot of wheel re-invention in JavaScript. I always get the feeling that a lot of people in the JS community think that there is nothing to software besides JS. Has any other language been called “stupid” by its creator? And it all seems unstable.

Back in June 2015, Bloomberg wrote this:

JavaScript is fast-moving right now. Too much of what you know today will be useless in six months. Every hard-fought factoid about the absolute best and most principled way to use the language will be fetid zoo garbage by the end of the year. And some sniveling, bearded man-toddler will be looking slightly to your right with his pale, buzzword-infected eyes and awkwardly mumbling, “Yeah, no, wow, it says you have a lot of Gulp and Angular, but I’m guessing you don’t use Fleejob or Grimmex with the Snurt extensions? (Long sigh.) I’m just not sure if you’re gonna like working here.”

Maybe it’s better now, but they thought they were smarter than the rest of us while making their ecosystem a total morass.

Anyway, Mr Normand said he used JavaScript several years ago, and he had to use it again recently, and the libraries and ecosystem was totally different. But in four years, ClojureScript has not really changed.

I mentioned that I do not like 4Clojure. I tried it a few times, and I keep finding myself in a position where I am randomly scanning the Clojure Cheat Sheet looking for a function that might help at that moment. He said a side project is a good way to learn a language. He asked me if there is a problem I would like to solve, and I thought of one.

I am starting on a project to publish tweets to a webpage. I used to use a plug-in called twitter-tools that once a week would take all my tweets and make a WordPress post. It is old, and does not work with more recent versions of WordPress. (I think the developer passed away from cancer a few years ago.) I looked recently and I could not find anything else that has the same functionality.

There are a lot of plugins and widgets that will put your twitter stream on the side. In fact, I think Twitter also has a script for that. The other major category is sending a tweet when you make a blog post.

Granted, you can log into twitter and download your archive, but it would be nice to have something automated.

We will see what I can get done in three weeks.

You’re welcome.

The editorializing is by me, not Mr Normand.

2018-02-18 Update

I spent a bit more time on the Groovy Mail Server. I am still unable to send to ProtonMail, which uses Postfix. I opened up a ticket and sent them a log from tshark, but they were not able to find anything wrong. A lot of people use Postfix. Not being able to send to Postfix might be a show stopper.

I will install iRedMail; the purpose is two-fold: 1. Try to get Groovy Mail Server working with Postfix (and later TLS), and 2. And just to try it out in general. I am currently using Apache James. The version I am using is getting old, and it is time to look at other options. I might go with a newer version, but I figured I should try something else too. Eventually the version of James I am using might not work on a future JDK.

I posted a command that you can use to generate passphrases on a Linux laptop. I also added a page about the core Clojure API. Slowly but surely I am making progress. I might look more at Simply Scheme, but I plan on focusing more on Clojure.

You’re welcome.

2018-02-05 Update

I know it’s a day late, but here is the weekly update.

I worked some more on the Groovy Email Server, even though I said I would not. Sometimes I hit a wall on something, say I am going to stop, but it just bugs me that I left things in a bad state. Then at some point I get back to it.

I was getting a lot of null strings, which was causing exceptions, and (after some changes I had to revert) sometimes infinite loops. It turns out I was not checking to see if the arguments to EHLO were proper domains. Apparently there are some bots that send bad arguments to some commands to try to take them over. At first I thought I was doing something wrong, but now I know it’s not me. I can exchange messages with Apache James, Gmail, Yahoo and Outlook.com, so if you are sending null strings you are doing something wrong. (I think Yahoo used to use QMail, but now I think they have moved to something else.)

I also have to work on delivery status notifications (RFC 3461). I got rejected by a server that told me I was not implementing the protocol correctly. I guess that SMTP extensions can really change things.

Not much Clojure. I have a call in a couple of weeks with the Purely Functional guy. He offered to come up with a lesson plan for people. I have noticed a few job posts in the Clojure mailing list and Brave Clojure requiring people to have paid Lisp/Clojure experience. One huge complaint in the Lisp world is there are not enough Lisp jobs. I want to email these companies and ask them where I can get the Lisp job that will enable me to apply for the Lisp job they are offering.

You’re welcome.

2018-01-21 Update

There is not too much on the Clojure front. There was a meetup at Cafe Express. I went to that, and I looked at some of Clojure’s special forms. I might work with them a bit and add them to my API example pages.

I am also working on the Groovy mail server. There are a lot of things that should be case-insensitive that were not, so I am working on that. I also need to beef up the docs, especially on setting up clamav. Hopefully I can start using it for myself pretty soon.

You’re welcome.

2017-12-17 Update

This week I spent some time working on HugSQL again. I got it to work with conman. I tried with hikari-cp, but I was unable to get it to work.

I am still futzing around with HugSQL. I volunteered to give a presentation at Austin Clojure. I might not post too much about it, since I will be putting content into the presentation.

You’re welcome.

2017-11-19 Update

I am still looking at HugSQL. I started messing around with the quoting option in the connection macro. I noticed that I was not able to get any SQL injection samples to work through HugSQL. (It was a bit odd to try to intentionally do SQL injection after years of trying to prevent it.) I think the Postgres JDBC driver takes care of SQL injection.

To test this, I started looking at Migratus (and its leiningen plugin as well) to make a database in MySQL. I am more of a Postgres guy, so it took a while to get things right. Plus I think that Migratus has to do things a bit differently than regular SQL. I think that creating a table and creating a trigger for that table need to be two separate migrations.

I also had problems with foreign keys. With one foreign key, I got the table name wrong. I had to google the generic (and useless) error message. That led me to googling a few more steps. I had to log in as root, run the command

and look in that wall of text for a section labelled “LATEST FOREIGN KEY ERROR”.  The cause was buried in there. If MySQL is saving some text about the cause in this object, why can’t MySQL just print it out to the prompt instead of forcing me to go through all these other steps?

I might do a Migratus project with Postgres just to see if this small, irritating problem happens there too.

Another thing while working on all of this is I have used pg_dump a few times. I found a page online with examples that mostly work. Maybe I have Postgres configured differently, but I have found that for pg_dump, I have to add a few options to get it to work. The –help says that –password is unnecessary, that you should be prompted for it automatically. I have found that I need to add that, as well as –port and –host (even though I have been running it on localhost).

You’re welcome.

2017-11-12 Update

This weekend I planned on starting a Luminus app. But before too long I started looking at the database parts. This led me to look at HugSQL, based on a project outlined on a page hosted by a company called Compose.

I did a few things that are not in the article, incorporating a few more things I learned about HugSQL. I might add it to my Clojure app repo on Github in a few days.

Last week I mentioned I found a project that is a Clojure wrapper for Deeplearning4J. I did some searching on the Clojure subreddit, and I found a reference to a page about using Clojure on the Deeplearning4J website. Apparently there is an “official” port of Deeplearning4J to Clojure here. No offense to the other guy, but I think I will look at the official project first. I feel it is best to start with the official way of doing things before trying something unofficial. But it is always good to have options.

You’re welcome.

2017-11-06 Update: Deeplearning4J

One thing I did this weekend was get permalinks working again on my blog. I got an SSL certificate from Let’s Encrypt several months ago, and I was not able to get permalinks to work. It bothered me for the longest time. Problem solved.

Not much on the Clojure API front.

I did look at Deeplearning4J, a deep learning framework written in Java. I cloned their repo of examples, and I got some of them working with gradle files, and learned a bit more about Gradle in the process. You can use a GPU, or a CPU. No messing with CUDA if you don’t want to.

There is even a Clojure wrapper for Deeplearning4J as well.

I had a post about using CPUs and GPUs from JVM languages for math/science/AI a while back. Since then, I have gotten both Neanderthal and Deeplearning4J to work on my system. I did mention Bytedeco, which is used by Deeplearning4J and a few other libraries. I looked at some of the Javadoc, and they use a LOT of static methods (see here for an example). I may leave Bytedeco for others and use some of the higher-level libraries, like Deeplearning4J. I think a lot of static methods is not idiomatic Java. I might consult “Effective Java” later for a second opinion.

I am going to include below one of the build.gradle files that I used to get some of the Deeplearning4J examples to work.

You’re welcome.