Adding Boost to the mix…

I’ve built and used boost before and had good results. I’m going to add boost to my home C++ tools mix and I suspect I may find a workable json parser/generator in there. Grabbing the pieces now, but I don’t expect that I’ll have a usable build for a day or two given available cycles/time.

Built b2 and now I’ve bootstrapped the zip archive of boost. We’ll see what is there in the morning after the .\b2 run finished. I think I may wind up missing some interesting bits that require optional extras, but I should have a decent subset and can likely add in the missing pieces as needed.

A bit of C++ over the weekend

I spent a good bit of time over the weekend digging into some java coding for work. Wrapping some things up and the extra time will help.

I noticed that there is a third edition of effective java out there. I have the older edition, but it is really too old to be helpful with the current state of the java world. The ‘effective’ books overall have tended to be very helpful with usage, idioms and anti-patterns beyond the basic so I’m looking forward to reading this volume and seeing what it has to offer.

I spent a good piece of today writing up a free-standing command line tool to display the unique file id for windows files. The API that provides this is exceptionally useful when working with file cleanup in systems where there are mount points, symbolic links and other reparse points present. This API is not directly accessible from languages such as java or C# and thus an invokable command line tool seems handy. Interop and jni would also offer access, but the command line tool seems the most general purpose (if perhaps low on the performance scale).

I wound up writing a small command line option parser to support this work (though only used a little at this point). I’ll likely keep this around and use it in other tools going forward.

I’m also looking at adding a json output generation option and a stream in/stream out switch to make this little tool more useful for higher volume solutions with programmatic interfaces. It seems as if a json based programmatic interface using standard I/O streams would offer significant performance while also providing enough ‘traction’ to make program to program use of the tool practical.

I ran into a small hiccup this evening as I was unable to upload the code to github as github appeared to be suffering from some sort of relatively serious failure. Hoping that tomorrow morning things will be in better shape and I can push the code up then.

I will probably build a simple json library for local use over the next couple of days (I’ve done this before and it is relatively straightforward as json is a very regular and simple format). I need small and easy more than capable and fast so something coded locally seems best.

Recent E-Book Purchases

Packt publishing, Manning and APress have been key sources of software related books for a variety of topics. Lately they’ve also been pushing out daily deals on eBooks that have grabbed my attention in a number of cases. Packt in particular has deep discounts on selected books (and often even deeper discounts if you buy all four on a given day) so they’re over represented in my list.

I tend to buy on a wide range of software topics as my preferred roles touch on all aspects of the engineering process and having some background across that range improves my effectiveness immensely. I’ve listed my purchase prices to give an idea of how deep these discounts go.

  • Game Programming using Qt 5 Beginner’s Guide – Second Edition ($8.00) Aug
    QT keeps coming up in discussions of C++ based UI programming. It is cross platform and seems to be well supported while the Microsoft specific alternatives all have limitations and most are seriously showing their age.
  • Hands-On GUI Programming with C++ and Qt5 ($7.20) Aug
    Another QT book covering core QT programming (the games book sounded interesting as it likely covers more graphical and interactive QT). I’m going to have to find time to do some sandbox programming with QT sometime soon.
  • Qt5 Python GUI Programming Cookbook ($8.00) Aug
    Combines python and QT as an interesting mix. Python also keeps showing up out there and being able to build QT UI tools with python on the back-end would be quite useful in places.
  • Fixing Bad UX Designs ($6.40) Aug
    I’ve tended to operate mostly in the middle and bottom ends of software stacks in the past. I’m trying to improve my feel for the user experience end of things and the UX books on my list support this effort.
  • Hands-On UX Design for Developers ($6.40) Aug
    A more general purpose UX book.
  • Unity 2018 By Example – Second Edition ($7.20) Aug
    I’d love to find time to build some simple games…particularly if I can combine interesting game play with a networked back end. Unity seems like one of the best ways to make this happen so I’ve been slowly reading enough to find my way around (also one of the reasons for my blender reading).
  • Unity Virtual Reality Projects – Second Edition ($8.00) Aug
    I bought an HTC Vive quite some time ago and while it has been fun to play with (though currently buried in the basement as I sort through years of various items) I really want to do some programming. Unity and VR seem like a good combination…with C# on the back end even better.
  • Hands-On Full Stack Web Development with Angular 6 and Laravel 5 ($10.00) Sept
    I bought this because Angular is high on my ‘web UI’ list and my web hosting here is PHP only. This stuff could give me the ability to break free from WordPress a bit and put some more interesting content on the site.
  • React Cookbook ($7.20) Oct
    React (and Vue a bit) is the other web UI framework that seems to be popular. I’d like to become a bit more familiar with it when time permits.
  • React and React Native – Second Edition ($7.20) Oct
    Another React book with (hopefully) broader coverage and some React Native bits along the way. Web UI for the win?
  • D3.js Quick Start Guide ($2.40) Oct
    Part of a set of four (thus the very low price) covering some odd corners of the web UI universe.
  • Learn WebAssembly ($3.60) Oct
    I have been hearing about webassembly from a few people at work as an interesting technology. Hoping this book gives me some more depth on this front.
  • Learn Three.js – Third Edition ($3.60) Oct
    I’ve been poking at three.js and WebGL for a while now. Another book on the three.js side can’t hurt and for the price I couldn’t turn this down.
  • Mastering SVG ($3.60) Oct
    SVG also keeps coming up at work and while I’m aware of the technology and its basic outlines, I’ve not dug deeper to date. Going to read through this one and see what I can pick up.
  • Kotlin in Action
    Kotlin seems to be an interesting attempt to end-run the conservatism of the Java eco-system. I’ve been looking at it a bit for some time. So far I haven’t found time to do more than some reading though.
  • The Java Module System
    Java 9 feature that I’d like to know a bit more about.
  • The Joy of Kotlin
    More on Kotlin.
  • Web Components in Action
    More web UI advanced topics.
  • Clean C++
    Hoping for some additional insights into modern (2011/2014) C++ usage.

