Quaternions, Coordinate Transformation and a bit of Tensor Calculus

I started the weekend intending to write some java code as a ‘stretching exercise’ as I’ve been away from java for a couple of years.

This took me to the linear algebra based representation of transformation matrices and from there to quaternions. I’ve looked at them in the past just a bit. This time I decided to dive in and found a good presentation at mathoma on youtube.

They make sense as an extension of the complex numbers and seem to provide a superior way of managing rotations about an arbitrary axis in three-space.

I’ve started framing out some code to process quaternion values and I expect that to be helpful. I’ve also got the rudiments of point, vector, plane and transformation matrix classes. I’ll push what I’ve got up to github tonight and keep working on it later in the week.

I wound up watching another segment here that I switched away from after realizing that this was a mathematician who claimed not to believe in the real numbers.

I did run across another channel that has a pretty decent series of lectures on tensor calculus and vector calculus. I got pulled into the tensor calculus lectures and I’m currently here.  I expect to work through the remainder and likely watch the vector calculus side.

I has been a long time since I did any vector calculus and I’ve never until now looked into tensor calculus, but it looks intriguing.

I’ll probably start reading the accompanying text while I’m on vacation. I’ve also bought a more comprehensive book on quaternions that should arrive before vacation.

 

Floating point 3D primitives in Java…

I’ve been looking for some vector (3D) primitives in Java. I was hoping to find an existing library (something like blitz or tnt in c++). So far no luck so it looks as if I’ll wind up writing those I need myself.

Shouldn’t be too bad really. Mostly looking for things like dot product, cross product and some matrix multiplies in floating point. I did find pieces here and there, but none of the libraries I came across has the full set and since everyone implements their own point, matrix and vector classes, they don’t play well together.

The pieces I need shouldn’t take all that long to write and test so I’m going to go that way. Not looking for anything attached to 3D rendering, just need to work with some geometry in three-space and get some results. In the end, probably not a bad exercise.

More fun with RS232-C

I need to do some RS232-C communications from a java program. My initial investigations suggest that java support for serial port connections is at best rudimentary and that the dedicated solutions are mostly old and poorly maintained.

I odn’t need all that much sophistication from the solution so I may be able to get away with treating ‘\.\COM10’ as a file type device and simply streaming bytes to and from it. I’m currently putting together a setup here at home that will help to play with the alternatives.

I bought a null modem adapter on the way home at a local computer shop (I was mildly surprised they still stocked them, but they had a broad selection of RS232 adapters).

Turned out that the pin 2/3 swap wasn’t the issue after all though.

Continue reading More fun with RS232-C

Different languages, different strengths

I’m convinced that in the modern world of software engineering it is critically important to be comfortable building systems that use different programming languages and runtime environments for their various parts.

With the wide variety of options that are available and the capabilities of different languages and tools to make specific tasks simpler, being able to write PHP for some middle-ware pieces with Java or C# microservices on the back-end (perhaps in docker containers) and a javascript/typescript web UI is likely to allow your team to build faster and create a more capable system than keeping everything in a single language would have.

The wider the range of tools that are available to your team (and that your team is comfortable working with) the more flexibility you’ll have to move quickly and adapt to changing needs.

Apache Commons Daemon

Pulled the code and built a copy from source. Looks like it doesn’t handle the pre-shutdown flag in its out of the box form. It probably can have the capability added easily enough.

The harder question will be how we interface that functionality to the hosted java code. The hosted java would need access to the message and be able to generate the response that tells the system how long to wait before allowing shutdown to proceed. It also needs access to the win32 function that can request the shutdown be aborted.

Given this code is native C, I’d expect that to be relatively easy.

 

Looking at Java, Windows Services and hosted Javascript

This weekend I’m roaming a bit afield of my normal haunts.

I’m looking at service hosted JVMs in windows and in particular having such a service interact with the SERVICE_CONTROL_PRESHUTDOWN message. Handling this message allows a service to defer shutdown while handling activities that it needs to complete before the actual shutdown processing begins. I suspect it may also allow that service to call AbortSystemShutdown()  in order to cancel the shutdown.

I’m looking at the Apache Commons Daemon package first as it seem to be common, well regarded and reasonably licensed. At first look it doesn’t seem to support the extended messaging from the host OS but it seems like an interesting starting point. Continue reading Looking at Java, Windows Services and hosted Javascript

Just bought some eBooks on Kubernetes

A container coordinator isn’t something that is all that likely to be important to me in the immediate future but given that docker keeps showing up in java spring related tutorials I’m inclined to take a look at the technology.

It sounds as if the docker equivalent has largely fallen flat and kubernetes  is the solution I’m seeing most frequently out there.  I’m not sure when I’ll find time to do more than skim these, but interesting technology is always worth a look…

Surprised that Docker and VirtualBox are Incompatible

I’ve been doing some reading on Spring Boot and Spring in general. Several of the books I’ve been reading use docker containers to provide tools to support the sandbox projects they walk through.

Last night I installed Docker on my small development machine so that I could start playing with some of the examples. I was surprised to find that it uses Hyper-V and that I’d lose access to my VirtualBox VMs if I completed the installation.

There appears to be a ‘toolbox’ version that doesn’t have such issues and I’ll be looking into that sometime soon (I installed it, but I haven’t yet dug into running it).

I have installed the full docker on a machine that I don’t run VMs on and will likely use that one for any experimental coding that needs Docker.

It is disappointing that they chose a path that makes it difficult to share one development box between VM and docker containers though…

Finally Spring Tools is Working all Around

After a bunch of reinstalling of JDK code and messing with environment, the sprint tools suite is back to a working state on my small home development machine.

I’m not sure what fixed the problem but it was a rather strange one. Eclipse and IntelliJ were working normally and the java command line looked good. For some reason the STS IDE wouldn’t find some JDK pieces it expected. I have STS running on three other machines here at home without problems (and with pretty much identical installs).

Glad to have that dealt with though I wish I understood why it was broken and what actually fixed the problem.

Monday morning after some java spring for the weekend…

I spent my sandbox time this weekend bouncing between JavaFX and various java spring topics.

I have pretty much concluded that JavaFX isn’t somewhere I want to spend sandbox time. It appears to be less capable and productive than WPF for local UI work and Angular on Spring appear more broadly useful in the environments where Java reigns supreme.

Continue reading Monday morning after some java spring for the weekend…