2016-04-21 Update

I added an SSL cert to this site with Let’s Encrypt. So now I am secure. The only issue is that for some reason the WordPress permalinks stopped working, so I had to go back to the default URL style. I spent about 20 minutes on the google, and all the sites gave the same suggestion that did not work. Perhaps it is time to look at Nginx.

I am also working on the Groovy Mail Server. I know I keep saying I will get to Clojure, and I promise I will. I got a few things working with SSL, so I decided to keep going just a little bit longer.

You’re welcome.

2015-11-08 Update

I have been traveling for work, but now I am back.

I did some work on the Groovy Mail Server. I am ready to start working on sending mail. I will have to look into authentication, which will complicate things a lot.

I am thinking about going forward with a Grails 3 tutorial.

I am thinking about looking more into Common Lisp/Racket/Scheme/Clojure. I know a lot of the pragmatic programming crowd says you should learn a language every year, I am starting to question that. It seems like languages in the C/C++ family are moving more towards Lisp and Smalltalk. Why not just learn those and be done with it?

You’re welcome.

2015-07-27 Update

I took some time off work to see family on the East Coast. Now I am back in front of my computer again.

I am still working on my Groovy email server. Just getting one RFC done is taking a long time.

I have talked about working on a Grails tutorial. It looks like there is some progress on porting the Shiro plugin to Grails 3. I will try it out and see what happens. If I make a tutorial, I think I would need to run it on a static site. I will also look into static site generators, like Grain or JBake.

After I get done (or closer to done) with the mail server (or at least RFC 5321), I will spend some time with Clojure. I found an article on programming on HuffPo (via hacker News) with a link to a page by the author that advocated functional programming (without using the word “functional”). It is looking like that might be the way to go.

You’re welcome.

2015-07-05 Update

Lately I have been working on a mail server in Groovy.

I have thought about making a mail server for years. The evolution of the idea is this: I decided to run my own mail server, so I went with Apache James. The version I am running is a bit old. The newer version that will be coming out soon is a bigger piece of software. It also handles IMAP as well as POP and SMTP. I looked at it a while back. I am running on a small VPS. I don’t know if I could run something too big.

So I decided to try doing it myself. Let’s see how simple SMTP is.

Turns out it is a bit hard in some places. Right now I am getting bogged down in regular expressions to validate email addresses. There is a class in Apache Commons that handles that. But the problem with using any of the sub-projects in Apache Commons is that you wind up having to download a whole bunch. Like commons-logging, commons-beanutil, commons-io, commons-kitchensink and commons-baggage.

I am writing it in Groovy. I was hoping to try using GPars, but I might not need to. Some of the GDK extension classes, like java.net.Socket and java.net.ServerSocket take closures for arguments, and they run each closure in a separate thread.

I am doing a lot of meta-programming. Mostly I am adding methods to the String class. I am making methods like “isGreaterThan255Char” which just checks if a String is more than 255 chars, and methods that check if a string contains or starts with a particular substring. It is more lines of code, but I think it makes things easier to read. After Groovy Validators, I decided to try some easier meta-programming.

I am also going to use Postgres for the database. I might even use it for tests. I know some testing purists say your tests should never touch the database. Good for them. Never argue with a purist. They will always find something to complain about. What’s wrong with touching the database? I am not using some external data source. I figured I can learn more about mocking and stubbing later. Applications change databases, not mocks and stubs, so why if you never test against a database, what are you really testing?

There are a lot of people in the Chicago Ruby community who are big on automated tests, never touching the database, and making sure their tests run fast. Good for them. But now, looking back, they all seem pretty hilarious. There is a lot of code in this world that has no automated tests at all. If telling people it’s okay to touch the database brings more people into the world of automated testing, then that is a good thing.

You’re welcome.

2015-06-15 Update

For the past couple of weeks, I have been working on some Groovy.

I have been working with some metaprogramming to make lists more functional in Groovy. I spent some time trying to intercept the constructors and replace the output with a call to List.asImmutable(). I wasn’t able to quite get the default call, but now that I think about it, that might be a good thing. I think it is good to have choices. I had to use a closure to get what I want.

I took a look at Functional Groovy. He does some stuff with lists, but he does not make them immutable. I think that is part of the functional way: immutable data. I have not committed anything yet, but I might soon.

I have also spent more time on my Groovy email server. It took me a while to get the hang of things. I wanted to use some of the Groovy goodness, but bytes and IO streams are pretty low-level, so I think I may have had to make some compromises. I made two versions, one that uses some of the Groovy goodness, and one that reads bytes. At first I was able to test the version that uses bytes, but not the other one. But the version with bytes is not working as well for some reason. I got another VPS host, and I email myself and print out logging statements to the console. After the “DATA” command, my regular server sends a “RSET” command.

But I figured out how to do some testing in the version that uses some of the Groovy goodness for the java.io classes.

