Yet Another Tech Blog

  • About
  • BBCodeXtra
    • BBCodeXtra – Custom Tags
    • BBCodextra – Menu Reference
  • Photos
  • Benefits of Intermittent Fasting in COVID-19 Times

    Quite a deviation from the technology focused articles that I usually post on this blog, but I have been thinking about this for a while, thanks also to COVID-19 lock-downs, and wanted to write down a few thoughts and notes.

    Premise: I’ve been obese or overweight for most of my life. My best guess is that I got close to 115 kg at my heaviest, and I would be considered tall only for a hobbit basketball team. I started keeping track of my weight when I was about 20 years old, and decided to do something about it, also because my knees and ankles were falling apart. Ignoring some set-backs – the dreaded yo-yo effect – I consider my efforts quite successful.

    I’ve learned a few things along the way. Not necessarily in order of importance:

    • Drastic changes won’t last. You can starve yourself and lose weight, but you’ll get that weight back, and some more. It’s not a matter of “if” but “when”.
    • Find a sport that you like, and use it to balance the calories intake instead of relying on drastic diets.
    • Learn to cook, stop eating crap.
    • Keep an eye on your weight. Stepping on a scale every day is not needed, once or twice a week is good.

    But, in the end, it’s mostly about finding something that works for you. Which brings me to the title of this post: intermittent fasting (or IF).

    A few years ago, I saw this documentary from BBC, called Eat, Fast, Live Longer (by Michael Mosley). I was quite skeptic at the beginning, but this turned out to be the “thing that works for me”.

    The concept is simple: you have periods where you can eat (often called “windows”), alternated to periods where you don’t eat anything, and you’re only allowed to drink water, tea, or coffee (without sugar or other additives). Some folks are less strict about the fasting period, but I personally stick to water, occasionally espresso coffee.

    There are different intermittent fasting patterns, the most common being:

    • 16:8 – You eat within a 8 hours window, then fast for 16 hours straight.
    • 18:6, 20:4 – Same concept, longer fasting period. The more extreme version is OMAD (one meal a day).
    • 5:2 – You eat for 5 days, then fast for 2 days straight (sounds fun, doesn’t it?).

    I tried 16:8 a few years back, skipping breakfast, but it wasn’t really working for me. About a year ago, I noticed my weight slowly but worryingly increasing (did I mention to keep track of your weight?), and decided to give it a try again. But this time I would keep track of what was happening, and how good I was at sticking to my goals.

    Normally I eat breakfast quite early in the morning (often well before 7AM), have lunch around 12, then a closing snack around 2PM. In case of social events, e.g. dinners, I would try to rotate my schedule, but without losing my mind if I couldn’t fast for 16 hours for a couple of days.

    Here are the results of 1 year worth of tracking weight and number of fasted hours (using an Android app called Zero), averaged by week.

    Graph of weight and number of hours fasting over last year

    On top of helping me lose more weight that I hoped for at my age, I realized how much IF helped me in COVID-19 times, while I work from home and personally cook every meal I eat. Here are a few benefits:

    • Having one meal per day helps limiting the calories intake, assuming weight loss is your goal.
    • I only need to cook – and wash dishes – once per day. It might seem a small thing, but working with a US company means that 4-8PM are my busiest hours of the day. So, dinner often ended up consisting of unhealthy food that didn’t require too much time or effort.
    • I sleep a lot better, since I don’t end up in bed with my stomach still working on digestion.
    • Energy levels are unaffected, or possibly positively affected. For example, earlier this year I lowered my half-marathon personal best by 6 minutes (around 1:50), and I’ve already exceeded my overall running goal of 1300 km for 2020.

    OK, but what are the negatives?

    • It works well for me because I live alone, and I’m not exactly a social animal. If you have to cook for someone else, or meals represent a social gathering in your family, then you need to adapt your schedule accordingly. And that means no breakfast, which is OK for some, terrible for others.
    • It would be challenging to organize my sport activities around a different schedule: running fasted is quite OK, but you are supposed to eat soon after exercising, and my body doesn’t seem to like running in the afternoon.
    • Medical conditions (e.g. diabetes) might require extra care, and IF could just not be suitable for some folks.

    As they say, “your mileage might vary”, but maybe it’s worth a try now that you’re likely stuck at home.

    November 12, 2020
  • Why Fluent Matters for Localization

    In case you don’t know what Fluent is, it’s a localization system designed and developed by Mozilla to overcome the limitations of the existing localization technologies. If you have been around Mozilla Localization for a while, and you’re wondering what happened to L20n, you can read this explanation about the relation between these two projects.

    With Firefox 58 we started moving Firefox Preferences to Fluent, and today we’re migrating the last pane (Firefox Account – Sync) in Firefox Nightly (61). The work is not done yet, there are still edge cases to migrate in the existing panes, and subdialogs, but we’re on track. If you’re interested in the details, you can read the full journey in two blog posts from Zibi (2017 and 2018), covering not only Fluent, but also the huge amount of work done on the Gecko platform to improve multilingual support.

    At this point, you might be wondering: do we really need another localization system? What’s wrong with what we have?

    The truth is that there is a lot wrong with the current systems. In Gecko alone, we support 4 different file formats to localize content: .dtd, .properties, .inc, .inc. And since none of them support plural forms, we built hacks on top of .properties to support pluralization.

    Here are a few practical examples of why Fluent is a huge improvement over existing technologies, and will allow us to improve the quality of the localizations we ship.

    DTDs and Concatenations

    You want to localize this simple fragment of XUL code without using JavaScript.

    
     Please sign in to reconnect 
    
    

    This turns into 2 separate strings in a DTD file, and a long localization comment:

    
    
    
    

    Why the empty string at the end? Because, while English doesn’t need it, other languages might need to change the structure of the sentence, adding content after the email address. On top of that, some localization tools don’t support empty strings correctly, not allowing localizers to mark an empty translation as a “translated” string.

    In Fluent, this is simply:

    sync-signedin-login-failure = Please sign in to reconnect { $email }
    

    One single string, full visibility on the context, flexibility to move around the email address.

    Plural Forms

    Plural forms are supported in Gecko only for .properties files. Fluent supports plural forms natively, and with a lot of additional flexibility.

    First of all, if you’re not familiar with the complexity of plurals across languages (limiting the discussion to cardinal integer numbers):

    • English, like many other European languages, only has 2 plural forms: n=1 uses one form (“1 page”), all other numbers (n!=1) use a different form (“2 pages”). Sadly, this makes a lot of people think about plural in terms of “1 vs many”, while that’s not really the case for most languages.
    • French still has 2 plural forms, but uses the same form for both 0 and 1.
    • Other languages can only have one form (e.g. Chinese), or have up to 6 different plural forms (e.g. Arabic). Fluent uses the CLDR categories (zero, one, two, few, many, other) to match a number to the correct plural form. For example, in Russian 1 and 21 will use the form “one”, but 11 will use “other”.
    • The behavior might change if the actual number is present or not. For example, Turkic languages don’t need to pluralize a noun after a number (“1 page”), but need plural forms in sentences referencing to one or more elements (“this” vs “them”).

    Consider for example this use case: in Firefox, the button to set the home page changes from “Use Current Page” to “Use Current Pages”, depending on the number of open tabs.

    If you want to use a proper plural form, you need to add the number of tabs to the string. In .properties, it would look like this (plural forms are separated by a semicolon):

    use-current-pages = Use Current Page;Use Current #1 Pages
    

    This will force languages to create all plural forms for their locales, even if they might not be needed. If your language has 6 forms, you need to provide all 6 forms, even if they’re all identical. Fun, isn’t it? Note that this is not just a limitation of the plural system used in .properties, the same happens in GetText (.po files).

    Here’s how Fluent improve things: first, you don’t need to add all plural forms, you can rely on the fall back to the default value (indicated by *), without raising any error:

                 
    use-current-pages =
         .label =
             {
                *[other] Использовать текущие страницы
             } 
    

    More important, you can match a specific number (1 in this case):

      
    use-current-pages =
         .label =
             {
                 [1] Использовать текущую страницу           
                *[other] Использовать текущие страницы
             } 
    

    In Russian, the “[one]” form would be also used for 21 tabs, while here it’s only used for 1 tab.

    Let’s assume the English message looks like this:

    use-current-pages =
         .label =
             { $tabCount ->
                 [1] Use Current Page
                *[other] Use Current Pages
             }
    

    Do you need to expose the number in your message and treat it like a standard plural form? You can:

    use-current-pages =
         .label =
             { $tabCount ->
                 [one] Use { $tabCount } Page
                *[other] Use { $tabCount } Pages
             }
    

    Do you only need one form? Again, you can simplify it into:

    use-current-pages =
         .label = Use { $tabCount } Pages
    

    or even:

    use-current-pages =
         .label = Use Current Pages
    

    Variants

    This is one of the most exciting changes introduced to the localization paradigm.

    Consider this example: “Firefox Account” is a special brand within Firefox. While “Firefox” itself should not be localized or declined, “account” can be localized and moved. In Italian it’s “Account Firefox”, “Cuenta de Firefox” in Spanish.

    A special entity is defined in order to be reused in other strings:

    
    

    For example:

    
    

    In Italian this results in “Connetti &syncBrand.fxAccount.label;”. It’s not natural, and it looks wrong, because we don’t capitalize nouns in the middle of a sentence.

    My only option to improve the translation, and make it sound more natural, would have been to drop the entity and just add the translated name. That defies the entire concept of having a central definition for the brand.

    Here’s what I can do in Fluent. The brand is defined as a term, a special type of message that can only be referenced from other strings (not code), and can have additional attributes.

    -fxaccount-brand-name = Firefox Account
    sync-signedout-account-title = Connect with a { -fxaccount-brand-name }
    

    And now in Italian I can do:

    -fxaccount-brand-name =
        {
            [lowercase] account Firefox
           *[uppercase] Account Firefox
        }
    sync-signedout-account-title = Connetti il tuo { -fxaccount-brand-name[lowercase] }
    

    While uppercase vs lowercase is a trivial example, variants can have a much deeper impact on localization quality for complex languages that use declensions, where the word “account” changes based on its role within the sentence (nominative, accusative, etc.).

    This is only the tip of the iceberg, there’s more you can do with Fluent, and the new localization API will allow us to drastically improve the experience for non English users in Firefox. Here are some additional links if you want to learn more about Fluent:

    • Project Fluent
    • Fluent documentation for Firefox Developers
    • Fluent documentation for localizers
    April 5, 2018
  • Goodbye Jooliaan

    Today is a sad day for Mozilla, not just for the Italian community but for the Mozilla Community as a whole. We just learned that Giuliano Masseroni, aka jooliaan, passed away last night.

    jooliaan, even if he hasn’t been active for a few years, had a crucial role in the growth of the Italian community and the creation of the legal association known as Mozilla Italia, as Vice President first, then President, and administrator of the local support forum. If you’re using Firefox in Italian, or seeking and getting help on the forum, it’s also thanks to his work and dedicated contribution.

    Today we’re sharing in the pain of his family and friends, remembering a person, a friend, who’s given a fundamental contribution to the history of the Open Source in Italy and Mozilla, and to our own lives.

    February 6, 2017
  • Test of PHP 7 Performances

    PHP might not be hugely popular these days, but it’s a fundamental part of the tools I use everyday to manage localization of web parts at Mozilla (e.g. mozilla.org).

    Today I’ve decided to give PHP 7 a try on my local virtual machine: it’s a pretty light VM running Debian 8 (2 GB ram, 2 cores), hosted on a Mac with VMWare Fusion. Web pages are served by Apache and mod_php, not by PHP’s internal web server, and there’s no optimization of any kind on the config.

    Since I and my colleague Pascal spent quite a bit of time improving code quality and performances in our tools during the last year or so, I already had a script to collect some performance data. I ran the test against Langchecker, which is the tool providing data to our Webdashboard.

    Existing version: PHP 5.6.14-0+deb8u1
    New version: PHP 7.0.0-5~dotdeb+8.1

    Time needed to generate the page

    TimeMemory consumption

    MemoryWhile the number of runs was pretty small (50 for each request), I got decently consistent results for memory and time. And the results speak clearly about the performance improvements in PHP 7.

    I don’t personally consider PHP 7 ready for a production environment but, if you can, it’s definitely worth a try. In our case the code didn’t need any change.

    December 19, 2015
  • Localizing BBCodeXtra

    If you never noticed the menu item in this blog, I’m the developer of a small add-on for Firefox called BBCodeXtra: it’s an extension, started about 10 years ago, that makes posting on forums and other places (e.g. GitHub) a little less painful.

    This extension, currently at version 0.4.1, is localized in 16 languages: de, es-ES, fi, fr, he, it, ja, ko, pl, pt-BR, pt-PT, ru, sk, sr, th, zh-TW.

    For the first time in years, I’m going to release a new version that includes new features, and therefore new strings. While I obviously love localization and localizers, I don’t intend to work with localization platforms for an add-on with a very limited set of strings and infrequent updates.

    The new version (v0.5.0) will be released with all the existing languages enabled, but the new strings will be left in English (excluding Italian). Starting from the next version, I will drop locales that go below 60% unchanged strings (currently it’s about 70% for all locales).

    If you want to contribute updating your localization:

    • Source code is hosted on GitHub. Localizations are stored in /extensions/locale. If you’re already familiar with GitHub, great. If you’re not, you can try with this tutorial or try using the online editor available on GitHub.
    • If you want to receive an email before the next release, in case I have to add new strings and you want to localize them before release, send me an email at flod(at)lodolo(dot).net and I’ll organize a mailing list.
    May 18, 2015
  • Video Subtitles and Localization

    Let’s talk about localization and subtitles – not captions. From Wikipedia:

    “Subtitles” assume the viewer can hear but cannot understand the language or accent, or the speech is not entirely clear, so they only transcribe dialogue and some on-screen text. “Captions” aim to describe to the deaf and hard of hearing all significant audio content—spoken dialogue and non-speech information such as the identity of speakers and, occasionally, their manner of speaking – along with any significant music or sound effects using words or symbols.

    So far I worked on two projects that involved subtitles – Web We Want and Firefox: Choose Independent – and this is what I learned in the process. (more…)

    January 15, 2015
  • 2014 – My Q4 [:flod]

    FirefoxOne of my many resolutions for 2015 is to blog more, both here in English and on my Italian blog, which just turned 10 last September.
    Keeping a diary of what happened in the last months can be useful, and it’s definitely a good exercise for me, so I’ll try to make a habit of posting a summary of my quarters like my teammate Pascal does.

    (more…)

    January 3, 2015
  • l10n: String Length and Verbosity across Languages

    A few months ago I was discussing with @kaze about the truncation plague on Firefox OS, and he came out with a sentence that left me doubtful:

    according to the desktop metrics I had, French is the least compact locale and Chinese is the most compact one

    So I had to check it somehow 😉 (in Italy they would call me Saint Thomas for being skeptical).

    The basic idea was simple: use Silme to analyze all locales available in Mozilla l10n repositories, comparing string lengths between English and another language.

    Here’s the resulting Python script (beware my slowly improving programming skills) and a table with the results (data can be sorted by clicking on column headers).

    Sample and Reference

    I’m using mozilla-beta as a reference, and comparing each locale against en-GB. Why not en-US? The reason is simple: en-US strings are scattered across the entire mozilla-central repository, so I should do tricks like Transvision in order to create a pseudo en-US string-only repository. Using en-GB leads to less precise results (see below), but for the sake of this analysis I considered it an acceptable compromise.

    I’m not checking all folders, only the main ones (‘browser’, ‘dom’, ‘mail’, ‘mobile’, ‘netwerk’, ‘security’, ‘services’, ‘suite’, ‘toolkit’, ‘webapprt’). This still generates an archive of almost 18,000 strings for locales translating all products, so it seems a decent sample.

    Caveats and Weird Results

    String 1: en-GB 2 characters, locale X 4 characters -> +2 characters, +100%
    String 2: en-GB 8 characters, locale X 4 characters -> -4 characters, -50%
    Average for locale X: -1 characters, +25% (sum of differences divided by total number of items).

    Not sure if this is the best choice, but I couldn’t think of an alternative. Note also that I’m ignoring single character strings (access keys, shortcuts).

    In the table you’ll see a global column (average results) and “buckets”, with string groups based on en-GB original length. Too bad these groups are often unreliable because of the “concatenation conundrum”, where one string could be created by concatenating 3 different labels.

    Typical example to create a sentence with a link (note that concatenation should be always avoided):

    sentence.before = Hey, this is a
    sentence.link = very interesting link
    sentence.after = .

    In Italian this could be localized as

    sentence.before = Ehi, questo
    sentence.link = link
    sentence.after = è veramente interessante.

    Do you see what just happened here? Length comparison based on groups just became less interesting, both averages and maximum/minimum differences.

    Anyhow, here’s a good image (graph based on global difference in percentage) that I’d like to call “Why using English as a reference for designing UI may not be a great idea”.

    Length Comparison - mozilla-beta
    Open link in a new tab/window to see the full image

    Why not use Gaia directly?

    This sounds like a good idea: we have a real en-US repository, and we don’t have concatenations. But there are some disadvantages as well:

    • Most locales already did at least two rounds of QA, so a lot of strings have already been (heavily) shortened to fit in the UI. So data could be less useful and interesting.
    • Several locales are incomplete on gaia-l10n. For this very reason I excluded all locales with less than 1000 strings translated.

    Here’s the same table for Gaia. And, again, a similar graph based on global difference in percentage.

    Length Comparison - GaiaOpen link in a new tab/window to see the full image

    Fun facts:

    • We know that en-GB is 0.16% longer than en-US, at least on Gaia.
    • A simple word as “OK” (2 characters) can become as long as “Kulungile” (9) in Xhosa, or “Ceart ma-thà” (12) in Scottish Gaelic.
    December 27, 2013
  • Summit 2013 planning assembly: a wonderful begin

    Note: this is a guest post from Iacopo Benesperi, a fellow Mozillian from the Italian community.

    This week-end took place in Mozilla’s Paris office the Summit 2013 planning assembly: a gathering of about 65 people from all around the world and representing all areas of the Mozilla project, with both paid staff and volunteers, aimed to plan and shape the next Summit, that will take place the first week-end of October in Bruxelles, Toronto and Santa Clara.

    TL;DR: it’s been a great assembly. If we manage to accomplish at the next Summit half of the things we’ve discussed in this week-end, it will have been the best Mozilla event ever.

    The aim of the assembly was not to define a schedule for the event and fix everything but to talk about which are the important topics that animate the Mozilla project these days, start to discuss them and shape them in a way so that we can come out with a good format for the Summit to address them and try to give and propose solutions for them. To do this, all the planning committee has taken interviews to fellow Mozillians in the last month to have a wider view of which is the temperature of the project in these days and act as a representative for the comments expressed.

    I went to Paris without a clear idea of what we would have accomplished there, but I’m impressed with the result we had.
    First of all, this assembly was facilitated by people of unconference.net, who proposed a peculiar way to proceed with it. I was a bit skeptic with the method proposed, but it turned out that some of their methods are really great (like unpanel) and we will definitely adopt them for the next Summit, while some others still look like rubbish (I may still be proved wrong).
    The second important fact is that we talked little about technology and a lot about Mozilla, its community, its communication (internal and external) and the interactions between its components and people. On one hand, as Gandalf pointed out, this is a sign that we trust implicitly our technology and the fact that it will be discussed at the Summit, because this is a big portion of what Mozilla is about. On the other hand, it’s a sign that there’s a general awareness, not only among community members but also (finally) among employees and paid staff and board of directors that we have communication problems between the different parts of the projects and especially between paid staff and volunteers, and the time is now mature to address and try to solve them. What I’m talking about is not only communication to get things done but also communication related to the decision-making process.

    So, it will be interesting to experiment discussions around different time-zones and locations. I will probably post more about the assembly and the planning for the Summit in the next days, when ideas and thoughts will have settled down a bit and I’ll have had the time to read all the ideas and documentation we produced during this two days. What I felt important to communicate immediately is the fact that the next Summit will be a wonderful occasion to talk not only about our technologies but also about who we are, what we want to do and where we want to go. It will be an occasion for the community to teach and mentor the newest community members and more importantly all the new employees to let them understand and feel the power and importance of our community and it will be, in general, an occasion to have our voice finally be heard and taken into consideration not only in the tasks at hand, but in building the new policies and guidelines that will drive all the project in the future.

    I’m sure we’ll try, in the next months, to provide some initial information and documentation about what have been discussed and decided so far so that you can arrive at the Summit prepared to give your contribution to the conversation, so that we can take the most out of the Summit and make it really matter in our future.

    As I said at the beginning: if we manage to discuss and propose solutions to half of the problems and concerns raised during this two days, we will have had the best Mozilla event ever; one that will have strengthened and made our project more mature.

    June 17, 2013
  • Mozilla Italia at Fa’ la cosa giusta 2013

    Last weekend, March 15-17, Mozilla Italia took part in Fa’ la cosa giusta 2013 in Milan (Fa’ la cosa giusta means Do the right thing!). For our association this was the fourth time in this particular event: we participated from 2007 to 2009, then we moved to Florence for a couple of years (event called “Terra Futura”) and took a break in 2012. In Milan there were six active members from our community, which is quite a gathering considering how spread we are through Italy, and two guests who helped us during these three days.

    Mozilla Italia a Fa' la cosa giusta 2013

    Citing from the official site: Fa’ la cosa giusta is a fair about ethical consumerism and sustainable living, with over 700 exhibitors hosted on 29,000 square meters. This year edition had more than 72,000 visitors, among them 3,300 students from 17 different schools.
    The number of tech-related exhibitors is always quite limited: for example near our booth there was an area where people from Ubuntu and Document Foundation had talks about their communities and their products, there were also other realities like a lab which takes in old IT hardware (printers, computers, etc.) and restore them, or even low cost 3D printers (Waspproject).

    Taking part in this kind of events, compared to more tech-oriented exhibitions, has some positive aspects. For example trying to explain the Open Web, or the importance of web standards and diversity to people who can’t really understand the difference between a browser and a search engine is quite a challenge (Q: “What software do you use to browse the Internet?” A: “I use Google.”). At the end of these three days we welcomed a lot of people at our booth, even a couple of puppies: some of them wanted help for some problems they were having with Firefox or Thunderbird, some others wanted to know more about Mozilla or just say hello to us.

    More frequently questions: what is Mozilla? Why are you here, how do you fit in? In some ways answering this last question was the most interesting: what Mozilla does, how Firefox and all other products are created by a non-profit organization and a unique community equally built on employees and volunteers from around the world, what we do as an association in Italy, how our ideals and principles help creating and driving initiatives like WebMaker or WebFWD. And then see these people agree with us 🙂

    Fa' la costa giusta 2013 - Mozilla Italia

    On Saturday and Sunday the main point of interest was this developer phone running Firefox OS. A lot of people stopped by to see and try the phone: some of them knew the project, thanks to the good coverage of the last MWC 2013 in Barcellona, others didn’t know it at all and wanted to understand what Mozilla is working on. Again, there were questions a lot more frequent than others:

    • How and when will Firefox OS be commercialized? Distribution should start soon in some countries (e.g. Spain, Brazil, Poland, etc.), and then cover other areas. In the meantime people, in particular those interested in developing Apps for the new OS, can try Firefox OS with an emulator or desktop builds.
    • When will Firefox OS be available in Italy? Well, we don’t know 😉 Personally I hope at some point during 2014, considering that Telecom Italia is listed among the partners on the official page.
    • Will I be able to install Firefox OS on my phone and replace Android/Windows? It depends, but it can’t be excluded given the open nature of the project.

    I made a set of photos on Flickr, considering the amount of people stopping at our booth I wasn’t really able to shot many photos. Enough said: at the end of those two days I almost had no voice left 😉

    March 25, 2013
1 2 3 … 6
Next Page→

Yet Another Tech Blog

Proudly powered by WordPress