468x60

lunedì 27 gennaio 2014

Mysql error 1093 - Can't specify target table for update in FROM clause

Queries of the following type can not be run on MySQL, because in a DELETE query you can not specify the same table both on FROM and on WHERE:
DELETE FROM story_category
WHERE category_id NOT IN (
        SELECT DISTINCT category.id AS cid FROM category 
        INNER JOIN story_category ON category_id=category.id
)
We must therefore modify the query as follows:
DELETE FROM story_category
WHERE category_id NOT IN (
    SELECT cid FROM (
        SELECT DISTINCT category.id AS cid FROM category 
        INNER JOIN story_category ON category_id=category.id
    ) AS c
)

Mysql error 1093 - Can't specify target table for update in FROM clause

Query del seguente tipo non possono essere eseguite su MySQL, perchè in una query DELETE non è possibile specificare la stessa tabella sia in FROM che in WHERE:
DELETE FROM story_category
WHERE category_id NOT IN (
        SELECT DISTINCT category.id AS cid FROM category 
        INNER JOIN story_category ON category_id=category.id
)
Bisogna perciò modificare la query nel seguente modo:
DELETE FROM story_category
WHERE category_id NOT IN (
    SELECT cid FROM (
        SELECT DISTINCT category.id AS cid FROM category 
        INNER JOIN story_category ON category_id=category.id
    ) AS c
)

giovedì 23 gennaio 2014

The green house will be 3D printed in 24 hours

The revolutionary robot of Professor Behrokh Khoshnevis can print in 3D a house of 230 square meters in 24 hours. The technology was developed at the University of Southern California. The device is based on the principles of the countour crafting, a process of three-dimensional printing for large objects that proceeds layer by layer. The use of this process limits the waste of electricity and emissions harmful to the environment.


How it's done
The 3D printer has two large arms similar to the crane and a cross beam that carries the printhead. The whole machine runs through the tracks and can work simultaneously on all parts of the house. Professor Khoshnevis believes that the printer can build a two-storey house in just one day. Because the printer is doing its job, the surrounding space must be prepared and must be the foundation already in place. The innovative 3D technology for large structures could revolutionize the construction industry and fill the growing demand for houses in urban centers.

Why it's good for the environment
Garbage is a major problem in conventional construction methods. To erect a single-family home generates between 3 and 7 tonnes of garbage. In addition, resources are dispersed and this contributes greatly to harmful emissions. In general, with the new technique using fewer materials, not wasting raw materials and uses less electricity. The means used to transport materials can only make a round trip and one return, reducing the use of fuel.

La casa green si stamperà in 3D in 24 ore

Il rivoluzionario robot del professor Behrokh Khoshnevis può stampare in 3D una casa di 230 metri quadri in 24 ore. La tecnologia è stata sviluppata presso la University of Southern California. Il dispositivo è basato sui principi del countour crafting, un processo di stampa tridimensionale per oggetti di grandi dimensioni che procede strato per strato. Il ricorso a questo processo limita lo spreco di energia elettrica e le emissioni dannose per l'ambiente.


Com'è fatta
La stampante in 3D ha due grandi braccia simili a gru e una trave trasversale che trasporta la testina di stampa. L'intera macchina scorre attraverso binari e può lavorare simultaneamente su tutte le parti della casa. Il professor Khoshnevis crede che la stampante possa costruire una casa di due piani in appena un giorno. Perché la stampante faccia il suo lavoro, lo spazio circostante deve essere preparato e le fondamenta devono essere già al loro posto. L'innovativa tecnologia in 3D per le larghe strutture potrebbe rivoluzionare l'industria edile e colmare la crescente domanda di case nei centri urbani.

Perché fa bene all'ambiente
I rifiuti sono il problema maggiore nei metodi di costruzione convenzionali. Per erigere una casa unifamiliare generano dalle 3 alle 7 tonnellate di rifiuti. Inoltre, vengono disperse risorse e ciò contribuisce notevolmente alle emissioni dannose. In generale, con nuova tecnica si usano meno materiali, non sprecando materie prime e si usa meno energia elettrica. I mezzi usati per il trasporto dei materiali possono fare soltanto un viaggio di andata e uno di ritorno, riducendo l'impiego di carburante.

lunedì 13 gennaio 2014

The pasta of the future will be on the table thanks to a 3D printer