I also got logging to work with Slf4J and Logback. I was using an older version of Logback that was causing problems, but upgrading fixed them.

This might be like the Groovy Validators: I might get frustrated and stop, and then after a while come back to it. We shall see.

You’re welcome.

2015-01-25 Update

I have a bit more free time on my hands these days.

I plan on getting more into Clojure soon. I might use it to build my mail server. Or I might try that with GPars first.

Before that, I will take another crack at Groovy Validator. I would like to get rid of the static class that processes the annotations for mutable objects. I have one way of processing them for immutable objects, and another for mutable. It should be the same to the end developer.

 

I Got a New Laptop Running Windows 8

Last week my older laptop running Windows XP died. So I got one running Windows 8. The only reason I run Windows is because my mp3 player will not connect to my Linux laptop.

So far, it is okay. I have not worked with the touch screen. I like the fact that if you hit Windows-X you can have the old XP interface. It is nice that Microsoft is actually giving people some degree of choice. I guess that the newer way of doing things might someday become the standard, so I should probably look at it at some point. Maybe it will be like Intel’s Itanium: Consumers will ignore it and it will just die.

When I was setting up my user account it tried to force me to get a Microsoft account. I did some googling on my other machine, and one of the results pointed out there was a link in fine print that would allow me to log in without a Microsoft account. One thing that I did not like was that Windows 8 tried to call the mothership. I have my router set up to only allow explicit ethernet addresses through. But I could not get the ethernet address without logging in, so I had to disable that on my router. I got the ethernet address, entered it, and re-enabled that feature. I am not a security expert. Maybe the Russians are using my WiFi to plan their next invasion of Estonia. But I do not like doing something that I know for sure will make me less secure.

I then downloaded Firefox, the JDK, and a few other apps that I use, like jEdit and aTunes. For one of those, I downloaded an installer from Sourceforge by mistake that installed a browser add-on called mysearchdial. I got id of it from Firefox. I was only able to disable it in IE. I have not figured out how to delete it. I was a bit surprised that Sourceforge was installing spyware on machines. It is not that hard to avoid doing it, you just have to be careful what you click on.

But so far Windows 8 seems nice.

2014-03-30 Update

I am still getting into Groovy.

I am on a new project at work, so getting used to that takes a lot of time and energy.

I did write something in Groovy to make a few tasks easier. I don’t know if other people will be using it. We shall see.

I spent some time going through Programming Concurrency on the JVM by Venkat Subramaniam again. I have a repo on github. I typed in a lot of the examples, and I refactored some of them. I went through and I added a README.md file to each directory giving a summary of that the apps do, and making some comments. I also added a few more classes. I learned some more by going through it. I might give a presentation on it someday.

I also might be giving a presentation on ActiveJDBC, an ORM framework for Java. I got it working with Gradle. It uses instrumentation for a lot of its magic under the hood. I had honestly never heard of instrumentation before. I think it is when you compile a Java class, and add some more bytecode to your compiled class. Anyway, I will work on something to present to the Austin Groovy and Grails group in a few months.

 

What To Do With Myself Partially Solved

Recently, I stated that I did not know what to do with myself in my free time, or what to work on WRT technology, since there is a lot to work on.

I started looking at Struts 2. It’s Java, it uses POJOs and claims to be thread-safe. I have heard that it is used where I work, and I may get hired full-time, and so I thought it would be a good idea to look into it.

But when I go to http://struts.apache.org/release/2.3.x/docs/unit-testing.html, I got a warning pop-up window saying: “Syntax Highlighter: Can’t find brush for: xml”. I really hate it when projects have bad documentation.

I mentioned this on the list. Someone responded that you can find good docs at http://struts.apache.org/development/2.x/docs/getting-started.html. Notice that it is not a doc for a numbered release. There might be a link to that directory of files, but I could not see it anywhere. Someone else pointed out that this is a bad practice, and the developer who first answered my post said that it would be fixed in the next release. “Soon.”

Whenever that is.

There is also a notice that they are starting to work on the next release of Struts, and it will break backwards compatibility. Perhaps I should just hold off on Struts 2 for the time being.

I noticed that there were a lot of plug-ins for IDEs for Struts 1, and a lot more tutorials online for Struts 1 than Struts2, even long after Struts 2 was released. In many ways Struts 2 looks better. Yet it did not get as much attention.

So I think for now I will look at Groovy and Grails in more detail. There are a couple of Groovy books that have become available for free online. One is the new edition of Venkat Subramaniam’s “Programming Groovy” (at http://www.it-ebooks….), and the other is “Beginning Groovy, Grails and Griffon” (at http://www.it-ebooks….). I need to get a better understanding of closures/lambdas, since I think they will have a big effect on Java 8. Everyone raves about them, but they mostly seem to be used for looping or iterating.