text:
Shortest script that gives the time passed since a Unix timestamp
What you need to do to win this challenge is to write the shortest "timeago" script that outputs the number of decades, years, weeks, days, hours, minutes, and seconds between a given Unix timestamp and the time the script is run.
You must give the time difference in "lowest terms", e.g. 1 week not 7 days, 9 years not 0 decades 9 years. You also must use plural forms correctly, e.g. 1 day not 1 days.
Your script must be accurate to within plus or minus 1 second (so the exact second rounding method is unimportant).
Time Equivalency Table
1 decade = 10 years
1 year = 31536000 seconds (not technically correct but close enough)
1 week = 7 days
1 day = 24 hours
1 hour = 60 minutes
1 minute = 60 seconds

The output should be of the form
A decade(s) B year(s) C week(s) D day(s) E hour(s) F minute(s) G second(s)

where A...G are all non-negative integers and the s is only there for plurals.
Notes

The timestamp will always be a time from the past. It may be negative.
Input and output may be anything reasonable: stdin/stdout, function input and return value, etc.
You may not use any tools that already do this. i.e. if your language has a timesince(timestamp) function built in you may not use that function.

I have vastly edited this to make it clearer in hopes to assuage the somewhat silly battle between new users with unclear questions and old users who require perfection. It was not a terrible question (though now it may be too similar to this).
Given that enough time is passed since the last answer, I declare Three If By Whiskey with its 177 bytes Ruby implementation the winner of this context!

So it has to be JavaScript? If not, where do the times come from?

"In the case of Javascript JQuery is forbidden :P Everything else is ok." -- is Zepto allowed, then?

The spec is kinda poor. Please provide an exact definition of what it is supposed to do - an example implementation doesn't suffice.

Is Timeago some new scripting language? Is updating every 30 seconds optional (as stated in one place) or a requirement (as stated in another)? What I/O mechanisms are acceptable? What rounding should be used? In particular, how does rounding interact with variable-length time periods such as calendar months and years? Some of these may imply follow-up questions depending on your answers.

Your title made me want to find out more, what was the task before it was removed?  And why does this restore of a backup have auto-correct, when the backup didn't o.0

@PopeyGilbert It doesn't seem to be something interesting anyway. The task was to create the shortest "timeago" script ;) Should I revert?

Ah no, don't worry.  I have this avid need to know things that I can't find out.  Once I can find them out it becomes less interesting =).

@PopeyGilbert No problem, you're welcome :) And I'm like that too :p

@Abdossam The issue is that the question was unclear. You never mentioned that 1408813114 was a Unix timestamp, something not everyone would pick up on. You also never specified the output format. Should we say 1 hour 7 days ago or 1 hour 1 week ago? That is why it is being voted down and closed, but it could still be salvaged.

@Calvin'sHobbies Thank you for the comment. I made it clearer by specifying the output format and what an Unix timestamp is with a link to Wikipedia, can you tell if it's any better?

Ok, another downvote. I fixed what I had to fix, what else is to be fixed guys? I'm nearly banging my head on the wall because I can't understand where it's wrong at this point

What exact units are used and what's the granularity? e.g. will month be used? year, decade, century, etc.? Do you allow negative timestamps? (I'd suggest not using month since it's variable.) What about I/O: stdin/stdout? (See PeterTaylor's comment above.)

The title sounds like Timeago is some new programming language. I'd suggest something like "Shortest script that prints the time passed since a Unix timestamp"

@Calvin'sHobbies The granularity is like the following: If less than a minute is passed since, it will be displayed as num seconds ago, if less than a hour is passed num minutes ago and so on. This means that even if 1 hour and 5 minutes is passed since it will be just displayed as 1 hour. As I said I/O is not important as long as it doesn't impacts the size of the final code. Why is there so much concern about I/O for this script? Is there something I missed? I changed the title now :)

I think this task might be challenging. But please, give a complete list of units and example output! (Do you expect years, months, weeks?)

This is code-golf. So of course I/O matters and impacts the final code length. print n is shorter than return n.

@Abdossam I know we all seem pretty fussy but it's because questions on this site are supposed to have objective winning criteria and a clear spec.

@Abdossam Didn't notice that you said all I/O was ok but it should say so in the question.

@Calvin'sHobbies Updated the question. I understand your motivations :)

@Falko I've updated the question to reflect your comment and added context. So, as long as it accomplishes the goal and doesn't impact the size of the final code you're good to go!

Two suggestions: 1) Leave out the HTML part. I guess nobody want's to write an HTML parser before being able to tackle the real task of printing times. 2) Make clear that you restrict to "second(s)", "minute(s)", "hour(s)" and "day(s)". You might add "week(s)" if you wish. But months and years are not that clearly defined (28-31 days / 365 or 366 days...). This should fix the major concerns with this question in my point of view.

Why didn't the shortest solution get accepted?

Ruby, 184 177
->n{x=Time.now.to_i-n;d=[3650*y=86400,365*y,7*y,y,3600,60,1];(0..6).map{|i|c=x/d[i];(x%=d[i]*c;"#{c} #{%w[decade year week day hour minute second][i]}#{c<2?'':'s'}")if c>0}*' '}

There's nothing particularly clever here, but I suspect it's still very close to optimal.
Example run
p ->n{x=Time.now.to_i-n;d=[3650*y=86400,365*y,7*y,y,3600,60,1];(0..6).map{|i|c=x/d[i];(x%=d[i]*c;"#{c} #{%w[decade year week day hour minute second][i]}#{c<2?'':'s'}")if c>0}*' '}[0]
"4 decades 4 years 41 weeks 3 days 14 hours 20 minutes 48 seconds"