The pasta of the future will be on the table thanks to a 3D printer. A big step forward in their creativity in the kitchen for many cooks. And realize your own pasta it will not be difficult. Depend upon the imagination and artistic abilities of each one. We speak of a simple printer, but in 3D, such as the one developed by Barilla and by the Dutch company TnO to carry out the pasta with the shape you want and that you can print directly to your home. The process seems to be simple enough: virtually designed a new type of pasta, we will proceed to print. The printer layer after layer solidify the desired shape releasing a special ink, thus creating the desired shape of pasta.

 The innovative 3D printer created by the synergy between the multinational of the pasta and the Eindhoven society allow you to design and implement dried pasta shapes of various kinds. In a short time we will find the 3D printer for the pasta in restaurants, but in a not too distant future we will have a course in home.

La pasta del futuro sarà in tavola grazie ad una stampante 3D

La pasta del futuro sarà in tavola grazie ad una stampante 3D. Un bel passo in avanti quanto a creatività in cucina per molti cuochi. E realizzarsi la pasta da soli non sarà poi difficile. Dipenderà dalla fantasia e dalle capacità artistiche di ognuno. Parliamo di una semplice stampante, ma in 3D, come quella messa a punto da Barilla e dalla società  olandese TnO per realizzare la pasta con la forma che desideri e che potrai stampare direttamente a casa tua.  Il procedimento sembra abbastanza semplice: progettato virtualmente un nuovo formato di pasta, si procederà alla stampa. La stampante strato dopo strato solidificherà la forma desiderata sprigionando un inchiostro particolare creando così il formato di pasta desiderato.

 L’innovativa stampante 3D creata dalla sinergia fra la multinazionale della pasta e la società di Eindhoven consentirà di disegnare e realizzare  formati di pasta secca di vario genere. Tra non molto troveremo la stampante 3D per la pasta nei ristoranti, ma in un futuro non molto lontano ne avremo una certamente anche in casa.

venerdì 10 gennaio 2014

Script for checking if a file exists on Windows

Use this shell script to check for existence of a file on Windows. It was useful many times during the execution of tasks with certain conditions to check...
if exist "file_path_here" (echo "file exists") else (echo "file doesn't exist")

Script per controllare l'esistenza di un file su Windows

Usare questo script per controllare l'esistenza di un file su Windows. Mi è tornato utile molte volte durante l'esecuzione di task con determinate condizioni da controllare...
if exist "percorso_file_qui" (echo "il file esiste") else (echo "il file non esiste")

Come "pinnare" su Pinterest da ovunque (Google Immagini, Facebook...)

Se usi Google Chrome come browser, pinnare su Pinterest è semplice come cliccare un bottone con l'estensione Pinterest Chrome extension. Essa consente di trovare immagini, video, canzoni o altre cose "pinnabili" in tutto il web e pinnarle facilmente sulle tue bacheche.

image


Per installarla, dal Chrome Web Store bisogna cliccare su Add to Chrome.

image

How to pin on Pinterest from everywhere (google images, facebook...)

If you use the Google Chrome browser, pinning on Pinterest is now as easy as clicking a button with the Pinterest Chrome extension. It allows you to find images, videos, songs or other pinnable stuff across the web and easily pin them to your boards.

image


To install, simply head on over to the Chrome Web Store and click Add to Chrome.

image

iOptik science fiction contact lenses at CES 2014

Innovega has contact lenses that see beyond the human eye, capable of making already old Google Glasses. Anyone who has ever dreamed of a science fiction future in which interfaces are floating in front of us and the information does not exist on the screens, but are projected in front of our eyes, chances are you will soon be able to touch all these things thanks to the market of wearable technologies that making inroads with great anticipation.

With its system iOptik lenses wearable developed by startup Innovega offering its futuristic vision that we have always seen in the movies and now can become reality. The company has designed the special contact lenses that are also headlamps of information. It is a great innovation that goes far beyond what Google has promised with his glasses smart Google Glass.

Real display mounted on the eyes of the people, as is the case of the lenses above, or simpler devices such as augmented reality can be the Google Glass, the fact remains that this kind of products are ready to be at the forefront of technology wearable. One of the biggest obstacles right now is that, while technology can provide unprecedented performance, yet few have the opportunity to test these devices, and certainly when they arrive on the mass market costs will be high.

Innovega clearly knows what he wants to do in his immediate future: making the best view for all, through a pair of contact lenses, but not only. "Several companies have developed hardware to adapt to smart glass. We want to improve the view for all through a pair of contact lenses and for those who wish, increase with network information through the glasses."

Making a direct comparison with the Google solution, Innovega says that "in comparison with the Google Glass giving a vision equivalent to that of a smartphone placed 60 cm in front of the eyes, iOptik has a resolution six times higher and 20 times the viewing area available."

