Monday, September 27, 2021

Why for me Firefox still rules on desktop in 2021 (and why NOT)

In this article I would like to show you why I think Firefox is still the best browser among the well known desktop browsers today. For those who want to be productive while browsing the web, I do believe there is no better alternative for many years already.

Why this article?

Well, maybe you've heard about diminishing number of users of Firefox recently. The fact is that the decrease in Firefox users has got various reasons, but that's not the topic I would like to go into here. 

Like me, you may also read some articles how the new Firefox with its new, "totally revamped" UI is great, or, from the other camp, a total mess. There is also this popular "privacy & tracking" topic nowadays. But as I will show you below, I honestly think none of these is really an important decisive factor in a long term.

What bothers me is how so many people seem to be blind to see what is really important when choosing the browser "for their life". So this and also the lack of articles that would show the real strong sides of Firefox, where its competitors are a good way behind, led me to writing this post.

What really matters to me?

Most of the time we use a web browser for navigating the web, right? That is to view web pages and to search for them, being it via a search engine like Google, or by finding them in our browsing history, among pages we have bookmarked or among pages (tabs) that we have got currently opened.

And while this may sound new and surprising to some readers, there are IMHO huge gaps in how efficient Firefox versus the other browsers let you be in this area of quickly getting to pages opened either now, just recently or in a more distant past.

A side note: While there are various add-ons that strive to bring you some "core" functionality that is missing in a browser, based on my research mainly with Chrome, due to various technical limitations like restricted browsers' API, those add-ons mostly fail to deliver the desired functionality. Moreover, when you need to use a corporate PC, you might not be allowed to install any add-ons to your preinstalled browser. It's exactly when one realizes, as it happened to me, what a nightmare it is when you are forced to use a different browser, when it lacks all the functionality which you already consider an obvious, basic one.

OK, so let's finally have a look at what I consider the game-changing pros of Firefox.

Intelligent address bar and searching

This is such a superior and time saving feature for so many years, I'm surprised that the other browsers are seemingly only taking the first baby steps in this area. It feels like it is just not promoted enough by Firefox authors or its users.

Let's have a look at what all the address bar in Firefox offers. As in all browsers, you can search using your default search engine, but also at the same time:

  • search in the history of visited pages
    • unlike Chrome or Edge, Firefox does a fully fledged search here. I. e. you can enter unlimited number of words (or their parts), and Firefox still gives you relevant results from history. The very same applies to the 2 following features as well.
  • search in bookmarked pages
    • you can also add tags to your bookmarks or even assign a keyword and later refer to them in the address bar
  • search in the currently opened tabs
    • as in the aforementioned searches, both URL and title of a page can be searched for
  • learn and suggest pages the user visits the most among the top matches

And of course, as most of the stuff in Firefox, the address bar behavior is pretty much customizable.

Switch to the most recently viewed pages easily

Firefox doesn't limit you when it comes to switching to another tab. You can either use the Ctrl+Tab shortcut similarly to Alt+Tab, i. e. to switch to the most recently viewed pages, which many people, including me, naturally prefer. Or you can setup Firefox to switch to the next tab in the tab bar.

And what about the other browsers? They only offer you the latter way of switching, which is quite limiting, moreover when one can always use Ctrl+PageUp and Ctrl+PageDown in order to navigate in this way!

Advanced Find on page possibilities

I guess that this is not critical for most users, but when you press Ctrl+F in Chrome or Edge, you can just search a plain string on the page, with no further options. While in Firefox you get many more options: "Match Case", "Match Diacritics", "Whole Words" and "Highlight All". 

A side note: There was this 17 years old feature request To also highlight matches on the scrollbar that was just implemented this year, a big thank you to the contributors! For me, this was possibly the only bigger missing feature when compared to Chrome. It could have been somewhat mitigated by add-ons, but they could have never reached the quality of a native function.

What matters, but is secondary to me?

