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.

 

2017-10-29 Update

I worked a bit more on going through the Clojure functions. I might start working on a Clojure web app as well. (And start looking at TensorFlow too. Maybe.)

I also tried some of the scripts on the nftables wiki to move from iptables to nftables. I locked myself out and had to go to my host’s console to reboot the server. I guess copying and pasting will not work and I will have to figure this out the old school way.

You’re welcome.

2017-10-22 Update

There is not a whole lot to report this week. Not much progress on the Clojure front.

I did upgrade one of my laptops to the newest version of Ubuntu. I will use some of the updated packages to update my firewalls to nftables, although I have a feeling there will be more work that just running the scripts on the nftables website. This is part of completing my Groovy mail server.

Once I do that, I plan on running another mail server in another domain so I can send emails with TLS and not worry about getting banned. I hope mail-in-a-box is as easy as it sounds.

You’re welcome.

2017-10-01 Update

I am still going through Simply Scheme. I am on chapter 8.

I may also start going through the Clojure API. I have tried 4Clojure a few times, and I tried the Kotlin Koans. I don’t think that is a good way for me to learn. I have a Kotlin book that I am looking at. I have thought about going through the functions on the Clojure Cheat Sheet, but I would need some way to keep track of what I have done. I made a page with a list of the functions in the core Clojure API for version 1.8. I have thought about this for a while, but recently I found a page called “One Weird Trick To Become a Clojure Expert“, which advocates going through the API. I may not go alphabetically.

Plus, unlike the Kotlin API, the core Clojure API is small enough that you can actually get through it without feeling overwhelmed.

I also found out that lein and boot do not work with JDK 1.9 on Ubuntu. I gathered from web searches that Clojure 1.9 will solve the issue. It seems to work fine on Windows 10.

You’re welcome.

2017-09-24

This week I worked more on Simply Scheme. I got done with Chapter Six. Chapter Seven looks pretty short.

The Austin Clojure group had a code get-together at Cafe Express. There were only a few of us there. I worked on Simply Scheme.

One thing a lot of veteran Lisp/Scheme people do not like about Clojure is that it uses other characters for data structures (vectors, maps, sets) in places where other Lisps just use parentheses. I think I agree with Clojure for changing things a bit. I think it makes things more clear. There was a line about this topic in Chapter 7 of Simply Scheme that made me think about this:

Like cond, let uses parentheses both with the usual meaning (invoking a procedure) and to group sub-arguments that belong together.

There was a lot of discussion about JavaScript at the Clojure Meetup this weekend. I generally do not like anything related to JavaScript, not even ClojureScript. I have heard great things about it, and that David Nolen is a really smart guy, but it just seems like if you use ClojureScript, you will probably have to deal with a bunch of JavaScript anyway. So for now, I am not too eager to do anything mobile with Clojure. It seems like ReactNative still has a bad license, and you have to deal with Node on top of it all.

A couple of guys mentioned WebAssembly. I first read about that on the Racket mailing list in a thread in which a few people (myself included) were lamenting the inescapability of JavaScript. I think it is a drag that a lot of people want to use JavaScript everywhere. I would like an actual alternative (not just yet another *js framework, or a language that transpiles to JS). Will that be WebAssembly?

Someone on Hacker News somewhere warned that if a site uses WebAssembly, a site could prevent you from blocking ads if they really wanted to force you to see them. Stay tuned.

You’re welcome.

2017-09-17 Update: Updating Ubuntu

This week (and especially this weekend) were not too productive. I was hoping to look at some Clojure libraries for TensorFlow.

But I started out updating one of my laptops to Ubuntu 17, and I was unable to log in. So I downloaded Ubuntu Gnome and spent a lot of time trying to get that right. I hate hate hate the default Gnome window manager (I think it is called “mutter”). I tried to switch to another window manager, locked myself out, and then I tried to install Mint.

For some reason I was not able to burn the iso files, so I re-installed Ubuntu Gnome and figured out how to get compiz t work to make it somewhat usable.

I also thought about working on an nftables firewall, but there are some migration utilities that will be available in the next version of Ubuntu. I think the next version is coming out in a month.

You’re welcome.

2017-09-10 Update: Uncomplicate Neanderthal

This weekend I made another attempt at some numeric programming. I have been working on a Clojure library named Neanderthal. It can use CUDA, OpenCL or native libraries. Instead of using BLAS and LAPACK for native libraries, it uses the Intel Math Kernel Library.

In order to use the native library, I installed the Intel MKL library. I did have a bit of trouble with the library. This worked:

export LD_LIBRARY_PATH=/home/ericm/intel/compilers_and_libraries_2017.4.196/linux/mkl/lib/intel64_lin/

For some reason, the “export” had to be on the front. I tried without, and I got an error. But I was able to copy and paste the code from the native example here.

I was able to get the code running from the first OpenCL example.

These are some packages I installed to get the OpenCL example to work:

aptitude install ocl-icd-opencl-dev
aptitude install dkms
aptitude install beignet-opencl-icd

I will also look at TensorFlow. There are a few libraries that let you use Clojure.

2017-12-21_01.25.32 update: Based on an email from the library author on the mailing list, this is how you run the native tests and skip the CUDA/OpenGL tests:

Just run mkl_test namespace. Note: these are mije tests, so for example in Leiningen:

lein midje uncomplicate.neanderthal.mkl_test

Or, with the REPL running, just evaluate mkl_test namespace.

You’re welcome.

2017-08-27 Update

This week I finally got done with chapter 2 of Programming Kotlin.

IntelliJ IDEA sometimes takes a while to start up; at least it feels like it takes a while. Downloading Kotlin for the first time was a very slow process. So far it is a pretty interesting language. I am still not ready to make Android apps with it. I do think that Kotlin might wind up being the replacement for Java, despite what the Scala crowd thinks. Languages that look like a cat walked across your keyboard have limited appeal.

If I use Kotlin, it might just be for Android and command line apps. On the Kotlin site, there is a page recommending books to learn Kotlin. According to its table of contents, the one for using Kotlin for web development spends a LOT of time on JavaScript. JavaScript is also used for mobile apps. I really really do not like JavaScript. It is like a cancer that infects everything. And, yes, I know there is KotlinJS. There is also ClojureScript. And TypeScript. And Elm. And CoffeeScript. And BucketScript. And Dart. And the original wrapper, GWT. If JavaScript is so wonderful, why don’t people just use it directly? Why are there all these wrapper languages around it? That is in addition to the myriad of frameworks and libraries that all do the same things as the frameworks and libraries that JS developers were using last month. Instead of taking the Pragmatic Programmer advice of learning a new language every year, the JS community finds a new way of doing the same thing every six months.

Anyway, no progress on Scheme or Clojure. My future at my current company is still uncertain, so I might need to get back to Clojure.

I also spent some time trying to move my iptables firewall scripts to nftables. I found a page with some tools to convert, but I think some of them are available on straight Debian, but not Ubuntu. It looks like I will have to write them by hand. iptables is pretty obtuse. Many people do not deal with it directly. (Kind of like Javascript.) They make the scripts in admin panels, or they use ufw or shorewall. I used fwbuilder, but that is no longer maintained.

You’re welcome.