Com\’è dura la professione!

8 Maggio 2017

SCXML support in QXmlEdit

Filed under: Open Source,qxmledit,SCXML,xml — lbell @ 16:19
Tags: ,

SCXML is a W3C standard to describe a state machine and its behavior upon events reception; it is expressed in XML format with bindings with data and scripting code.

QXmlEdit offers support to SCXML with specialized editing dialog and validations.

A special edit mode can be enabled automatically when loading a SCXML file, or manually using a menu item. When loading an XML file, if the format can be guessed as SCXML, QXmlEdit automatically asks if the edit mode can be enabled. Using the preferences panel, the option can be automatically enabled (or disabled) for all the SCXML files.

SCXML Activation

SCXML edit mode activation

The special edit mode sports a context sensible editing, specialized forms and a state navigator that shows the data in hierarchical or flat form.

Each edit form has specific validations for states and identifiers.

There is also a validation of the whole file done using Qt API with a limitation: the only scripting languages supported by Qt are accepted by the validator, currently ECMAScript (aka JavaScript) and C++.

In the normal edit mode it is always possible to invoke an ‘Insert Specialized Element’ for SCXLM, using the keyboard or the menu, enabling the same validations of the extended edit mode.

SCXML Navigator

Navigation of states in SCXML

Some links to resources:

SCXML specifications: http://www.w3.org/TR/scxml/

More info on QXmlEdit and in depth tutorial of using SCXML edit mode in QXmlEdit can be found at qxmledit.org

4 marzo 2016

Siblings, Parents and Other Relationships in XML with QXmlEdit

Filed under: Open Source,qxmledit,xml — lbell @ 21:06
Tags:

Navigate in a sea of siblings in an XML hierarchy can be problematic like the navigation in a true sea when the cardinality of the data is high. And yet, the XML can contain hand craft made test data to be validated or coming from an external source outside of our control.

Examine an element not conforming to a given XML Schema to understand the source of problems requires a lot of patience with complex data. QXmlEdit provides some tools to ease the task, customizing the data view and provides some facilities for the editing.

uno

Starting data

Visualization

Concentrating on some elements in a sequence, bookmarks are the first help to move quickly between different parts of data.

Each child element can show its index with respect to the parent using the menu “View>Show Child Index”.

The tree representation of the selection and all its siblings can be closed using the menu “View>Siblings>Close This and All Siblings”; the item “Close Siblings” of the same “View” menu can close all the siblings of the selection.

To reduce the visual clutter the siblings of the selection can be hidden.

The attributes can be sorted in alphabetical in the view order without modifying the position in the real data.

tre

Hiding siblings

Editing

The operations triggered in visualization can be made permanent with the commands of the menu XML.

In the “Siblings” menu there are commands to delete the siblings of an element, all the following, the previous ones, or simply all.

An element can be cloned, optionally adding an index using an attribute, to create quickly a feature that can differentiate a set of siblings.

With the hierarchy operations, the children of the selection can be moved or grouped, moving all the existing children to a new child.

Parents can be created or removed, isolating an element or promoting it to the previous level.

The sorting of attributes, available in the presentation layer, can be made permanent.

quattro

Siblings

In the End…

QXmlEdit can ease the task of manipulating complex XML files, while retaining the hierarchical structure of the data.

Get QXmlEdit at http://qxmledit.org, or go to the download folder at sourceforge.net.

6 dicembre 2015

Replicating XML Elements

Filed under: Open Source,QT,qxmledit,xml — lbell @ 18:06
Tags:

It is possible cloning or assigning unique indexes to elements in QXmlEdit 0.9.2 using two new menu items:
Tools > Fill Serie and Tools > Clone.

Applying an index is possible using Fill Serie. An attribute will be used on the siblings of the selected element. The value of the index can be a padded or unpadded number or alpha sequence giving birth to series like “AA”, “AB”, … or “A”, “B”, … and so on.
There are options to skip or replace existing values in the elements as well to merge the values. A non existing attribute can also be created.
The index can be applied recursively to the children of the selected element.

fill options

Cloning elements is a matter to select a sample element and apply the clone command. Only elements can be cloned unless they are the root of the XML. The cloning can be deep, that is applied recursively to the children too or only to the selected element.
An index can be applied in the process. QXmlEdit suggest you to use it if the option has not been selected.

clone options

The final result is shown in the next image.

 

cloning results

2 giugno 2015

QXmlEdit gets a New Home

Filed under: Uncategorized — lbell @ 20:03
Tags: , ,

Nowadays, everyone is always moving, not even Google is firm and stable and is closing Google Code project hosting, so QXmlEdit must have a new home.

