Category Archives: Sandbox

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

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…

Flying home from California

Heading for home after a few days in California for my daughter’s wedding. Going to try to keep up with the C# sandbox projects and fit in a bit of playing with Kotlin and the intellij idea IDE.  I’m thinking that Kotlin looks like a less constrained Java and there is so much JVM code out there that it could be an interesting option in my kit of tools.

Also looking as if I should get my PHP back in shape as this hosting runs PHP and I’d like to do a little single page application game work. As that will need a back end I will need some restful PHP code for persistence and some rules engine logic.

A C# implementation of ‘which’

The ‘which’ tool from unix had long been a small but useful part of my command line toolbox. For years now I’ve used the cygwin implementation when I needed to find out where the executable I was running lived.

The cygwin implementation isn’t ideal for use on windows as cygwin has its own approach to drive letters and simulates a unix style environment.

I’ve been working with C# quite a bit lately (and rather enjoying working with the language) and decided to put together some tools in C# that would streamline things.

I had a few hours between things over the last few days and put together the initial form of a more windows-y which written in C#. The current, partial version is on my github as C9Which.

I expect this to acquire more commmand line switches to control its behavior and a bit more polish in terms of what it looks for.

Currently it takes the full name of the file and returns all hits on the path in order with the first item being the one that would run if you typed the name on the command line. It also gripes about folders that are present in the path that don’t correspond to actual folders in the filesystem.

I expect to keep these features but likely hide them behind command line switches. I’m looking at command line switch processing library code out there and there seems to be a somewhat standard library shared by Microsoft called CommmandLineUtils  that looks promising. I’ll likely try using that one and see where it gets me.

Finished my quick read of ‘Learning JavaScript’

Came across a few items I had not seen before. WeakMap and the Map and Set types in ES6 look useful. I think I had seen the map, reduce and filter methods on array but had not really considered their usefulness.

There were probably a bunch of other minor items that I picked up along the way. All in all, worth the small investment of time. I learned a few things and can feel more comfortable that there aren’t core concepts that I’ve missed by jumping into the middle up front.

One day soon I’ll likely read through the ES6 standard document. Ultimately that is the only way to hit all of the high points (missing details of products specific quirks, but then that is what the other books can do).

What I really need to do now is put together a small node based sandbox project with a web UI on the front end…

Struggles with Ubuntu

I have Ubuntu 17.04 installed on one of my NUC machines as a place to run Linux code. I haven’t used it in a while and now I’m finding that it fails to connect with its apt-get repositories and cannot update to 17.10. I’ve done enough google digging and come up with nothing convincing and so I’m on the cusp of blowing everything up and loading it clean.

I think I may just go with the LTS version 16.04.3 as I expect that will have longer useful life and be easier to upgrade to version 18 when it drops. I’m mildly tempted to go to 17.10 and just accept that upgrades to Linux are really clean installs. Not thrilled with that as it means reinstalling everything else each time but I’m finding that I don’t do enough Linux work to maintain the skills to dig deep and fix the routine issues that pop up.

More Functional Programming and some MERN

Functional and Haskell

I’ve been reading through the Haskell book I bought (the C# functional programming book isn’t here yet). So far, Haskell functional programming still looks like a gimmick more than a set of useful tools. I’ll keep reading through to the end and likely play with the language a little before I’m done.

I’m looking forward to the C# functional programming book as I’m hoping it will provide a more practical view of what functional methods bring to the table. Working in a hybrid environment should allow the best of both worlds to shine and allow any awkward spots on one side of the other to be worked around.

MERN and Bootstrap and Things…

I’ve also been rummaging through a book on using node with react rather than angular 2/4. Seems like an interesting option as react sounds less proscriptive than angular. As with angular 2 the react tool still needs a CSS library and also similarly this book suggests bootstrap.

I need to sit down and code up a simple sample program that self-hosts a web server (probably OWIN based) and presents a web UI and perhaps a handful of RESTful web methods as a trial. Not sure whether I’ll go with react or angular 2 for this. Stay tuned…

Oh…also picked up ‘Learning Bootstrap 4, Second Edition‘ to read a bit more about bootstrap along the way. The Amazon web UI framework was bootstrap derived I believe so I expect this to  be somewhat familiar…

I am looking at self-hosting partly because node doesn’t play as nicely with windows as it does with linux and I’m mostly windows based. It is also rather nice to have a one-stop simple web UI hosting option that can get access to native code as needed. The NSSM package seems as if it provides a reasonable way to host something like node as a boot time startup service…I’ll probably play with that at some point.

Interesting…there is a package manager for windows called ‘Chocolatey‘ that seems to be an option for deploying NSSM…