Marv Klotz Calculators for Model Engineers

Marv Klotz Calculators for Model Engineers

Home Forums Workshop Techniques Marv Klotz Calculators for Model Engineers

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #858636
    David Banham 1
    Participant
      @davidbanham1

      About 25 years ago, Marv Klotz gave model engineers 128 calculators running under Microsoft DOS for conducting workshop, mathematical, and design calculations. Unfortunately, they are no longer available online. The calculators were written in C and were very difficult to update.

      Now they are available for Mac, Linux and  Windows 10+ and can be downloaded.

      All 128 Calculators Marv created for Microsoft DOS have been successfully converted to Go and are available at https://github.com/dsbitor/MWKCalculators/. The code and full documentation (not available for the original code) are available for every calculator. The new code includes Go test cases for every calculator, which can be used for both basic testing and edge-case testing.

      Enjoy!

       

      #858640
      DC31k
      Participant
        @dc31k
        On David Banham 1 Said:

        Unfortunately, they are no longer available online.

        For reference, another archive of them is here:

        https://github.com/andygoulden/mklotzpy

        #858792
        David Banham 1
        Participant
          @davidbanham1

          MWK Calculators

          Thanks for your comments and for pointing to the GitHub repository containing Marv’s original code. And yes, if you read the notes, they point you to a utility called DOSBox, which allows DOS programs to run on non-DOS environments, particularly Windows, macOS, and Linux.

          Unfortunately, there are a whole load of issues and points that are either not identified or not emphasised; here are a few of them.

          DOSBox

          1. DOSBox is supported by a Gaming Software group that apparently has not provided a major/minor/maintenance update (release) for several years. Latest version: 0.74-3 released 2019-06-26
          2. DOSBox has an active group of enthusiasts who raise comments and propose patches and changes, but most require significant knowledge to apply; see https://www.vogons.org/viewforum.php?f=53, which is separate from the support site and hosted at Vogons/DOSBox. There are dozens of patches at this site.
          3. Dozens of software clones of DOSBox are available on GitHub, but which one would be stable and suitable for general use?  Each one claims to offer a different point of view and usage capability.
          4. The number of patches and GitHub repositories makes one wonder how current and stable DOSBox is.
          5. You need a C Compiler that runs on DOS to compile the source, and that would need research, testing and a methodology for supporting calculator binaries without having DOSBox running continuously.
          6. DOSBox appears to be run as a transient program, and this may not make running stored binaries in a permanent directory easy.

           

          MWK Source

          1. The source on the site is incomplete; one or more C functions, defined macros, or important values defined/written by Marv are not included but are referenced in the source and required to compile the C code provided on the site.
          2. The most obvious problem that tends to cause most people to abandon updating the code is that many of the calculators use an input function that replaces unique input code in each calculator.
          3. This function has to be reconstructed before a common approach to updating code is required.
          4. The MWK source does not have comprehensive documentation about what the calculator does or important information about the algorithm or input values. Some do, and some have useful comments in the source file.

           

          Updated GO Code

          1. If you examine the updated Go source code, you will see that the calculators now all use that missing common input routine. Even calculators that originally had independent input code have been converted to the common routine.
          2. The original Go code used separate DAT files for variable data required by about 20 calculators. This meant the user had to keep the specific DAT files with each calculator executable for the code to function.
          3. Some of those DAT files had to be changed by the User. No methodology existed for maintaining the original DAT file and user changes to that file; the user had to manage those versions. An editor was required to manage the DAT file changes. The new Go system has a single database for all calculators.
          4. The new versions maintain two versions of the data for each calculator so that the original as distributed can be reverted to, and the current version updated by the user.
          5. To allow updates to the data, all that is required is a spreadsheet program
          6. Every calculator has a test suite which can be expanded and makes testing and describing failures considerably easier.

          I leave it to the reader to decide whether there is value in retaining the huge corpus of capability provided by Marv as-is, fixing the code as required to run a calculator, or moving forward and using an updated system with many improvements.

          #858840
          Mark Rand
          Participant
            @markrand96270

            If you are still able to program, they aren’t all that difficult to translate to a supported C or another language. If you are an old fart like me and are learning Python, but nowhere near as fast as I would have four decades ago, you can feed Marv’s code into any handy AI and it will spit out the Python, FORTRAN, COBOL etc. code of your choice.

             

            Did this when I found my DOS virtual machine on the PC had got corrupted and I couldn’t be bothered to keep running it just for Marv’s utilities.

            #858865
            DC31k
            Participant
              @dc31k
              On David Banham 1 Said:

              MWK Calculators

              There is a factual error in the statement “they are no longer available online”. It does not require an essay as acknowledgement of a gentle correction to that statement.

              Please also see:

              https://web.archive.org/web/20081218161528/http://myvirtualnetwork.com/mklotz/

              https://www.mkutils.com/ (this gives me a security warning, but is OK).

              #858875
              JasonB
              Moderator
                @jasonb

                I do wonder how many of those are not needed these days with CAD and AI

                #858898
                Clive Foster
                Participant
                  @clivefoster55965

                  Jason

                  A fair number of them I think for that “just one time calculation”.

                  AI could certainly substitute for most, if not all, providing your “AI-fu” is up to asking the right question in the right manner.

                  It’s taken me a couple of decades to hone my Google-fu to getting right, reliable, answers “just like that”.

                  Dunno if I’ll live long enough to manage the same with AI. Certainly seems still to be in too much of a flux for me put in the effort of getting good right now.

                  Given some of the work I did in my employed life I have good reasons to distrust indiscriminate activation of Large Language Models for random queries. Converting the Marv Klotz programs to be easily available on modern systems is the sort of thing a LLM does really well. As it should because at the core an LLM runs on the same internal logic as a computer program.

                  In wider issues I’m already seeing disinformation becoming established fact on AI assisted searches concerning things I’ve actually worked with and therefore have right and proper knowledge. Attempting to cheat by finding some data relating to something I built 40 odd years ago but in a different context I was horrified to discover that the thing I made couldn’t have worked! Ina actuality it worked too well causing significant political repercussions at bosses boss level and netting me a sideways (non)promotion. I understand that was a context thing due to the stoichiometric parrot rusting up a blind ally driven by popular opinion and more annoying than dangerous. But its easy to see how this sort of thing could be lethal when used by folk without background knowledge.

                  I suspect that when it comes to CAD as a substitute for calculations most folk do as I do and (largely) design round what the CAD does easily in their hands. Learning a few extra twiddly bits when they have to. Not really any different to using the formulae in a manner best suited to turn the handle mechanical calculators and log tables in the days when Clive was but a wet behind the ears sproggit who got the honour of actually turning the handles and using the 6 figure tables.

                  Clive

                  #858908
                  Mark Rand
                  Participant
                    @markrand96270

                    The Klotz utility that I have found to be the most use and hardest to replicate with CAD/spreadsheet etc. is his change gear one. I find it immensely useful when trying to match my collection of gears to my lathes when cutting odd threads.

                    #859180
                    southernchap
                    Participant
                      @southernchap

                      Hmmm.  Is the OP well known on this forum or in other contexts.

                      I’ve written in C, albeit a long time ago (or rather I made changes to an existing codebase), and am a professional software engineer (Java, C#, and a tedious 6 months in Ruby, that I never wish to repeat) of 30 years vintage.

                      I would struggle to spot nefarious code, deliberately obfuscated, that was slipped into the source in this repo (obviously partly because I’ve never worked in Go, but eh, code is code).  Many on here would definitely not be able to verify the safety or otherwise of the code.

                      I haven’t looked, but if there’s an already compiled executable that’s available to be downloaded, most will just download it, and ain’t nobody finding malware in that.

                      Just a note of caution, and apologies to the OP if, as is probably the case, he’s on the level, and is being entirely altruistic.

                      #859188
                      JasonB
                      Moderator
                        @jasonb

                        This site (also posted earlier) has them in quite a usable format that will work in your Browser rather than having to know what to do with the code, it come up not secure but was posted on HMEM about 6 months ago and no issues reported.

                        https://mkutils.com/

                        #859195
                        John Haine
                        Participant
                          @johnhaine32865

                          It would be nice if they updated the security certificate though which seems to have expired 10 days ago…

                          #859435
                          David Banham 1
                          Participant
                            @davidbanham1

                            Hello southernchap, and for fellow communicators, I thought southernchap’s post for a professional programmer with 30 years of experience was a little disrespectful.

                            ‘Starting with:,  is the OP well known on this forum or in other contexts.’, is hardly a nice way to start or show respect.

                            I am well known in my adopted Toronto, Canada, as a Yorkshireman, with broad computing experience, although in recent years I have been semi-retired and then retired. My job as a consultant has been grounded in programming, software, equipment and capacity planning, operating and operational systems, and operational risk. I wrote a three-piece article for MEW about Silver Soldering in 2017. I have been a member of various Model Engineering Societies since the age of 18, including York, Sheffield and Toronto Societies.

                            I have 59 years of computing experience; my first boss, Dr K.D Tocher (Toch), an early and very well respected computer scientist and head of department at British Steel’s Department of Operational Research and Cybernetics, ensured I was broadly educated in the field. I started programming real-time systems, moved to real-time language definition and computer performance, and advanced to Principal Technical Officer at British Steel. After ten years, I became a Consultant with Software Sciences, then emigrated to Canada and became a Consultant with Bell Canada, and then a Consultant for HP, in conjunction with my role as Senior Director at CIBC, a large Canadian bank. I have also consulted with quite a few large companies, including IBM, Logica, Tata Computer Systems, Nortel, StorageTek, and Amdahl. I do not hide behind a pseudonym!  So please show this OP a little respect!

                            If you had looked at the supplied code, you would have quickly seen that the code hides little and burying a bug of some sort would be considerably more difficult than in some seriously obfuscated C# or Java. Given your experience with C, C# and Java, you would quickly be able to get a grip on how the conversion has been done; nothing is hidden.

                            Take one simple example, the code for the chord calculator, and read it. Your knowledge of  C, C# and Java is all you need; you are not writing or debugging it; you are trying to understand what was done to Marv’s code. 41 lines in the file; 11 are comments, down to 30 lines; seven are blank, down to 23; four are closing curly brackets closing blocks of code, down to 19; the top  6 lines, excluding the types described above, declare the package and import libraries; we are down to 13 lines. Three of those lines declare and implement a function that does the calculation; down to 10 lines; and they are the main function, which practically explains itself.  No room for nasty spyware (nefarious code)… but eh code is code!

                            The downloadable code is far more risky, and as you say, finding the bugs in that is much harder. But detecting bad stuff is not. Just find the process name or number, see what network it is linking to, and monitor what is going on. With macOScommands below, give you a start:

                            By process name:

                            sudo lsof -i -a -c Safari

                            By PID:

                            sudo lsof -i -a -p 12345

                            Similar functions, I am sure you know, are available for Windows.

                            A Better Idea

                            Explore, have fun, look at the work Marv did and required preserving. Marv’s work, as built, will only run on 32-bit systems. The effort here was to first preserve what was an immense effort and then make it much easier to use (Part 2), which I am still working on.

                            About altruism, yes, that is partially correct. You should give back if you can! Readers, please think about how you can contribute; it’s much better than criticism, wrapped up in an enquiring comment.

                            The ME community have been utterly kind:

                            • York SME  as a teenager, allowing me to learn how to drive locomotives and answering lots of questions.
                            • Toast at Reeves in Birmingham in the mid 197O’s while I chose castings.
                            • Sheffield SME meetings where inspiring talks were given by luminaries from the hobby. Prof Chadock, Ivan Law and many others.
                            • Watching my first lathe being made at Portass in Sheffield.
                            • Toronto SME meetings and open days.
                            • Visits in later years to Myford and  RDG Tools in Mytholmroyd.
                            • Visits, one on a day the museum was closed, to Bolton Steam Museum, and dozens of historical technology sites around the UK, every one welcoming and informative, on annual visits home.
                            • Great days at Leeds SME at Eggborough Power Station.
                            • Lots of advice from readers and writers of Model Engineer!

                             

                            #859478
                            southernchap
                            Participant
                              @southernchap

                              Well, at the bottom of my post, I did pre-apologise in advance, and I kept my tone quite polite all the way through.

                              If you find yourself clutching at your pearls, when someone very politely raises a note of caution about a post of yours, I’m glad I never had a chance to work with you.  I have worked with a few over-defensive, chippy, software engineering colleagues in my career, and they’re a pain the rear. Humility is an asset that’s required to be a good engineer in a team.

                              Here’s a quick suggestion how you should have replied:

                              “SC makes a fair point and obviously I’m not asking anyone to trust a stranger on the internet.  Perhaps someone well-known on this forum who can read the code, could take a scan through and verify that there’s nothing dubious going on”

                              I don’t have to show any particular deference, you’re the one pimping your repo, the onus is on you to reassure.

                              I don’t need the functionality offered by this repo, and I don’t have the time or inclination to trawl through your code.  I was just giving the members a heads up.

                              As for the rest, it’s just noise.

                            Viewing 13 posts - 1 through 13 (of 13 total)
                            • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                            Latest Replies

                            Home Forums Workshop Techniques Topics

                            Viewing 25 topics - 1 through 25 (of 25 total)
                            Viewing 25 topics - 1 through 25 (of 25 total)

                            View full reply list.