Friday, October 12, 2012

It seems all a matter of size

After the new iPhone 5 sporting a bigger screen and a thinner body*, comes the Samsung SIII mini and probably a new smaller iPad mini. Then I see the new Vaio Tap 20 that it is really a new kind of PC. Watching movies on a home-portable bigger screen, playing social games... but still having a full PC available for editing two documents at the same time by typing with a real old-style classic keyboard.

 New Vaio Tap 20 - source Sony

I don't really like the idea of 'touching' the screen of a laptop, which seems way too delicate and wobbly but I kind of like the idea of a bigger home-tablet. I am just wondering what happens when this big screen falls on the ground... because that is going to happen.

* I would have honestly gave that up for a better battery

Thursday, October 11, 2012

Here's To The Crazy Ones, Again

Years ago I cam across the famous Apple Computers most inspiring piece of advertisement - at least for me:
"Here's To The Crazy Ones. The misfits. The rebels. The trouble-makers. The round pegs in the square holes. The ones who see things differently. They're not fond of rules, and they have no respect for the status-quo. You can quote them, disagree with them, glorify, or vilify them. About the only thing you can't do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world - are the ones who DO !" - Apple Computers
Naturally, I believe many people mentally associated this piece to one person Steve Jobs. At the end, the good times of Apple seem always been happening during Steve's lead - and I believe that is one of the reasons why everything that is going on with iOS6 and iPhone 5 is carefully monitored and inspected by the entire world. Personally, I just liked what the piece conveys. 

Anyhow, after days of reading about the new iPhone 5 problems, and in particular about the fact that the aluminum scratches really easily, I read this: These Laser-Engraved iPhone 5s Look Really Cool (via Gizmodo). 

I like the fact that a problem - Apple inefficiency - has been translated into an opportunity. As the iPhone 5 max customization you can get is the choice between two colors, the engraving would make your phone really unique and different. I remember I ordered my first iPod Nano with the engraving
Dreams change the world - Paolo Ciccarese
That made my iPod Nano unique until it has been recalled by Apple some years later and exchanged for a new anonymous Nano that I basically never used. I feel the iPhone 5 engraving potential is going to make a difference in the 'think different' iWorld.


Friday, September 28, 2012

New Apple maps and Cook's iSorry

It is well known that maps are one of the most useful features of smartphones. I still see a very good amount of unexploited potential in maps. And I believe this is also the reason why Apple decided to develop a version of their own.

But I am surprised to see Apple delivering the new products with such poor and buggy maps. I not surprised to read Cook's official apologies. I am a little surprised by Cook recommending, in the same letter, to use competitors product. I would have expected a link to a different page listing alternatives.

I am sure Apple had very good reasons to deliver the phone in September even if map were clearly not ready. As I am assuming they knew the new maps were not classic Apple-quality, I cannot stop wondering if this would have happened with Jobs in charge.

Anyhow, customers are always lining up for iPhones and I am sure Apple will fix and work on the maps to make them amazing. Still, I find what happened very Apple-unusual… and I guess Cook felt it too if he delivered the official Apple iSorry.

Meanwhile - maybe also because of the new potential competitor? - Google keeps improving Google Maps:
- Google Maps, Now With More High-Res Satellite And 45° Aerial Imagery
- Google Maps Goes Diving, Provides “Seaview” Of Great Barrier Reef, Hawaii and Philippines
- Google Brings Its Indoor Maps To France

Wednesday, May 09, 2012

Running GWT 2.4.0 with STS 2.9.1 and Grails 2.0.3

Alright, if you followed all the steps of the previous post, you should be able to see the results of the GWT code execution at the address:
http://localhost:8080/{projectname}/hello.gsp 
As you might have noticed, I previously asked the plugin to compile the GWT code (compile-gwt-modules). That operation takes some seconds as the entire artifact is recompiled (when the application will grow, the compilation can last minutes).  Luckily there is an alternative, the hosted mode. When an application is running in hosted mode, the Java Virtual Machine (JVM) is actually executing the application code as compiled Java bytecode, using GWT plumbing to automate an embedded browser window. This means (1) we don't need to recompile the code as STS is producing the Java bytecode for us incrementally (2) the debugging facilities of your IDE are available to debug both your client-side GWT code and any server-side Java code as well.

First we start the grails application (run-app), second, in the command prompt we type:
run-gwt-client
This last command starts the hosted mode and you should see appearing a window like the one depicted in figure 1. 

Figure 1: hosted mode window.

Now we can 'copy to clipboard' and open that link in a web browser:
http://localhost:8080/GwtTest/hello.gsp?gwt.codesvr=127.0.0.1:9997
The page should appear in the window and the alert 'hello' should display. Now you can verify the usefulness of the hosted mode by updating the alert - in the class HelloApp.java from 'hello' to 'hello me' - and reloading the page. The alert will display the new string without you having to trigger the GWT code compilation manually. And this will result in a huge save of time. (Read more)

