Paypal donate button

Hi,

I added a donate button today :). If you would like to give me a tip, feel free, but be sure this will never be a must. You do not get stuff done quicker by me of you donate. I will not push this to TDF-blog as those who search for the donate option will find it, and those who don’t should not be bothered :) [I do not push this on social media as well]

Yours,

Florian

44alpha

Assertion errors – not only for devs

Hi,

So one difficult topic now. In his post I will throw around with things like precondition and code, but I really try to keep it simple.

So, let us first introduce the example. A “Linked-List”. What you need to know (just valid for this tiny example):

  • No element –> NULL
  • “->” is the link between elements
  • No element is an element
  • A list starts at “head”, so head is just the link to the first element

Let’s have an example. These are valid lists

  1. head->null
  2. head->1->2->3->null

The length of 1) is ZERO, of 2) THREE. That is most of the coding skills you need ;)

So, what are errors? You find them in LibreOffice as well as in all other software. It does not behave as expected, maybe resulting in a crash. That is quite obvious.  You can have invalid or simply unexpected input. As you can see in the above example, we do not expect to add the element “null” at position 1 [between 1 and 2] Would result in head->1->null->2->3->null (again sorry to all developers, I need easy examples).  So we are not allowed to add the element “null”, as this would result in changing the length of the list from 3 to 1, by adding one element. 3+1=1 okay, I guess that should not be like that…. So the code is a little bit inspired by Java, so sorry for the overhead ;)


public void addElement(int position /*A number from -2147483648 to +214483647*/, IntElement e /*Also a number like in our example, but it can have a link to a different IntElement*/){
assert e != null && LENGTH_OF_LIST >= 0;
if(head == null) //If we have an empty list
INSERTFRONT //We do not need to much detail here
assert LENGTH_OF_LIST == 1; //== means equals
return; //Exit the function here
}
int oLength = LENGTH_OF_LIST;
assert position >= 0 AND position <= LENGTH_OF_LIST;
INSERT_MIDDLE_LAST //Insert at the rest of the list
assert LENGTH_OF_LIST == oLength +1; // If adding succeeded the new length must be 1 greater than the old one
}

You can see some line start with “assert”. This are developer’s magic little helpers.

A function in mathematics and informatics has 3 conditions:

  1. Precondition –> How should the input should look like
  2. Post-condition –> How should the output / result of the function should look like
  3. Invariance–> What should be valid at the beginning and the end

Invariance

What should be at the beginning and at the end?  The length must be >=0.

Precondition

The inserted element must not be NULL and the length of the list must be positive (So this includes the invariance as well)

Post-Condition

If the list is empty –> Length is 1 (this includes the invariance)
If the list is not empty the new length must be by one greater than the old length. (this includes the invariance as well)

So, did you get the need? You can assure yourself that the input and output of a function (and if you want steps inside) are correct. So you cannot get any unexpected result, if assertions are enabled. Assertions are disabled by default, because they slow down a bit, but in LibreOffice Daily build from tinderbox 39  (downloadable @ SI-GUI atm) assertions are enabled.

So finally, an example (I only realized they were enabled because of this message:44alpha

 

So at line 1291 of winlayout.cxx an assertion failed (while testing bug # 77248) That’s a starting point for devs. The error might be near there ;) So yes, it makes sence to have assertions enabled and more to write them. If you write down how the output and the input should look like, everyone knows. You are turning implicit to explicit knowledge. And you will save hours to search for the place, where the error did occur. So please, and this is not limited to LibreOffice, have assertions enabled during testing!

And if you see such a dialog and remember the steps you did to come there, check if such a bug exists and comment with the exact version, or create a new bug. The exact version is needed, because this is the only way, that devs know on which version of the file they can find the failing assertion.

Global bughunt

SI-GUI stats

Hi,

So right after the bug-hunting session (ok, I am a bit late ;) ) I pulled the statistics today, and I want to share with you 3 things :) [Statistic is available here]

Global bughunt
It was global

Well, as far as I can tell from the SI-GUIstats it was a global success – with France as top nation, congrats Sophie and all the french QA team.