Of course, there are plenty of other criteria you can also take into consideration when choosing your favorite browser. Yet, even though being important, for me the following features and traits of the top browsers are mostly quite similar and therefore not the primary decision factors.

  1. Performance and system resources. It is already many years back when Firefox was apparently slower than Chrome (and when Firefox was even missing native developer tools). If you watch this topic, you know that in some areas like memory consumption it might be even vice versa today. BTW we are still waiting whether Chrome will ever implement lazy loading of tabs on browser's start.
  2. Add-ons. Historically there were much more add-ons for Firefox. I admit I'm not sure how it is now and how strong are the communities of add-ons authors. As a user I can't see any dramatic differences now.
  3. Web pages functionality. Yes, there are some unfortunate exceptions when developers test or even target their page / app just at some browser, typically (and logically) at the wide-spread Chrome (while Edge uses the same engine beneath). That's something I can live with though.
  4. Security, blocking trackers. I consider this as a nice bonus of using Firefox. But having this as the main criteria to choose a browser? I'm not that paranoid and this area is also quite dynamic, so definitely not.
  5. License. Well, sure, Firefox being open source is great and promising, but do users generally really bother?
  6. Synchronization among devices, auto-play blocking, etc. etc. While once again Firefox beats for example Chrome in some aspects (see Mozilla's comparison), I find that browsers are mostly on par here.

What shouldn't matter at all?

Here come the 2 main topics that I've come across recently in articles which either promoted or reproved Firefox...

"Modern design / looks"

Firefox has got this new UI called "Proton" recently. While some promote this nearly as revolutionary, the only practical differences I can see are:

  • The new UI eats some extra vertical pixels "just for fun" of some crazy designer, but I can surely live with that, moreover when it may get changed soon.
  • I hope that they will bring back a page icon in the tab bar while there is a video / audio playing on that page.

All the other changes won't get into my view most of the time. Call me design ignorant if you want, but Firefox is basically still the same browser, with the same controls and UI layout that in principle cannot even be much different from the other browsers!

History

What happened happened, right? It's good to know how the various browsers evolved, so that we can better guess their future, but it is the present functionality that we should mainly talk about.

Summary

In short, I don't choose a browser because it is preinstalled, out of nostalgia or because it has a "modern UI" (whatever that means). I do choose a browser because of its functionality and because it makes me more productive than the other browsers. And I believe everyone should do the same and not to judge a browser if they haven't really actually checked it out and its full potential. Of course, your point of view may vary, but please try to be kind and as much as objective as possible. :)

Sunday, April 18, 2021

Localizing Pentaho reports - The missing pieces

Maybe you have already read the official documentation page Localize a report or the Hitachi's blog post Internationalization and localization of Pentaho Report Designer. Yet, you may still be unsure about the real possibilities of how to localize your Pentaho Reporting Designer reports. You can take this article as an addendum to the linked resources that will hopefully spare you some time on investigating the missing pieces of this functionality, including possible gotchas of the Designer.

Note: The localization functions were tested with version 9.1 of the Pentaho Report Designer and Pentaho Server.

The basic principles

Firstly, let me shortly recapitulate how localization is done in the Designer:

  1. The localization is based on the Java's well-known "Resource bundles" mechanism, where you store your translated texts in one or more .properties files. Every such file basically holds a list of "key-value" string pairs. Designer authors call them "resources" in general. In the case of Designer, these files may also be stored as a part of your report (.prpt ZIP file) - I reference them as "inner resources" below.
  2. When you want to have a text localized, i. e. automatically translated into the language used by the user of your report, you need to add one of these fields into your report: Resource Message, Resource Label, or Resource Field. Then, in the field's attribute called value, you enter the "key" matching a key from one of your resources. You can also, but do not have to, specify the resource-identifier attribute in order to use a concrete resource - we'll get to this in detail later on.

How can I name my resources within a report?

Well, while Designer lets you name your inner resources whatever you like, naming your resource other than "<resource-name>.properties" will just not work. This is caused by the fact that every resource is stored as a file and it is expected that it will have the .properties extension - but Designer doesn't automatically append this extension for you when storing an inner resource!

Be careful that even when you import a resource from an external file, Designer expects you to fill in the correct name of your new inner resource all by yourself. Moreover, renaming an inner resource is not supported.

As you can see, using inner resources can be quite tricky.

Is there a default resource for a report?

The answer is YES, the default resource is named translations. This means that when you don't fill in the resource-identifier attribute of a resource field, Designer looks for a text in the resource file named "translations.properties" (or in whatever language variant of that file, of course).

Oddly enough, there is not a single word on this in the official documentation, but it is mentioned in the blog post linked above. Finally, it looks like there is no way of how to change this default resource name on any level.

Where can I store my resources?

