Claudio Cherubino's blog Life of a Googler

7Feb/088

Film e serie tv gratis con Stage6

Grazie a Daniele ho scoperto Stage6, un servizio simile a YouTube dove è possibile pubblicare dei video da visionare gratuitamente in streaming.

Rispetto a YouTube ci sono però delle differenze importanti.

Innanzitutto molti video sono in formato HD (risoluzione 1080p) ed inoltre è possibile trovare una grande quantità di film completi in lingua italiana.

Oltre ai numerosi film (da Kill Bill a Quarto Potere) si trovano anche tante serie tv (Lost, Heroes, Dr House, ...) e cartoni animati di ogni genere, sia in italiano che in lingua originale con i sottotitoli.

Tra questi potrei citare Naruto, One Piece o i Simpson e se siete interessati un buon punto di partenza è costituito dal canale OtakuTV.

I video infatti possono essere catalogati per canale ma anche ricercati liberamente in base ad alcune parole chiave o tag (ad esempio provate "italiano" o "ita").

La qualità dei video è eccezionale, l'unico dubbio che mi viene alla mente riguarda la legalità di questo servizio, dato che non penso proprio che la condivisione di film protetti da copyright sia stata autorizzata.

Se è come immagino, non passerà molto tempo prima che le armate di legali delle major televisive si muoveranno sul piede di guerra contro Stage6, ma fino ad allora vi consiglio di approfittarne!

4Feb/080

Project Euler in F# – Problem 16

This time we are gonna "cheat".

As in Problem 20 we have to sum the digits of a number, so we can just copy and paste the whole code and edit a single line to have a working solution.

The problem says:

2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.

What is the sum of the digits of the number 2^1000?

The only difference between this exercise and the last one is the number to evaluate.

However, as for the factorial, F# already provides us with a native function for the powers of a numbers, so the final code will be:

#light
open Microsoft.FSharp.Math.BigInt

let rec digits n =
    match n with
    | n when n < 10I -> n
    | n ->
        let x, y = divmod n 10I
        y + digits x

let answer = digits (pow 2I 1000I)

If you compare this exercise with the last one, you can see that we actually changed one line, i.e. line 11.

Do you really want me to explain this code?