Summary of open-source projects - July 2018 Read more

by Gautier de Montmollin

Here is a list of projects I participate to on SourceForge. Click on the links below for details.
Some projects have GitHub mirrors too.
  • Ada Bar Codes
  • Ada PDF Writer - a standalone, portable package for producing dynamically PDF documents
  • AZip - a free, portable Zip Archive Manager
  • CBSG - the Corporate Bullshit Generator
  • Engine_3D
  • Excel Writer - a standalone, portable Ada package for producing Excel spreadsheets
  • GID - Generic Image Decoder
  • GLOBE_3D
  • GWindows / GNAVI - the GNU Ada Visual Interface
  • GNOGA - the GNU Omnificent GUI for Ada
  • HAC - HAC Ada Compiler
  • Ini file manager - a standalone, portable Ada package for configuration files
  • LEA - Lightweight Editor for Ada
  • Mathpaqs - collection of mathematical, 100% portable, packages in Ada
  • P2Ada - Pascal to Ada translator
  • TeXCAD - a program for drawing or retouching {picture}s in LaTeX
  • Wasabee - a Web browser with safety focus
  • Zip-Ada - a standalone, portable Ada library for .zip archives
Enjoy!

Oh, and one more project which is not open-source, but based on the GNOGA framework listed above:
Pasta!

New GitHub mirrors Read more

by Gautier de Montmollin



New GitHub mirrors, for open-source projects I'm administrator or developer of, are located here.
Please ignore the old mirrors that relied on svn2github. If you see "svn2github" somewhere on a repository address, it's the old one → trash it!

You can find the same projects on SourceForge too, here.

The projects are...


ada-bar-codesAda Bar Codes: bar code (1D and 2D) generator in pure Ada

ada-pdf-writer
Ada PDF Writer: a standalone, portable package for producing dynamically PDF documents
azip
AZip: a free, portable Zip Archive Manager
cbsg
The Corporate Bullshit Generator
engine-3d
Engine_3D: a real-time, pure software, 3D engine for DOS-talgics. Abandoned project, but perhaps there are some interesting bits in the code... See GLOBE_3D for newer stuff !
excel-writer
Excel Writer: a standalone, portable Ada package for producing Excel spreadsheets
gid
GID (Generic Image Decoder): a standalone, portable generic Ada package for decoding images
globe-3d
GLOBE_3D: a real-time 3D Engine written in Ada
gwindows
GWindows: GUI framework for MS Windows
hac
HAC Ada Compiler: an experimental Ada compiler, fully in Ada
ini-files
Ini file manager: a standalone, portable Ada package for configuration files
lang-index
Language Popularity Index: an automated version of the TIOBE index. Project is inactive at the moment, but perhaps there are some interesting bits in the code...
lea
LEA is a Lightweight Editor for Ada
mathpaqs
Mathpaqs: a collection of mathematical packages in pure Ada
pascal-to-ada
Pascal to Ada translator
texcad
TeXCAD: a simple LaTeX {picture} drawing tool
wasabee
Wasabee: a Web browser with safety focus
zip-ada
Zip-Ada: a standalone, portable Ada library for .zip archives

The Corporate Bullshit Generator - Business Agility Edition Read more

by Gautier de Montmollin

Our best-in-class, high-performance digitized business intelligence tool, the Corporate Bullshit Generator, just got a tremendous impulse thanks to no one less than Dilbert himself (see the October 28, 2019, cartoon: Business Agility Influencer) ! Here are a few gems including the new items, that the CBSG produces - by the thousands each second, beating the most talented managers worldwide and beyond !
  • The Global Chief Business Agility Officer (CBAO) influences our business process quality engineering.
  • Business agility and solution orientation empower a sales target by expanding boundaries.
  • The Chief Operations Solutionist (COS) activates a first-mover, state-of-the-art, cross-pollination across the entire spectrum.
  • An insightful say/do ratio strengthens our high-performing customer behavior patterns, whilst a hybridation quickly strengthens the mediators.
  • The Enterprise Chief Business Planning Influencer (CBPI) cost-effectively enforces synchronized assets.
  • The "why" behind visions will be best positioned to enforce our field workforce optimization.
  • Pre-integrated diversification is all about right, awareness-raising, usage-based and holistic data science innovation.
  • Our challenge is not to co-specify our Business Model Innovation (BMI). Our challenge is to call "check-mate" ahead of competition. 