J , 165
;' '&,@":&.>@((#~([:*&>{."1))@((;:' decades years weeks days hours minutes seconds')(],.([}.~[:-1=])&.>)<"0@(_ 10 52 7 24 60 60&#:)@(-~([:".@}:[:2!:0'date +%s'"_))))

Can probably be golfed more. Uses a shell call to date for getting the current unix epoch time, since Unix epoch is unavailable in J.
Example run:
;' '&,@":&.>@((#~([:*&>{."1))@((;:' decades years weeks days hours minutes seconds')(],.([}.~[:-1=])&.>)<"0@(_ 10 52 7 24 60 60&#:)@(-~([:".@}:[:2!:0'date +%s'"_)))) 0
4 decades 4 years 41 weeks 3 days 12 hours 54 minutes 1 second

Python - 183
import time;t=int(time.time()-input());d=86400
for f,u in zip((3650*d,365*d,7*d,d,3600,60,1),'decade year week day hour minute second'.split()):
 if t/f:print`t/f`,u+'s'*(t/f>1),;t%=f

Output for a timestamp 999996400 seconds in the past:
3 decades 1 year 37 weeks 46 minutes 39 seconds

Javascript, 287
function p(e,n){return e>2?e+" "+n+"s ":e+" "+n+" "}function t(e){n=new Date/1e3,l=e-n,c=1,m=60,h=60*m,d=24*h,w=7*d,y=365*d,a=10*y,s="",v={a:"Decade",y:"Year",w:"Week",d:"Day",h:"Hour",m:"Minute",c:"Second"};for(i in v)k=v[i],i=window[i],(r=Math.floor(l/i))>0&&(s+=p(r,k)),l%=i;alert(s)}

to run use t(secondsInFuture);

When I run t(10) I just get an empty alert.

Ugh, forgot the seconds, thanks @IngoBürk. To be clear its t(new Date()/1000 + 10);

Use ES6's fat arrow notation, also eval(i) is 2 bytes shorter than window[i].

JavaScript, 392
t=function(c){i=function(){var a=+new Date/1e3-c,b=document;29>a?b.write("just now"):60>a?b.write((a|0)+" seconds ago"):60<a&&120>a?b.write("1 minute ago"):60>a/60?b.write((a/60|0)+" minutes ago"):60<a/60&&120>a/60?b.write("1 hour ago"):24>a/3600?b.write((a/3600|0)+" hours ago"):24<a/3600&&48>a/3600?b.write("1 day ago"):1<=a/86400&&b.write((a/86400|0)+" days ago")};i();setInterval(i,3e4)};

Also the unminified code for the curious ones
t = function(timestamp){

i = function() {
var diff = (+new Date/1e3)-(timestamp),
d = document;

    if( (diff) < 29) {

        d.write( 'just now' )
    }
    else if( diff < 60) {

        d.write( ( (diff) |0 ) + ' seconds ago' )
    }
    else if( diff > 60 && diff < 120) {
        d.write(  '1 minute ago' )
    }
    else if( (diff)/60 < 60) {
        d.write( ( (diff)/60 |0 ) + ' minutes ago' )
    }
    else if( (diff)/60 > 60 && (diff)/60 < 120) {
        d.write( '1 hour ago' )
    }
    else if( (diff)/3600 < 24) {
        d.write( ( (diff)/3600 |0 ) + ' hours ago' )
    }
    else if( (diff)/3600 > 24 && (diff)/3600 < 48) {
        d.write( '1 day ago' )
    }
    else if( (diff)/86400 >= 1) {
        d.write( ( (diff)/86400 |0 ) + ' days ago' )
    }
  }

i()

setInterval(i, 3e4)

}

It updates every 30 seconds and calculates both singular and plural.
To run it use t(unix_timestamp)

Shouldn't you use fat arrow notation?

@user965091 Please avoid throwing around accusations without any proof via public comments on unrelated posts; if you think someone is using a sock account, flag a post of theirs for moderator attention. I see absolutely no reason to suspect any sockpuppetry here, and even if there was, such a discussion should not be had in public.

@user965091 I don't see how any of the comments here could be considered "provocations." In any case, rudeness is not tolerated on the Stack Exchange network. Please try to remain courteous to all users, regardless of whether you suspect they are breaking the rules or for any other reason.

Javascript, 263
i=[315360000,31536000,604800,86400,3600,60,1];s=['decade','year','week','day','hour','minute','second'];function g(d){return p(parseInt((new Date().getTime()-d)/1000), 0);}function p(d,n){k=d-d%i[n];r=k/i[n];return (r>0?r+' '+s[n]+'(s) ':'')+(n<6?p(d-k,n+1):'');}

to run from the Javascript console, call
g(unixTimestamp);

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Drawing Epicyclogons
An epicycloid is the curve a point on a circle makes as it rolls around another circle. A cyclogon is the shape a point on a regular polygon makes as it rolls across a plane. An epicyclogon is the curve traced by a point on one regular polygon as it rolls around another.
Write a program that draws an epicyclogon given r, r1, r2, n1, n2:
r = number of clockwise revolutions rolling polygon makes around stationary polygon (any real number as limited by float values)
r1 = distance from center of stationary polygon to each of its vertices (positive real number)
r2 = distance from center of rolling polygon to each of its vertices (positive real number)
n1 = number of sides stationary polygon has (integer greater than 2)
n2 = number of sides rolling polygon has (integer greater than 2)

Notes

When r is negative the roller should go counterclockwise.
For r, one revolution occurs when the line connecting the centroids of the two shapes sweeps out a full 360 degrees. This notion is expanded to include all values of r. (So in a quarter revolution the line connecting the centroids sweeps out 90 degrees.)
These arguments should come from the command line or your program should prompt for them (e.g. with Python's input()).
r1 and r2 are relative to each other, not the dimensions of the image. So you can set one "unit" to be any number of actual pixels.

The point you must trace out is one of the vertices of the rolling shape. The shapes must start with this vertex touching a stationary vertex and two sides adjacent:

The exact starting vertices and the angle of the stationary polygon do not matter.
Output
The output should go to an image that is at least 600x600 pixels (or some variable dimension than can be set to 600). It must show the entire epicyclogon curve specified by the parameters, well framed in the image.
The rolling and stationary polygons must also be drawn (with the roller in it's final state). The two shapes and the epicyclogon should be three noticeably different colors.
There must also be a simple way to not draw the polygons (a change of true to false in the code suffices).
Please show us at least 2 output images. It's ok to shrink them if necessary.
Scoring
The shortest code that produces valid output images wins.
Bonuses

Minus 50 bytes if the output is an animated gif (or similar) of the curve being drawn.
Minus 150 bytes if you let n1 and n2 take the value 2 so the shapes become line segments of length 2 * r1 (or r2), "rolling" around each other. How you handle r when n1 and n2 are 2 is up to you since the centroids don't revolve around each other the way they do in other cases. (Not "rolling" at all does not count as handling it.)

Since I am quite eager to see this novel idea executed well (and it's not exactly a cakewalk), I am going to award 150 bounty rep to the winner. The contest will end the same day the bounty runs out.
The bounty will not be awarded to the winner if it is clear that they simply rewrote most of the code from another submission.
Library functions that already happen to do this (if there are any) are not allowed.
Note: This came from my leftover questions that anyone is free to post. But if no one else posts them there's a good chance I will in time. :P

I think anticlockwise should be positive instead.

@SohamChowdhury I think it hardly matters.

You're right, actually.
Do you have any example images? I don't have the CDF player.

@githubphagocyte I see your point. Fixed.

@MartinBüttner Not too strict, it was just the first thing I though of. You can prompt for values in another way if necessary.

What about extraneous output? E.g. axes: do I have to remove them? Also, I don't see anything in your spec that the traced vertex has to be highlighted somehow, is that right?

@MartinBüttner Axes/gridlines/etc. are fine as long as the curve and polygons are clearly drawn. The tracer vertex does not need to be highlighted or anything.

@SohamChowdhury CCW positive is useful for graph coordinates, but with screen coordinates it's CW positive that's more natural.

If a program displays an animation to the screen but doesn't write it to a file, is that worth a -50 bonus?

@feersum Yes that's alright.

MATLAB: 735 bytes - 200 bonus = 535
My program handles the n=2 case and draws a real-time animation.
There are a few differences between the golfed and ungolfed versions:
The ungolfed version only has an option to save the animation to a file 'g.gif', by setting savegif = 1 in the code. It is off by default as it can be annoying for a few reasons:

Creation of an unwanted file
Possible lag
An error is generated if you have multiple monitors and the plot window is not on the right one...
The gif saving had to be dropped in the golfed version as it took about 100 bytes, exceeding the size of the bonus.

The ungolfed version draws a circle on the tracer vertex. It also produces more frames and moves faster (though this can be adjusted in the golfed version by changing the numbers).
Samples:
f(11,5,90,2,99,0) after program termination

epic(1.3,4,2,6,6,1) with gif output

Ungolfed code
%epicyclogon animation outputs to 'g.gif' if savegif=1 as well as animating in real time

function[] = epic(r,r1,r2,n1,n2,dispPoly)

savegif = 0;  %set to 1 to write .gif

cs = @(a) [cos(a);sin(a)];
vert = @(r, n, v) r * cs(2*pi*v/n);
polyPt = @(l, s, n, r) vert(r, n, floor(l/s)) + mod(l/s,1)*(vert(r, n, floor(l/s)+1) - vert(r, n, floor(l/s)));
polyPt2 = @(i, f, n, r) vert(r, n, i) + f*(vert(r, n, i+1) - vert(r, n, i));
rotm = @(a) [cos(a) -sin(a);sin(a) cos(a)];
arrpluspt = @(a, p) a + kron(p, ones(1,length(a)));
arg = @(p) atan2(p(2), p(1));

E = 1e-9;

dispPoly = dispPoly / dispPoly;

sgn = sign(-r);
r = abs(r);

s1 = 2*r1*sin(pi/n1);
s2 = 2*r2*sin(pi/n2);

%d1 = (r1*r1 - s1*s1*.25)^.5;
d2 = (r2*r2 - s2*s2*.25)^.5;

plotmax = r1+2*r2;

astep = .05; %determines amount of frames per rotation
delay = .01; % time per frame

l = 0;

lRem = 0;
lr = 0;

P1 = vert(r1, n1, 1:n1+1) * dispPoly;
trace = [];

first = 1;
while 1

    if lr %exists while rotating about a corner of the stationary
        rotA = 2*pi/n1;
    else
        rotA = 2*pi/n2;
    end
    rotPt = polyPt(l, s1, n1, r1);
    lb = l + lRem;
    side1 = floor(l / s1 - E);
    side1up = side1 + lr;
    p2cen = polyPt2(side1, lb/s1 -side1 - .5 * s2/s1, n1, r1) + d2 * cs(2*pi*(side1+.5)/n1);
    if first
        p2cen0 = p2cen;
        r = r + arg(p2cen0)/(2*pi);
    end

    for a = 0:astep:rotA
        P2 = vert(r2, n2, 0:n2);
        P2 = rotm( pi +pi/n1 -pi/n2   +2*pi*side1/n1) * P2;
        P2 = arrpluspt(P2, p2cen);
        P2 = arrpluspt(P2, -rotPt);
        P2 = rotm(a) * P2;
        P2 = arrpluspt(P2, rotPt);
        trV = mod(floor(l/s2 + E) + lr, n2) + 1;

        cen = rotm(a) * (p2cen - rotPt) + rotPt;
        trace = [trace,P2(:,trV)];

        plot(P1(1,:), sgn*P1(2,:), P2(1,:)*dispPoly, sgn*P2(2,:)*dispPoly, trace(1,:),sgn*trace(2,:),P2(1,trV), sgn*P2(2,trV),'o');

        %plot(P1(1,:), P1(2,:), P2(1,:), P2(2,:), trace(1,:),trace(2,:),...
        %[0,p2cen0(1)],[0,p2cen0(2)],[0,cen(1)],[0,cen(2)], P2(1,trV), P2(2,trV),'o');

        axis([-plotmax,plotmax,-plotmax,plotmax]);
        axis square
        figure(1);
       if savegif
           drawnow
           frame = getframe(1); % plot window must be on same monitor!
           img = frame2im(frame);
           [img1,img2] = rgb2ind(img,256);
       end
       if first
           if savegif
               imwrite(img1,img2,'g','gif','DelayTime',2*delay); %control animation speed(but not really)
           end
           first = 0;
       else
           if savegif
               imwrite(img1,img2,'g','gif','WriteMode','append','DelayTime', 2*delay);
           end
       end
       pause(.01);

        adf = mod(arg(cen) - r*2*pi, 2*pi);
        if adf < astep & l/(n1*s1) + .5 > r
            return
        end

    end

%cleanup for next iteration
    jump = lRem + ~lr * s2;
    lnex = l + jump;

    if floor(lnex / s1 - E) > side1up
        lnex = s1*(side1up+1);
        lRem = jump - (lnex - l);
        lr = 1;
    else
        lRem = 0;
        lr = 0;
    end
    l = lnex;
end

Golfed code
function[]=f(r,h,H,n,N,d)
P=pi;T=2*P;F=@floor;C=@(a)[cos(a);sin(a)];g=@(i,f,n,r)r*C(T*i/n)*(1-f)+f*r*C(T*(i+1)/n);R=@(a)[C(a),C(a+P/2)];W=@(a,p)[a(1,:)+p(1);a(2,:)+p(2)];b=@(p)atan2(p(2),p(1));E=1e-9;d=d/d;S=1-2*(r>0);r=-r*S;x=2*h*sin(P/n);X=2*H*sin(P/N);M=h+2*H;l=0;z=0;L=0;A=h*C(T*(0:n)/n)*d;t=[];while 1
v=l/x;D=F(v-E);q=g(D,v-D,n,h);Z=D+L;c=g(D,v+z/x-D-.5*X/x,n,h)+H*cos(P/N)*C(T*D/n+P/n);r=r+~(l+L)*b(c)/T;for a=0:.1:T/(L*n+~L*N)
O=@(p)W(R(a)*W(p,-q),q);B=O(W(R(P+P/n-P/N+T*D/n)*H*C(T*(0:N)/N),c));t=[t,B(:,mod(F(l/X+E)+L,N)+1)];plot(A(1,:),S*A(2,:),d*B(1,:),d*S*B(2,:),t(1,:),t(2,:)*S)
axis([-M,M,-M,M],'square');pause(.1);if.1>mod(b(O(c))-r*T,T)&v/n+.5>r
return;end;end;j=z+~L*X;J=l+j;L=F(J/x-E)>Z;l=L*x*(Z+1)+~L*J;z=L*(J-l);end

Instructions:
Save the function to a file with the same name, i.e. epic.m or f.m.
Run it by calling the function from the Matlab console.
Usage: epic(r, r1, r2, n1, n2, dispPoly)
where dispPoly is a Boolean variable (zero if false, a nonzero number if true) determining whether to draw the polygons.
Edit: Added bonus of 50 for animated image.

Java - 2,726 2,634 - 200 = 2434 characters
Improved from 3800 ish bytes
Thanks to all for your suggestions (especially pseudonym117), here is the new version.
I added a class P which is the point class and a class L which extends ArrayList
I also added some minor logic changes.
Here is the main class (not golfed):
import java.awt.*;
import java.awt.geom.*;

import javax.swing.*;
public class Polygons2 extends JPanel{
    public static void main(String[] args) throws InterruptedException{new Polygons2(args);}
    double q=Math.PI*2;
    int d=1;
    public Polygons2(String[] args) throws InterruptedException{
        double revolutions=Double.valueOf(args[0])*q;
        double stationaryRadius = Double.valueOf(args[1]);
        double rollingRadius = Double.valueOf(args[2]);
        int stationarySides = Integer.valueOf(args[3]);
        int rollingSides = Integer.valueOf(args[4]);
        double dist = stationaryRadius+rollingRadius+70;
        P sp = new P(dist,dist);
        P rp = new P(sp.x,sp.y-rollingRadius-stationaryRadius);
        //get points for rolling polygon and stationary polygon
        int key=0;
        for(double stationaryAngle=-q/4;stationaryAngle<q-q/4;stationaryAngle+=q/stationarySides){
            P p=new P(Math.cos(stationaryAngle)*stationaryRadius+sp.x,Math.sin(stationaryAngle)*stationaryRadius+sp.y);
            p.k=key;key++;
            stationaryPoints.add(p);
        }
        for(double rollingAngle=q/4;rollingAngle<q+q/4;rollingAngle+=q/rollingSides){
            P p=new P(Math.cos(rollingAngle)*rollingRadius+rp.x,Math.sin(rollingAngle)*rollingRadius + rp.y);
            p.k=key;key++;
            rollingPoints.add(p);
        }
        double g=(q/2)-((q/2-(q/rollingSides))/2) - ((q/2-(q/stationarySides))/2)-.05;
        for(P p:rollingPoints){p.r(getPoint(0), g);}
        //set up JFrame
        JFrame f = new JFrame();
        f.add(this);
        f.setSize((int)dist*2+60,(int)dist*2+60);
        f.setVisible(true);
        int[] pKeys= new int[]{stationaryPoints.get(0).k,rollingPoints.get(0).k};
        int index=1;
        P rc = rollingPoints.c();
        P sc =stationaryPoints.c();
        double currentRadian=Math.atan2(rc.y-sc.y,rc.x-sc.x);
        double totalRadian = 0;
        while(Math.abs(totalRadian)<revolutions){
            P rc2 = rollingPoints.c();
            P sc2 =stationaryPoints.c();
            double angle = Math.atan2(rc2.y-sc2.y,rc2.x-sc2.x);
            if(currentRadian-angle<2){totalRadian+=(angle-currentRadian);}
            currentRadian=angle;
            L clone=(L)path.clone();
            clone.add(new P(rollingPoints.get(1).x,rollingPoints.get(1).y));
            path = clone;
            for(P p:rollingPoints){
                p.r(getPoint(pKeys[index]),.01);
                int size = stationaryPoints.size();
                for(int i=0;i<size;i++){
                    P stationaryPointAtI = stationaryPoints.get(i);
                    P nextPoint=null;
                    if(i==size-1){nextPoint=stationaryPoints.get(0);}
                    else{nextPoint=stationaryPoints.get(i+1);}
                    if(p.b(stationaryPointAtI, nextPoint)==1&&containsKey(pKeys,p.k)==0){
                        //rolling point is between 2 stationary points
                        if(index==1){index=0;}else{index=1;}
                        pKeys[index]=p.k;
                    }
                    int size2=rollingPoints.size();
                    for(int h=0;h<size2;h++){
                        P nextPoint2=null;
                        if(h==size2-1){nextPoint2=rollingPoints.get(0);}
                        else{nextPoint2=rollingPoints.get(h+1);}
                        if(stationaryPointAtI.b(rollingPoints.get(h), nextPoint2)==1&&containsKey(pKeys,stationaryPointAtI.k)==0){
                            //stationary point is between 2 rolling points
                            if(index==1){index=0;}else{index=1;}
                            pKeys[index]=stationaryPointAtI.k;
                        }
                    }
                }
            }
            repaint();
            Thread.sleep(5);
        }
    }
    volatile L path = new L();
    L rollingPoints = new L();
    L stationaryPoints = new L();
    P getPoint(int key){
        for(P p:rollingPoints){if(p.k==key){return p;}}
        for(P p:stationaryPoints){if(p.k==key){return p;}}
        return null;
    }
    int containsKey(int[] keys,int key){
        for(int i:keys){if(key==i){return 1;}}
        return 0;
    }
    @Override
    public void paintComponent(Graphics g){
        Path2D.Double sPath = new Path2D.Double();
        sPath.moveTo(stationaryPoints.get(0).x, stationaryPoints.get(0).y);
        for(P p:stationaryPoints){
            sPath.lineTo(p.x, p.y);
        }
        sPath.closePath();
        Path2D.Double rPath = new Path2D.Double();
        rPath.moveTo(rollingPoints.get(0).x, rollingPoints.get(0).y);
        for(P p:rollingPoints){
            rPath.lineTo(p.x, p.y);
        }
        rPath.closePath();
        g.setColor(Color.white);
        g.fillRect(0,0,getWidth(),getHeight());
        Graphics2D t = (Graphics2D)g;
        if(d==1){
        t.setColor(Color.black);
        t.draw(sPath);
        t.setColor(Color.blue);
        t.draw(rPath);
        }
        g.setColor(Color.green);
        for(P p:path){g.fillOval((int)p.x-1, (int)p.y-1, 2, 2);}
    }
}

And the golfed version:
import java.awt.*;import java.awt.geom.*;import javax.swing.*;import static java.lang.Math.*;class Polygons2Golfed extends JPanel{public static void main(String[]a)throws Exception{new Polygons2Golfed(a);}double q=PI*2;int d=1;public Polygons2Golfed(String[]a)throws Exception{double b,c,f;b=Double.valueOf(a[1]);c=Double.valueOf(a[2]);int d,e;d=Integer.valueOf(a[3]);e=Integer.valueOf(a[4]);f=b+c+100;P o=new P(f,f);P r=new P(o.x,o.y-c-b);int s=0;for(double u=-q/4;u<q-q/4;u+=q/d){P p=new P(cos(u)*b+o.x,sin(u)*b+o.y);p.k=s;s++;l.add(p);}for(double u=q/4;u<q+q/4;u+=q/e){P p=new P(cos(u)*c+r.x,sin(u)*c+r.y);p.k=s;s++;k.add(p);}double g=q/e/2+q/d/2-.05;for(P p:k){p.r(v(0),g);}JFrame j=new JFrame();j.add(this);j.setSize((int)f*2+60,(int)f*2+60);j.setVisible(true);m=new int[]{l.get(0).k,k.get(0).k};int ad=1;P rc=k.c();P sc=l.c();double ab,ac;ab=atan2(rc.y-sc.y,rc.x-sc.x);ac=0;while(abs(ac)<Double.valueOf(a[0])*q){P rc2=k.c();P sc2=l.c();double ah=atan2(rc2.y-sc2.y,rc2.x-sc2.x);if(ab-ah<2)ac+=(ah-ab);ab=ah;L ag=(L)n.clone();ag.add(new P(k.get(1).x,k.get(1).y));n=ag;for(P p:k){p.r(v(m[ad]),.01);int af=l.size();for(int i=0;i<af;i++){P aa=l.get(i);P w=null;if(i==af-1){w=l.get(0);}else{w=l.get(i+1);}if(p.b(aa, w)==1&&w(p.k)==0){if(ad==1)ad=0;else ad=1;m[ad]=p.k;}int ae=k.size();for(int h=0;h<ae;h++){P u=null;if(h==ae-1)u=k.get(0);else u=k.get(h+1);if(aa.b(k.get(h),u)==1&&w(aa.k)==0){if(ad==1)ad=0;else ad=1;m[ad]=aa.k;}}}}repaint();Thread.sleep(5);}}L n=new L();L k=new L();L l=new L();P v(int key){for(P p:k){if(p.k==key)return p;}for(P p:l){if(p.k==key)return p;}return null;}int[]m;int w(int key){for(int i:m){if(key==i)return 1;}return 0;}@Override public void paintComponent(Graphics g){Path2D.Double aq=new Path2D.Double();aq.moveTo(l.get(0).x,l.get(0).y);for(P p:l){aq.lineTo(p.x, p.y);}aq.closePath();Path2D.Double aw=new Path2D.Double();aw.moveTo(k.get(0).x, k.get(0).y);for(P p:k){aw.lineTo(p.x, p.y);}aw.closePath();g.setColor(Color.white);g.fillRect(0,0,getWidth(),getHeight());Graphics2D t=(Graphics2D)g;if(d==1){t.setColor(Color.black);t.draw(aq);t.setColor(Color.blue);t.draw(aw);}g.setColor(Color.green);for(P p:n){g.fillOval((int)p.x-1,(int)p.y-1,2,2);}}}

As well as classes P:
import java.awt.geom.*;class P{double x,y;public P(double a,double b){x=a;y=b;}int k;void r(P c,double g){double a,r;a=Math.atan2(y-c.y,x-c.x)+g;r=Math.sqrt((c.x-x)*(c.x-x)+(c.y-y)*(c.y-y));x=Math.cos(a)*r+c.x;y=Math.sin(a)*r+c.y;}public int b(P a,P b){if(Line2D.ptSegDist(a.x,a.y,b.x,b.y,x,y)<.5)return 1;return 0;}}

And L:
import java.util.*;public class L extends ArrayList<P>{public P c(){double x,y;x=0;y=0;for(P p:this){x+=p.x;y+=p.y;}return new P(x/size(),y/size());}}

Change int d to 0 or 1 to show polygons
arguments - 1 100 50 5 2

args - 1.5 100 100 7 3

args - 2 40 100 3 7

Is r really 50 in all your examples? That would mean the roller goes around 50 times.

@Calvin'sHobbies new example shows pi*3

@StretchManiac That can't be right. 3π should take you a bit over 9 times around the stationary polygon.

If you use interfaces instead of implementations, which is better practice anyway, you can save bytes there. You can also use Java 8 to remove a lot of code. And you can shorten Point. And probably tons of other things. Either way, it's still Java... ;)

It's funny how the class name is RotatingPolygonsGolfed in the "golfed" code while it's just RotatingPolygons in the normal code. ;)

@MartinBüttner yes, I measured rotations in radians. I'll fix that.

Instead of an ArrayList you can create your own subclass class PList extends ArrayList<Point> {}, that should shave off some bytes. You also use this, those can go too.

double[2] instead of Point? Adds 68 bytes (quick estimation) but removes the 94-byte class.

you can save a good chunk of characters just by changing your imports to use * instead of specific classes...

For more savings you can remove @Override (eclipse will complain, but it compiles fine), change the InterruptedException you throw to just an Exception, declare alot of variables (i mostly see doubles) on the same line with a , instead of a new line with double again, and most methods you can remove public from with 0 consequences (except paintComponent). Also you dont need volatile, it seems

Javascript, 1284 chars (-200 = 1084 chars)
Minified code is
function epi(B,r2,r1,n2,n1){K=Math;function C(t){return K.cos(t)}function S(t){return K.sin(t)}function A(y,x){return K.atan2(y,x)}P=K.PI;v=[[],[]];w=[[],[]];z=[];function Z(x,y,j){c=C(t=f*H+P/2);s=S(t);v[j][n]=c*x-s*y;w[j][n]=s*x+c*y;}function E(i){return{x:r1*S(t=p-i*q),y:r1*C(t)};}function D(x,y,X,Y,t){L=A(m.y,m.x);M=K.sqrt(m.x*m.x+m.y*m.y);N=K.sqrt(X*X+Y*Y);O=~~(t*(M>N?M:N)+1);for(i=J;i<=O;i++){J=1;z[n]=f*H+P+t*i/O;Z(x+M*C(T=L+t*i/O),y+M*S(T),0);Z(x+N*C(T=A(Y,X)+t*i/O),y+N*S(T),1);n++}}function F(x,y,n,r,L,s){I.strokeStyle=s;I.beginPath();for(i=0;i<n;i++)I[i?'lineTo':'moveTo'](x+r*C(t=L+(1-2*i)*P/n),y+r*S(t)*W);I.closePath();I.stroke()}p=P/n1;q=2*p;u=P/n2;H=2*u;s2=r2*S(u);g=f=l=n=J=h=0;R=300;while(l<=(B*2+1)*P/H){o=E(0);m=E(h);m.y-=o.y;m.x-=o.x;if(g<s2){D(g,-r2*C(u),-o.x,-o.y,q);h=(h+1)%n1;g+=2*r1*S(p)}else{m.x+=g-s2;D(s2,-r2*C(u),-o.x+g-s2,-o.y,H);g-=s2*2;f=(f+1)%n2;l++}}return function(e_,t,aa,W_){W=aa?-1:1;I=(e=e_).getContext('2d');I.fillStyle='black';I.fillRect(0,0,600,600);W_&1&&F(R,R,n2,r2,0,'white');T=A(w[1][0],v[1][0]);U=V=0;I.strokeStyle='teal';I.beginPath();I.moveTo(R+v[0][0],R+w[0][0]*W);while(U<t){_=A(w[1][V+1],v[1][V+1]);U+=_-T+(_+1<T?2*P:0);T=_;V++;I.lineTo(R+v[0][V],R+w[0][V]*W)}W_&2&&I.stroke();W_&4&&F(R+v[1][V],R+w[1][V]*W,n1,r1,z[V],'red')}}

Full code is
function epi( nr, r2, r1, n2, n1 ) {
function C( t )
    { return Math.cos( t ); }
function S( t )
    { return Math.sin( t ); }
function A( dy, dx )
    { return Math.atan2( dy, dx ); }

var iCCW, e, t_, xs = [[],[]], ys = [[],[]], ts = [], n = 0, iArc0 = 0;

function addpt( x, y, iBin ) {
    var c_ = C(t_ = iFrame*t2 + Math.PI/2 ),
        s_ = S(t_);

    xs[iBin][n] = c_*x-s_*y;
    ys[iBin][n] = s_*x+c_*y;
}

function poly1pt( iP )
    { return { x: r1*S(t_ = t1b2-iP*t1), y: r1*C(t_) }; }

function arc1( P_Arc_, xP_, yP_, xC_, yC_, t ) {
    var dx_, dy_, dxC, dyC;
    var t0 = A( dy_ = P_Arc_.y, dx_ = P_Arc_.x ),
        r_ = Math.sqrt( dx_*dx_ + dy_*dy_ ),
        t0C = A( dyC = yC_, dxC = xC_ ),
        rC = Math.sqrt( dxC*dxC + dyC*dyC ),
        nt = ~~(t*(r_>rC?r_:rC)+1);

    for( var i = iArc0; i <= nt; i++ ) {
        iArc0 = 1;
        ts[n] = iFrame*t2 + Math.PI + t*i/nt;
        addpt( xP_ + r_*C(t_ = t0+t*i/nt), yP_ + r_*S(t_), 0 );
        addpt( xP_ + rC*C(t_ = t0C+t*i/nt), yP_ + rC*S(t_), 1 );
        n++;
    }
}

function poly( x,y, n, r, t0, sColor ) {
    var Cx = e.getContext('2d');
    Cx.strokeStyle = sColor;
    Cx.beginPath();
    for( var i = 0; i < n; i++ )
        Cx[i ? 'lineTo' : 'moveTo']( x + r*C(t_ = t0+(1-2*i)*Math.PI/n), y + r*S(t_)*iCCW );

    Cx.closePath();
    Cx.stroke();
}

var t1b2 = Math.PI/n1,
    t1 = 2*t1b2,
    t2b2 = Math.PI/n2,
    t2 = 2*t2b2,
    s1 = 2*r1*S(t1b2),
    s2 = 2*r2*S(t2b2),
    xPivot = 0,
    iPivot = 0,
    iFrame = 0,
    P_Pivot, P_Arc,
    nFrame = 0;

while( nFrame <= (nr*2+1)*Math.PI/t2 ) {
    P_Pivot = poly1pt( 0 );
    P_Arc = poly1pt( iPivot );
    if( xPivot < s2/2 ) {
        P_Arc.x -= P_Pivot.x;
        P_Arc.y -= P_Pivot.y;
        arc1( P_Arc, xPivot, -r2*C(t2b2), -P_Pivot.x, -P_Pivot.y, t1 );
        iPivot = (iPivot+1) %n1;
        xPivot += s1;
    } else {
        P_Arc.x -= (P_Pivot.x - (xPivot - s2/2));
        P_Arc.y -= P_Pivot.y;
        arc1( P_Arc, s2/2, -r2*C(t2b2), -P_Pivot.x + xPivot - s2/2, -P_Pivot.y, t2 );
        xPivot -= s2;
        iFrame = (iFrame+1) %n2;
        nFrame++;
    }
}

function renderTo( eCanvas, t, isCCW, sWhat ) {
    iCCW = isCCW ? -1 : 1;
    var Cx = (e = eCanvas).getContext('2d');
    Cx.fillStyle = 'black';
    Cx.fillRect( 0,0, 600,600 );

    if( sWhat &1 )
        poly( 300,300, n2, r2, 0, 'white' );

    var tRef = A( ys[1][0], xs[1][0] ),
        tCum = 0,
        i0 = 0;

    Cx.strokeStyle = 'green';
    Cx.beginPath();
    Cx.moveTo( 300+xs[0][0], 300+ys[0][0]*iCCW );
    while( tCum < t ) {
        t_ = A( ys[1][i0+1], xs[1][i0+1] );
        tCum += t_ - tRef + (t_ - tRef < -1 ? 2*Math.PI : 0);
        tRef = t_;
        i0++;
        Cx.lineTo( 300+xs[0][i0], 300+ys[0][i0]*iCCW );
    }
    if( sWhat &2 )
        Cx.stroke();
    if( sWhat &4 )
        poly( 300+xs[1][i0], 300+ys[1][i0]*iCCW, n1, r1, ts[i0], 'red' );
}

return renderTo;
}

A fiddle to behold the routine in all its polygony glory (and to demonstrate animation) is found at
http://jsfiddle.net/7rv751jy/2/embedded/result/
The script defines a function called epi that accepts the five listed parameters in the OP. epi returns a function with the signature (e,t,isCCW,flags) which accepts arguments:

e - a reference to a 600x600 HTML5 canvas element on which to render
t - the total angle (in radians) that the centroid of the second polygon should sweep around the centroid of the first. The argument passed in should not exceed 2 pi times the number of rotations passed to epi.
isCCW - boolean indicating whether the trace should proceed in a counterclockwise direction (as opposed to a clockwise one)
flags - a set of bit flags indicating which elements should be rendered

bit 1 - render polygon 1 if set
bit 2 - render trace if set
bit 3 - render polygon 2 if set

The function can be called any number of times with varying sets of arguments.
Some Notes:

The routine handles the degenerate cases where n1 = 2 and/or n2 = 2. When animating, certain combinations of lengths will cause sudden rapid advances in the trace. This is because the animation frames are indexed by the angle to the centroid of the second polygon, and d theta poly2 / d theta centroid becomes singular in cases where the centroid of 2-sided poly 2 is near a vertex of 2-sided poly 1. This does not affect the trace, however.
The parameter names in epi will seem confusing since throughout development, I referred to polygon 1 as "2", and polygon 2 as "1". When I realized the inconsistency between my convention and that of the OP, rather than swapping all of the indices in the code, I simply swapped the order of the arguments in epi.
The fiddle above imports jQuery, but this is to handle the UI. The epi function has no library dependencies.
The code handles CCW traces by simply inverting the Y axis. This is somewhat inelegant since polygon 2 starts in a Y-inverted position during CCW traces, but nobody said the routine had to be elegant. ;)

Beautiful! I've found the fullscreen link is easiest to work with: http://jsfiddle.net/7rv751jy/embedded/result/

One tiny complaint is that the tracer vertex doe not start out on a stationary vertex.

Ha. I completely overlooked that in the specs. I say 'Ha' because the code was originally (inadvertently) to spec, but I changed the trace vertex because I figured the trace would look better if it started immediately. I've updated the code so that it's to spec, and updated the link to the fiddle to a fullscreen spec-compliant version. As a bonus, it knocks one character off the total count.

How can I speed it up a bit? JS noob here.

@SohamChowdhury: Change the code nt = ~~(t*(r_>rC?r_:rC)+1) to nt = ~~(t*(r_>rC?r_:rC)/10+1) and it should speed things up a bit.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Swing Through Trees with Your Grappling Hook
You have found the path through the forest and now plan on travelling along it. However, just before you start on your journey, the ground turns into lava.
You manage to scurry up the nearest tree (the trees have inexplicably not burnt up), but now you are faced with a problem: how can you get out of the forest when the floor is lava? The answer hits you like a good idea for a programming challenge - you can use your magical grappling hook (made from a piece of the canoe earlier) to swing through the trees and the branches!
However, you're not sure which trees and branches you need to swing on to get there. Luckily, you have your programming skills, so you decide to draw a program on your arm to tell you which trees to swing on. However, there is not much surface area on your arm, so you must make the program as small as possible.
We can represent a forest using a n by m array. The following characters will make up the array:

T: A tree. You can land here. You cannot use your grappling hook on this. You can swing through this.
P: Functions the same as T. You start here.
Q: Functions the same as T. This is the goal.
+: A branch. You cannot land here. You can use your grappling hook on this. You can swing through this.
*: A man-eating spider. If you land here, you die. If you use your grappling hook on this, you die. If you swing through this, you die.
-: Regular ground, in other words, lava. You cannot land here. You cannot use your grappling hook on this. You can swing through this. All area outside of the given array is this type.

Here is an example of what a forest might look like:
               y
----T---+------12
---------------11
----T---+---T--10
---------------9
T-+-T-+-T------8
---------------7
------------+--6
----+----------5
+-------+------4
---------------3
----P---+-*-Q--2
---------------1
T-+-T-+-T------0
012345678911111
x         01234

I will refer to coordinates with the notation (x,y), as shown on the axes.
You begin from P and have to make your way to Q. To do this, you swing from tree T to tree T using branches +. You can attach your grappling hook on any branch that is orthogonal to you - that is, a branch that is either on the same x position or y position that you are in. For instance, if you were at the position (4,8) in the example forest, you could attach your grappling hook to the positions (2,8), (6,8), or (4,5). You can attach this even if there are trees or other branches between you and the branch.
Once you attach your grappling hook onto a branch, you will travel a distance in the direction of the branch equal to twice the distance between your initial position and the branch. In other words, your final position will be the same distance from the branch as your starting position, just on the opposite side. A more formal definition of how the movement works is below. A subscript of v is the final position, u is the initial position, and b is the position of the branch.
$$(x_v, y_v) = (2x_b-x_u, 2y_b-y_u)$$
Note that if there is a spider between your initial position and your final position, you cannot go there. For example, in the example forest the swing from (4,2) to (12,2) is not possible because you would run into the spider at (10,2).
The goal is, using this swinging through branches method, to travel from the point P to the point Q in the fewest swings possible. For instance, in the example forest, the shortest path is:

From (4,2) to (4,8) using (4,5)
From (4,8) to (0,8) using (2,8)
From (0,8) to (0,0) using (0,4)
From (0,0) to (4,0) using (2,0)
From (4,0) to (4,10) using (4,5)
From (4,10) to (12,10) using (8,10)
From (12,10) to (12,2) using (12,6)

Input
Input is from whichever method is convenient (STDIN, command line arguments, raw_input(), etc.), except it may not be pre-initialized as a variable. Input starts with two comma separated integers n and m representing the size of the board, then a space, and then the forest as a single long string. For instance, the example forest as an input would look like this:
15,13 ----T---+-------------------------T---+---T-----------------T-+-T-+-T---------------------------------+------+----------+-------+-------------------------P---+-*-Q-----------------T-+-T-+-T------

Output
Output a space-separated list of comma separated tuples indicating the coordinates of the branches that you must swing to. For instance, for the above input the output would be:
4,5 2,8 0,4 2,0 4,5 8,10 12,6

You may have noticed that this is not the only shortest path through the forest - indeed, going to (8,8), down to (8,0), left to (4,0) and continuing as normal from there takes exactly the same number of swings. In these cases, your program may output either of the shortest paths. So the output:
4,5 6,8 8,4 6,0 4,5 8,10 12,6

is also allowed. This is code-golf, so the entry with the shortest number of bytes wins. If you have questions or my explanation is not clear, ask in the comments.

Your example input should start 15,13 because the array is 13 by 15 in size.

@Howard Fixed. Thanks.

GolfScript, 196 characters
' '/(~):H;,):W(\~/-1%'*':S*:^{:I,,{I=79>},:A{{[\1$1$+2/]}+A/}%{)I=43=\$.~I<>S&!\~+1&!&&},}:C~S^W/zip*C{{.H/\H%W*+}%}%+:B;^'P'?]]{{(B{0=1$=},\;\`{\1>\+}+/}%.{0=^=81=},:|!}do;|0=1>-1%{.W%','@W/' '}/

A horrible piece of GolfScript code - however it works as desired. The algorithm is not optimal but fairly fast, the example is running well below a second on my computer.
> 15,13 ----T---+-------------------------T---+---T-----------------T-+-T-+-T---------------------------------+------+----------+-------+-------------------------P---+-*-Q-----------------T-+-T-+-T------
4,5 2,8 0,4 2,0 4,5 8,10 12,6

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Display the mouse pointer trails... of the future!
Inspired by this example of using d3js, I challenge you to create a canvas (or your language-of-choice equivalent) in which the mouse pointer trails will be displayed, with the following twist:
The Twist
You should not display the trails of where the mouse pointer was, but the "trails" of where it will (might) be in future.
You can do it by using either:

A time machine, or
Probabilistic estimations based on previous mouse
movements

Assumptions
In case you didn't choose the time machine implementation, when the mouse does not move for more than threshold milliseconds, you can display none of the trails. (The threshold value is up to you to choose).
The cursor image is up to you and does not have to be the same of the OS's cursor (you can even draw a plain small circles or dots).
No evil input will be tested: You can assume the movements are smooth. 'Smooth' definition for this case is: if the mouse movements were a function over the x and y axis of the canvas - it would be a continuous function.
Winning
The valid answer with the least characters in code will win. In case of a tie - the one that was posted first will win.
EDIT: The valid answer with the most upvotes will win. In case of a tie - the one that was posted first will win. You can be creational on the implementation, or be precise with the prediction. I'm not the judge anymore, we all are :)

A valid answer must include a way for me to play with (test! I meant test), either on an online tool or on a freely-downloadable compiler/interpreter/runtime/etc.

I think this question might be better suited to a popularity contest than a code-golf, because it's fairly subjective as to what qualifies as a good enough prediction. I would recommend clarifying that or changing the tag. Nevertheless, looks fun.

You're right. I edited the question and changed the tag.

Time for someone to implement machine learning algorithms!

For testing purposes, which models of time machine do you have access to? And may we use standard libraries to interface with them?

Just a mathematician whining here: smooth != continuous. In fact wild spikey movement will still be continuous.

@CompuChip, you're absolutely right. And Weierstrass Function can prove it. However, I didn't want to dive into Calculus here, just wanted to give a plain explanation for programmers who are not necessarily mathematicians.

Tip! When the cursor goes up it must go down at some point.

Actually, since your mouse can be at only integer pair coordinates, a continuous function is impossible. I'm actually not really sure what you mean? That the next point must be "touching(in one of the 8 directions, or not moving)" the last?

@PeterTaylor My time machine uses GPIO pins. I decided that was too much of a hassle to deal with though.

Javascript
My program predicts the direction of the pointer by using the average of the angular change in direction of the last 20 mouse moves.  It also uses the variance of the angular change to create a "cloud" of possible locations and directions of the pointer.  The color of each pointer in the "cloud" is supposed to represent the likelihood of it being the new position of the mouse pointer, where darker colors represents a greater likelihood.  The distance of the pointer cloud ahead of the mouse is calculated using the speed of mouse movement.  It doesn't make the best predictions but it looks neat.
Here's a fiddle: http://jsfiddle.net/5hs64t7w/4/
Increasing the size of the pointer cloud is interesting to see. It can be set by changing the cloudSize variable on the first line of the program. Here is a fiddle with a cloud size of 10: http://jsfiddle.net/5hs64t7w/5/
I used these sources to get formulas for circular mean and variance:
Circular Mean: http://en.wikipedia.org/wiki/Circular_mean
Circular Variance: http://www.ebi.ac.uk/thornton-srv/software/PROCHECK/nmr_manual/man_cv.html
Here is the code if anyone is interested:
    var cloudSize = 3;

    var canvas = document.getElementById('canvas_element');
    var c = canvas.getContext('2d');
    var prevX = -1;
    var prevY = -1;
    var curX = -1;
    var curY = -1;
    var distance = 0;
    var direction = 0;

    function drawMouse(x, y, angle, gray){
        var grayVal = Math.round(gray*255);
        var grayString = "rgb(" + grayVal + "," + grayVal +"," + grayVal + ")";
        c.fillStyle = grayString;
        c.strokeStyle = grayString;
        c.lineWidth = 1;
        c.beginPath();
        c.moveTo(x, y);
        c.lineTo(x + 16*Math.cos(angle + Math.PI/2.0 + Math.PI/8.0), y + 16*Math.sin(angle + Math.PI/2.0 + Math.PI/8.0));
        c.moveTo(x, y);
        c.lineTo(x + 16*Math.cos(angle + Math.PI/2.0 - Math.PI/8.0), y + 16*Math.sin(angle + Math.PI/2.0 - Math.PI/8.0));
        c.lineTo(x + 16*Math.cos(angle + Math.PI/2.0 + Math.PI/8.0), y + 16*Math.sin(angle + Math.PI/2.0 + Math.PI/8.0));
        c.stroke();
        c.fill();
        c.beginPath();
        c.moveTo(x, y);
        c.lineTo(x + 24*Math.cos(angle + Math.PI/2), y + 24*Math.sin(angle + Math.PI/2));
        c.stroke();
    }

    function sum(array){
        var s = 0.0;
        for(var i=0; i<array.length; i++){
            s += array[i];
        }
        return s;
    }

    var sins = [];
    var coss = [];
    var lengths = [];
    var times = [];
    var index = 0;
    var limit = 20;
    var variance = 0;
    var prevTime = new Date().getTime();
    function updateDistanceAndDirection(x, y){
        var angle = Math.atan2(prevY - curY, prevX - curX);
        sins[index] = Math.sin(angle);
        coss[index] = Math.cos(angle);
        lengths[index] = Math.sqrt((curX-prevX)*(curX-prevX) + (curY-prevY)*(curY-prevY));
        var time = new Date().getTime();
        times[index] = time - prevTime;

        variance = 1.0 - Math.sqrt(sum(coss)*sum(coss)+sum(sins)*sum(sins))/sins.length;

        direction = Math.atan2(1/sins.length*sum(sins),1/coss.length*sum(coss));
        var speed = sum(lengths)/(sum(times)/200);
        distance = Math.min(Math.max(40, speed), 100);
        prevTime = time;
        index = (index+1)%limit;
    }

    function drawMice(count){
        c.clearRect(0, 0, canvas.width, canvas.height);

        for(var i=count; i>=0; i--){
            var dir = direction + i*variance;
            drawMouse(curX - distance*Math.cos(dir), curY - distance*Math.sin(dir), dir - Math.PI/2, i/count);
            dir = direction - i*variance;
            drawMouse(curX - distance*Math.cos(dir), curY - distance*Math.sin(dir), dir - Math.PI/2, i/count);
        }
    }

    canvas.onmousemove = function (event) {
        curX = event.clientX;
        curY = event.clientY;

        updateDistanceAndDirection(curX, curY);

        drawMice(cloudSize);

        prevX = curX;
        prevY = curY;
    };

Can you display a sequence of mouse pointer (with fixed orientation) instead of a pointer pointing to variable direction? I was expecting to see "mouse trails" but can't see any, haha

Very nice, but isn't it more plausible that the pointer should go up in the future when it currently goes down? Imho, the program should do exactly the opposite so the it predicts the pointer stays on screen.

@MennoGouw its not perfect but its pretty damned good

@nimchimpsky Just saying the probability of the mouse going up is higher if the mouse currently goes down. The program itself is great.

Do you think it's also possible to use the usual human behavior for mouse handling ? Like circles, straight lines... These could be predicted even further in the future (calculating the radius of the circle after a couple mesures, and finishing the circle even before you drafted it)

It always points to the left. (Safari 7.0.6, OS X 10.9)

Java
I decided to take the time machine approach. It turns out the key ingredient of a time machine is java.awt.Robot. My program lets you move your mouse around for 10 seconds. After the 10 seconds it goes back in time and recreates your mouse movement, while predicting it perfectly.

Here's the code:
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Robot;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.util.ArrayList;
import java.util.TimerTask;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.Timer;

public class TimeMachine extends JPanel implements MouseMotionListener {

    Timer timer;
    int time = 10;
    java.util.Timer taskTimer;
    ArrayList<Point> mousePoints;
    ArrayList<Long> times;
    Robot robot;
    int width, height;
    ArrayList<Point> drawMousePoints;

    public TimeMachine(){
        width = 500;
        height = 500;
        drawMousePoints = new ArrayList<Point>();

        robot = null;
        try{
            robot = new Robot();
        }
        catch(Exception e){
            System.out.println("The time machine malfunctioned... Reverting to 512 BC");
        }
        mousePoints = new ArrayList<Point>();
        times = new ArrayList<Long>();

        taskTimer = new java.util.Timer();

        ActionListener al = new ActionListener(){
            public void actionPerformed(ActionEvent e){
                time--;
                if(time == 0)
                    rewind();
                repaint();
            }
        };
        timer = new Timer(1000, al);
        start();
    }

    public void paint(Graphics g){
        g.clearRect(0, 0, width, height);
        g.drawString("Time Machine activiates in: " + time, 15, 50);
        for(int i=0; i<drawMousePoints.size(); i++){
            Point drawMousePoint = drawMousePoints.get(i);
            drawMouse(drawMousePoint.x-getLocationOnScreen().x, drawMousePoint.y-getLocationOnScreen().y, g, Color.BLACK, Color.LIGHT_GRAY, (double)i/drawMousePoints.size());
        }
    }

    public void drawMouse(int x, int y, Graphics g, Color line, Color fill, double alpha){
        Graphics2D g2d = (Graphics2D)g;
        g2d.setColor(new Color(fill.getRed(), fill.getGreen(), fill.getBlue(), (int)Math.max(Math.min(alpha*255, 255), 0)));
        g2d.fillPolygon(new int[]{x, x, x+4, x+8, x+10, x+7, x+12}, new int[]{y, y+16, y+13, y+20, y+19, y+12, y+12}, 7);

        g2d.setColor(new Color(line.getRed(), line.getGreen(), line.getBlue(), (int)Math.max(Math.min(alpha*255, 255), 0)));
        g2d.drawLine(x, y, x, y + 16);
        g2d.drawLine(x, y+16, x+4, y+13);
        g2d.drawLine(x+4, y+13, x+8, y+20);
        g2d.drawLine(x+8, y+20, x+10, y+19);
        g2d.drawLine(x+10, y+19, x+7, y+12);
        g2d.drawLine(x+7, y+12, x+12, y+12);
        g2d.drawLine(x+12, y+12, x, y);
    }

    public void start(){
        timer.start();
        prevTime = System.currentTimeMillis();
        mousePoints.clear();
    }

    public void rewind(){
        timer.stop();
        long timeSum = 0;
        for(int i=0; i<times.size(); i++){
            timeSum += times.get(0);
            final boolean done = i == times.size()-1;
            taskTimer.schedule(new TimerTask(){
                public void run(){
                    Point point = mousePoints.remove(0);
                    drawMousePoints.clear();
                    drawMousePoints.addAll(mousePoints.subList(0, Math.min(mousePoints.size(), 30)));
                    robot.mouseMove(point.x, point.y);
                    repaint();
                    if(done)
                        System.exit(0);
                }
            }, timeSum);
        }
    }

    long prevTime = 0;
    public void record(MouseEvent m){
        if(timer.isRunning()){
            long time = System.currentTimeMillis();
            mousePoints.add(new Point(m.getXOnScreen(), m.getYOnScreen()));
            times.add((time-prevTime)/10);
            prevTime = time;
        }
    }

    public static void main(String[] args){

        TimeMachine timeMachine = new TimeMachine();

        JFrame frame = new JFrame("Time Machine");
        frame.setSize(timeMachine.width, timeMachine.height);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
        frame.addMouseMotionListener(timeMachine);

        frame.add(timeMachine);
    }

    public void mouseDragged(MouseEvent m) {
        record(m);
    }

    public void mouseMoved(MouseEvent m) {
        record(m);
    }

}

Code slightly optimized by Netbeans (got rid of the warnings): http://pastebin.com/E57LZ4zY

Vanilla Javascript
Just to get things started, here is a simple prediction based on two values. The last n mouse postions are memorized and kept in a queue, the prediction is a simple linear extrapolation of the first and last element in the queue.
This is just the prediction code, the full code including the demo can be seen in this fiddle:
function predict(trail) {
    var b = trail.pop(),
        a = trail[0],
        d = {
            x: b.x - a.x,
            y: b.y - a.y
        },
        m = Math.sqrt( d.x * d.x + d.y * d.y );

    d.x = 5 * d.x / m;
    d.y = 5 * d.y / m;

    var predictions = [];
    for(var i = 1; i <= 10; i++) {
        predictions.push({
            x: b.x + i * d.x,
            y: b.y + i * d.y
        });
    }

    return predictions;
}

The demo contains a comment in the prediction that allows you to instead use the last two elements in the queue for the prediction. Makes the result more "real-time", but also less "smooth".
If anyone wants to use the boilerplate work to implement a different prediction algorithm, feel free. It's not a lot of work anyway.

Can you display a mouse pointer instead of a line? I was expecting to see "mouse trails" but can't see any, haha

The question says it doesn't have to be a cursor ;)

Javascript
The past is the best prediction for the future - me, and propably someone else too
My solution is very simple. First, here is the >>> Fiddle! <<<
All it does is shifting the past trail, so it looks like the future trail. Basically no Math is involved (I Know, pretty boring). You can easily see the errors, especially when moving the cursor in circles. That's why I made the trail so short ;)
The code:
<!DOCTYPE html>

haha I just had a look at the date. Whatever, I like it


text:
Morse Decode Golf
I've become alarmed with the growing hatred of spaces and this answer has inspired me to make sure Morse code is safe from this insidious removal of whitespace.
So, your task will be to create a program that can successfully translate Morse code with all of the spaces removed.

Rules:

Input will be a string consisting only of dashes and dots (ASCII 2D
and 2E). Output is undefined for input containing any other characters. Feel
free to use any method convenient to your language of choice to
receive the input (stdin, text file, prompt user, whatever). You can
assume that the Morse code input only consists of the letters A-Z,
and matching numbers or punctuation is not required.
Output should include only words contained in this dictionary
file (again, feel free to use any
convenient method to access the dictionary file). All valid
decodings should be output to stdout, and all dots and dashes in the
input must be used. Each matched word in the output should be
separated by a space, and each possible decoding should separated by
a newline. You can use upper case, lower case, or mixed case output as
convenient.
All restrictions on standard loopholes apply with one exception
as noted above, you may access the dictionary file referenced in
requirement 2 via an internet connection if you really want to. URL
shortening is acceptable, I believe that goo.gl/46I35Z is likely the
shortest.
This is code golf, shortest code wins.

Note: Posting the dictionary file on Pastebin changed all of the line endings to Windows style 0A 0E sequences. Your program can assume line endings with 0A only, 0E only or 0A 0E.
Test Cases:
Input:

......-...-..---.-----.-..-..-..

Output must contain:

hello world

Input:

.--..-.-----..-..-----..-.--..--...---..--...-.......--.-..-.-.----...--.---.-....-.

Output must contain:

programming puzzles and code golf

Input:

-.....--.-..-..-.-.-.--....-.---.---...-.----..-.---..---.--....---...-..-.-......-...---..-.---..-----.

Output must contain:

the quick brown fox jumps over the lazy dog

How can you tell between AN (.- -.) and EG (. --.) ?

@Sieg You look up possible combinations in the dictionary

@Sieg - That is the crux of the challenge. EG isn't in the word file - AN is. If there are multiple valid decodings, you output them all. Although I would be extremely impressed if somebody checks for valid grammar as well.

@Comintern I bet there are words where similar problem arises.

@Sieg - The output would then need to include both valid decodings.

Can I strip the carriage returns from the dictionary>

@Dennis - To be fair, I'd have to say not before inputing it. Otherwise, I can envision several ways in which preprocessing the file could give an undo advantage.

I could too. That's why I asked specifically about the line endings. Oh well, I'll deal with the pesky Windows format... :P

@Dennis - Ahhh... I'll bet that either Pastebin or my browser did that. My source file doesn't have them. You can change the line delimiter to a system appropriate one, no other changes. I'll edit into the question when I'm not on my phone.

I'm afraid this challenge does not work as expected: For the "hello world" morse code example my Python prototype yields hundreds or maybe thousands of possible translations: http://pastebin.com/baveM1FH, all of which seem to be valid. I mean, technically that might be a valid solution...

@Falko that's correct behavior. Note that the problem says your output must include "hello world", not that it's limited to that. It should print all valid decodings.

@Falko By my count, the "hello world" example has 403,856 lines of output, eventually degenerating to stuff like "i i it i et it met to et it it i"

(almost poetic, really)

For the first input, there are 403856 answers. For the second input, there are 2889424682038128 valid answers. For the third output, there are 4986181473975221635 answers...

@seequ eg is not in the list, but ate and we are. ;) eisner a go mae a ere sounds nice.

What do You want with all the irish family names in the word list? What are we supposed to do with the '? My code will take it as end of word.

Ruby, 210
(1..(g=gets).size).map{|x|puts IO.read(?d).split.repeated_permutation(x).select{|p|p.join.gsub(/./,Hash[(?a..?z).zip"(;=/%513':07*)29@-+&,4.<>?".bytes.map{|b|('%b'%(b-35))[1,7].tr'01','.-'}])==g}.map{|r|r*' '}}

If there exists such a practice as "over-golfing", I suspect I have partaken this time around. This solution generates an array of arrays of repeated permutations of all of the dictionary words, from length 1 up to the length of the input. Given that "a" is the shortest word in the dictionary file and its code is two characters long, it would have been sufficient to generate permutations of length up to half the size of the input, but adding /2 is tantamount to verbosity in this domain, so I refrained.
Once the permutation array has been generated (NB: it is of length 45404104 in the case of the pangrammatic example input), each permutation array is concatenated, and its alphabetic characters are replaced with their Morse code equivalents via the rather convenient (Regexp, Hash) variant of the #gsub method; we've found a valid decoding if this string is equal to the input.
The dictionary is read (several times) from a file named "d", and the input must not contain a newline.
Example run (with a dictionary that'll give the program a fighting chance at ending before the heat death of the universe):
$ cat d
puzzles
and
code
dummy
golf
programming
$ echo -n .--..-.-----..-..-----..-.--..--...---..--...-.......--.-..-.-.----...--.---.-....-. | ruby morse.rb
programming puzzles and code golf
^C

Haskell, 296 characters

Dictionary file: must be a text file named "d"
Input: stdin, may have a trailing newline but no internal whitespace

main=do f<-readFile"d";getLine>>=mapM(putStrLn.unwords).(words f&)
i!""=[i]
(i:j)!(p:q)|i==p=j!q
_!_=[]
_&""=[[]]
d&i=do
w<-d
j<-i!(w>>=((replicate 97"X"++words".- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --..")!!).fromEnum)
n<-d&j
[w:n]

Explanation of elements:

main reads the dictionary, reads stdin, executes &, and formats the output of & with appropriate whitespace.
(replicate 97"X"++words".- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --..")!!) (an expression inside of the definition of &) is a list whose indices are character codes (97 is the code of 'a') and values are Morse sequences.
! (a function named as an infix operator) matches a string against a prefix; if the prefix is present it returns the remainder in a one-element list (success in the list monad), otherwise the empty list (failure in the list monad)
& uses the list monad for “nondeterministic” execution; it

picks an entry of d (a dictionary word),
uses ! to match the Morse form of that word (w>>=((…)!!).fromEnum, which is equivalent to concatMap (((…)!!) . fromEnum) w) against the input string i,
calls itself (d&j) to match the rest of the string, and
returns the possible result as a list of words w:n, in the list monad [w:n] (which is the shorter, concrete equivalent to return (w:n)).

Note that every line after line 6 is part of the do expression started on line 6; this takes exactly the same number of characters as using semicolons on a single line, but is more readable, though you can only do it once in a program.

This program is extremely slow. It can be made faster (and slightly longer) easily by storing the morsified words next to the originals in a list rather than recomputing them at each pattern match. The next thing to do would be to store the words in a binary tree keyed by Morse symbols (a 2-ary trie) so as to avoid trying unnecessary branches.
It could be made slightly shorter if the dictionary file did not contain unused symbols such as "-", allowing removal of replicate 97"X"++ in favor of doing .(-97+) before the !!.

Damn son, that's clever.  +1 to you.

Did you know that (+(-97)) can be rewritten as (-97+)?

You should remove the third definition of h and instead add |0<1=[] to the second definition

But if it was me, i would try to define h using isprefixof. I think this is worth a try.

@proudhaskeller |0<1=[] doesn't handle the case where i is empty and p isn't. isPrefixOf requires an import and doesn't give us the remainder of the string to continue matching.

How about import List;h i j|isPrefixOf j i=[drop(lengh j)i]|0<1=[]. Almost shorter.

@KevinReid I think the next thing you should do is make h, g infix.

@proudhaskeller Done, thanks. (I knew about that technique but for some reason thought it wouldn't help here; I was WRONG.)

Use interact and win 12 characters. interact$unlines.map unwords.(words f&)

You should be able to replace concatMap with >>=

You should be able to replace concatMap with >>=, or maybe =<< if it's precedence saves a few characters.

Python - 363 345
Code:
D,P='-.';U,N='-.-','.-.'
def s(b,i):
 if i=='':print b
 for w in open('d').read().split():
  C=''.join([dict(zip('abcdefghijklmnopqrstuvwxyz-\'23',[P+D,D+3*P,U+P,'-..',P,D+N,'--.',4*P,2*P,P+3*D,U,N+P,2*D,D+P,D*3,'.--.',D+U,N,P*3,D,'..-',3*P+D,'.--','-..-',U+D,'--..']+['']*4))[c]for c in w]);L=len(C)
  if i[:L]==C:s(b+' '+w,i[L:])
s('',input())

Explanation:
The dictionary must be stored as a plain text file named "d".
D, P, U and N are just some helper variables for a shorter definition of the morse lookup table.
s(i) is a recursive function that prints the previously translated message part p and each valid translation of the remaining code part i: If i is empty, we reached the end of the code an b contains the whole translation, thus we simply print it. Otherwise we check each word w in the dictionary d, translate it into morse code C and, if the remaining code i starts with C, we add the word w to the translated beginning b and call the function s recursively on the remainder.
Note on efficiency:
This is a pretty slow but golfed version. Especially loading the dictionary and constructing the morse lookup table (dict(zip(...))) in each iteration (to avoid more variables) costs a lot. And it would be more efficient to translate all words in the dictionary file once in advance and not in each recursion on demand. These ideas lead to the following version with 40 more characters but significant speed-up:
d=open('d').read().split()
D,P='-.';U,N='-.-','.-.'
M=dict(zip('abcdefghijklmnopqrstuvwxyz-\'23',[P+D,D+3*P,U+P,'-..',P,D+N,'--.',4*P,2*P,P+3*D,U,N+P,2*D,D+P,D*3,'.--.',D+U,N,P*3,D,'..-',3*P+D,'.--','-..-',U+D,'--..']+['']*4))
T=[''.join([M[c]for c in w])for w in d]
def s(b,i):
 if i=='':print b
 for j,w in enumerate(d):
  C=T[j];L=len(C)
  if i[:L]==C:s(b+' '+w,i[L:])
s('',input())

You can save 2 characters by replacing .startswith(C) with [:len(C)]==C.

Wow, thanks! It's getting pretty weird, since loading the whole dictionary in each recursion saves characters - and slows down the algorithm once more.

@GregHewgill: Yeah, that's what I did originally. I just edited my answer to address both versions.

You can produce more interesting results (longer words) more quickly by sorting the dictionary by descending length of words. d=sorted(open('d').read().split(),key=len,reverse=1) Or, do that externally by pre-sorting your dictionary that way.

Heck, if you can reformat the dictionary file, format it as a precalculated Python dictionary and M=eval(open('d').read()) :)

Good idea. But sorting does not help w.r.t. the challenge, since each solution needs to get printed anyway. 2) As far as I understand the rules this is not allowed. (Then I'd include the translation into morse code as well! ;) )

Perl (5.10+), 293 characters
Dictionary file should be saved as "d" (and should be in unix format if you don't want CRs between words), morse input on stdin, with no trailing newline (use echo -n).
open D,d;chomp(@w=<D>);@m{a..z}=map{substr(sprintf("%b",-61+ord),1)=~y/01/.-/r}
'BUWI?OKMATJQDCLSZGE@FNHVXY'=~/./g;%w=map{$_,qr#^\Q@{[s/./$m{$&}/reg]}#}@w;
@a=[$i=<>];while(@a){say join$",@{$$_[1]}for grep!$$_[0],@a;
@a=map{$x=$_;map{$$x[0]=~$w{$_}?[substr($$x[0],$+[0]),[@{$$x[1]},$_]]:()}@w}@a}

(linebreaks only for formatting).
Ungolfed code:
# Read the word list
open my $dictionary, '<', 'd';
chomp(my @words = <$dictionary>);

# Define morse characters
my %morse;
@morse{'a' .. 'z'} = map {
  $n = ord($_) - 61;
  $bits = sprintf "%b", $n;
  $bits =~ tr/01/.-/;
  substr $bits, 1;
} split //, 'BUWI?OKMATJQDCLSZGE@FNHVXY';

# Make a hash of words to regexes that match their morse representation
my %morse_words = map {
  my $morse_word = s/./$morse{$_}/reg;
  ($_ => qr/^\Q$morse_word/)
} @words;

# Read the input
my $input = <>;

# Initialize the state
my @candidates = ({ remaining => $input, words => [] });

while (@candidates) {
  # Print matches
  for my $solution (grep { $_->{remaining} eq '' } @candidates) {
    say join " ", @{ $solution->{words} };
  }
  # Generate new solutions
  @candidates = map {
    my $candidate = $_;
    map {
      $candidate->{remaining} =~ $morse_words{$_}
        ? {
          remaining => substr( $candidate->{remaining}, $+[0] ),
          words => [ @{ $candidate->{words} }, $_ ],
        }
        : ()
    } @words
  } @candidates;
}

Modus Operandi:
Morse code symbols are stored by changing "." and "-" into binary digits 0 and 1, prepending a "1" (so that leading dots aren't gobbled up), converting the binary number into decimal, and then encoding the character with the value 61 higher (which gets me all printable chars and nothing that needs backslashing).
I thought of this as a kind of partitioning problem, and built a solution based on that. For each word in the dictionary, it constructs a regex object that will match (and capture) that word's spaceless morse representation at the beginning of a string. Then it begins a breadth-first search by creating a state that has matched no words and has the entire input as "remaining input". Then it expands each state by looking for words that match at the beginning of the remaining input, and creating new states that add the word to the matched words and remove the morse from the remaining input. States that have no remaining input are successful and have their list of words printed. States that can't match any words (including successful ones) generate no child states.
Note that in the ungolfed version the states are hashes for readability; in the golfed version they're arrays (for shorter code and less memory consumption); slot [0] is the remaining input and slot [1] is the matched words.
Commentary
This is ungodly slow. I'm wondering if there's a solution that isn't. I tried to build one using Marpa (an Earley parser with the ability to give multiple parses for a single input string) but ran out of memory just constructing the grammar. Maybe if I used a lower-level API instead of the BNF input...

If I add the same requirement as Kevin Reid (no newline in the input) I can save 7 characters by removing chomp(). Should I?

"Feel free to use any method convenient".

Shave 2 bytes with ord instead of ord$_. Shave 1 byte saying join$" instead of join" "

Haskell - 418
This decoing problem can be solved efficiently by dynamic programming. I know this is a codegolf, but I love fast code.
Say we have the input string s, then we build an array dp, dp[i] is the list of all valid decoding results of substring s[:i]. For each word w in the dictionary, first we encoding it to mw, then we can compute part of dp[i] from dp[i - length(mw)] if s[i - length(mw):i] == mw. The time complexity of building dp is O({count of words} {length of s} {max word length}). Finally, dp[length(s)], the last element, is what we need.
In fact, we don't need to store the whole decoding as the element of each dp[i]. What we need is the last decoded word. This make the implementation a lot faster. It cost less than 2 seconds to finished the "hello world" case on my i3 laptop. For other cases posted in the question, the program will not finish pratically since there are too many to output.
Using the dynamic programming technique, we can compute the number of valid decodings. You can find the code here. Results:
input: ......-...-..---.-----.-..-..-..
count: 403856

input: .--..-.-----..-..-----..-.--..--...---..--...-.......--.-..-.-.----...--.---.-....-.
count: 2889424682038128

input: -.....--.-..-..-.-.-.--....-.---.---...-.----..-.---..---.--....---...-..-.-......-...---..-.---..-----.
count: 4986181473975221635

Ungolfed
import Control.Monad

morseTable :: [(Char, String)]
morseTable = zip ['a'..'z'] $ words ".- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --.."

wordToMorse :: String -> Maybe String
wordToMorse xs = return . concat =<< mapM (`lookup` morseTable) xs

slice :: (Int, Int) -> [a] -> [a]
slice (start, end) = take (end - start) . drop start

decode :: String -> String -> IO ()
decode dict s = trace (length s) [] where
  dict' = [(w, maybe "x" id . wordToMorse $ w) | w <- lines dict]
  dp = flip map [0..length s] $ \i -> [(j, w) |
        (w, mw) <- dict', let j = i - length mw, j >= 0 && mw == slice (j, i) s]

  trace :: Int -> [String] -> IO ()
  trace 0 prefix = putStrLn . unwords $ prefix
  trace i prefix = sequence_ [trace j (w:prefix) | (j, w) <- dp !! i]

main :: IO ()
main = do
  ws <- readFile "wordlist.txt"
  decode ws =<< getLine

Golfed
import Control.Monad
l=length
t=zip['a'..]$words".- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --.."
h s=return.concat=<<mapM(`lookup`t)s
f d s=g(l s)[]where g 0 p=putStrLn.unwords$p;g i p=sequence_[g j(w:p)|(j,w)<-map(\i->[(j,w)|(w,m)<-[(w,maybe"x"id.h$w)|w<-lines d],let j=i-l m,j>=0&&m==(take(i-j).drop j$s)])[0..l s]!!i]
main=do d<-readFile"d";f d=<<getLine

Glad to see a reasonably efficient solution. Now I just have to understand it :)

PHP, 234 226 bytes
function f($s,$r=""){$s?:print"$r
";foreach(file(d)as$w){for($i=+$m="";$p=@strpos(__etianmsurwdkgohvf_l_pjbxcyzq,$w[$i++]);)$m.=strtr(substr(decbin($p),1),10,"-.");0!==strpos($s,$m)?:g(substr($s,strlen($m)),$r.trim($w)." ");}}

recursive function, takes dictionary from a file named d.
Fails for every word in the dictionary containing a non-letter.
You can use any file name if you define ("d","<filename>"); before calling the function.
Add 2 or 3 bytes for faster execution:
Remove $s?:print"$r\n";, insert $s!=$m? before 0!== and :print$r.$w before  ;}}.
breakdown
function f($s,$r="")
{
    $s?:print"$r\n";            // if input is empty, print result
    foreach(file(d)as$w)        // loop through words
    {
        // translate to morse:
        for($i=+$m="";              // init morse to empty string, $i to 0
                                        // loop while character is in the string
            $p=@strpos(__etianmsurwdkgohvf_l_pjbxcyzq,$w[$i++])
        ;)
            $m.=                        // 4. append to word morse code
                strtr(
                    substr(
                        decbin($p)      // 1: convert position to base 2
                    ,1)                 // 2: substr: remove leading `1`
                ,10,"-.")               // 3. strtr: dot for 0, dash for 1
            ;
        0!==strpos($s,$m)           // if $s starts with $m
            ?:f(                        // recurse
                substr($s,strlen($m)),  // with rest of $s as input
                $r.trim($w)." "         // and $r + word + space as result
            )
        ;
    }
}

Groovy 377 337
r=[:];t={x='',p=''->r[s[0]]=p+x;s=s.substring(1);if(p.size()<3){t('.',p+x);t('-',p+x)}};s='-eishvuf-arl-wpjtndbxkcymgzqo--';t()
m=('d'as File).readLines().groupBy{it.collect{r.get(it,0)}.join()}
f={it,h=[]->it.size().times{i->k=it[0..i]
if(k in m){m[k].each{j->f(it.substring(i+1),h+[j])}}}
if(it.empty){println h.join(' ')}}
f(args[0])

Notes
The dict must be a file named d.  The morse string is passed by command line.  e.g.:
% groovy morse.groovy ......-...-..---.-----.-..-..-.. | grep 'hello world'
hello world

For "morse code compression" I am using a binary tree

authors: Рустам Балафендиев


text:
Linking without a Link
Introduction
Hello!  This is my second post, and I decided to do one which is more language specific, since my last one was very much orientated towards mathematical languages, and thus did not leave room for languages like JavaScript or HTML.  If there is anyway to make this more clear, or to tidy up a wording problem, please do not hesitate to leave a comment below this post.
The Task
You have to create a JavaScript program which, when pasted into chrome's omnibar will open up the wonderful Google page.
The Catch
You may not use any characters within the google URL ("ceghlmopstw") or those characters in any other base.  Also, you may not use any other links, redirect links or IP addressed.
Extra Information

You can put JavaScript code in the omnibar by doing
"JavaScript://Code"
You cannot copy and paste javascript code into the omnibar.  The code below will actually strip the "javascript:" part, the result of which is to simply search for "alert("Hello World!").  To get around this, I suggest typing your code in an IDE, such as Notepad++ without the "JavaScript:" and then add it in the omnibar when you go to test it.
javascript:alert("Hello World!")
As this is code golf, the shortest entry wins!

Bonuses

Each bonus will take away a certain amount of points from the total amount of characters, bonuses that are percentages will stack, so if one received a 20% bonus and a 25% bonus, they would in essence receive a 45% bonus.
25% - Changeable - You can change the website URL without doing complicated maths, or having to change the entire code!
50 chars - NoScript - Don't use any JavaScript!  I have no idea how your going to achieve this!
25 chars - Exceptional - Don't use the ".:/" characters in your code.  Removed from the main task as "JavaScript:" requires a colon.
15 chars - Multi-lingual - Make a solution that makes use of 3 or more languages!

TL;DR
You must code something to put in the chrome omnibar, that then redirects you to https://www.google.com without using the characters "ceghlmopstw"
Leader Board
soktinpk - 24  - Exceptional - First post to complete it in a way I had expected!
Someone  - -40 - NoScript    - Used a redirect link however.  Points for finding one without those characters, all of the ones I just found did!
Von llya - -37 - NoScript    - Used an IP address!

Does anyone else get nervous, while waiting for the first comment or answer, whether people will hate your task and down vote you?  I always have this mini-panic attack that delays me from posting questions xD!  While trying to download Paint.net (computer rebuild) my internet speed is 128Kbps... back to ISDN speeds.

Just an fyi that language specific scripts are generally discouraged (as you may well know). This looks fine however since it's not like the omnibar understands C++ ;) (I admit I'm not bothering to try.)

What counts as "opening up the wonderful Google page"? In your answer, bear in mind that for people in most countries Google will respond to a request for www.google.com with a redirect to a country-specific site. Also, how is one supposed to write a javascript: URL without using the characters scpt?

I should add that "anything similar to your idea" is subjective and has no place in a scoring system on this site.

@Calvin'sHobbies Thanks for the heads up!  For my next posts I will try to think up an interesting puzzle for all languages!

@PeterTaylor  You have made some very good points.  I believe that if everyone makes a program that heads to www.google.com, it will be fair for all countries, plus, as you said, it would go to their country-specific site anyway.  I didn't quite think that JavaScript would use the letter disallowed, even though I did with the colon!  I'll edit that in the post.  For the thing about similarity, I don't really know how to put it.  I want to discourage posts that just steal another persons idea and golf it better.  Do you have any ideas?

@PopeyGilbert I've found that people stealing other's code without attribution is rare and likely to be downvoted, so I wouldn't worry about it too much.

@Calvin'sHobbies Okay, would you recommend I remove the bonus completely?

@PopeyGilbert Probably since it is subjective and people are likely to think of the same solutions themselves anyway (e.g. you and "Someone" both thought of using a URL shortener)

What you seem to be saying is that you want to discourage golfing on a question tagged [tag:code-golf]. That doesn't make any sense to me.

@PeterTaylor Is this about using multiple languages?  I feel that although golfing is a very fun thing to do.  It's better to have a level playing table.  Golf against people using your own language.

I had an idea but id doesn't works because there is a c, and I can't find a way to avoid it :'( %67%6f%6f%67%6c%65.%63%6f%6d.

This is Mision Impossible

It does seem to be very hard, however we did get our first answer!  Which is great =)

Javascript - 49 chars + (Exceptional bonus) = 24
There's a catch for this one; you have to have it open on this page. Also it will break as more links come to it. It requires jQuery.
javascript:$("a")[35][(r=(""+{})[5])+(""+!1)[2]+"i"+r+"k"]()

Commented version
$("a")[35] // Gets the 35th link (to google)
[
  (r=(''+{})[5]) // ''+{} is "[object Object]" get 5th char "c", assign it to variable r
  +(''+!1)[2] // grabs "l"
  +"i"+r+"k" // "ick" which makes "click" function
]() // Execute

As more links get published, you have to update the 35 to accomodate. (Again, it only runs on this page).
Tested on Chrome 35.0.1916.153

Do I get an exceptional bonus for not having .:/ in my answer?

Yeah!  Well done on our first completely legitimate answer!

No JavaScript
x.vu/zffW4Z

It took quite some searching to find an URL shortener that (a) was still around, and (b) avoided the prohibited characters.

Congratulations on your solution!  However I'm afraid it breaks the rule about "Also, you may not use any other links, or redirect links".  Might as well add yours to the leaderboard though =)

Ok, undeleted my answer since it somehow made it to the leaderboard anyway. :)