Logo

Studio AQuA LAB

  • Archivio
  • RSS
  • Domande
'\x3ciframe width=\x22500\x22 height=\x22375\x22 src=\x22http://www.youtube.com/embed/ApoTK56fMOk?wmode=transparent\x26autohide=1\x26egm=0\x26hd=1\x26iv_load_policy=3\x26modestbranding=1\x26rel=0\x26showinfo=0\x26showsearch=0\x22 frameborder=\x220\x22 allowfullscreen\x3e\x3c/iframe\x3e'

Oggi Apple ha pubblicato questo video sulla sua home page con alcuni degli interventi di Steve Jobs ai keynote e agli eventi Apple nel corso degli anni. Vengono mostrate le immagini di lui e dei prodotti ha creato e che ha cambiato il nostro modo di pensare e usare u computer e i dispositivi mobili. Il video inizia con la famosa citazione Wayne Gretzky che praticamente definisce la carriera di Jobs

Pattino dove sta andando il dischetto, non dove è stato.

Il messaggio dal CEO di Apple Tim Cook, che segue il video, ricorda il primo anniversario della morte e sottolinea l’importanza di Steve per quello che ha significato e continuerà a significare per l’azienda.

Fonte: TechCrunch

    • #Studio AQuA
    • #apple
    • #stevejobs
    • #video
  • 7 mesi fa
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+
Oggi Facebook annuncia di aver superato la soglia di 1 miliardo di utenti
Pop-upView Separately

Oggi Facebook annuncia di aver superato la soglia di 1 miliardo di utenti

    • #Facebook
    • #Studio AQuA
    • #Guinness
  • 7 mesi fa
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+

Geotagging photos in Wordpress

A partire dalla versione 2.5 Wordpress supporta l’estrazione dei dati EXIF e IPCT dall’header delle foto. Per visualizzare queste informazioni bisogna creare il proprio template file single.php o image.php all’interno della cartella del tema in uso ed aggiungere alcuni frammenti di codice che vedremo qui di seguito.

Nel codice core di Wordpress non tutte le informazioni EXIF e IPCT vengono prelevate dalla foto, in particolare mi sto riferendo alle informazioni di geolocalizzazione. Per poter recuperare queste foto bisogna aggiungere il seguente filtro alla funzione wp_read_image_metadata, quindi aggiungere il codice qui sotto al file function.php (che si trova dentro alla cartella del tema in uso, se non c’è creare il file):

add_filter('wp_read_image_metadata', 'saveGeoExif','',3);
function saveGeoExif($meta,$file) {
    $exif = @exif_read_data($file);
 
    if (isset($exif['GPSLatitude'])){
        $meta['GPSLatitude'] = $exif['GPSLatitude'];
    }
    if (isset($exif['GPSLatitudeRef'])){
        $meta['GPSLatitudeRef'] = trim($exif['GPSLatitudeRef']);
    }
    if (isset($exif['GPSLongitude'])){
        $meta['GPSLongitude'] = $exif['GPSLongitude'] ;
    }
    if (isset($exif['GPSLongitudeRef'])){
        $meta['GPSLongitudeRef'] = trim($exif['GPSLongitudeRef']);
    }
 
    if (isset($exif['GPSAltitudeRef'])){
        $meta['GPSAltitudeRef'] = trim($exif['GPSLongitudeRef']);
    }
    if (isset($exif['GPSAltitude'])){
        $meta['GPSAltitude'] = trim($exif['GPSLongitudeRef']);
    }
    if (isset($exif['GPSTimeStamp'])){
        $meta['GPSTimeStamp'] = $exif['GPSLongitudeRef'];
    }
    if (isset($exif['GPSDOP'])){
        $meta['GPSDOP'] = $exif['GPSLongitudeRef'];
    }
    if (isset($exif['GPSImgDirectionRef'])){
        $meta['GPSImgDirectionRef'] = trim($exif['GPSLongitudeRef']);
    }
    if (isset($exif['GPSImgDirection'])){
        $meta['GPSImgDirection'] = trim($exif['GPSLongitudeRef']);
    }
 
    return $meta;
}

In questo modo ogni volta che viene caricata una foto, verranno salvate nel database anche tutte queste informazioni di posizione.

Ora vediamo come visualizzare queste informazioni. All’interno del file single.php o image.php aggiungiamo quanto segue. Per prima cosa vanno inserite queste due funzioni per poter convertire nel formato corretto longitudine e latitudine.