Enjoy!


    The Corporate Bullshit Generator - the Crossroads of Data Read more

    by Gautier de Montmollin

    Without fresh data from our fans, the Corporate Bullshit Generator could not stay at the cutting-edge of innovative data-centric business intelligence. Here are two key additions (coming from the same sentence):

    (1)

    At the crossroads of supply-chain, bandwidth and reorganization, value stream management is all about business acumen.
    At the crossroads of values congruence, brand pyramid and socialization, the key to framework is technical strength.
    At the crossroads of relevance, responsibility and convergence, the General Senior Head of Management Office drives customer-centric co-innovations.

    ---

    (2)

    Flat out, the standard-setters conversate by turning data into transformation processes.
    Actually, an open-door policy transgenerates our outward-looking, skills-based and up-to-the-minute success factors by turning data into superior-quality re-engineering.
    Adjacencies are on track by turning data into long-term, movements-based, rollout plan.
    The science-based action fosters our integrative document; this is why industry market shifts accelerate the analytics-based, hypothesis-driven, top-level and diversified case study by turning data into synergization.
    The product manager potentiates corporate data practices by turning data into trigger events.
    The enablers ignite our accountability by turning data into workforce adjustments.
    The standard-setters differentially right-size pipelines by turning data into business equation.
    As the consumer and commerce landscape continues to evolve, the group targets our frameworks by turning data into convictions.
    The Senior Vice Director of Facilities Management envisioneers scalings by turning data into cross-functional synergies.
    Our sourced say/do ratios influence the game changers by turning data into infrastructure.
    In order to improve, you need to promote advanced-analytics and first-mover support structures by turning data into outstanding issues.
    The stakeholders cost-effectively overcome our problems/difficulties by turning data into mind-blowing core values.
    To remain relevant, the Enterprise Chief Value Added Services Officer (CVASO) filters out our limitations by turning data into predictability.

    ---
    Thanks for the input - and enjoy!

    Controlling a Crazyflie Read more

    by Forward in Code

    This is a note on getting set up to work on a Crazyflie 2.0.

    After unpacking, testingand assemblingthe drone, you need to get some software to talk to it.

    Read more »

    Zip-Ada v.55 Read more

    by Gautier de Montmollin


    Changes in v.55:
    • Zip_Streams: ZS_Size_Type is now 64-bit signed, enabling Zip.Create to capture archive size overflows in Zip_32 mode.
    • Zip.Create raises Zip_Capacity_Exceeded when archive creation exceeds the Zip_32 format's capacity: 4GB total size, 65,535 entries.
    • Zip.Create is now using an Ada 2005+'s Containers's Hashed Maps; creation is much faster on Zip archives with many entries.
    • (Tools) ReZip has a new option for working only with its own internal compression algorithms - those provided by Zip.Compress. This option is useful if external tools are not available.
    • New Trained_Compression package: generic streaming encoder-decoder engine with the capability of training the engine with data known in advance, in order to achieve better compression. Not Zip-related.
    • Minimum required Ada version is now Ada 2005 (was Ada 95 before).

    http://unzip-ada.sf.net

    AZip 2.25 Read more

    by Gautier de Montmollin

    AZip 2.25 screenshot - click to enlarge

    • Added buttons for New, Open and Toggle view commands.
    • Cases where Zip format capacity is exhausted are properly handled.
    • Sorting is a bit faster.
    AZip Web site: http://azip.sf.net

    AZip 2.35 Read more

    by Gautier de Montmollin

    New AZip features since v.2.25:
    • Select columns menu entry allows you to select the columns that you find useful to be displayed (v.2.30)
    • Option for a default extraction directory (v.2.31)
    • Drag & Drop from a folder within AZip, to Windows Explorer or to the Desktop (v.2.35)
    • Context menus within AZip (v.2.35)
    Visit AZip home page here.

    Column selection - click to enlarge

    Option for a default extraction directory - click to enlarge

    Context menus with AZip - click to enlarge


    Drag & Drop between GWindows and Windows Explorer Read more

    by Gautier de Montmollin

    This article refers to the programming framework GWindows available here.

    1.

    Dragging files into your GWindow window is very easy:
    Have a call to Accept_File_Drag_And_Drop when desired:

       Window.Accept_File_Drag_And_Drop (True);

    Override...

       procedure On_File_Drop (Window : in out My_Window_Type; File_Names : in Array_Of_File_Names);

    ...to process the list of dropped file names – that’s it!
    A reason for this simplicity seems to be that the underlying message & event were introduced in Windows versions of the early 90’s, like perhaps 3.0 or 3.1 (did not dig too much into this…). Articles from various points in time of the last 25 years warn that feature will disappear “very soon, perhaps in the next version of Windows”, but as you may have seen all the way through Windows 10, Microsoft fortunately never removes features in Windows API – or do they?

    2.

    The reverse operation, dragging things that represent files out of your program’s window is notoriously complicated and poorly documented. Doing it requires complicated stuff of the Windows 95+ era with what seems to be an active connection with Windows explorer – with good chances of crashing the latter, or having at least some interesting delays because you are dragging the mouse pointer over a window or a shortcut representing data located on the other side of the planet. From the programming perspective, some proposed implementations give headaches just by reading the code snippets.


    Fortunately, there is a simple way used by some open-source software. Finally, you can be already happy with the file path indicated by the Windows Explorer window under the mouse cursor, right? Surprisingly, Windows lets you get the handle of any visible window (including buttons, edit boxes, …), and including those of foreign programs! Furthermore, you can get the root ancestor window of a window, then the tree of children, and for each child, their text (for instance button labels, contents of edit boxes, window titles). This technique leads to the knowledge of what kind of window is under the mouse cursor and to the contents of the address bar. If you are interested, you can see the details of the whole hack in the body of GWindows.Application (gwindows-application.adb). Fortunately the dirty stuff is hidden there, and the specification (gwindows-application.ads) gives you access to those information through neat functions with only very innocent types: Integer, Boolean, GString.

       function Get_Window_Text_At_Location (X, Y : Integer) return GString;
       --  Returns the text of the window that contains the point (X, Y).
       --  It can be a window of any application, including the desktop.

       function Get_Window_Class_Name_At_Location (X, Y : Integer) return GString;
       --  Returns the class name of the window that contains the point (X, Y).
       --  It can be a window of any application, including the desktop.

       function Get_Window_Root_Class_Name_At_Location (X, Y : Integer)
          return GString;
       --  Returns the root class name of the window that contains
       --  the point (X, Y).
       --  It can be a window of any application, including the desktop.

       function Is_Desktop_At_Location (X, Y : Integer) return Boolean;

       function Explorer_Path_At_Location (X, Y : Integer) return GString;
       --  Returns the path from a Windows Explorer window (if meaningful),
       --  or the Desktop's path if (X, Y) points to the Desktop.
       --  In any other case, the returned string is empty.

    The code sample, cap_test.adb (in gwindows/samples/mouse/), built seamlessly from the project file gwindows_samples.gpr, will demonstrate those recently added functions.
    You can find a real usage of Explorer_Path_At_Location in the AZip Zip file manager, here: http://azip.sf.net.

    Screenshots of cap_test follow:

    The existing GWindows feature: identify a GWindows window (of any app) - click to enlarge

    Here, new GWindows.Application feature: a Windows Explorer is found, its path is given - click to enlarge
    Here, the desktop is under the mouse cursor, so the user's path to it is given - click to enlarge




    GitHub mirrors Read more

    by Gautier de Montmollin

    As promised, here is a list of GitHub clones of Ada open-source projects I'm participating to:
    Public Projects
    GitHub Clones
    Ada Bar Codes
    Ada PDF Writer
    AZip
    Corporate Bullshit Generator
    Engine_3D
    Excel Writer
    GID
    GLOBE_3D
    GNAVI: GNU Ada Visual Interface
    HAC
    Ini file manager
    LEA
    Mathpaqs
    Pascal-to-Ada
    TeXCAD
    Wasabee
    Zip-Ada


    Enjoy!
    __
    UPDATE: the svn2github cloning service seems to be closed now.
    For newer sources, click here, click on "Show More", select a project, then click on "Code".

    Zip-Ada and AZip presentations at FOSDEM 2019 Read more

    by Gautier de Montmollin


    Shrink your Data to (almost) Nothing with Trained Compression


    Presentation is available as PDF and PPT.


    The AZip Archive Manager: a full-Ada Open-Source Portable Application



    Presentation is available as PDF and PPT.


    Click here for the whole list of presentations (8½ hours without break!) in the Ada developer room at FOSDEM 2019.


    Pasta! - Levels 37 to 40 Read more

    by Gautier de Montmollin

    Levels 37 to 40 of Pasta! are now available.
    Enjoy, and try to beat the best score!

    If you like the game, don't forget to "like" it with the Facebook button!


    Screenshots:

    37

    38

    39

    40


    MacOS Software Development Kit changes Read more

    by Forward in Code

    This post is based on the README from the corresponding Github repository.

    That repository attempts to cope with expected changes in Apple’s approach to software development kits, specifically where to find the system headers (you’d expect /usr/include).

    Read more »

    Coding Guidelines Read more

    by Forward in Code

    Coding_Guide """"""""

    This is a rather self-satisfied document, written in the mid-1990’s, which may still have some relevance.

    Coding Guide

    Purpose and Scope

    While it is hard to make a silk purse out of a sow’s ear (to create good code from a bad design), it is all too easy to do the reverse.

    The principle that clear, readable, understandable source text eases program evolution, adaptation, and maintenance is not dependent on the programming language in which the text is written. The purpose of this document is to indicate those language-independent techniques which can help you to produce source text with these qualities.

    Read more »

    Mojave vs. GCC Read more

    by Forward in Code

    After you've installed Xcode (or, my preference, the Command Line Tools via xcode-select -install) so that you can install and use GNAT, you may expect to be able to compile C code too.

    Mojave may surprise you with


    $ gcc casing.c -o casing
    casing.c:1:10: fatal error: stdio.h: No such file or directory
    1 | #include <stdio.h>
    | ^~~~~~~~~
    compilation terminated.

    The reason, according to this question and its answers, is that Apple's developer tools, in particular the clang compiler, know where to find the include files under /Library/Developer; GCC doesn't (I'm sure it could be made to, but ...) and so we have to add an extra step to install them in the normal place:


    $ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
    Password:
    installer: Package name is macOS_SDK_headers_for_macOS_10.14
    installer: Installing at base path /
    installer: The install was successful.
    You may need to repeat this after macOS or Command Line Tools (or Xcode) updates.

    Pasta! - Level 34 Read more

    by Gautier de Montmollin

    First of all, ladies and gentlemen, welcome to the newcomer, the fusillone:


    The new pasta makes its first appearance in level 34 of the Pasta! game.


    Caution: it's a Piccante level, which means it's a tough one.
    Here are a few hints about how to tame it.

    • There are lots of moves at start (30), so your fate is (mathematically speaking) quite divergent: perhaps you'll be very lucky quite early, perhaps not at all. Don't give up, and try again!
    • Spot the 4's, the L's and T's early to earn points, even if all this basil is still blocking you (usually the tactic is to get rid of obstacles first)
    • Try to clear as much basil as possible in single moves (like the three fusillone on the bottom left in the picture)
    • Once there is more room on the plate, don't forget the general rule of these kind of games: do matches on the bottom, so you trigger more chain reactions.
    • Remember that there is an infinity of lives in this game, and that you can restart a level at any time either by clicking on the map, but, even easier, by clicking the Reload button!

    As a bonus, here is the development Pasta! server, running from the GNAT Programming Studio (GPS), with level 34 as source code.
    Click to enlarge


    Pasta! - Level 35 Read more

    by Gautier de Montmollin

    Level 35 of Pasta! is easy.

    However you'll notice the redoubtable Antipasta hiding below basil layers.
    Still, they can trigger nice chain reactions...

    Pasta! - level 35
    As a bonus, I've written down how much time it took to build this level.

    • 7 minutes from the sketch on paper to Ada code, using two editors: LEA and GNAT Programming Studio (GPS) including debugging: Ada detects at compile-time bugs like size mismatches or type errors. The only run-time issue was an infinite loop with rows of identical Antipasta. Perhaps it is a bug, or there are really no possible combination without immediate match for the startup board. I did not look into this.
    • 15 minutes testing the first version, which was a bit boring with nine columns and too few pasta sorts - that is, too many pasta of the same kind.
    • After reducing the number of columns from nine to seven and increasing the number of sorts of pasta, it became much funnier.
    • After v2 (2 minutes of testing), came v3 (7 minutes) and a few others (30 minutes in total) with always smaller fine-tuning for the number of rounds, the threshold in points, that corresponds to an easy (but not too easy) level.

    Mojave vs. GDB Read more

    by Forward in Code

    Apple's software development tools are based on LLVM, and Apple don't seem to feel it necessary to keep GCC and friends up to date with changes in the Apple tools or security policies.

    GDB has been particularly affected by this. You can see why a tool which is capable of interacting with running programs would have to be treated with caution.

    Read more »

    Piazza 4 Read more

    by Gautier de Montmollin

    After 1 1/2 year of inactivity, the development of Pasta! continues, with the levels 31 to 40.

    Click to enlarge

    A gentle level #31 to begin with Piazza Quattro...

    Click to enlarge

    For those curious about the code behind the game, here you are:

    Click to enlarge

    The entire level's description holds in an expression (called aggregate in Ada), returned from a function.

    Using GDB with a BBC micro:bit Read more

    by Forward in Code

    This note is about using Segger J-Link software to help debug code on a BBC micro:bit.

    Read more »