Luca Zanini
  • Home
    • Astronomy
    • Android
    • Java
    • Lotus
  • About me
  • Getting the variables of the outer class from an inner class

    Jan 27, 2014

    —

    by

    Luca Zanini
    in Java

    The inner classes, and then not static, can access even if with some limitation to the variables of the outer class.

    Read more: Getting the variables of the outer class from an inner class

  • Truncatable primes

    Jan 4, 2014

    —

    by

    Luca Zanini
    in Uncategorized

    Project Euler Problem 37: The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3. Find the sum of the only…

    Read more: Truncatable primes

  • Double-base palindromes

    Dec 21, 2013

    —

    by

    Luca Zanini
    in Uncategorized

    From the Project Euler Problem 36: The decimal number, 585 = 10010010012 (binary), is palindromic in both bases. Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2. (Please note that the palindromic number, in either base, may not include leading zeros.) checked

    Read more: Double-base palindromes

  • How to implement Up Navigation

    Dec 19, 2013

    —

    by

    Luca Zanini
    in Android

    In this example you can see how to implement the Up Navigation, i.e. the option to go back to a previous activity using the button in the upper left of the action bar. The previous activity can be a fixed activity or an activity determined at runtime.

    Read more: How to implement Up Navigation

  • Circular primes

    Dec 15, 2013

    —

    by

    Luca Zanini
    in Uncategorized

    From the Project Euler Problem 35: The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97. How many circular primes are there below…

    Read more: Circular primes

  • Digit factorials

    Nov 30, 2013

    —

    by

    Luca Zanini
    in Uncategorized

    From the Project Euler Problem 34: 145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums…

    Read more: Digit factorials

  • Replacing a Fragment in a Tab Layout with an ActionBar

    Nov 17, 2013

    —

    by

    Luca Zanini
    in Android

    In the post Tab Layout in Android with ActionBar and Fragment the fragments can’t be replaced later, in this post I write the changes in order to replace the first fragment of the first tab with a third fragment using a button at runtime.

    Read more: Replacing a Fragment in a Tab Layout with an ActionBar

  • Digit canceling fractions

    Nov 16, 2013

    —

    by

    Luca Zanini
    in Uncategorized

    From the Project Euler Problem 33: The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that 49/98 = 4/8, which is correct, is obtained by cancelling the 9s. We shall consider fractions like, 30/50 = 3/5, to be trivial examples. There are exactly four non-trivial…

    Read more: Digit canceling fractions

  • The services in Android

    Nov 15, 2013

    —

    by

    Luca Zanini
    in Android

    A service is a task running in the background to perform actions without a user interface and they are used to perform long running operations with a significant use of resources by avoiding delays in the user experience. The services belong to one or both of the following categories: started: the service is launched using…

    Read more: The services in Android

  • Passing an object from an Activity to another

    Nov 13, 2013

    —

    by

    Luca Zanini
    in Android

    The method startActivity(Intent intent) of the class Activity allows you to call a second activity specified using the argument Intent. You can associate primitive data or primitive data array to the argument Intent and then the second Activity can access them, you can also pass objects of type String using methods of the class Bundle…

    Read more: Passing an object from an Activity to another

←Previous Page Next Page→
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.