function fractionResult($fraction){
    list($sup, $sub) = explode('/', $fraction);
    if(floatval($sub) != 0){
        return $sup / $sub;
    }else{
        return 0;
    }
}

function getCoord($fractional, $ref){
    $coord = 0;
    if(is_array($fractional)){
        $coord = fractionResult($fractional[0]) + fractionResult($fractional[1]) / 60 + fractionResult($fractional[2]) / 3600;
    }
    if($ref == "S" || $ref == "W"){
        $coord = -$coord;
    }
    return $coord;
}

Ora dobbiamo recuperare l’ID di tutte le foto allegate (attachments) ad un post.

// Recupera tutte le foto allegate al post
$args = array(
  'post_type' => 'attachment',
  'numberposts' => -1,
  'post_status' => null,
  'post_parent' => $post->ID
);
$attachments = get_posts( $args );

A questo punto iteriamo su tutte le foto ed eseguiamo la funzione che ci permette di recuperare i metadati di cui abbiamo bisogno.

if ( $attachments ) {
  foreach ( $attachments as $attachment ) {
    $imgmeta = wp_get_attachment_metadata( $attachment->ID );

    // Convert the shutter speed retrieve from database to fraction
    if ((1 / $imgmeta['image_meta']['shutter_speed']) > 1) {
        if ((number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1)) == 1.3
	    or number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1) == 1.5
	    or number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1) == 1.6
	    or number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1) == 2.5){
	  $pshutter = "1/" . number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1, '.', '') . " second";
	} else {
          $pshutter = "1/" . number_format((1 / $imgmeta['image_meta']['shutter_speed']), 0, '.', '') . " second";
	}
    } else {
      $pshutter = $imgmeta['image_meta']['shutter_speed'] . " seconds";
    }

    // Convert latitude and longitude								
    if(isset($imgmeta['image_meta']['GPSLatitude']))
      $lat = getCoord($imgmeta['image_meta']['GPSLatitude'], $imgmeta['image_meta']['GPSLatitudeRef']);
    if(isset($imgmeta['image_meta']['GPSLongitude']))
      $long = getCoord($imgmeta['image_meta']['GPSLongitude'], $imgmeta['image_meta']['GPSLongitudeRef']);
									
    // Start to display EXIF and IPTC data of digital photograph
    echo "Date Taken: ".date("d-M-Y H:i:s", floatval($imgmeta['image_meta']['created_timestamp']))."<br />";
    echo "Copyright: ".$imgmeta['image_meta']['copyright']."<br />";
    echo "Credit: ".$imgmeta['image_meta']['credit']."<br />";
    echo "Title: ".$imgmeta['image_meta']['title']."<br />";
    echo "Caption: ".$imgmeta['image_meta']['caption']."<br />";
    echo "Camera: ".$imgmeta['image_meta']['camera']."<br />";
    echo "Focal Length: ".$imgmeta['image_meta']['focal_length']."mm<br />";
    echo "Aperture: f/".$imgmeta['image_meta']['aperture']."<br />";
    echo "ISO: ".$imgmeta['image_meta']['iso']."<br />";
    echo "Shutter Speed: ".$pshutter."<br />";
    echo "Latitude: ".$lat."<br />";
    echo "Longitude: ".$long."<br />";
  }
}

Eccovi qui i link ai tutorial che mi hanno illuminato il buio sentiero della geolocalizzazione delle foto in Wordpres.

http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information
http://www.lucianmarica.com/stuff/geotagging-from-image-exif-data-in-wordpress

Con questo è tutto per oggi.
Bye bye, Rob

    • #wordpress
    • #geolocation
    • #EXIF
    • #IPCT
  • 8 mesi fa
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+
'\x3ciframe width=\x22500\x22 height=\x22281\x22 src=\x22http://www.youtube.com/embed/NdDU_BBJW9Y?wmode=transparent\x26autohide=1\x26egm=0\x26hd=1\x26iv_load_policy=3\x26modestbranding=1\x26rel=0\x26showinfo=0\x26showsearch=0\x22 frameborder=\x220\x22 allowfullscreen\x3e\x3c/iframe\x3e'

The LEGO story ia a perfect example of “never give up” idea. Don’t you think so? 

Fonte: ninjamarketing.it

    • #lego
    • #startup
    • #never give up
    • #entrepreneur
  • 8 mesi fa
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+

Paginated Scan on DynamoDB