There are quite a few locations where Designer looks for the resource files. The files are looked up in the following locations, in order:

  1. Inner resources stored within the report.
  2. The same directory where the report file is stored. (Strangely enough, this doesn't seem to be documented.)
  3. Directory "[Designer Install]/resources", or "pentaho/WEB-INF/classes" in the case of deploying reports to a Pentaho Server. This is told to be a good location for resources shared among reports. I cannot quite imagine though that common report makers will get access to this Pentaho system folder.

We may say that the closer the resource file is to the report, the higher priority it gets.

What if I've got accents in my texts?

Whenever there is a character in your text that is outside the Latin-1 (ISO-8859-1) charset, it must be entered by using a Unicode escape sequence, e. g. "\u00A0" for the gold old non-breaking space character. There is no built-in support for easily editing these characters within the Designer's Resource Editor, which might be another reason for keeping your resources rather as external files.

We may expect there will be a support for storing texts in UTF-8 in the future, so that editing resources gets easier.

Conclusion

As you can see, Pentaho Report Designer offers quite a lot of possibilities when it comes to localizing reports. But there is also some undocumented stuff and some gotchas that I tried to make you aware of, hopefully successfully. :) I will be glad if you share your own experience and findings in the comments. Are they the same, or do you find some differences? I think it would also be cool to have a comparison with how localization is done in the competitive JasperReports solution...

Saturday, December 19, 2020

CopyQ - Quick diff texts

TL;DR

In short, you can use the power of CopyQ commands in order to quickly compare any two pieces of text - just copy the texts into the clipboard and run the Diff Latest Items command on them. As always, simply follow the installation instructions in order to install the command into your CopyQ instance.

As mentioned in the documentation page, you will also need a compare tool that can be invoked by the CopyQ command in order to do the actual comparison. The last step is, possibly, to modify a part of the command's code. This part looks like the following at the time of writing:

// Choose your favorite diff tool (leave just one execute(...) uncommented):

// === Beyond Compare ===
// reference: https://www.scootersoftware.com/v4help/command_line_reference.html
execute('bcompare', name1, name2)

// === WinMerge ===
// reference: https://manual.winmerge.org/en/Command_line.html
// execute('winmergeu', '/e', '/x', '/u', '/fl', '/dl', 'item1', '/dr', 'item2', name1, name2)

Note: In order to work, the program passed to the execute() command must be on the system PATH, otherwise a full path to the program needs to be specified.

Story of the Diff Latest Items command

I don't know how you, but I pretty much hate doing something that a computer can do for me instead. In regards of this post, it is finding out differences in texts. It might be the case of comparing similarly looking methods in a source code, or for example similar paragraphs found on different web pages.

Of course, one can use many different tools to do the comparison, but they usually require you to firstly have files created that are going to be compared.1 So, I was looking for a quick and universal solution. And once you get familiar with CopyQ, creating a simple CopyQ command just for that is the next logical step, and that is how the Diff Latest Items command got created. Well, I'm not the original author of it though. :)

I was playing with this idea in my head for several weeks and just on the weekend when I started with implementation, I searched for an example of how to create a temporary file from CopyQ (so that it can be fed to an external comparison tool). And instead of an example, I found this ready-to-use script that was created just a few days before! So at least I improved its documentation and also added support for my favorite tool WinMerge, job done. :)

Conclusion

And what about you? Do you have some other tricks of how to compare text chunks? Or have you also found this CopyQ's command useful? Don't hesitate to let all know in the comments. :)


1 If you use Eclipse IDE, for example, and you are lucky enough to come across the AnyEdit Tools plugin, you can e. g. compare a part of an opened file with clipboard contents pretty easily. Yet, this still requires some clicking "here and there" and we also know that startup times of IDEs like Eclipse are not the best. ;)

Saturday, October 3, 2020

Google Analytics - Easiest way of not counting your page views

There are many ways of how not to count your own pageviews (or page views) into the Google Analytics (GA) statistics of your web site. Most of them are described for example in 5 ways to exclude your own visits from Google Analytics.

Let's have a look at the way I find myself one of the easiest ones for individual users and for sites that you can't directly control - like this Blogger site. As a side effect, we will also learn some basics of the Tampermonkey browser extension.

How to do it generally

In order to block your own visits from GA, you don't need to setup special IP-based or cookie-based filters in the GA administration, nor you don't need to install any fancy extension to your web browser.

All we have to do is to create a simple JavaScript snippet for your browser that will set a page variable called "ga-disable-UA-XXXXX-Y" to "true" before the GA's JavaScript code is run within any visited page (see Opt-out of measurement for your site for documentation on this). The snippet basically needs to look like this:

window['ga-disable-UA-XXXXX-Y'] = true;

You only need to replace "XXXXX-Y" with the GA ID assigned to your site.

How to do it via Tampermonkey

In order to be able to run our code, we need to have an extension installed in our browser. We will use the well known Tampermonkey here - just follow the instructions on its home page if you don't have this extension installed yet.