Bouncing around a bit…

…and I don’t think that’s a bad thing.

Still slowly reading VHDL material to get a feel for the language and prepare to work with the Xilinx Spartan-6 board I’ve got at home.

Doing some Win32/C++ investigations to support some file management/archiving tools that have been simmering for a long time but never yet finished. This also drives some C++/CLI work as I’m likely to use C# for the user interface on just about anything I write for home use at the moment.

Continuing Java and Functional programming investigations to support and enhance my current work role and project involvement.

Reading new material (the new Xiling Versal parts look very exciting for a range of applications). Revisiting some older material that I haven’t used all that much (USB hardware level, PCIe hardware level and formal forward error correction).

Kotlin continues to look interesting but not get any time devoted to actually reading the material I have on the language.

A bit of PHP and more WordPress as I look at some networked game stuff and adding another segment to my site here. I’m splitting off the ‘creative’ material from my general purpose blog (which will continue to host my photography for the time being). I’m trying to keep blog entries going as a replacement for my facebook presence. It is a way to keep people I know personally in the loop. This does clutter that area and so I’m setting up pandamallet.com to host more general interest things. So far the new site is skeletal at best, but I’m expecting to keep that moving forward soon.

Still planning to get my RepRap build moved forward. I must find time to read the plans for the Prusa i3 and figure out what my next steps are. I expect that the wooden frame will be right in there and likely followed shortly by buying some filament for plastics and some threaded rod for lead-screws. 

Work continues to eat well over forty hours each week and house projects take a bite as well. I expect this to keep on at least through the early parts of the winter as there’s much on the plate. Hoping to keep the interesting projects in the game a bit along the way.

Automation for PDF Viewing

I’ve wanted to automate view management for PDF documents for some time. It would provide a way to make locating the document I want and getting content up on the screen amid a mass of technical documentation much easier (and with the cryptic names that many companies use for their pdf files that can be a big deal).

Ideally I’d like to access the viewer over something like a DCOM automation link with full control over the view state and other particulars. In a pinch, I’d settle for process control, cross process window size and location management and some command line arguments to force the view mode and initial page view.

Here are some pages that might be helpful with this (still reading things but trying to keep a record here).

Another approach would be to find a PDF renderer that can be run inside a C# or C++ process. Looking there as well… Suspecting there may very well be a project or two on GitHub.

Win32 Multiple Monitors

Spent some time over the weekend looking at APIs in windows that give access to the monitor configuration of the system that code is running on.

I tend to run on systems with several monitors (usually as many as is practical). Ideally, I’d like to create tools that can use the available display real-estate in helpful ways.

The main API involved is EnumDisplayMonitors which will invoke your provided callback function with the HMONITOR for each monitor that is recognized by the system. Calling GetMonitorInfoW can then provide some of the details of each display in a MONITORINFOEX structure.

