Author: Luca Zanini
-
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…
-
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…
-
Highly divisible triangular number
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,…
-
Largest product in a grid
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…
-
Summation of primes
From the Project Euler Problem 10: The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. checked A processor Intel® Core™ i7-2720QM CPU @ 2.20GHz × 8 takes about 6 minutes to complete this calculation.