Note. Remember that the manual compilation is still necessary prior to deployment as the deployed version of the page will run the compiled JavaScript.


Friday, May 04, 2012

Setting up STS 2.9.1, Grails 2.0.3 and GWT 2.4.0

If you need to integrate Grails and Google Web Toolkit (GWT) here is a list of tips. If you are interested in Grails you might want to consider the SpringSource Tool Suite or briefly STS. I usually install the STS package in a directory which name includes the version of the STS software to make sure multiple versions of the tool can beautifully coexist on the same machine. The tool is currently in version 2.9.1 and, as the previous versions of STS, it offers a good set of features for integrating with Grails. After the installation is completed I suggest to open the Dashboard and select the tab "Extensions". If you have just installed the tool, it should look more or less like in figure 1.

Figure 1: STS 2.9.1 Dashboard right after installation.

As you can easily verify in figure1, I would suggest to pick two extensions in particular: Grails Support and Google Plugin for Eclipse - which now comes with GWT 2.4.0. Select those and proceed with the installation. I don't usually pick the "Grails (current production release)" as I usually download and install Grails separately. The current release version of Grails is 2.0.3 and you should download it and unzip it in a convenient location.

Figure 2: Setting up Grails in STS.

Once the installation is terminated, it is time to configure the plugins. The Grails Support plugin needs to know where the Grails installation is (figure 2). We can now create a new Grails project that I am going to name GwtTest.

Figure 3: Creating a new Grails project in STS 

The creation process should ask you if you want to change the perspective into the Grails perspective offered by STS. Once the project is created it is time to install the GWT Plugin for Grails.

Figure 4: Opening the Grails command prompt

You can perform this operation through the Grails command prompt offered by STS (figure 4) by typing
install-plugin gwt
And the process should complete displaying the details in the console:

Figure 5: Console after installation of the GWT plugin (0.6.1) for Grails
 
Note: Remember also to set up the GWT_HOME that is used for compilation.

We are now ready to create our first GWT module (learn about GWT modules here). Using once again the Grails command prompt offered by STS, we type:
create-gwt-module org.example.HelloApp
Once the process is completed, if you refresh the project, you will be able to notice that a new directory 'src' has appeared in the project explorer.

Figure 6: Project explorer and Console after the creation of the HelloApp GWT module

In order to declare this folder as a source code folder we can right click on the project and select 'Build Path'>'Configure Build Path' dialog. In the tab 'source' we select 'add folder' and we pick the newly created 'src/gwt' folder.

Figure 7: Declaring the GWT folder as a source code folder

We can now create the page hosting the GWT script by typing in the command prompt:
  create-gwt-page hello.gsp org.example.HelloApp
The new page will include the line of code that is performing the actual import of the GWT artifact:
<script src="${resource(dir:'gwt/org.example.HelloApp',
 file:'org.example.HelloApp.nocache.js')}" type="text/javascript">
</script>

We are now going to modify the HelloApp.java file adding Window.alert("hello"); within the method onModuleLoad() so that when the script is loading the alert 'hello' will fire.

We then compile the GWT code by typing in the command prompt:
compile-gwt-modules
And we are potentially ready to go. After running the Grails project - a simple run-app is good enough - and opening the page:
http://localhost:8080/{projectname}/hello.gsp
you will notice that nothing happens. As a matter of fact, if you check out what happens with Firebugs, you will notice that a resource has not been found. Unfortunately, it seems the Grails Resources Plugin, which is installed by default in the project, is not compatible with the Grails GWT Plugin. As suggested in this post we can modify the Config.groovy file to include:
grails.resources.adhoc.excludes = ['**/gwt/**']
When restarting the server, the hello.gsp page should now work and fire the 'hello' alert.

Saturday, January 14, 2012

Domeo v2 working much faster on Firefox then Chrome

Since a week now, I am deeply involved in developing the v.2 of the Domeo annotation tool. Domeo is a combination of GWT (Google Web Toolkit) and JavaScript. I've been mainly working on the infrastructure and, initially, as it is not much UI work, I was testing only on Chrome (16.0.912.75). Sadly, I've  noticed several times that my code was not running fast enough and I started to study alternative ways of performing various tasks.

Then, out of curiosity, I ran the same tests on Firefox and surprise... what was running slow on Chrome was running almost without any latency in FF (6.0.2).


The test consists in 18 steps and each of them is adding the same amount of complexity. Looking at the above figure (milliseconds on the Y-axis) you will easily detect what I am talking about. The difference seems way too big.