Luca Zanini
  • Home
    • Astronomy
    • Android
    • Java
    • Lotus
  • About me
  • Longest Collatz sequence

    Mar 25, 2013

    —

    by

    Luca Zanini
    in Uncategorized

    From the Project Euler Problem 14: The following iterative sequence is defined for the set of positive integers: n → n/2 (n is even) n → 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 → 40 → 20 → 10 → 5 →…

    Read more: Longest Collatz sequence

  • Attaching shared javascript and css code in a lotus form

    Mar 24, 2013

    —

    by

    Luca Zanini
    in Lotus

    The javascript and css code used in a lotus form can also be useful in other forms, and so it is best to save it only one time in a shared place. The pages works well for this purpose and in this post I explain how to create page containing JavaScript code and css and…

    Read more: Attaching shared javascript and css code in a lotus form

  • Getting the current document from a button in an embedded editor

    Mar 20, 2013

    —

    by

    Luca Zanini
    in Lotus

    Consider the following scenario: a lotus form containing an embedded view and an embedded editor, the 2 embedded controls are linked together according to targeting by linking an embedded editor to an embedded view. The embedded editor contains a button that tries to get the current document (often called uidoc) with the code: Sub Click(Source…

    Read more: Getting the current document from a button in an embedded editor

  • Varargs: passing a variable number of arguments to a method

    Mar 17, 2013

    —

    by

    Luca Zanini
    in Java

    From version 5 of Java you can call a method passing a variable number of arguments. A variable of this type is called varargs, you can only use in a method signature and its syntax is the primitive type or object type followed by 3 dots (ellipsis).

    Read more: Varargs: passing a variable number of arguments to a method

  • Large sum

    Mar 6, 2013

    —

    by

    Luca Zanini
    in Uncategorized

    From the Project Euler Problem 13: Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.

    Read more: Large sum

  • Validation of an Edit Box control in the XPages

    Mar 3, 2013

    —

    by

    Luca Zanini
    in Lotus

    In the XPages the “Edit Box” controls have some settings that allow you to perform simple validations. These settings are under the label “Validation” of the control and depend on the value of “Display Type” under the label “Data”; in the figure you can see a screenshot of the validation of an Edit Box control…

    Read more: Validation of an Edit Box control in the XPages

  • Highly divisible triangular number

    Feb 24, 2013

    —

    by

    Luca Zanini
    in Uncategorized

    From the Project Euler Problem 12: The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45,…

    Read more: Highly divisible triangular number

  • How to save the state of a WebView inside a Fragment of an Action Bar

    Feb 22, 2013

    —

    by

    Luca Zanini
    in Android

    The idea for this post came to me after reading the comment of Esthon Wood: “do you have any idea on how to save the state of the WebView? I mean, the webview refreshes everytime I tap on the tab.” in the post Tab Layout in Android with ActionBar and Fragment.

    Read more: How to save the state of a WebView inside a Fragment of an Action Bar

  • How to replace a Fragment in an ActionBar in mode NAVIGATION_MODE_TABS

    Feb 14, 2013

    —

    by

    Luca Zanini
    in Android

    In the post Tab Layout in Android with ActionBar and Fragment I wrote an example about tabs in an action bar where each label open a fragment that you can not change at runtime. In this post I explain how to replace a fragment with an other using a button.

    Read more: How to replace a Fragment in an ActionBar in mode NAVIGATION_MODE_TABS

  • Largest product in a grid

    Feb 4, 2013

    —

    by

    Luca Zanini
    in Uncategorized

    From the Project Euler Problem 11: In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98…

    Read more: Largest product in a grid

←Previous Page Next Page→