Innovega, who presented his device iOptik augmented reality on the head of a mannequin at CES last year, he was confident in the fact of being able to bring the technology to market soon. The company, headed by CEO Stephen Willey, is back at CES 2014, but this year with a fully functional prototype.

Once worn, the lenses allow you to have a clear and comparable to what can be seen through a microscope. "Imagine segments of the skin on a finger which, by the use of contact lenses, become more defined and distinguishable to the naked eye," explains Innovega. In this way, the eye becomes like that of Superman, in fact capable of recognizing people, cars and objects to tens of meters away.

For those who want something more than the lenses you can wear glasses with embedded micro projectors that interact with applications and multimedia content, creating a perfect experience and improved style of Google Glass.

Using both lenses glasses, promises Innovega, the wearer of the device can recognize items, manage multiple windows on the panel that is projected in front of him, without going to harm the visual field.

iOptik, lenti a contatto fantascientifiche al CES 2014

Innovega presenta lenti a contatto che vedono oltre l'occhio umano, capaci di rendere già vecchi gli occhiali Google Glass. Chiunque abbia mai sognato un futuro fantascientifico in cui le interfacce fluttuano davanti a noi e le informazioni non esistono sugli schermi, ma sono proiettate davanti ai nostri occhi, è probabile che presto potrà toccare con mano tutte queste cose grazie al mercato delle tecnologie indossabili che si sta facendo strada con grande anticipo.

Con il suo sistema iOptik, le lenti indossabili sviluppate dalla startup Innovega propongono proprio quella visione futuristica che abbiamo sempre visto nei film e che oggi può diventare realtà. La società ha infatti progettato delle lenti a contatto speciali che sono anche dei proiettori di  informazioni. Si tratta di una grossa innovazione che va ben oltre ciò che Google ha promesso con i suoi occhiali smart Google Glass.

Dei veri display montati sugli occhi delle persone, come è il caso delle lenti di cui sopra, o più semplici dispositivi di realtà aumentata come possono essere i Google Glass, resta il fatto che prodotti di questo genere sono pronti per essere l'avanguardia della tecnologia indossabile. Uno degli ostacoli più grandi ora è che, mentre la tecnologia può garantire prestazioni senza precedenti, ancora pochi hanno la possibilità di testare tali dispositivi e di certo quando arriveranno sul mercato di massa i costi saranno elevati.

Innovega ha ben chiaro cosa vuole fare nel suo immediato futuro: rendere la vista migliore per tutti, attraverso un paio di lenti a contatto, ma non solo. "Diverse aziende sviluppano hardware da adattare agli smart glass. Noi vogliamo migliorare la vista per tutti attraverso un paio di lenti a contatto e, per chi desidera, aumentarla con le informazioni della rete attraverso gli occhiali."

Facendo un diretto confronto con la soluzione di Google, Innovega dice che "a confronto con i Google Glass che danno una visione equivalente a quella di uno smartphone posto a 60 centimetri davanti agli occhi, iOptik ha una risoluzione sei volte maggiore e 20 volte l’area visiva a disposizione".

Innovega, che ha presentato il suo dispositivo iOptik di realtà aumentata sulla testa di un manichino al CES lo scorso anno, era fiduciosa nel fatto di riuscire a portare la tecnologia presto sul mercato. L'azienda, guidata dal CEO Stephen Willey, è di nuovo al CES 2014, ma quest'anno con un prototipo perfettamente funzionante.

Una volta indossate, le lenti permettono di avere una visione chiara e paragonabile a ciò che si può vedere attraverso un microscopio. "Immaginate segmenti della pelle su un dito che, mediante l’uso delle lenti a contatto, diventano più definiti e distinguibili che ad occhio nudo", spiega Innovega. In questo modo, l'occhio diventa come quello di Superman, capace infatti di riconoscere persone, automobili e oggetti a decine di metri di distanza.

Per chi vuole qualcosa in più, oltre le lenti è possibile indossare gli occhiali, che integrano dei micro proiettori che interagiscono con applicazioni e contenuti multimediali, creando una perfetta e migliorata esperienza in stile di Google Glass.

Usando sia le lenti che gli occhiali, promette Innovega, chi indossa i dispositivi potrà riconoscere elementi, gestire diverse finestre sul pannello che si proietta di fronte a lui, senza andare a nuocere il campo visivo.
468x60

Cerca su Google

Cerca nel Blog con Google