Downloadstats
4.3 a1 is #2

I do not know why you downloaded 4.1.5.3 so often,  but as of today alpha 1 of our next release is one of the most downloaded versions since we make the statistic

Good testers!

So, what do tester test? It’s great to see so many of you testing master and the test builds. This helps us to bring out a good “Fresh” branch (lb => latest branch). It is great to see you on the “Stable” branch as well (“ob” => Older branch) to catch anything there as well.

Pie cake where you can see all versions downloaded
Yes, we do release some versions ;)

Thanks for testing so many versions and helppacks :). You know, we always tell QA is not difficult so if you are on Windows, feel free to use SI-GUI, and please share your stats. It’s nice to see your product is used :D

DOCX is not pure XML

Hi,

So one more bashing post against OOXML from a TDF member? I see it more as a reflection as I had to create a non-binary (do not say anything about binary formats to save important data) for a homework from my university. And I realized that I made the very same mistake, it is just easier to explain…..

Anyway I start with bashing ;) The example I took is from here.

<!--?xml version="1.0" encoding="UTF-8" standalone="yes"?-->

<xml xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel">
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout>
<v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe">
<v:stroke joinstyle="miter"/>
<v:path gradientshapeok="t" o:connecttype="rect"/>
shapetype>
<v:shape id="_x0000_s1025" type="#_x0000_t202" style="position:absolute;
margin-left:203.25pt;margin-top:37.5pt;width:96pt;height:55.5pt;z-index:1;
visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto">
<v:fill color2="#ffffe1"/>
<v:shadow on="t" color="black" obscured="t"/>
<v:path o:connecttype="none"/>
<v:textbox style="mso-direction-alt:auto">
<div style="text-align:left"/>
</v:textbox>
<x:ClientData ObjectType="Note">
<x:MoveWithCells/>
<x:SizeWithCells/>
<x:Anchor>
4, 15, 2, 10, 6, 15, 6, 4</x:Anchor>
<x:AutoFill>False</x:AutoFill>
<x:Row>3</x:Row>
<x:Column>3</x:Column>
</x:ClientData>
</v:shape>
</xml>

So, do you find the mistake? What is not XML? It’s this line:

<x:Anchor>4, 15, 2, 10, 6, 15, 6, 4</x:Anchor>

So please keep that code fragment in mind…. I will continue with the story of my program. It is a sudoku program. (Wikipedia for Sudoku). What I want to achieve: A sudoku (for me, you can skip this it is not necessary) consists out of x boxes, where x is the total # of numbers. Each box of a sudoku has a height h and a width w.  x = w*h. w and h naturally have to be natural numbers starting from inclusive 2. This also means you have to store the width and height, as you will need them (A box can have 12 numbers and a height of either 3 ,4 or 6). The following shows the final XML file for a sudoku,

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sudoku>
<innerWidth>3</innerWidth><innerHeight>3</innerHeight>
<row>6 0 0 0 1 0 5 0 0 </row>
<row>8 0 3 0 0 0 0 0 0 </row>
<row>0 0 0 0 6 0 0 2 0 </row>
<row>0 3 0 1 0 8 0 9 0 </row>
<row>1 0 0 0 9 0 0 0 4 </row>
<row>0 5 0 2 0 3 0 1 0 </row>
<row>0 7 0 0 3 0 0 0 0 </row>
<row>0 0 0 0 0 0 3 0 6 </row>
<row>0 0 4 0 5 0 0 0 9 </row>
</sudoku>

So, do you see the parallel between this file (or a row-element of it) and the docx file? Although it should not be too difficult to get a sudoku out of this, it is no real XML…. Why? Because a row in fact is application encoded.  So

<row>1 0 0 0 9 0 0 0 4 </row>

should in a perfect world be

<row>
<cell>1</cell>
<cell/>
<cell/>
<cell/>
<cell>9</cell>
<cell/>
<cell/>
<cell/>
<cell>4</cell>
<cell/>
<cell/>
<cell/>
</row>

I am quite sure, that you realized it in the sudoku context, that it should not be a big problem, but

 <x:Anchor>4, 15, 2, 10, 6, 15, 6, 4</x:Anchor> 

