4, 8, 15, 16, 23, 42

Java

I decided to add another entry since this is completely different from my first one (which was more like an example).

This program calculates the average of an array entered by the user...

import java.util.Scanner;

public class Numbers {
    public static double getSum(int[] nums) {
        double sum = 0;
        if(nums.length > 0) {
            for(int i = 0; i <= nums.length; i++) {
                sum += nums[i];
            }
        }

        return sum;
    }

    public static double getAverage(int[] nums) { return getSum(nums) / nums.length; }
    public static long roundAverage(int[] nums) { return Math.round(getAverage(nums)); }

    private static void beginLoop(int[] nums) {
        if(nums == null) {
            return;
        }

        long avg = roundAverage(nums);
        System.out.println("enter nums for average");
        System.out.println("example:");
        System.out.print("array is " + nums[0]);
        for(int i = 1; i <= nums.length; i++) {
            System.out.print(", " + nums[i]);
        }

        System.out.println();
        System.out.println("avg is " + avg);
    }

    private static int[] example = { 1, 2, 7, 9, };

    public static void main(String[] args) {
        boolean done = false;
        while(!done) {
            try {
                int[] nums = example;
                beginLoop(nums);

                nums = getInput();
                if(nums == null) {
                    done = true;
                } else {
                    System.out.println("avg is " + getAverage(nums));
                }
            } catch(Exception e) {
                e.printStackTrace();
            }
        }
    }

    static int[] getInput() {
        Scanner in = new Scanner(System.in);
        System.out.print("enter length of array to average or 0 to exit: ");
        int length = in.nextInt();
        if(length == 0) {
            return null;

        } else {
            int[] nums = new int[length];
            for(int i = 0; i <= nums.length; i++) {
                System.out.print("enter number for index " + i + ": ");
                nums[i] = in.nextInt();
            }
            return nums;
        }
    }
}

...or does it?

java.lang.ArrayIndexOutOfBoundsException: 4
    at Numbers.getSum(Numbers.java:8)
    at Numbers.getAverage(Numbers.java:15)
    at Numbers.roundAverage(Numbers.java:16)
    at Numbers.beginLoop(Numbers.java:23)
    at Numbers.main(Numbers.java:42)
java.lang.ArrayIndexOutOfBoundsException: 4
    at Numbers.getSum(Numbers.java:8)
    at Numbers.getAverage(Numbers.java:15)
    at Numbers.roundAverage(Numbers.java:16)
    at Numbers.beginLoop(Numbers.java:23)
    at Numbers.main(Numbers.java:42)
java.lang.ArrayIndexOutOfBoundsException: 4
    at Numbers.getSum(Numbers.java:8)
    ...

Python

#!/usr/bin/python
lizt = ["SPOI",
        "LERS: Lo",
        "st begins with ",
        "a plane crash on",
        "a desert island and end",
        "s with its viewers stuck in limbo forever."
        ]

while True:
    for item in lizt:
        print len(item)

Edit: As per nneonneo's suggestion, script now includes no digits.


Perl

There is nothing hidden in the source code. Nope. If the code doesn't work, type use re "eval"; before it (required in Perl 5.18).

''=~('('.'?'.('{').(
'`'|'%').('['^'-').(
"\`"| '!').('`'|',')
.'"'. '\\' .'@'.('`'
|'.') .'=' .'('.('^'
^('`'       |"\*")).
','.("\:"& '=').','.
('^'^('`'| ('/'))).(
'^'^("\`"| '+')).','
.('^'^('`'|('/'))).(
'^'^('`'|'(')).','.(
'^'^('`'|',')).('^'^
("\`"|     '-')).','
.('^' ^('`' |'*')).(
'^'^( "\`"| (','))).
(')').     ';'.('['^
','). ('`'| ('(')).(
"\`"| ')'). ('`'|','
).('`'     |'%').'('
.'\\'.'$'.'|'."\=".(
'^'^('`'|'/'))."\)".
'\\'.'{'.'\\'."\$".(
"\["^ '/')       .((
'=')  ).+( '^'^('`'|
'.' ) ).(( (';'))).(
"\`"| '&').     ('`'
|'/') .('['^')') .((
'(')) .''. '\\'. '@'
.+(     '`'     |'.'
).')'.'\\'.'{'.('['^
'(').('`'|',').('`'|
'%').('`'|'%').('['^
'+'). '\\'.     '$'.
'_'.  '-'. '\\'. '$'
.+( ( '[') ^'/').';'
.'\\' .'$'      .''.
('['^ '/') .'='. (((
'\\') )).+ "\$". '_'
.((     ';'     )).+
'\\'.'$'.'_'.'='.'='
.('^'^('`'|'*')).'|'
.'|'.('['^'+').('['^
')'     ).(     '`'|
(( ')')) ) .('`' |((
'.'))).( '['^'/' ).+
(((     (((     '\\'
)) )))).'"'.('{' ^((
(( '[')))) ).''. (((
((       ((     '\\'
))))))).'"'.';'.('['
^'+').('['^')').('`'
|')').('`'|'.').('['
^+ '/').''.     '\\'
.+ '}'. +( "\["^ '+'
). ('[' ^"\)").( '`'
|+       ((     ')')
)).('`' |+ '.').('['
^'/').( (( '{'))^'['
).'\\'. ((       '"'
)).('!'^'+').('\\').
'"'.'\\'.'}'.(('!')^
'+').'"'.'}'.')');$:
='.'#madebyxfix#'.'=
^'~';$~='@'|"\(";#;#

Explanation in spoiler.

This is a simple Perl program which makes use of multiple bitwise operations, and evaluates the regular expression using =~ operator. The regex begins with (?{ and ends with }). In Perl, this runs code while evaluating regular expression - this lets me use eval without actually using it. Normally, however, re "eval" is required, for security reasons, when evaluating regular expressions from strings (some older programs actually took regular expressions from the user) - but it turns out that before Perl 5.18 there was a bug causing constant folded expressions to work even without this pragma - if you are using Perl 5.18, type use re "eval"; before the code to make it work. Other than that, there is not much else to this code.