Programming Shadows
Total Page:16
File Type:pdf, Size:1020Kb
Programming Shadows Computer programming in the context of the Sundial Simon Wheaton-Smith FRI, MBCS, CITP Phoenix, AZ 1 ILLUSTRATING TIME’S SHADOW Programming Shadows by Simon Wheaton-Smith my business card in 1970 ISBN 978-0-9960026-2-2 Library of Congress Control Number: 2014904841 Simon Wheaton-Smith www.illustratingshadows.com [email protected] (c) 2004-2020 Simon Wheaton-Smith All rights reserved. February 14, 2017 April 1, 2020 2 THE ILLUSTRATING SHADOWS COLLECTION Illustrating Shadows provides several books or booklets:- Simple Shadows Build a horizontal dial for your location. Appropriate theory. Cubic Shadows Introducing a cube dial for your location. Appropriate theory. Cutting Shadows Paper cutouts for you to make sundials with. Illustrating Times Shadow the big book Illustrating Times Shadow ~ Some 400 pages covering almost every aspect of dialing. Includes a short appendix. Appendices Illustrating Times Shadow ~ The Appendices ~ Some 180 pages of optional detailed appendix material. Supplement Supplemental Shadows ~ Material in the form of a series of articles, covers more on the kinds of time, declination confusion, other proofs for the vertical decliner, Saxon, scratch, and mass dials, Islamic prayer times (asr), dial furniture, and so on! Programming Shadows A book discussing many programming languages, their systems and how to get them, many being free, and techniques for graphical depictions. This covers the modern languages, going back into the mists of time. Legacy languages include ALGOL, FORTRAN, the IBM 1401 Autocoder and SPS, the IBM 360 assembler, and Illustrating Shadows provides simulators for them, including the source code. Then C, PASCAL, BASIC, JAVA, Python, and the Lazarus system, as well as Octave, Euler, and Scilab. And of course DeltaCAD and its Basic variant, Python as in FreeCAD and Blender CAD systems, VBS and Java Script as in NanoCAD, programming TurboCAD (VBS and parametric script), and LISP as in the ProgeCAD system. And so on! Illustrating Shadows provides a variety of software tools:- CAD DeltaCAD ~ macros for almost all dialing needs in BASIC NanoCAD ~ dial macros written in VBS and Java Script FreeCAD ~ dial macros written in Python Powerdraw ~ dial macros in a Pascal subset ProgeCAD ~ dial macros written in LISP TurboCAD ~ dial macros written in VBS, and parametric part scripts also Blender ~ dial macros written in Python Languages Programs in the languages are discussed in Programming Shadows Spreadsheets illustratingShadows.xls simpleShadows.xls cubicShadows.xls Updates Check for general updates and corrections at:- www.illustratingshadows.com/reference or scan the QR code to the left which takes you there. 3 Programming Shadows additional programming information for Illustrating Times Shadow I first learned programming in 1966, ALGOL on the Elliot 803. Next it was SPS then Autocoder on the IBM 1401, then BAL on the IBM 360, 370 and later under BPS, BOS, DOS, MFT, MVT, MVS, VM with CMS and GCS. I have programmed in Algol, SPS, Autocoder, BAL, RPG, COBOL (some), PL/I, FORTRAN, ADA, Perl, Pascal, C, C++, Objective C, Java (some), JavaScript, as well as work in BASIC, Excel, macros for DeltaCAD, TurboCAD, FreeCAD, NanoCAD, PowerDraw, ProgeCAD, and Blender, using VBS, Python, and LISP, also I have programmed applications in Scilab, Octave, and Euler. I am the original author of the SHADOW teleprocessing control program, and the CAPEX graphics package which was IBM GDDM call compatible, and co authored Manage-IMS. I also programmed the 1419 MICR system for Thos Cook & Son Travel Checks. I have even programmed using mercury delay line memory! I admit my code has become sloppy after some 48 years. Sorry. But this book is free, however! This book shows the code for various computer languages, and some of the theory. More detailed theory is found in Supplemental Shadows. This book, however, is good for PBE (programming by example), and will save a lot of time when locating, installing, and coding various applications, even if not sundial related. The code herein may not be the most up to date, and current code is found on the website. You may copy some or all of this book provided the website and Illustrating Time’s Shadow are credited. If you benefit from this book, please consider buying the CD or an online download, that helps with web site costs. Please check regularly for updates at: www.illustratingshadows.com/programmingShadows.pdf 1 Programming Shadows Illustrating Times Shadow INTRO 3 INTRODUCTION 4 Available programming systems and languages TECHNIQUES 6 Object Oriented Methods, and classes 8 Language comparisons and techniques 65 Programming techniques: geometry to trigonometry to programming MAINFRAME 74 Early computers 75 IBM 1401 second programming language I learned 107 IBM 360 third programming language I learned 140 IBM 7094 (FORTRAN II) TABULAR 145 Excel Open Office ~ notes for spreadsheets CAD 153 DeltaCAD programmable 2d CAD system, uses BASIC 165 NanoCAD programmable 2d CAD system, uses VBS, free 176 FreeCAD programmable 2d CAD system, uses Python, free 186 ProgeCAD programmable 2d CAD system, uses LISP, free if non commercial, (AutoCAD compatible) 195 TurboCAD VBS 197 Parametric Script 202 notes when manually drafting in 3d 204 Powerdraw a Pascal like free CAD program 210 OpenSCAD a 2D and 3D free CAD system (and OpenJScad) SCIENTIFIC 230 Euler Scientific graphical programmable systems 237 Octave “ “ 245 SciLab “ “ PROCEDURAL 250 JustBASIC a free and an upgraded IDE BASIC system 253 C C++ C# C++ and old fashioned ways of graphics, and C# and modern graphical methods using Canvas (Visual Studio) 278 FORTRAN and old fashioned ways of graphics 278 Algol first language I used in 1966, and old fashioned graphics 289 ADA 298 Pascal and old fashioned ways of graphics 302 Lazarus a Pascal IDE & GUI system 326 COBOL 338 Visual Basic Envelop (no longer available), but good insights, then the Visual Express system, and also dotNET, and finally the 2013 Visual Studio implementation. 349 JAVA Eclipse (as in stand alone Java programs) 358 NetBeans (as in stand alone Java programs) 373 JavaScript as in web pages, good introduction to the Java world 389 Python, as in… Blender ~ a free 3D modeling system 414 Python, as in… as a standalone programming system 426 Perl stand alone PERL 2 INTRODUCTION Much of this material was in Illustrating More Shadows and some is in in Illustrating Times Shadow. However some material was culled when Illustrating Times Shadow was produced (it was the merging of Illustrating Shadows and Illustrating More Shadows), and this book was created in order to retain valuable commentary on some languages, such as Envelop and Visual Basic Express. Additionally, some programming systems were not included in the other books due to low interest, yet they are valuable; examples would be Algol, LISP and the like. Since this was written, some systems are no longer available (Envelop), and some do not work on Vista 64 bit systems (pyScripter for Python). This is not a “how to program” book, it is a cook book designed to get you up to speed quickly. OOP A short introduction to object oriented techniques and event driven programming as opposed to conversational programming kicks off this book. LANGUAGES AND SYSTEMS Most of the systems here have been tested on Windows XP, Vista 64 bit, and Windows 7. Some are no longer available, and some no longer function on newer operating systems. They are retained here for completeness. Many have been tested on Windows 8. SPREADSHEETS Spreadsheets are software programs that allow data to be stored in individual cells, or in columns, or in rows, and for manipulation of that data to take place. This seems simple enough, however there a few traps along the way. NOTE: Open Office is a free package that is mostly compatible with Microsoft Office, however the formulae differ in syntax slightly. NOTE: WPS is an excellent office package. www.kingsoftstore.com/ (c) 2005-2020 Simon Wheaton-Smith All rights reserved. However selections may be copied provided credit is given to this book and author, and the author emailed for information purposes at: illustratingshadows @ yahoo.com Please check: www.illustratingshadows.com regularly for articles, updates, templates, or spreadsheets. An all purpose spreadsheet covering many dialing functions is available there: illustratingShadows.xls 3 AVAILABLE PROGRAMMING SYSTEMS AND LANGUAGES NOTE: The book “Programming Shadows” is strongly recommended since it takes you through the installation, odd quirks, and sample programs. SPREADSHEETS Spreadsheets are software programs that allow data to be stored in individual cells, or in columns, or in rows, and for manipulation of that data to take place. discussed on a prior page Most of the systems here have been tested on Windows XP, Vista, Windows 7, and Windows 8 as well as on 32 and 64 bit systems. CAD SYSTEMS DeltaCAD the standard 2d CAD system used by diallists www.deltacad.com NanoCAD www.nanocad.com FreeCAD http://www.freecadweb.org/ Powerdraw www.powerdraw.software.informer.com ProgeCAD http://www.progesoft.com/en/products/progecad-smart/ TurboCAD http://www.turbocad.com/ SDK and parametric script Blender www.blender.org (more a modeling system than CAD) SCIENTIFIC SYSTEMS Euler http://euler.rene-grothmann.de Scientific Octave http://www.gnu.org/software/octave/ “ “ “ SciLAB http://www.scilab.org/ “ “ “ 4 PROGRAMMING LANGUAGES ADA http://www.libre.adacore.com ALGOL http://www.xs4all.nl/~jmvdveer/algol.html C and C++ There is a free