Marco Pracucci

Marco Pracucci – Technology news and blog

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!

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.

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

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 more →

[youtube Pl4JICjTPHI]

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.

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

Mobitouch cube, la nuova piattaforma di proximity marketing di Waymedia, verrà rilasciata pubblicamente lunedi 5 Maggio. Questa piattaforma, che rappresenta un’importante milestone per Waymedia, introduce una nuova architettura, un CMS (Content Management System) completamente riscritto e nuove funzionalità supportate.

Nodi – Configurazione base

Il termine nodo viene utilizzato per indicare un access-point bluetooth che effettua il push di contenuti multimediali ai dispositivi mobili che transitano nella sua area di copertura. Questi nodi vengono gestiti e configurati attraverso Mobitouch cube CMS, un’applicazione web-based fornita da Waymedia.

Funzionalità base principali:

  • Configurazione singolo nodo
  • Configurazione gruppo di nodi
    • Blacklist (successi, rifiuti, fallimenti, notifiche scadute)
    • Statistiche (formato, dispositivi di monitoring)
    • Sistema (timezone, sincronizzazione, networking)
    • Fine-tuning algoritmo di device identification
    • Fine-tuning parametri Bluetooth avanzati (ottimizzazione trasmettitori)
  • Raggruppamento di nodi in zone
    • Possibilità di creare un numero illimitato di zone
    • Drag and drop per muovere uno o più nodi tra due zone



Campagne – Creazione campagna semplice

Una campagna rappresenta un periodo temporale nel quale uno o più nodi effettuano il push di contenuti. La campagna più semplice, come mostra il video, consiste di un unico contenuto inviato indistintamente a tutti i dispositivi mobili.




E’ possibile creare campagne più complesse, nelle quali vengono inviati più contenuti (es. wallpaper), ciascuno composto da un insieme di file che rappresentano lo stesso contenuto informativo (es. immagine del wallpaper) ma in formati differenti (es. wallpaper adattato per specifiche risoluzioni dello schermo). Queste funzionalità avanzate verranno mostrare in uno dei prossimi screencast che pubblicherò su questo blog.

Note

  • Consiglio di visionare i video in fullscreen, per ottenere una migliore risoluzione
  • L’aspetto dell’interfaccia grafica potrebbe subire modifiche e migliorie prima del rilascio ufficiale.

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

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.

Copyright © 2009 Marco Pracucci.

Powered by Wordpress. Theme by One Theme Per month.