The Markdown benefits

The Markdown format It is a format that guarantees the maximum of graphic rendering with the minimum of code. Why is this important?

A rich graphic rendering, on the one hand, is a value because the things that are written (and then they must be correctly readable) do not all have the same importance. And, on the other hand, the minimal use of the code helps to reduce the size of the file, occupying as little space as possible on the device. Moreover, Markdown helps also to modify directly and easily the code, since it is an extremely “clean” code and very similar to its graphic rendering.

titles

A title must hit more than the body of the text. And a main title must hit more than secondary titles. A way to do this is a different size of characters. Markdown can do this.

the TOC

The use of titles is also useful for “browsing” quickly in a document, jumping from one title to another, without having to flow the whole body of the text. A good text viewer is able to provide a TOC (Table of Content) which allows you to browse quickly between the parts of the document (characterized by higher or lesser level titles).

text formatting

But the body of the text is also important to highlight what is most important from what is less: bold and italics are ways to do it.

blockquotes

Then it is good to be able to distinguish between what the author of the document and the blocks of text said by other authors (i.e. long citations) writes, and for this there is the blockquote, which is good is also graphically distinct from the rest of the body of the text.

LibreCalc data sorting problem

After importing a csv file, you could not be able to sort your data, if you have to sort “date” cells. Indeed, even setting cells as date format and the right date format (such as GG/MM/AAAA or the like), you couldn’t be able to sort as expected your data.

To fix this, as explained here, you should import in LibreCalc a csv file with something like “date” checking “Detect special numbers” field. In this way you should be able to sort your items by the “date” columns.

pdf editor (linux)

The best pdf editor in linux is, IMO, Master PDF. That is not, however, an open source application: to get its full function you must buy a (quite expensive) license.
You can bypass this problem using a previous pdf master release, that have less features, but all free. Remember to lock (pin) this relaese, otherwise your software manager will update it to the new ones.

There are others pdf editor, but not so good

  • LibreDraw i.g. can edit a pdf, but the result a very untidy (detroying original formattation) and huge-sized (4 or 5 bigger than the original one) page.
  • Scribus can edit a pdf, but not the outlines, and in a very poor mode. Moreover big pdf files are a problem for Scribus.

php include: no absolute path

To get include command working you should avoid an absolute path: i.g. not

http://somepath/somefile

But, i.g.:

../somepath/somefile

2) In localhost it would be possible this workaround:

$yourvariablepath = realpath($_SERVER["DOCUMENT_ROOT"] . "/a/path");

But this doesn’t work in remote.

3) Another workaround to include a content from a file in another absolute path could be the object tag:

<object data=”your-file-even-on-another-server” />

But an object in another page is an island, a stranger “guest”, without any sharing with the “host” page.

4) Another way (for short text) is to use javascript.

Regex : an alphabetic letter

To mean one letter, such as ‘a’ or ‘G’, you can use [A-z].

I.g. if you want find any occurrence of strings such as 7956A, 5476H, 3865V, you can use

\d\d\d\d[A-z] 

mysql order negative number

In a table (chronological) if you have dates stored as text you could have problem to order your data.

I.g. you coud have this (wrong) order:

-13.600.000.000, -13.700.000.000,-4.600.000.000

To get the right order you can try with

cast(data as int)

Where “data” is the column of data (as the above values). In this way you will get the correct order:

-13.700.000.000, -13.600.000.000,-4.600.000.000

Check a mysql connection error

If your server cannot establish a connection with a webpage, you can check where is the problem with a code like the following:

<?php
$link = mysqli_connect("localhost", "user", "psw", "dbname");

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

if (!mysqli_query($link, "SET a=1")) {
    printf("Error message: %s\n", mysqli_error($link));
}

/* close connection */
mysqli_close($link);
?>

Replacing Autokey in Wayland

Many Linux distros are leaving xorg (x11) for Wayland, as display server protocol. Unfortunately not all the applications are ready for Wayland.

In particular Autokey, a very useful application to expand text and automatize typing operations, is not (yet) compatible with Wayland.

A quite good replacement of Autokey is Espanso. But there are also some limitations:

  • Espanso has big problems in LibreWriter (abbreviations are often expanded with errors). Similar problems there were also with Autokey in LibreWriter, but Autokey was able to provide some workarounds.
  • Espanso, unlike Autokey, can provide a very small range of hotkeys (such as ctrl + alt + d): Espanso can use only hotkeys with ctrl (not with alt or shift) and a few letters. I.g. “x01” means “ctrl + a”. You can find the whole range of possible combinations here.

However, as long as the main typing operations are in LibreWriter, or Kate, you can use that applications possibilities to expand text.

in LibreWriter there are at least two possibilities (to expand an abbreviation):

  • tools – > autocorrect
  • tools -> autotext

In Kate you can use snippets to create something similar to Autokey.

I.g. to create a snippet to wrap selected text with the tag <h1>, you can add this code as snippet code:

${rangeCommand("<h1>%%1</h1>", "title")}

Choose the title as you prefer (obviously without spaces), and a key combination, i.g. ctrl+1.

Don’t forget to add, in the javascript section (the tab scripts) this code

function rangeCommand(command, def) {
    if (view.selectedText().length > 0) {
        return command.replace("%%1", view.selectedText());
    } else {
        return command.replace("%%1", def);
    }
}

In this way, you will be able to add a title <h1> to your selected text.

Google speech-to-text

If you use Google speech-to-text one problem is to type signs such as ‘(‘ or ‘)’. In English you can say (in a low voice) open bracket or close bracket. In Italian apri parentesi tonda o chiudi parentesi tonda: indeed saying only apri parentesi Google will type “apri parentesi” and not “( “.