Skip to main content

Posts

Showing posts from 2021

Basic Python macros in Libre Office Calc

There are only a few Libre Office Python macro examples in the internet. Here are some basic macros: Insert the current time in the cell D1: from datetime import datetime def insert_time(*args):   desktop = XSCRIPTCONTEXT.getDesktop()  model = desktop.getCurrentComponent()  active_sheet = model.CurrentController.ActiveSheet  now = datetime.now()  current_time = now.strftime("%H:%M:%S")  active_sheet.getCellByPosition(3,0).setFormula(current_time)  return Delete contents of the Column A: def delete_column_contents(*args):   desktop = XSCRIPTCONTEXT.getDesktop()  model = desktop.getCurrentComponent()  active_sheet = model.CurrentController.ActiveSheet  column = active_sheet.getCellByRangeName("A:A")  column.clearContents(1) #unfortunately this code deletes numbers only   return Place a cursor on the cell A11 (it is more like a workaround, partly derived from this forum ): def gotoCell(*args):   desktop = XSCRIPTCONTEXT...

How to save a Box tree from caterpillars?

Caterpillars ate your Box tree? Don't worry, you can revive it! Just cut all branches and leave the stem only. Your Buxus tree will recover!

Making life decisions according to the sunspot number

When making life decisions, it is worth checking the sunspot trends. By having some life experience I can confirm that the my worst life decisions were made during the spikes in sunspot number: My worst life decisions and a sunspot number The picture above shows the dates of my worst life decisions: September 2011 November 2013 December 2020 Sunspots produce magnetic flares, which reach the Earth, and negatively affect humans. As you can see, in September 2011 the average sunspot number was above 100, and there was a huge spike in the sunspot number in the second half of 2011. My worst life decision was made in September 2011. In the second half of the 2013, there was also a huge spike in sunspot number, and the average monthly sunspot number was above 100. My second worst life decision was made in November 2013. Also we can see a huge spike in the end of 2020 – also one of the worst decisions was made, however, this time the average monthly sunspot number was below 100. So in general,...

The best Linux Distribution ever – Lubuntu Bionic Beaver 18.04.5 LTS!

For beginners, it is always difficult to choose the right Linux distribution. Everybody wants an easy configuration, an everlasting " snap feel ", a great stability and extensive information in forums. Lubuntu Bionic Beaver 18.04 LTS was my first distribution. I have been using it for 3 years. I really liked it. I would like to point out the major reasons, why it is so great! 1. The Ubuntu community is more willing to help, it is more likely to provide you with the required commands. I started to admire Lubuntu even more when I tried another distribution – Manjaro. After I configured everything in Manjaro, a black screen appeared after login. I could not find the solution, so I gave up on Manjaro. When I was searching for the solution, I learned that Manjaro people tend to explain everything in  a more advanced way, skipping various aspects, which beginners may come up with. For example one of the reasons of why I experienced a black screen, is probably the error of lightdm: ...