Posts

Showing posts from October, 2020

Java 8 development on Linux/WSL with Visual Studio Code on Windows 10

Image
Linux on Windows via WSL 2, has become a great development environment when targeting cloud containers and functions.  Windows has a shot at becoming the favorite desktop for users building Linux applications. Visual Studio Code (VSCode) is a great IDE. VSCode can run in a split GUI/Server fashion with the GUI in Windows and all the full SDLC executing on Linux. Development happens inside the Linux, WSL2 leveraging VS Code Server The GUI happens as a real part of the Windows Desktop and connects to Remote  VSCode servers, in this case in WSL Linux Ooh A Video Java Development VSCode's Java integration is built on top of Java 11.  This means you probably will end up with Java 11 JDK installed in WSL2 Linux and in Windows.  By default, applications will be Compiled with Java 11.   You can target  application compilation against versions other than the one used by the IDE. This is done by installing the needed Java versions on the Linux side and adding the Java installation locations

The public's level cybersecurity understanding means we have to do something different.

Image
The industry has done a poor job of educating the public or making it clear to the public various cybersecurity risks. The high level of trust the public has in the software installed on used purchases is one of those areas. Would you use a dirty plate in a restaurant if the server took someone else's plate, wiped the food off with their rag, and then put the plate in front of you? Basic Security People have no qualms doing the computer equivalent of the dirty plate when buying used computers. They buy a used computer with an operating system already installed.  They boot the machine and start using it.  The buyers trust the installation and use that computer for their most private transactions. We have plenty of evidence that people receive machines with malware, bot-ware, or intrusive software that sends data back to some other servers.  The same people would never log into their bank account on some random machine they find sitting unlocked in a coffee shop. Risks A used machine

Business Rules - state vs transition driven

Image
Co-workers and I were recently trying to tease out whether our rules were event-based or state-based.   Was the predicate, if clause , written to be based on an action that occurred, an event?   Was the predicate, if clause , written based on the current state of the business data? Were our rules a mix of event-triggered  and state-driven? We started poking at this with the business users. We showed them both styles and described the side effects.  It turns out our business users were thinking in a specific and simplifying way. This meant we could increase the reliability of our design by pushing rule definitions mostly into a specific style.  Business Rules can be written in an unlimited number of ways and syntaxes.  We'll ignore most of that for this conversation and instead focus on how we define the  if clause  that determines if action is taken. Video Transition vs State Based Simple Example A person loses their driving permit for a given state. It could be that this person le

Diagram definition and image in one file with draw.io editable PNG files.

Image
Diagrams are a great way to communicate because most people think visually. Most diagraming tools have some type of diagram file type, vsd, vsdx, dwg, emf and some type of exported graphics format used in documents, png, jpg, gif. This means there are two files for every drawing, the drawing itself and the exported image. Dual file storage and synchronization is eliminated with drawing-embedded-png files. Some drawing tools draw.io have the ability to export an image with the drawing instructions embedded as metadata in the image. This means the PNG is both an image and a drawing. You only need to maintain one file in your document, your wiki pages, google drive, SharePoint or in your source code repository. This video walks through how to use this create and load editable PNG drawings in draw.io Saving the Diagram as a PNG with embedded markup Launch draw.io  Ccreate a diagram. Select File --> Export the diagram as png. Set a border width other than 0.  Bad image! Make sure

Routing Java Logs and Business Events to Kafka - via logging

Image
We often want to stream business events or raw logs from our applications to an analytical or operational data stores.  Kafka is currently one of the streaming APIs/platforms of choice for this.   Java applications can use their standard logging APIs and send the logs to Kafka via the Kafka Appender that can be attached to the log4j2 subsystem. We can make just a few tweaks to this and use the same logging mechanisms and Kafka platform to capture custom Business Events. Example code is availabe  https://github.com/freemansoft/spring-boot-log-to-kafka-example , It builds on previous work.   The sample code demonstrates using the logging subsystem to route logs and Audit to different destinations based on their severity or associated tags. The example send logs to the console and to a Kafka logs topics.  It sends tagged log messages to the Kafka Audit . topic.  All of this happens with the application code only having to write through the usual logging APIs. Limitations The Kafka Appende

Is anyone downloading my releases - GitHub API Cheat Sheet

Image
I migrated a repository from SourceForge to GitHub and wanted to see how many downloads were being done from GitHub.  SourceForge had a great UI for this.  GitHub does not. GitHub has a REST API that you have to script against that provides information about releases and artifacts. Need I wanted to find out the number of downloads for a given release in a specific repository. GitHub API  GitHub API docs can be found here:  https://developer.github.com/v3/   There is also v1, v2 APIs that in some cases are more different than evolutionary. Releases The releases of  portion of their API  https://developer.github.com/v3/repos/releases/  . There is a bunch of stuff to parse through. All releases for a given repository Releases Documentation This API will show you show you all the releases for a given repository.. https://api.github.com/repos/:owner/:repo/releases Example  Owner: freemansoft Repository: jacob-project https://api.github.com/repos/freemansoft/jacob-project/releases You can se