We click the Tampermonkey toolbar icon and then select "Create a new script..." from the popup menu. An editor appears that lets us edit our new script (called "userscript"):

Tampermonkey: Create a new script.

Next, we change the "@name" and optionally also other metadata of the script to whatever we like. We also need to edit the "@match" line, so that the script is run on all pages of our site (note that an ending "*" is necessary!). And of course, we also add the line mentioned above. Then we save the script.

The resulting script looks for example like the following, for this Blogger site:


// ==UserScript==
// @name         Block GA on my pages
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  try to take over the world!
// @author       You
// @match        https://programmedbycoincidence.blogspot.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    window['ga-disable-UA-158769633-1'] = true;
    console.info('Disabled GA');
})();

Finally, we need to ensure the script is run before the page gets rendered. We click on the "Settings" tab and choose "document-start" from the "Run at" combobox:

Tampermonkey: Run our script at document start (the other fields shown are not relevant).

Now when we visit our site, we should see that our script was executed - both from the Tampermonkey toolbar icon indicating one userscript was executed, as well as from the console output:

Seeing that our script was run on a visited site page.

As the last step, we should also see our GA console and make sure our visits are no longer counted.

When we have more sites

If we need to block another site, we just add another "@match" line with an expression matching that site and another "window['ga-disable-UA-XXXXX-Y'] = true;" line to the script.

And that's all, folks. :)

Sunday, March 22, 2020

CopyQ - The most useful commands

In this post, we will look at some of the most useful CopyQ commands that are either built-in, or that can be additionally imported from a dedicated project on GitHub. If you are unsure what CopyQ or its commands mean, or what are the various types of commands, I recommend you to read the quick introduction to CopyQ first.

Note: There are simply too many commands available to name them all, so what follows is just a selection of commands which I myself currently find generally the most useful. It's quite likely that depending on the stuff you do and applications you use, your selection of favorite commands might be different.

Built-in commands


Built-in commands are the commands which can be easily added to CopyQ via the "Add" button of the Commands window, as shown in the following screenshot:

CopyQ's "Add commands" dialog, listing all the built-in commands.

Command: Paste clipboard as plain text (global)


More often than not one needs to paste a clipboard content without any formatting. And that's exactly what the global command "Paste clipboard as plain text" does. This function is already built-in to some programs, e. g. into the LibreOffice suite, but many other programs don't have anything like that.

CopyQ also offers a similarly named command: "Paste as Plain Text". It does the same thing, but you run it upon a selected item from CopyQ's history instead of using the current clipboard content.

And that's all from built-in commands. Still, there are commands which you might find useful in specific scenarios, so you can surely give them a try as well.

Commands from the GitHub project


There is a dedicated copyq-commands project on GitHub, maintained by the CopyQ's author, that one can use to easily get to plenty of useful commands. Another pro of this project is that you can suggest or contribute new commands there.

Let's have a look of some handy commands from this project now. Note that there is a small gotcha that the commands are often called differently than in the project's documentation.

Command: Import Commands after Copied to Clipboard (automatic)


[documentation]

As described at the project's home page linked above, this command saves you time when adding other commands to CopyQ - so that you don't need to enter all the command attributes manually.

Warning: If the copied text is a link to a command on GitHub, the automatic import doesn't have to always succeed due to a general SSL issue #1177.

Command: Big Data Tab (automatic)


[documentation]

If you copy too big items, searching in the clipboard history might get slow. That's when this command steps in and moves an item into a dedicated tab if the item exceeds a predefined size (counted as a sum from all the item formats - e. g. plain text + html1).

Of course, you can change this limit - right at the beginning of the script. But how to find out how big an item is, without scripting? Simply select an item and select "Show Content..." from the context menu (or press F4) and you will see the size in bytes in the follow-up dialog.

Command: Replace All Occurrences in Selected Text (global)


[documentation]

This is a simple find-replace text function which is not that powerful and I can imagine it could be taken at least one step further. Yet, it nicely demonstrates some of the CopyQ's capabilities for those who want to write their own commands - like:
  • triggering copy and paste system events,
  • showing a user input dialog,
  • or using various JavaScript / ECMAScript constructs, including RegExp functions.

Command: Snippets (global)


[documentation]

This powerful command is my favorite one. In short, this command extends CopyQ so that it can be used as a simple tool for snippets, or templates, if you like.

This command is quite nicely documented, so I will just illustrate its usage on the following example:

Imagine you write a blog post and you want to insert a footnote and a corresponding footnote link into the post. As this doesn't have to be directly supported by your blogging system, you can use the Snippets command for generating relatively complex HTML code chunks:

