Crea la tua web radio con Spreaker!

February 25th, 2010

Spreaker è una web radio dove tutti gli show radiofonici sono creati dagli utenti. La novità di questa web radio è dare la possibilità a chiunque di diventare speaker e realizzare così il proprio show (registrato oppure in diretta).

Spreaker mette a disposizione degli utenti una deejay console online, strumento che permette di mixare la propria voce con una libreria musicale contenente canzoni, jingle ed effetti sonori che si possono utilizzare durante lo show.

Spreaker Web Radio - Online Deejay Console

Spreaker Web Radio - Online Deejay Console

I diritti ed i costi di streaming sono a carico di Spreaker ed il servizio è gratuito per gli utenti (sia speaker che ascoltatori). Il modello di business si basa sulla pubblicità audio e così l’unico vincolo imposto agli speaker è quello di introdurre uno spot pubblicitario di 30 secondi ogni 15 minuti di programmazione.

Crea la tua web radio con Spreaker!

Mobile browsers comparison chart

November 19th, 2008

Gizmodo has published an interesting article that compares several mobile browsers, testing how most recent mobile phones deliver the real web. The award for the best mobile browser goes to iPhone and Android.

3G chart

Mobile browsers comparison - 3G

Wi-Fi chart

Mobile browsers comparison - Wi-fi

For more information read the original article.

Zend Framework and Session Cookies across Subdomains

September 24th, 2008

Session support in PHP consists of a way to preserve certain data across subsequent accesses. Each visitor accessing the web site is assigned a unique id, the session id. This session id is either stored in a cookie or propagated in the url. The best solution is to store it in a cookie.

The cookie used to store the session id sets, by default, the cookie domain to the current domain. This means that if you are visiting www.domain.com, the session id will be stored in a cookie bounded to the domain www.domain.com. This behavior leads to a problem: if your site uses multiple subdomains, the session won’t be shared between the site’s subdomains.

To solve this problem you have to share the cookie between all subdomains, setting its domain it to “.domain.com”. The following code shows how to change the session cookie domain with Zend Framework:

Zend_Session::start(array('cookie_domain' => '.domain.com'));

Browers compatibility

The prefix dot in “.domain.com” is not always necessary, but it’s highly recommended to support all browsers.

References

Watermarks with PHP and IMagick

August 30th, 2008

There are a lot of web sites, online communities and social networks that apply a watermark over photos uploaded from users. This watermark, usually a logo or a text with the service name, should be applied in a region of the image where there are no important things, because no one likes to see a text over his face.

This simple feature requires an algorithm to automatically select the best corner where apply the watermark.

The algorithm

The watermark should be placed in the corner with the lowest number of graphic details, in order to be as less invasive as possible. To select the best corner, the proposed algorithm counts the number of different colours inside each corner and applies the watermark to the corner with the lowest number of different colours.

This algorithm is very simple but effective, and can be described with the following steps:

  1. For each candidate image region (corners) calculate the number of different colours
  2. Select the image region with the lowest number of different colours
  3. Apply the watermark to the selected region

The code

Here is the code the PHP code of a function that selects the best corner of an image and then apply the watermark.

/**
 * Draw a watermark over an image (the watermark position is
 * selected automatically) and returns true. If the watermark
 * is bigger than the image, this method returns false.
 *
 * @param IMagick $image
 * @param IMagick $watermark
 * @param int $padding
 * @return bool
 */
private function drawWatermark($image, $watermark, $padding = 0)
{
	// Check if the watermark is bigger than the image
	$image_width 		= $image->getImageWidth();
	$image_height 		= $image->getImageHeight();
	$watermark_width 	= $watermark->getImageWidth();
	$watermark_height 	= $watermark->getImageHeight();

	if ($image_width < $watermark_width + $padding || $image_height < $watermark_height + $padding) {
		return false;
	}

	// Calculate each position
	$positions = array();
	$positions[] = array(0 + $padding, 0 + $padding);
	$positions[] = array($image_width - $watermark_width - $padding, 0 + $padding);
	$positions[] = array($image_width - $watermark_width - $padding, $image_height - $watermark_height - $padding);
	$positions[] = array(0 + $padding, $image_height - $watermark_height - $padding);

	// Initialization
	$min 		= null;
	$min_colors = 0;

	// Calculate the number of colors inside each region
	// and retrieve the minimum
	foreach($positions as $position)
	{
		$colors = $image->getImageRegion(
			$watermark_width,
			$watermark_height,
			$position[0],
			$position[1])->getImageColors();

		if ($min === null || $colors <= $min_colors)
		{
			$min 		= $position;
			$min_colors = $colors;
		}
	}

	// Draw the watermark
	$image->compositeImage(
		$watermark,
		Imagick::COMPOSITE_OVER,
		$min[0],
		$min[1]);

	return true;
}

Read the rest of this entry »

Social networking wars

August 6th, 2008

[youtube Pl4JICjTPHI]

Notebook resistente all’acqua

May 9th, 2008

In Giappone, hanno realizzato un notebook resistente all’acqua. L’ha prodotto il colosso Nek, si chiama Shield Pro ed ha uno schermo da 12″.

E’ sicuramente un must per tutti coloro che hanno bisogno del portattile anche sotto la doccia ;)

Notebook resistente all’acqua

Nota: segnalato da Ema.

Programming languages context-switch

April 16th, 2008

Lavorando a mobitouch cube, mi capita spesso di passare da un linguaggio di programmazione ad un altro. E così scrivo codice Java in PHP, C in Java, Java in Javascript… con il risultato che non ci capisco più niente!

Maybe, I just need an holiday…

Programming languages caricatures

Voi non siete qui

April 10th, 2008

Ieri sera, ho provato a rispondere alle 25 domande di voisietequi e devo ammettere che ho scoperto di non avere quasi nulla in comune con nessuno dei partiti candidati per le prossime elezioni.

Voi siete qui

iPhone – Bluetooth OBEX profile non supportato

March 27th, 2008

iPhoneL’ultimo successo di casa Apple, l’iPhone, nonostante includa un trasmettitore Bluetooth 2.0 + EDR, non supporta alcuni dei più diffusi profili Bluetooth:

  • OBEX (Object Exchange)
  • A2DP (Advanced Audio Distribution Profile)
  • DUN (Dial-up Networking Profile)

Questo significa che non è possibile inviare/ricevere file a/da altri telefoni via Bluetooth (OBEX), ascoltare la musica in stereo con altoparlanti/cuffie Bluetooth (A2DP) o utilizzare l’iPhone stesso come modem (DUN).

Mi auguro che nelle prossime release del firmware aggiungano il supporto per questi tre diffusi protocolli, aumentando così i possibili utilizzi di questo bel giocattolino!

Firma la petizione per richiedere il supporto OBEX.