The code will be kindly hosted by GitHub (https://github.com/lbellonda/qxmledit), binary downloads by SourceForge as usual (https://sourceforge.net/projects/qxmledit/), but the project at last will have a brand new home: http://qxmledit.org.

The move is almost done, but like in all the moves something is still inside a packaging box.

The new QXmlEdit home: http://qxmledit.org

5 gennaio 2015

Anonymizing data with QXmlEdit

Filed under: Open Source,qxmledit,xml — lbell @ 21:10

QXmlEdit 0.8.13 sports a feature to anonymize data inside a XML file.
The menu Tools > Anonymize recalls a dialog to anonymize the data contained in attributes and text of the XML.
This feature can be useful if the XML file should be sent to technical staff for debugging purposes avoiding the disclosure of personal information.
Using this feature the text and the attributes can be altered using a fixed character or using a different letter for each input character by preserving the case of the original letters.
The original data structure is preserved replacing only letters and digits with altered text, preserving the case of the letters and the reserved XML attributes. The tags and attribute names are not changed.
Data and business rules
Often not all the input files contain personal information, but also data for business rules. Modifying all the contained text or attributes will end in a useless file transporting no information at all.
To avoid that result, manipulating the parameters that belong to the business rules, two features can be used:

  • A filter to avoid the anonymization of values consisting of less than 4 characters (the length of many codes).
  • The use of exceptions.

The exceptions can be bound to any element, attribute or text node and force the subject to be anonymized or not; if anonymized, a user defined value can be used to replace the original one.
The exceptions can be hierarchical and extended to the children of the subject. It is possible to isolate data from business rules from personal data. When applying more expressions, the more specific wins; for example if an element has been forced to be anonymized with children, and one of its children has another exception of reverse meaning, the child exception is applied.
Note: at the moment namespaces are not processed in the exception path
Each time an exception is modified, the anonymization operation results are shown in a preview pane. The original values can be seen in the tooltips of the elements of the preview.

tooltip

Since creating rules and exceptions is a time expensive process, it is possible to save them using a profile and recall them later in other anonymization processes.
Options

an_main

The options are:

  • All text: all the text will be changed.
  • Text with more than 3 letters or digit: only the text that is composed by more than 3 letters or digits will be changed. This to skip codes that usually have a limited length.

The check box “fixed pattern” determines how the text is transformed.

  • If checked: letters are replaced by ‘x’ and numbers by ‘1’.
  • If unchecked: the letters and the numbers are replaced by a succession of letters or numbers in alphabetical order.

The exceptions can be entered selecting the element and using the contextual menu.

cont_menu

Information in the panel:

  • Profile Name: name of the profile (read only
  • Options: options to anonymize data:
    • anonymize all the text
    • anonymize only the text with more than 3 letters or numbers
  • Preview: it shows the final result of the operation on the current data.
  • Add Exception: exceptions can be added when an element is selected in the preview.
  • Exceptions: the list of the exceptions.
  • Save Profile: saves the current profile data. If the profile has not been created, a creation panel will appear.
  • Edit Profile: edits the profile data.
  • Profiles: manages the profiles.

To insert an exception:

  1. Select an element in the preview pane
  2. Use one of the buttons in the “Add exception” row

To remove an exception:

  1. Select an exception in the exception list.
  2. Press “Delete” in the exception group.

To save the exception list in a profile:

  • Press “Save profile”

If the profile has not be created, a profile creation panel will appear.
To mange profiles:

  • Press “Profiles…”

A list of profiles, grouped by tags will appear. Selecting a profile and exiting with “Ok” will load the profile in the caller dialog. It is possible also creating and deleting profiles.

 

5 aprile 2013

Springs and forces in QXmlEdit 0.8.5

Filed under: Open Source,QT,qxmledit,xml — lbell @ 20:45
Tags: , ,

A force directed layout graph (http://en.wikipedia.org/wiki/Force-directed_graph_drawing) is is well suited for hierarchical structures or directed graph, perfect to visualize the relationships existent between the elements of a XML structure.

QXmlEdit 0.8.5 lets you view the content of the current data or another file of your choice creating a graphic scene of the current screen dimensions, inserts the graphical representation of the elements in random positions inside it. The nodes migrate into an equilibrium configuration automatically under the application of a force similar to the binding of the electric particles, to reach an optimal distribution in the general case. A damping factor is applied to avoid a long stabilization time of the configuration.

The panel can be reached with one of these methods depending on the data to show:

  • The current file open in the editor

Edit a file and select the menu item “Relations” from the “View” menu.

  • A file on the file system

Choose the “Relations…” item from the”Tools” menu and use the browse button to load a file or drop in a file.

  • The map panel

From the Tools menu, choose the View Map item, before loading any file, check the the “Analyze relations” option; after loading the file, operate the “View Relations…” button.

When the panel is open it is possible to

  • View the structure

The panel shows the relations between elements. Each circle represent an XML element. The lines show a relationship between element types. To evenly distribute the elements on the view area, each element is repelling the others, the nodes are connected by simulated springs.

strcture

  • Move the items

The elements can be dragged with the mouse causing the movement of the other elements until reaching a new equilibrium point. Zoom controls can modify the view.

Each time the “Reset” button is pressed, a new initial casual combination is generated and the elements move themselves to reach a new equilibrium point.

img_06

  • Isolate a single element

Checking the “Center Selected” option, hides all the elements that are not diretcly connected with the selected one. By clicking on one node, you can filter the display of nodes showing only the data related to the selected element.

img_08

The data can be shown also in tabluar format

Each element on the rows show its absolute and relative count and the references made to any other element.

img_09

The settings can be tuned.

 The intensity of the replusive force can be changed using the “Force” slider. The effective distance that the force can act can be set using the “Radius” slider. The lenght of the lines connecting elements can be regulated using the “Spring” slider.

31 agosto 2012

Visual comparison between XML Schema files in QXmlEdit

Filed under: Open Source,QT,qxmledit,xml,xsd — lbell @ 21:31
Tags: , , ,

Visualizing a comparison between files is first of all a semantic operation. The comparison of source code of programs usually is done at level of source lines, and the level of concepts, classes and methods in this case, is entirely left to the user. There is no doubt that any line of source code is important, but while in the programming world the abstraction level is always raising, using protocols, interfaces and as last resource, languages better suited for the job, the comparison of variations of different versions is always done at character level.

The comparison of XML files is similar to a source code comparison, given that the information carried by a file are not related to the XML syntax, but to the meaning associated with the particular XML structure.

XML Schema files can be compared at XML elements level, the analogue of the source code comparison, but understanding the difference of the information carried by of the different XSD files is not easy.

The future 8.3 QXmlEdit, now on development trunk, follows another approach, transforming the data into concepts, element, types, and so on, then comparing the concepts. Given that the XML Schema follows a strictly hierarchical model, the reference and the target schema are scanned in parallel for inner contents. Where an element in the reference schema has an equivalent on the target schema, is compared for equality on the basis of the element type and name. If the two values are equals, the element are posed in correlation and any other difference ends in modified items. The comparison continue recursively.

The schema is then presented, using colors that show at a glance only the reference schema, highlighting the changes, showing the information in their context. The key is shift the focus from the comparison as operation, to the variation of the information in the schema context.

Image

19 marzo 2012

Visualizing XML trees with QXmlEdit

Filed under: qxmledit,xml — lbell @ 22:36

Why to view XML using letters only?

Exploring big XML files trying to understand how the data are distributed in the file is difficult when the size of the files is relevant respect to the available memory.

Basically there are three points that are interesting in dimensions and distribution:

  • Data size.
  • Number of children.
  • Tree deep.

Given that the XML structure is a hierarchical one, in principle there is no difference between visualization and exploration of a XML structure and exploration of datasets used in other fields from the physics to the biology; there are already a lot of well known methods to handle this type of data, from data handling to image processing.

What is missing in a typical XML editor are visualization modes to give an idea of how the data are distributed at a bird’s eye view. The textual or tree map representation are often or too detailed, or not detailed enough.
QXmlEdit under development will show the data graphically giving the possibility to the user to use its eyes to evaluate the data, losing the details in a zoom out or delving deeper to investigate data structure.

To form the map the following data transformations are done:

The tree is converted in a grid, de-normalizing it.

Let’s suppose to have these start data, the following transformation is applied.

After that, the rows with the same logical data can be regrouped as in a tree map. The color of each cell can be the value of the observed quantity.

The map can be zoomed and navigated, selecting an area or descending in hierarchical mode.

23 ottobre 2011

QXmlEdit 0.5.3 released

Filed under: Open Source,QT,qxmledit,xml — lbell @ 15:14

QXmlEdit, a simple XML editor, is born to explore Qt libraries and then gradually added features becoming a sort of swiss army knife.

In its latest release, 0.5.3, there is a tool to split XML files of any size in smaller fragments. It is also possible to examine a fragment at time in the user interface, without loading it completely in memory.

You can download QXmlEdit at the following link: http://code.google.com/p/qxmledit/downloads

This little tutorial, extracted from the manual, shows how to use the file splitter in details:

When starting, the program will open a welcome dialog leading to the most common operations. Choose “Split a file”. If you choose to hide the dialog next time the program restart and change your mind, you can reactivate it in the configuration panel. You can access this feature also from the menu Tools.

(more…)

3 ottobre 2011

Se ne va il bello del computer

Filed under: cosi' va il mondo,Mac,Vaneggiamenti — lbell @ 20:43

Steve Jobs si è dimesso da CEO di Apple.

Il cambio di un dirigente di una ditta non ha solitamente grosse ricadute sugli utenti ed in certi casi neppure sulla vita della ditta stessa, ed il fatto che le ditte sopravvivano ai propri amministratori ne è una prova.

Steve Jobs è stato un’eccezione e con lui rischia di scomparire un parte di quello che ha reso il personal computer affascinante, almeno per chi è appassionato di tecnologia.

Chi ha iniziato ad usare i personal computer da piccolo, ha vissuto l’epoca degli 8 e dei 16 bit, con macchine che pur differenziandosi per potenza, dal mondo dell’hobbistico al professionale, si assomigliavano tutte nel modello di utilizzo e di programmazione. La differenza la facevano le periferiche disponibili ed il software per gestirle (chiamarli driver sarebbe forse troppo). Un hard disk ed un buon alimentatore differenziava le macchine di fascia alta da quelle di uso casalingo.

Era possibile scrivere simulazioni, risoluzioni di problemi matematici, piccoli database in Assembler, Basic o Pascal. All’uscita di un nuovo modello ci si procurava i manuali del relativo microporcessore e dell’immancabile versione di Basic per poter programmare, come quando dovendosi recare in un Paese straniero, ci si premura di procurarsi un dizionario ed un manuale di conversazione.

L’avvento dei sistemi ideati da Jobs ha cambiato tutto.

All’uscita del Macintosh in Italia, cercando i manuali del suo Basic, per capire come fosse possibile realizzare un programma come Mac Paint, restai allibito davanti ai volumi di Inside Macintosh.

Non si trattava solo di un sistema con un’interfaccia utente mai vista prima, di una grafica che sembrava uscita da una tipografia, ma anche dell’organizzazione della documentazione, finalmente fuori dai binari di una raccolta di trucchetti, e di come veniva teorizzata la via per scrivere i programmi, del primo tentativo di programmazione object oriented diffusa al di fuori dell’accademia.

Si trattava di tutto quanto assieme, un salto di una decina di anni avanti a tutto quello che era apparso fino a quel momento, quasi in ogni particolare della macchina, ahimè anche nel prezzo, decisamente fuori portata per le tasche di molti, me compreso.

Più tardi appresi che la macchina era curata anche al suo interno, in luoghi che l’utente non avrebbe mai raggiunto (si veda la storia su http://folklore.org/StoryView.py?project=Macintosh&story=PC_Board_Esthetics.txt).

Qualche tempo più tardi, al mio primo lavoro, parlando dell’argomento, un ingegnere mi disse letteralmente “real programmers don’t use icons”. Oggi tutti i sistemi sono essenzialmente dei Macintosh, perfino i telefoni.

Quando uscì il NeXT, forse il capolavoro di Jobs, abituato ai sistemi che le altre ditte comunemente costruivano per il mercato professionale, mi chiesi come fosse possibile avere pensato così in grande nel produrre qualcosa che comunque era soggetto alle regole di mercato e come mai nessun altro lo avesse fatto.

Il NeXT era esagerato in tutto e, come al solito, anni avanti agli altri sistemi, soprattutto nel software. Il Macintosh di oggi non è che la sua evoluzione adattata ai tempi.

I sistemi progettati da Jobs sono sempre stati innovativi e curati con perfezione maniacale. Se pure Jobs non ha scritto una riga di codice, la sua mano si vede in ogni prodotto che è sempre un piccolo gioiello.

Jobs è stato non solo geniale, ma ha segnato il proprio tempo con visioni che andavano al di là del presente. Come lui, nel suo campo sono stati, ognuno a modo suo ed in misura diversa, pochi altri: Clive Sinclair, Richard Stallman, Linus Torvalds, Alan Kay, Jay Miner fra quelli che conosco.

Quello che Jobs ci ha insegnato è che anche nel mondo del lavoro, a volte così concreto da sfiorare la grettezza, è possibile realizzare qualcosa di solido e di elegante, che va al di là di quello che sembra possibile quando ci si accontenta di fare quello che si è sempre fatto, perché si è sempre fatto così.

A proposito di Jobs mi sembra giusto chiudere con una citazione da “Cena ad Audoghast” di B. Sterling:

 “Non mi fiderei di nessun indovino del commercio. Per conoscere il mercato bisogna conoscere il cuore della gente, e per questo occorre un buon poeta.”

Pagina successiva »

Crea un sito o un blog gratuito su WordPress.com.