An example of a dedicated tab with custom snippets.

An example of the snippet selection dialog when the Snippets command is launched.

An example of the final dialog where values for placeholders are to be filled in.


Customizing the command

You may want to add the resulting snippet text as another item to history and not to paste it immediately. In the simplest case, you would have to change the function pasteSnippet() of the command script from this:

function pasteSnippet(mime, content) {
  copy(mime, content)
  copySelection(mime, content)
  paste()
}

... to this:

function pasteSnippet(mime, content) {
  copy(mime, content)
  copySelection(mime, content)
  tab('clipboard') // change this to whatever default tab name you use
  add(unpack(content))
}

Of course, I can't give any warranty on this, but it is supposed to work at the time of writing.

Conclusion


As you can see, you can use CopyQ not only as a simple clipboard manager, but thanks to commands you can extend its functionality in many ways. Don't hesitate to share your own experience with CopyQ commands in the comments!

1 Note that for texts copied e. g. from MS Word the size of clipboard content in the HTML format can be surprisingly high (like several kilobytes) even for short texts. This is due to all the extra styling information added to clipboard by the source application.

Saturday, February 22, 2020

CopyQ for the impatient - Introduction

CopyQ is a really handy clipboard manager. As its name suggests, it enables you to easily return to previous items in your clipboard, but as you will see later, it offers much, much more. Thanks to its scripting capabilities, it is also a handy automation tool. I'm a big fan of CopyQ and I think it deserves more promotion, so I decided to create this, hopefully useful wrap-up.

Why to use it, and not something else?


On AlternativeTo, CopyQ holds the 2nd position with 162 likes at the time of writing. The 1st place is occupied by Ditto with 304 likes, but Ditto has one big disadvantage: it is only for Windows. For me, CopyQ is also much better when it comes to options of running custom commands (scripting). Both apps are free and open source.

When talking about Windows, since a recent Windows 10 build, you might use their built-in clipboard manager as well (just try to press Win+V if you own one). But even without trying out, I'm sure it will be pretty much behind CopyQ & co. when talking about productivity-boosting features for advanced users - just read on!

Features


Firstly, to make a basic idea of the app, here is a screenshot of its main window:

An example of CopyQ's main window, illustrating some basic terms.


Here are the main distinguishing traits of CopyQ:
  • Runs and offers the same interface on Linux, Mac and Windows.1
  • Supports images as well as formatted text.
  • You can search the clipboard history easily (supports regular expressions).
  • It has a simple built-in editor of clipboard items.
  • You can control what gets into the clipboard history. And of course, the history is persisted among computer restarts.
  • If you want, you can control it from command line as well.
  • Nearly endless possibilities of customization, including running custom commands (see Commands).
  • A superb documentation (see Documentation).
And to mention some advanced "enterprise" features:
The only nice-to-have feature which is missing, is probably an automated synchronization of commands across multiple machines (e. g. in a company)...

Basic setup


So now that we know what CopyQ can do, how to make it run on our machine? We start by downloading an installer or a portable archive - simply follow the installation instructions.

Once the CopyQ is installed and running, we set a global keyboard shortcut for showing the CopyQ's main window. Firstly, we need to open the Configuration dialog from the system tray:


Secondly, we set the shortcut in the opened dialog:


Here we inspired from Ditto's default shortcut, which is Ctrl+` - i. e. hold down Ctrl and press the back-quote (tilde = ~) key.2

In the same dialog, we can choose whether we want immediate pasting after selecting a clipboard item from history, or not:



Add a tab for your favorite snippets


Next, we might want to add a tab for keeping our favorite code snippets (as seen on the very first picture above), or whatever we intend to use it for. This is as easy as pressing Ctrl+T in the main window:



Done!


Now we can just enjoy the CopyQ, let it maintain the clipboard in the background and use its main window and/or shortcuts whenever we need to return to a previous clipboard item, for example. The GUI and default shortcuts are pretty intuitive, so luckily there's only little to learn for the basic usage.

Documentation


CopyQ has a pretty good documentation and this post is definitely not meant to be its replacement. Beware though that there are some little gotchas:

  • The project's home page on Github contains some overlapping information (e. g. installation steps). And it is only here where you can see a quick overview of app's features.
  • If you by coincidence get to a project's wiki page like Basic Usage, run away - it got deprecated and replaced by the newer documentation.

Commands


Attention: It gets a little bit more technical in here!

Pressing F6 in the CopyQ's main window takes you to the management of commands:

An example of the Commands window. It shows the source code of one of the many built-in commands (selected & inserted via the "Add" button). Properties of the command are set in the "Advanced" tab.


While working with commands in CopyQ is great and thoroughly documented, I miss a quick overview of some concepts for newbies. So here is my little attempt to fix that (You might still want to read the official glossary page first.):

  • Commands are either built-in, or user defined. Every command is actually a readable script (with some necessary metadata - options). For the impatient: see this paragraph for various forms of the command scripts.3
  • Every command may be run in different contexts depending on what checkboxes get selected in its "Type of Action" options section. That is:
    • automatic (when there's a new clipboard item)
    • in menu (to run it over selected item(s); a shortcut may be assigned)
    • global (to run it at anytime when needed; a global shortcut may be assigned)
    • display (changes how items look like in the main window)
    • script (changes the default set of available functions, so a more precise name would be an "extension script")
  • If you don't see a built-in command, you need to explicitly add it to available commands via the Commands window (F6). Or, you can achieve the same effect by assigning a shortcut to the command in the Configuration dialog (Ctrl+P).
  • The Action Dialog dialog (F5) lets you run an ad-hoc command script instead of an existing named command. You have to explicitly select a "Standard input" for passing the content of selected item(s) to the script.
    Here's an example, showing a rather improbable scenario of converting a URL address to uppercase:

All-in-all, with CopyQ commands you can do lots of interesting stuff and there are many ways of how to create and use them. There is even a library of commands from the author(s) in a dedicated Github project called copyq-commands. Maybe in another post we will take a closer look at this!

Follow-up article: CopyQ - The most useful commands.

1 Ordered alphabetically.

2 Beware though that a keystroke which includes a key that maps to different characters based on the current keyboard layout (like Ctrl+`) doesn't have to work under all circumstances. See issue 1323 for more details.

3 As you may have guessed, the "copyq:" scripts are written in ECMAScript and you can call built-in CopyQ functions from them. So if you are familiar with JavaScript, you'll be like at home here.

Sunday, November 10, 2019

Being active in communities

If by a pure coincidence someone ever watched this blog, he may think for example that I gave up writing new posts. It's not quite like that. Maybe I got a little lazier, my priorities changed over time. But I was also a little bit more active in communities - and this is the topic I would like to write about this time - to give you some ideas of what and why, plus some real life examples.

Active in communities - what's that?


If you haven't guessed already, I mean software communities. And by being active in them, I mean direct communication with the authors or other users of a concrete piece of software, being it an application, library, framework or whatever else. Such communication is done via authors' bug tracking system, forum or for example by email if there is no better way.

When you do this, you typically report a problem, help to solve a problem, vote for solving a problem, or simply just ask a question. Some call this a contribution and such a contribution is usually expected to be useful - no trolling nor unintended stupidity is welcome. So better be prepared to formulate your thoughts well in this area.

Why being active?


Just a few paragraphs and we are already getting to the core of what I want to share with you. I'm so proud of my conciseness sometimes! ;)

So what's the point of being active in the communities? I can see several reasons:
  1. Better than to curse. Contributing has usually more positive effect than just to curse the software or their authors.
  2. Improvement of the software. More or less directly, your action may lead to improvement of the software or its documentation. If nothing else, then at least you somewhat increased awareness of some problem. And if there are enough people claiming the same, someone grabs the it and fixes it. A nice example: Eclipse 4 broken perspectives (Thanks to Andrey Loskutov for undertaking this software maintainers' nightmare!).
  3. Learning. You learn more about the software you use and you learn to express your thoughts in a clear way. You may also improve your language skills.
  4. The effect you wish. You may blog, tweet, etc., about the problem, but depending on your impact area this doesn't have to have the effect you wish. An example: I blogged about a very unwelcome Maven artifacts resolution "feature", but as I know that no one actually reads this blog, I linked to the post from the corresponding bug tracker issue.
  5. Easier than maintaining your local clone. It's not unusual that when you work with open source software, you make your locally maintained clone of it and put your custom features or bug fixes into the clone. Depending on your or your company strategy, this may suffice.
    But it turns out that contributing your patch to the original authors may be better because of all the positive side effects of doing so (easier or no merging of the changes when upgrading, authors or the community may give you a helpful feedback, maybe even tell you you are doing it wrong, etc.).
  6. Good feeling from doing something for the people and for the world. :) This may sound like a cliche, but let's have a deeper look at this...
    This is probably a topic for a separate post, but have you ever heard about Green Computing / ICT? Unfortunately there is plenty of software in our daily use that consumes resources for no good reason. Take for example all those background processes which start up your computer fan when you leave your computer idle for a while - this is nothing wrong if it takes some finite time. But when it has no end, such software needs to be considered broken, senseless and thrown away. It's like ordering a service for your company and the supplier tells you that it can deliver the service only when you stop all the work for 4 hours every day! Again, an example taken from an open source product which I quite appreciate otherwise: Alfresco CMS and its Solr indexing craziness.

More examples from practice


In the preceding text you could already read some real life examples of interaction with some of my favorite software products like Eclipse, Maven or Alfresco. Let's have a look at another interesting ones:

Activity with Jira


Well, Jira is surely a great bug tracking and projects management system, even when it isn't open sourced. Still, it has got some gotchas - long outstanding issues which kinda surprise me. (Add to this that Jira authors recently decided to completely "modernize" the good old main menu, which was quite loudly rejected by lots of users - I haven't watched the story for some time though...)

I think Jira is an example of where the results coming from community activity are often close to zero - a typical resolution of many issues is Won't Fix, without any useful explanation or workaround. And this is done even for issues which are both seemingly easy to resolve as well as highly upvoted, even by paying customers.

It starts with relatively small feature requests like:
  • Mousing over custom field name on view issue page shows only the field name in the tooltip, not the field description - JRASERVER-28503 (from 2012)
  • Unable to change issue link type - JRASERVER-3097 (from 2004!)
And it ends with some long outstanding WTF bugs (I mean: "How can they even exist in such an application?".). To name some that I have also participated in:
  • Unable to edit an issue when the user is deactivated - JRACLOUD-38412 (from 2014; after 5 years things seem to start moving - success finally?!)
  • Changing Default language and creating a new project creates unwanted Issue Types and Resolutions - JRASERVER-43539 (from 2015; a duplicate was created in 2018 and closed as well; hopefully a minor impact though)

Activity with KeePass


I don't use KeePass for that long, but after using it for a while I noticed an apparent security issue with passwords still being visible after KeePass restart - #2462. Even though I had to remind the issue to authors, a new option was implemented pretty quickly afterwards. The old behavior was not changed as I suggested, but be prepared that you can't always get all what you want - the final decision is always left to the authors.

And that was probably the final thought of this blog post. What do you think about the community contributions? Do you have some other or different experience?

Sunday, January 20, 2019

The biggest WTF new "feature" I've ever seen?

This is mainly to those familiar with Maven, the build and dependency management tool. Also a kind of "open letter" to the Maven authors. The tool itself is great, all respect to its authors. But let's just jump straight to the problem now...

The new feature, or better say problem


Since Maven 3.0 (year 2010), while building your project at work, you download some regular dependency, say from your company Nexus repository, you take your notebook home, where you don't have access to that repository, and out of the blue, Maven starts telling you the dependency is not there in your repository, in exactly the same like when you have never downloaded it at all. Still, you can see the dependency artifact in your local repository on the disk. But Maven won't build your project anymore, isn't that a nice new feature? ;)

How to make Maven work again


Luckily, there's a way out, you need to activate so called "legacy mode" for your repository:

a) put "-Dmaven.legacyLocalRepo=true" to your "MAVEN_OPTS" environment vairable,
b) pass an option "-llr / --legacy-local-repository" to the "mvn" command

Alternatively, you can remove "_maven.repositories" (or "_remote.repositories" since a newer Maven version) files from your local repository as the last resort.

And because Maven authors failed to at least introduce a special switch to disable just this academically useful "where did the artifact come from? is that repository still accessible? if no, I will fail the build, even if it is a released artifact version which should never ever change" check, you also get the following uncompromising warning whenever you build with "legacy mode" activated:

Disabling enhanced local repository: using legacy is strongly discouraged to ensure build reproducibility.

Isn't that nice as well? Because what you strive for actually is something like "build reproducibility". And you have no other simple way of achieving this than to activate that "legacy mode" (or playing around with those files which should be considered internal to Maven).

After 9 years...


Many years passed since the described problem arose. It is also evident from various reported bugs and forums that the community (read: people using Maven for serious work) didn't accept the problem and I do think that the majority wants the original (read: sane) Maven behavior back. Still, Maven authors seem to do nothing about it. So this problem keeps confusing, sooner or later, every new Maven adopter.

I wouldn't say a thing if there was at least some progress, but I just cannot see it anywhere after all the years. It's just me guessing, but it feels like one of those situations when one invests lots of work into some cool stuff, but then it turns out not to be so cool. Logic says you should throw the stuff away, but emotions tell you it is your little perfect baby and you won't abandon it that simply.

So in the light of what was said and written (and there are tons of it!), I beg you please, Maven authors, please go and let your baby go in an upcoming Maven version soon. Hopefully not only me will thank you... :)

Some of the reported bugs so far


Saturday, September 2, 2017

This year, I'm going to sea

No, I'm not actually going anywhere :) But have you noticed that there is something wrong with the post's title? Still nothing? Let's give you another two examples:

    "that is read..."
    => "... by anyone"?
    "that is a red..."
    => "... pen"?
    "there is nothing interesting in following..."
    => "... you on Twitter"?
    "there is nothing interesting in the following..."
    => "... paragraph"?

You've probably already guessed that I'm trying to highlight the importance of correctly using articles in English texts (or talks). Moreover, add some commas where they don't belong or don't follow the English word order system - the result is that your reader's attention will be distracted by all the mistakes and it will be harder for him to read your post, maybe skipping it altogether in an extreme case. From my experience, there is a surprisingly high percentage of people ignoring, or maybe not being able to fully appreciate this finding. OK, OK, you will most probably find some mistakes in my texts too, but you can't say I'm not at least trying ;)

<scientificInsertion>
A scientist would probably explain this better, but a human brain works as a kind of associative map, or a "pattern matcher", which, more or less willingly, tries to guess what comes next from the continuous input it receives. And it needs to throw away and reevaluate its conclusions if you supply it with invalid inputs which don't match the "carved" neural paths. And of course, this reevaluation takes some precious amount of time when one wants to quickly and efficiently read an article, for instance.
</scientificInsertion>

In fact, most of the English grammar rules are basically very simple when compared with other languages. So let's not be lazy and start using at least the articles correctly today, so we don't put unwanted "mental barriers" between us and our reader / listener, so we both can enjoy the reading / conversation. For non-native English speakers, it is not always easy to choose the correct article, but in most cases it is better than not to use articles at all. To take something similar from the IT world, it's like ever postponing doing a code refactoring in a hope there will be a "mythical cleanup project phase" for it (I'll get to this topic in a later post, maybe...), possibly leaving the refactoring stuff to a teammate. As a result, you won't learn this important skill needed to become a better developer...

And what is your experience? Are you pissed off by some forum posts so that you would better skip their reading altogether, or are you an opposite who does truly enjoy reading such posts? :)

Saturday, August 19, 2017

Eclipse Neon having Word wrap, say wow! ;)

All right, this is not the freshest piece of news (1+ year old), but who from regular developers like us has got enough time to play with "demo versions" ;) Anyway, in my opinion, having this "Word wrap" feature built-in is a good step forward. Look at Notepad, for example - even this minimalist editor offers you the word wrapping for ages already... :)

Of course, some may say you could always install and use the good old ahtik's plug-in, but mainly new adopters of the Eclipse IDE will be more happy that it is simply there, out-of-the-box.

I should maybe add that this feature is not perfect yet in some scenarios, but still, it "deserves the stripes". The latest information on this word wrapping topic can be seen at Stack Overflow (where else? ;)) - "Does eclipse have line wrap".

Tuesday, August 15, 2017

Foreword


Maybe you know the feeling of the need to write a not-that-private diary, to share your thoughts with someone, apart from "your only sane colleague from your work team", if you're lucky. So here it comes, yet another developer's blog... It nothing else, then it can make my English better.

Why the blog name "Programmed by Coincidence"? Well, I tried to think out a lot of different names, from the already-booked codeforpeople, favoritebytes or dontrepeatyourself, to still-free dryordie or kissanddry (footnote: someone quickly going to use them for their blog now, maybe? ;)). In the end, after letting my ideas settle down during a day, I came to programmedbycoincidence which I think "says it all" - it has got an IT word within, so nontechnical people will quickly run away, while also giving a small taste of irony, sarcasm, or whatever you'd call it. As experienced developers surely know, it points out a widespread bad programming practice. When one looks at it from one side, when someone starts to avoid this practice, he/she, with a dose of certainty, starts thinking about the code and its maintainability more, therefore also applying the good practices like DRY or KISS more. Finally, on a lighter note, we all are somewhat "programmed by coincidence", aren't we? ;)

So what am I to blog about in here? Not surprisingly, I'm going to write about interesting news and findings about my favorite programming tools, libraries, practices etc. These don't need to be interesting or likable to everyone, but well, that's life, isn't it. I will also probably share some criticisms on the various IT products, so that's why their authors, you should better get prepared... ;)

And yes, I do like using smileys :)