One oddity in all of this is that a monitor with a scaling factor applied (my 4K monitor is set to 150% scale factor for usability reasons) returns the post-scaling size with a gap in the coordinate system that reflects the ‘missing’ pixels. In my case the small monitor I use to keep an eye on the router is logically far to the right of the left hand edge of the big monitor.

There is a supplementary API call GetScaleFactorForMonitor which returns a DEVICE_SCALE_FACTOR indicating the current scale factor for a given monitor. This is a little bit strange on my system as the big monitor appears to be set for 150% scaling but the API call shows 140% scaling. The size numbers match what I’d expect for 150% so something must be a bit off here…

Interesting API to look into GetDpiForMonitor and MONITOR_DPI_TYPE.

Looks as if the SetProcessDpiAwareness API (with PROCESS_DPI_AWARENESS and WM_DPICHANGED) may have a part in all of this as well…deciding whether the process gets presented DPI aware or virtualized display metrics.

Curious translation in GetPhysicalMonitorsFromHMONITOR  could use a bit of a look.

I need to read more of the DPI aware and multi-monitor articles before I’m done here. I also want a better idea of how this functionality interacts with WPF user interfaces as I’m likely to build the upper layers that way.

This certainly gets more complicated with display scaling and DPI calculations in the mix.

Some more relevant articles (I haven’t read these all in detail yet):

Java Tasks don’t do Lambdas

I was spinning a thread recently and it was pointed out to me that the environment I was working in at the time used Task (JavaFX code) for such things. My thread was being created with a Lambda expression as the action to be performed. It surprised me when I could not directly translate that to a Task.

After a bit of research I found this post discussing why that is the case (as a side-effect of the fact that Task is an abstract class). As with so many things in Java where the choice is to accept less expressive and longer winded approaches to limit language level complexity, I’m not sure I agree with the choice, but it is what it is at this point.

Adding in the anonymous local class framing isn’t a big deal and that’s clearly the way to go for this item. 

Xilinx Versal looks interesting…

…for designs that have the budget and requirements to need this amount of capability. 

Just saw a web article on the family of parts. Programmable logic, ARM cores, DSP and machine learning resources along with high speed digital logic. Very interesting sort of parts…potentially allow for highly reconfigurable logic with lots of fast local resources to drive things. I’d love to get my hands on one to experiment with when they ship, but I expect they’ll  be far too pricey for my limited budget…

White paper here. Article from The Register here.

Also interesting items here and here related to ARM cortex M.

Taking a quick look at Mbed

A friend at work pointed me at Mbed devices for real-time end of line work. I’ve been involved in work that used 68hc11 processors for that sort of thing (getting very long in the tooth) and I’ve looked at using AVR parts (cheap, dip packages and decently capable). PIC controllers also seem to show up frequently (but the small look I’ve taken at the PIC architectures doesn’t make me happy).

These are ARM Cortex-M0 devices with what initially looks like pretty decent support. As an outbound, real-time controller and a back-end in something like an RPi (for home stuff) these might be a better solution than the AVR chips.

I’ve had good results from building systems with the ‘quick twitch’ responses pared down to the smallest size reasonable and baked into small controllers and keeping the higher level control (that doesn’t have the real-time response requirements) back on a linux or windows based system. This keeps the complexity in a location where powerful development tools and more capable processors reside and makes development much simpler.

I’ve been looking at CAN as an intermediate communications bus for this sort of work as well. The SPI and I2C options work well for tightly coupled peripherals in the same voltage/signalling family but don’t extend well.

Ethernet is wonderful for larger scale coordination between components that are running relatively complete operating systems.

CAN splits the difference with a defined physical layer running differential signalling that provides common mode noise resistance and (probabaly…haven’t looked in detail) avoids ground reference issues. It is still low level enough to code directly to (unlike TCP where the stack gets a bit involved to do things right). It supports quite a few devices on a single connection and has a decent access arbitration mechanism.

I haven’t bought any parts to try playing with this yet, but it seems promising.

Continued RepRap work

Looking to take some more steps forward on a RepRap printer. I’ve got at least some of the electronics for a baseline machine and the Prusa i3 has a wood frame option that looks very attractive.

Electronics list is here,. and a comparison chart here. Alternatives here.   RepRap DIY (looks like a European site). Heated bed discussion. Very much hoping to be able to buy (either as parts or a full assembly) an aluminum plate heated bed like the one in the commercial Prusa i3

Prusa i3 github site. I’m hoping this is where all of the directions, instructions and parts lists live…