And this could be 4 points x1,y1,x2,y2,x3,y3,x4,y4, but this would be a rect but no anchor. (As I really do not know what it is, but just want to give you an idea how tricky it could be ( means a “Test” property…):   ,  ,  ,  .

Just before the end please have a look at this line

21600r21600,l21600,xe">

coordsize=”21600,21600″: Ok, let us just hope it is pixel or distance from some corner of the page….

But you cannot tell me, that this is not application encoded….. Do you have a clue what it should be? I guess it is a curve (You see the coordsize here again)

path="m,l,21600r21600,l21600,xe">

I have written two articles about Microsoft office, you may find the first here. As always your thoughts are very much appreciated :D

About the business of Microsoft Office and why TDF’s projects are so important II – Strategy

As so many read the first part (you may find it here)

As the first part described the Office Open XML format, the history, we get a step back. Why is Microsoft Office so important still? It’s simple, because Microsoft knows what is best for their users (personally I like the ribbon-UI, but many don’t) and, this is from major importance, you are used to use it. You have been using it forever.

So yes, a reason why so many people are using it, is the laziness of many. Others might call that “never change a running system…

So let’s get young people used to office, so that they will pay forever. As long as you are a student, you can get MS Office for 20$ a year (You have to pay 80$ for 4 years), or if your university relies on MS Office, you can even get it for free. Good choice for Microsoft.

There is one thing I learned in strategy, it is a formula, but it is not quite Mathematics.

First Steps x Vision x Discontent > Resistance [This is not my idea]. If this is true, you are ready for a change. Okay first steps are easy, download LibreOffice ;). So what’s about the vision? Access your content, although the subscription ended? Seems like a good choice… Discontent: Do you dislike the current situation? Is the discontent high enough in order to learn something new (adapt the new software).There is one thing what have this very formula and mathematics in common. If you have no vision, no first steps or no discontent you won’t change anything. I tried to help you to get the first steps and a vision, but is the discontent high enough before it is too late. Now you can export all your documents to ODF and seamlessly switch to LibreOffice. I guess for many people, which bought a licence for Microsoft Office are soon shocked, as they are forced to pay to continue using them [Yes, I believe not everyone did get that licence model]. The bad thing the average end user, who does not know of this blog or LibreOffice or any other office software will be extremely annoyed, but the formula will look like this: 0 [What can I do to change this] x 100 [I can use this software for a lifetime and it is not my antivirus [I do understand why those need a subscription] x 100 [I am very angry at Microsoft] > 1000  [A magic number, which represents if a change happens. To cut it short: 0 > 1000 -> false –> no change is going to happen.

 

So the strategy is like that [AFAIK] : In young years free courses should be offered to the children, which should learn how to use office [“Informatics lessons” at school with “How to format a Word document”. Later they want a cheap or free office. You can use the formula from above again. You can use the software you have learned and worked with at a relative low price, you are very productive using it and you love all the features it has. Are you discontent? No, so you won’t change  your office suite. You might have third-party tools (Addins), which are only compatible with Microsoft Office, so why should you change. At the end of the university, (In Europe getting from 0 -> Master takes at least 10 semesters, 5 years), you paid 160$ (or 0$) to Microsoft, used the latest feature richest version and received as well as created a huge amount of documents. Now you have no discount any more, office costs 69$ per year. The price increased by 250%. Would you stick to MS Office [which they believe you would do] or would you change your office suite? The strategy is very good, will you play along? Looking foerward to hear your comments :)

About the business of Microsoft office and why TDF’s projects are so important I – Marketing

Are we living in world, where everyone has the same chances? Are we free in what we do and in which way we do it? Although all this questions seem very philosophical at first glance and improbable, no impossible, to answer for everyone. Sadly it is much easier to explain why this is, and why Open Source projects are so important for us.

When I was at school ( it is not different at university now) I was living in a world dominated by Microsoft. Do not understand me wrong, I do not have much against Windows, but for me it is impossible to switch to Linux. But what I will tell you about office software is in the exactly same way true for all other kinds of software.

At first there came an office

On university I had courses on marketing, I really try hard to get it down in a way that’s easy to understand. Microsoft’s Office came quite at the beginning (1989). The versions of office are the following:
1-3-4-7-8-9-10-11-12-14-15

As there were many 1.x versions, leaving out 2 might be reasonable, but what’s about the gap between 4 and 7? Believe me or not, that was only marketing. They even left out “unlucky” 13. After 11 major releases Office is broadly used nowadays, and whatever Microsoft does you are going to buy a new office with your next PC/Mac. Why will you? Because Microsoft owns your documents. Not close to “Facebook owns your photos”, but they own one right: The right to be the only one who can open and save your documents. So, you still can access your pictures on your hard drive, but not your office documents.

Office Open XML

That brings us to the year 2006, where Microsoft introduced a new file format, called Office Open XML, It is standardized (ISO/IEC 29500), so a new age begins. An age, where you not solely rely on Microsoft as everyone, really everyone can implement the standard and exchange documents. Ärm, to good to be true – right. Okay that was the “should” situation. Office 2007 is now (at the time of writing, used info from here) unable to open Office Open XML* (* I am speaking of Office Open XML, which is described in the standard. Microsoft calls that “Strict Open XML”).

Some facts now:

  • You saved your documents, your impression in a format, which can only be opened in one program (at that time [2006] ONLY Office 2007)
  • Apparently still we need reverse-engineering to free your content
  • (my opinion) Microsoft needed 3 additional years in order to get their standard implemented (beware: only import filter) and all in all 6 years for an output filter, which is capable of writing (Office 2013) and reading (Office 2010)….

Why Office Open XML??

For Microsoft it was from major importance to have a new file-format, which only can be opened by their product. That everyone needs to buy the new version. So do many other companies and also a well-known open-source project (Abiword).

Why no import for MS Office 2003?

Okay, I guess it was answered just one paragraph away from here, but I want to focus on something different here. Why not everyone is equal in today’s world. If you are unable to buy / your operating system is not supported by Microsoft you cannot access documents, which rely on this “standard”

Open Document Format

Some people (like me) think that the description of the Office Open XML standard is intentionally made so complicated, that they can say it is an open standard. In fact the import/export filters within LibreOffice are (as far as I am concerned) are based on reverse engineering. [As you likely won’t find loads of standard Office Open XML [docx, xlsx etc.] files in the wild….

So, good news for you: There is a broadly accepted standard, called Open Document Format, which is used in LibreOffice / OpenOffice. But it is not only used by us (I am working @ LibreOffice in my spare time), it is also supported in MS Office (ODF 1.2 with Office 2013, so do not wonder if you get messages like “this file is broken, we will try to repair it”. That means MS Office does not understand the new standard, or it’s a bug from them ;) ) If you want more infos about the adoption of ODF, please follow this link.

Wait…. One project is missing

Let’s start with the introductory video:

So what does the documentliberation project do? It straightens out the way from a world with proprietary formats to the open (document format) world, where the content belongs to you. Belongs means:

  • You have the choice which operating system you use – on MOST you will find a tool, which knows how to open ODF
  • On the 3 big operating systems (and on more like iOS and Android) YOU have the choice which software to use. You can compare them by functionality and price and choose the software, which fits you most

I admit you still need a software to display a document, but I cannot help you with that. If you want a list of all “liberated” formats, please refer to the original homepage.

 

I hope I could point out the importance of open standards. If you have any question, missing points, false information etc. please leave a comment.

EDIT: Make sure you have a look at the follow-up post

LibreOffice-Tankstelle

SI-GUI and BiBi-GUI updates

Hi,

It has been quite a long time since my last blog post. I am afraid this post could be just a little bit too long. That’s why I want to start off with a summary: I created a small tool called LibO Tankstelle [LibreOffice gas station], which has been used at Cebit, updated SI-GUI and BiBi-GUI. And I need YOU: You can help me test and improve Bibi-GUI. @Offtopic: I made a small game FYI

Long version after the break:

Continue reading

LibreOffice & more

Follow

Get every new post delivered to your Inbox.

Join 120 other followers

%d bloggers like this: