Forum Replies Created

  • Doug Easterbrook

    Member
    December 18, 2023 at 12:49 am in reply to: Calculate Row as List

    why not call a function that refers to the list instead of passing a list to a row. It makes it far easier to process multiple items within the method being called and means you don’t have to move data arond

    eg .. suppose list has 18 rows, 4 selected.

    then you can do

    do list.$doMyMethod

    and then in $doMyMethod, you can

    if $cinst.$totc(#lsel)=0

    calculate pErrorMessage as ‘Select whatever rows you want to work on’

    quit method kfalse

    end if

    do $cinst.$first(ktrue) returns #F

    while flag true

    # do some things to the line in the list

    do $cinst.$next(0,ktrue) returns $F

    end while

    # we processed all selected lines in the list

    reasons:

    1) in the long run, far easier to simply act on one, or the selected set (or all, if you want) lines in the list.

    2) there isn’t any passing of list to row

    3) its far easier to keep the method within the table class so that other methods can use it. that way it can be used in many places

    4) it improves the opportunity to use inheritance

    5) the any updated values in the list ara available to the calling method so you can redraw the list on the window

    6) it gets rid of the need to define the row

    7) makes code cleaner and kind of forces you to put it in the right place

    8) lets you gang up multiple calls to process the list. eg

    do list.$editListContents (pErrorMessage) returns $F

    if flag false

    # oh boy, we had some errors, better display them

    quit method #F

    end if

    do list.$increaseSalary(10%)

    do list.$saveList

    hopefully that gives a germ on the idea.

  • Doug Easterbrook

    Member
    July 25, 2023 at 2:31 pm in reply to: Euromnis 2023 – Oct 23-27

    Software Quality Metrics – Measuring Omnis Code Complexity
    <small>Calculate a code complexity index to predict maintenance effort.</small>

    How complex is your code? Wouldn’t it be nice if you had metrics that measured complexity of methods that could be used to:

    • estimate the cost of future support efforts -or-
    • whether it might be better to refactor code now for simplicity, while it is fresh in the mind

    What sounds like magic is actually possible – in Omnis!

    In the ‘70s, widely respected research by Thomas McCabe and Maurice Howard Halstead led to algorithms to measure code complexity. Currently, libraries exist that measure complexity in Java and C++. These are mainly used in areas requiring very high reliability like airplane construction, medicine etc. However, every application is better if the code is easier to understand well after it is written.

    In this workshop, Mirko will give you some theory on the Maintainability Index calculation and show this with Studio, which calculates the maintainability index for every method in an Omnis class.

    Mirko will provide you with his Studio code that you can use as you like to measure your own code.

    https://www.omnisworld.co.uk/speakers/mirko-pepa/

  • Doug Easterbrook

    Member
    July 25, 2023 at 2:31 pm in reply to: Euromnis 2023 – Oct 23-27

    OmnisDoc – Automatic Omnis Documentation

    <small>Generate MediaWiki pages where all the documentation comes from your Omnis code</small>

    After a few years of development, your codebase gets bigger and bigger. Even if you use the built-in documentation features of Omnis like $desc and $notes, it can be difficult to find the right information.

    With a little effort, you can find it all on a Wikipedia-like website, something that many are familiar with.

    In this workshop, Mirko will show you how to integrate MediaWiki, the software behind Wikipedia, into Omnis Studio, using Helper as the model to demonstrate:

    • OmnisDoc: Our solution to generate one documentation page for every class in Omnis, complete with all methods, parameters and descriptions.
    • Integration in Jenkins, so the documentation is always up to date.
    • Manual documentation of the code in an internal MediaWiki-Site.
    • A manual of our app for customers in a public MediaWiki-Site.
    • Customer-specific documentation of our app at the customer-site.
    • Automatically generate a Change-Log with all the completed issues in our bugtracker MantisBT.

    Mirko’s session provides code that you can use and implement as you like.

    https://www.omnisworld.co.uk/speakers/mirko-pepa/

  • Doug Easterbrook

    Member
    July 25, 2023 at 2:29 pm in reply to: Euromnis 2023 – Oct 23-27

    Mirko Pepa’s sessions emphasize software quality. One interesting topic applies Thomas McCabe and Maurice Howard Halstead’s software complexity metrics to Omnis code as a predictor about subsequent maintenance efforts. I recall using Halstead from my early career – putting a number on code comprehension, and therefor ease of maintenance, is a very interesting subject.

    see: https://www.omnisworld.co.uk/speakers/mirko-pepa/

    ————————————————

    Mirko Pepa has been developing with Omnis since Version 3 and his first application was a general ledger-app. He has attended a number of Euromnis Conferences as a participant and is ready to share his expertise in two aspects of the overall software development lifecycle:

    • automatic documentation and
    • measuring software complexity as a predictor of maintenance costs and effort.

    Mirko studied at the Swiss Federal Institute of Technology (ETH), and attended courses with Professor Wirth, the creator of the Pascal programming language. Then, he founded Profile GmbH, an IT-company based in Winterthur, Switzerland. In the beginning, the company did almost everything from selling Apple Computers, supporting customers to developing software. Later the company focused on its own software called Helper; an ERP-software solution for small and medium printing and prepress-companies.

    Helper has been updated over the years is now written in Studio 10 with PostgreSQL as the database. It evolved into a workflow-system for customers who do large volume document scanning and contains modules for generating PDFs, branding pages, adding bookmarks, injecting metadata, etc. To complement Omnis, the software stack at his company has grown to include: MantisBT, Mediawiki, NSIS, Sentry, OmnisTAP, PostgreSQL, Jenkins, Apache Archiva, Gitea, iCinga and others are in use.

    Mirko also serves as an exam expert in the Canton of Zürich for application developer apprentices.

    He lives in Winterthur, Switzerland, growing up bilingual, with roots in Italy and Germany. His passions include travelling to the beautiful ‘Riviera del Conero’ on the Adriatic Coast of Italy to enjoy good food and nice weather. Having already learned a few European languages, lately he started to learn Japanese and discover Japan. He is also interested in architecture and art, especially art nouveau, but is also fascinated by all complicated and big machines.

  • Doug Easterbrook

    Member
    June 9, 2023 at 1:48 pm in reply to: Easy way to send library WITH database?

    hi Uwe:

    I agree, I’ve submitted a number of issues to tech support. and they fall into two categories:

    1. those that can be isolated — and if you can do it in a few lines of code, it is good for both tech and ourselves. Those problems tend to be somewhat simple. I do it when I can.
    2. those that CANNOT be isolated and need the entire app plus data

    I know thats self evident. But complex problems that are multi layered need the entire system and a set of steps to reproduce it. Since we don’t always know if the problem is in the DAM, the UI, the code, some function within the code, IP based problems, the actual contents of the data, what have you — the full environment that shows the problem is best.

    I have three thoughts on recreating the environment:

    1. The support team at omnis UK know how to restore a postgres database – because they’ve done that for me in the past a number of times. So, send them the database and the pg_restore command, along with the sql to create for any user that needs to be created (we have a common user, so I send that SQL)
    2. set up a postgres server that can be accessed across the internet. Open port 5432, set the pg_hba.conf to allow access from Omnis, and then you keep your data, but allow access to the database remotely.
    3. put the database into a docker container and send that

    I would not rewrite your app to use some other sorts of data repositories or data access mechanisms because that fundamentally changes the nature of the problem.

    the Omnis support team is GOOD.

    accessing your database remotely (#2 above) should be no problem and is my preferred solution since I can set up a database for each problem if I need to so that the data is static for that problem.

    It has a benefit that if support can see the issue, you can test and verify any solution you are given.

    thats just my thoughts. Omnis is Client Server, or web services. The database doesn’t have to be delivered all the way to support in order for it to be accessed. It just needs to be accessible via an IP address. The database server can be on local or remote, it shouldn’t matter one bit (other than if its a performance related interaction, but then you’d find that yourself if you tried your database remotely before you sent the bug in.

  • Doug Easterbrook

    Member
    April 10, 2019 at 5:04 pm in reply to: Migrating DML to SQL

    hi mark.
    studio 10 might make conversion a different process. since the DML commands can now talk to postgres (instead of the omnis .df1 database)
    might be an avenue to approach..