Author: Luca Zanini

  • Adding colors with OpenGL ES in Android

    In the post Drawing a triangle with OpenGL ES in Android I explained how to draw a triangle without setting the colors, indeed, the triangle is gray. In this post I add a few lines of code that allow you to change the color of the triangle starting from the code in Drawing a triangle…

  • Lattice paths

    From the Project Euler Problem 15: Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner. How many such routes are there through a 20×20 grid? checked In the first attempt I counted all…

  • How to fix a corrupted view of a lotus database

    I found this command to use on the console of the domino server to rebuild a specific corrupted view in a lotus database without rebuilding all the views of the database: lo updall -R [database] -T [view] where [database] is the path to the database and [view] is the name of the view.

  • Drawing a triangle with OpenGL ES in Android

    The scope of this post is drawing a triangle with OpenGL ES 1.x in Android focusing especially on the relationship between code and position of the triangle. The coordinate system has the origin where the observer is, with the x axis horizontal and rightward, the y-axis vertical and upward and the z axis points so…

  • Longest Collatz sequence

    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 →…

  • Attaching shared javascript and css code in a lotus form

    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…

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

    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…

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

    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).

  • Large sum

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

  • Validation of an Edit Box control in the XPages

    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…