Riprendendo il post fatto un mese fa circa a proposito di DynamoDB ho potuto verificare che aumentando la capacità di scrittura e di lettura le prestazioni migliorano. Tanto per darvi un’idea, salvare un totale di 650 messaggi di dimensione random da 50byte a 1200byte ho misurato un tempo di latenza medio di circa 315ms (la latenza in questo caso corrisponde al tempo che trascorre dal momento in cui un client invia il messaggio al momento in cui riceve dal server la conferma che il messaggio è stato salvato nella tabella di DynamoDB.

Altra cosa da tener presente quando si effettua una scansione della tabella, il metodo scan() è paginato. Questo significa che restituisce al massimo 1MB di dati alla volta, se ci sono ancora dati nella tabella restituisce anche un LastEvaluatedKey e passandolo come parametro ad un’altra chiamata del metodo scan() ti restituisce la “pagina” successiva di items.

A presto, Rob

    • #DynamoDB
    • #scan
  • 1 anno fa
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+

Template diversi in base al URL alias per D7 

Questa mattina ho scoperto che Drupal 7 ha modificato il modo di gestire il nome dei template files. Tempo fa, in un progetto con Drupal 6, avevo modificato la funzione mytheme_preprocess_page(&$vars) presente nel file template.php per poter gestire template diversi su pagine differenti basandomi sul URL alias della pagina stessa. Ecco qui di seguito il codice per D6:

// Different page templates depending on URL aliases
if (module_exists('path')) {
    $alias = drupal_get_path_alias(str_replace('/edit','',$_GET['q']));
    if ($alias != $_GET['q']) {
      $template_filename = 'page';
      foreach (explode('/', $alias) as $path_part) {
        $template_filename = $template_filename . '-' . $path_part;
        $vars['template_files'][] = $template_filename;
      }
    }
}

In Drupal 7 questo codice non funziona perché è stata modificata la variabile che gestisce il nome del template, non è più $vars[‘template_files’] ma bensì $vars[‘theme_hook_suggestions’] e al posto del separatore ‘-’ viene utilizzato il doppio “underscore” ‘__’. Riporto qui sotto il codice modificato:

// Different page templates depending on URL aliases
  if (module_exists('path')) {
    $alias = drupal_get_path_alias(str_replace('/edit','',$_GET['q']));
    if ($alias != $_GET['q']) {
      $template_filename = 'page';
      foreach (explode('/', $alias) as $path_part) {
        $template_filename = $template_filename . '__' . $path_part;
        $vars['theme_hook_suggestions'][] = $template_filename;
      }
    }
  }

Dimenticavo il nome del template file ora dev’essere page—<path_alias_part>.tpl.php.

A presto, Rob

    • #drupal 7
    • #template
    • #URL alias
  • 1 anno fa
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+

Apertura, umiltà, collaborazione: solo così noi startupper cambieremo l'Italia

Fonte: chefuturo.it

  • 1 anno fa
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+
'\x3ciframe src=\x22http://player.vimeo.com/video/35802534\x22 width=\x22500\x22 height=\x22375\x22 frameborder=\x220\x22\x3e\x3c/iframe\x3e'

Studio AQuA è il risultato della fusione di due personalità e molte passioni

    • #Studio AQuA
    • #Video
    • #Nicola Stocco
    • #Roberto Peruzzo
    • #Founders
    • #Team
    • #Introduction
  • 1 anno fa
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+
Il 19 gennaio scorso Amazon ha annunciato l&#8217;introduzione di un nuovo servizio NoSQL Database: DynamoDB. L&#8217;aspetto che più mi interessa tra i vantaggi presentati dall&#8217;articolo scritto nel blog di Werner Vogels è quello della velocità che si traduce in una riduzione della latenza per garantire uno throughput elevato.
Per ora sto eseguendo alcuni test di scrittura con un&#8217;account Amazon Free Tier. I risultati non sono entusiasmanti, molto probabilmente dovuti dai limiti imposti (max 5 write per second). I miei test procederanno e sarò lieto di pubblicare qualcosa nei prossimi giorni a riguardo, nel frattempo vi posto alcune righe di codice per poter interagire con DynamoDB.
A presto, Rob.
// Get PropertiesCredentials
InputStream credentialsAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("AwsCredentials.properties");
AWSCredentials credentials = new PropertiesCredentials(credentialsAsStream);
			
// Activate the Amazon SimpleDB Client
this.dynamoDB = new AmazonDynamoDBClient(credentials);
			
// Create a table with a primary key named 'name', which holds a string
CreateTableRequest createTableRequest = new CreateTableRequest()	.withTableName(tableName)	.withKeySchema(new KeySchema(new KeySchemaElement()	.withAttributeName("messageId").withAttributeType("S")))	.withProvisionedThroughput(new ProvisionedThroughput()	.withReadCapacityUnits(10L).withWriteCapacityUnits(5L));
tableDescription = this.dynamoDB.createTable(createTableRequest).getTableDescription();
// Save itemMap item = newItem(	recordId, clientId, body, System.currentTimeMillis());
PutItemRequest putItemRequest = 	new PutItemRequest(this.table, item);PutItemResult putItemResult = dynamoDB.putItem(putItemRequest);/** * Create item object. */private Map&lt;String, AttributeValue&gt; newItem(	String messageId, String clientId, String body, long created) {	Map&lt;String, AttributeValue&gt; item = 		new HashMap&lt;String, AttributeValue&gt;();	item.put("messageId", new AttributeValue(messageId));	item.put("clientId", new AttributeValue(clientId));	item.put("body", new AttributeValue(body));	item.put("created", new AttributeValue().withN(Long.toString(created)));	return item;}
Pop-upView Separately

Il 19 gennaio scorso Amazon ha annunciato l’introduzione di un nuovo servizio NoSQL Database: DynamoDB. L’aspetto che più mi interessa tra i vantaggi presentati dall’articolo scritto nel blog di Werner Vogels è quello della velocità che si traduce in una riduzione della latenza per garantire uno throughput elevato.

Per ora sto eseguendo alcuni test di scrittura con un’account Amazon Free Tier. I risultati non sono entusiasmanti, molto probabilmente dovuti dai limiti imposti (max 5 write per second). I miei test procederanno e sarò lieto di pubblicare qualcosa nei prossimi giorni a riguardo, nel frattempo vi posto alcune righe di codice per poter interagire con DynamoDB.

A presto, Rob.

// Get PropertiesCredentials
InputStream credentialsAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("AwsCredentials.properties");
AWSCredentials credentials = new PropertiesCredentials(credentialsAsStream);
			
// Activate the Amazon SimpleDB Client
this.dynamoDB = new AmazonDynamoDBClient(credentials);
			
// Create a table with a primary key named 'name', which holds a string
CreateTableRequest createTableRequest = new CreateTableRequest()
.withTableName(tableName)
.withKeySchema(new KeySchema(new KeySchemaElement()
.withAttributeName("messageId").withAttributeType("S")))
.withProvisionedThroughput(new ProvisionedThroughput()
.withReadCapacityUnits(10L).withWriteCapacityUnits(5L));
tableDescription = this.dynamoDB.createTable(createTableRequest).getTableDescription();
// Save item
Map item = newItem(
recordId, clientId, body, System.currentTimeMillis()); PutItemRequest putItemRequest = 
new PutItemRequest(this.table, item);
PutItemResult putItemResult = dynamoDB.putItem(putItemRequest);

/**
* Create item object.
*/
private
Map<String, AttributeValue> newItem(
String messageId, String clientId, String body, long created) {

Map<String, AttributeValue> item =
new HashMap<String, AttributeValue>();

item.put("messageId", new AttributeValue(messageId));
item.put("clientId", new AttributeValue(clientId));
item.put("body", new AttributeValue(body));
item.put("created", new AttributeValue().withN(Long.toString(created)));

return
item;
}

    • #AWS
    • #Amazon Web Services
    • #DynamoDB
    • #Studio AQuA
    • #Tips
    • #Java
  • 1 anno fa
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+
lostaff:

Nice! AddThis ha appena pubblicato la sua statistica sulla “condivisione” sul web nel 2011.
Sembra che voi ragazzi siate stati piuttosto impegnati. :)
View Separately

lostaff:

Nice! AddThis ha appena pubblicato la sua statistica sulla “condivisione” sul web nel 2011.

Sembra che voi ragazzi siate stati piuttosto impegnati. :)

Fonte: adage.com

    • #AddThis
    • #Sharing Trends 2011
  • 1 anno fa > staff
  • 7824
  • Link permanente
Share

URL Corto

TwitterFacebookPinterestGoogle+
Pagina 1 di 3
← Recenti • Precedenti →

Social

  • @studioaqua on Twitter
  • studioaqua on Vimeo
  • studioaqualab on Youtube
  • Linkedin Profile

Twitter

loading tweets…

Top

  • RSS
  • Casuale
  • Archivio
  • Domande
  • Mobile
Effector Theme by Pixel Union