mercoledì 24 agosto 2011

googlecl

Google command line tool is great. I'm using it not to try to post something to my blog, not sure witch one.

giovedì 12 maggio 2011

Specify your canonical url

If you have different urls for the same resource, search engine can perceive them as duplicated content. This can create issues from a seo prospective. This post tell you how you can fix it.

I made the mistake to have two places where urls of articles are generated. I didn't care much at the beginning but I noticed that it can lead to problems from a seo prospective. The main problems is duplication of content. You can use webmaster tools to verify if your website is affected.

Html 5 part 3 : Data Storage

Before html5 the only solution to store data on the client were cookies. But they are a pain to use. Html 5 solves this with the introduction new ways of storing data on the client.

Html 5 takes into consideration all the difficulties of cookies and moves the client data storage far ahead. Html 5 adds new ways to store data on the client: 
  • web storage (session and local storage)
  • web sql database api
  • indexed database api (not there yet but announced at google io2011)
  • file storage

martedì 10 maggio 2011

Google app engine with go language

Google app engine has the numbers to move developers. I have seen it with python, when app engine was still young. Will it change the trajectory of go?

I'm lucky. I started to work with app engine from the very beginning. Thanks to that I learned to use python. I bet many developers did the same. Back then, 2008, I walked in a library to buy a book on python. I found 2 maybe 3 books about it, here in London. Now, a couple of weeks ago I saw an entire section about python. Is app engine responsible for this? I don't know, although there are numbers that make me think that it is at least partially responsible.

In the release blog post or in some page related to the google io of today I was reading numbers about the usage of app engine, they are impressive. 1.5 billion pages a day (was 0.5 a few months ago), 100k developers... So, there is something true if I say that app engine (and google) is responsible to the success of python. Now the question is : Will app engine push up the trajectory of go? 

Html 5 part 2 : Forms


Until now forms were a mere list of fields to submit data. Validation is done on server side or client side with complicated rules of javascript. All these rules have to be implemented over and over for all the website unless you use some library. This article show you how html5 solved most of the problems with forms.

We have a lot of custom code to deal with forms. This is because the needs of developers evolved away from html. In particular forms need two things, nice UI and validation rules. Html5 addresses both of them. This is a non-comprehensive list, if you want more check the links at the top left corner.






domenica 8 maggio 2011

Html 5 part 1 : new elements

This is a the first part of a series of articles related to html 5. In particular this first article goes through the list of new elements and what they are, what you should use them for. This is not a reference guide is just a summary so you know what is in html5 that you can use.

HTML 5 philosophy

Html5 is the winner of a battle between purity (XHTML 2.0) and pragmatism (html 5). I recommend you to read the html design principles link. I think that just by reading the list of principles, it is possible to better understand what are the aims of html 5.

Google Code Jam 2011 Qualification Round

Qualification round of Google Gode Jam 2011 is just finish. I'm sharing my experience for someone that missed it but want to get ready for 2012.

If you like to solve problems and play against time this is probably the contest for you. The rules are really simple. You get a set of problems that you have to solve against time.  The nice thing is that are no impositions on the languages or tools. So there are usually lots of different languages that are used in the final and you can use whatever you like.

giovedì 5 maggio 2011

Account Switcher for Chrome

The new version of the account switcher for chrome. A quick description of the changes I have made.

More than a year ago I wrote an extension that was useful at least for someone. Google Account Swicher. With it I reach nearly 11000 users, and I don't know how many downloads, but lots. What was strange to me is that even though Google developed a similar functionality users kept growing.

Google Analytics: measure page load time

How to use the new google analytics site speed to measure page load time. The set up in the loading script and a description on what you can see from the analytics dashboard

I'm attached to the old version of analytics. Probably I'm too used to it. But I'm trying to find some thing to convince me that the new one is better. Site speed is one of this new features that push you towards the new interface.

giovedì 28 aprile 2011

Google Blogger : webmaster tools and sitemap

Dev-articles is more or less my blog. Initially I wanted to have people to write articles, but who am I to compete with wordpress or blogger. I don't care anyway because I like this website and I love to improve it as I learn a lot from it. One of the most rewarding thing is to find ways to increase traffic. So I got to know quite a bit about SEO, and google tools like webmaster tools or analytics.
Recently I started to play with blogger.... 

martedì 26 aprile 2011

Useful git commands

This is just a list of commands that I think are useful. I would like to keep here with a short description so I can go back to them whenever I need. Hopefully they are useful to someone else. Of course this is more for who is still exploring the git.

read more on "Useful git commands" 

venerdì 22 aprile 2011

Delete lots of entities in google app engine datastore

How I solve the problem of deleting lots of entities in google app engine

There are different solutions to delete all the entities from the datastore:
  • Delete the application and create a new one
  • A servlet that on calls goes and delete a group of entities
  • Map Reduce
  • Remote api
  • Tasks and queue

mercoledì 20 aprile 2011

TimerTask and Android Service

Services are one of the fundamental building blocks at your disposal to build nice android applications. Services main goal is to run long-running processes. From the android online documentaion there are two fundamental points to remember about services  ...

Google App Engine and Channel Api with Gwt

Sometimes you need to show updates straight forward. In this case you have two options: polling and pushing. Polling require you to call the server with a refresh period. Polling can be expensive especially if you need a small refresh period. To resolve this you can use pushing. In this case is the server that inform the user of a change. With website the push is implemented by keeping a channel open between client and server.

Google app engine xmpp managing the status

I'm playing with a chat. An I want to do it with Google App Engine. In a previous article I have show how to send messages. Now I want to show you what I have done to manage the status of a user so that from google talk other users are able to see your status.

venerdì 15 aprile 2011

Google App Engine indexes

Sometimes you need to add an index to you app. Even though most of the times is done atomticaly it is not rare. To manage indexes in app engine is straight forward, but first you need to understand a few basic points.
Every query need an index to run. And the index is ordered. The development server does this for you in most of the cases. It does that primarily because there are a group of automatic indexes. On top of that if you run a query it is checking for the index and if there is not an index to serve the query it is adding it.

Google App Engine sending messages with XMPP

Google app engine has an amazing list of services you can use to enrich your web application. One of them is the XMPP service. In the documentation is stating :
Important: An App Engine application can send and receive chat messages to and from any XMPP-compatible chat messaging service, such as Google Talk. An app can send and receive chat messages, send chat invites, request a user's chat presence and status, and provide a chat status.
In this sentence are listed all the functionalities of the XMPP service. This is how I have implemented the send of a message to a certain client.

Google OAuth 2 on google app engine

If you want to use some google api for example docs or contacts you probably need to use one of the authentication methods that google gives you. At the moment there are 4 implementations you can use:
  • Hybrid protocol
  • OAuth 1.0
  • OAuth 2.0
  • OpenID

Gwt EventBus (HandlerManager) the easy way

Gwt application get complicated very quickly. To fix this problem in the last three years there was some work done around MVP (Model View Presenter). MVP though is very complex, but on my opinion is useful when the complexity of the project reach a certain threshold. There are a couple of things that can be used in every small projects. The event bus for example is one.

Map Reduce over App Engine

App Engine Datastore is a NoSql that need to be scalable. To achieve scalability it has lots of limitations that generally push you towards duplication of data. As a consequence you need a good tool to manage, move, manipulate and transform your data into something that is easy to manage for your app. Map Reduce give you a tool to abstract all the details and problems of doing this kind of operations and give you the freedom to focus only on your application logic.

Moving away from App Engine domains

We all use app engine because is fast, easy and scalable even considering the limitations, and is free. There are really a lot of projects on app engine now and moving domain is becoming a very common thing to do. This are the steps to follow :
  • Buy domain on google apps
  • Add app engine project to your google apps account
  • Add the web site to google webmaster tools
  • Implement a redirect filter

giovedì 14 aprile 2011

Android Boot Receiver

Sometimes is useful to be able to intercept reboot events.
For example of you have to set up a service that run at different intervals using the AlarmManager You have to make sure to handle the reboot and reset the alarm because is lost otherwise.

Android Activity startActivityForResult

I think we are all familiar with intents and startActivity() method. At least, you are, if you have done something with android. But we often do not consider the method startActivityForResult. Just to have an introduction this is what you can find about startActivity on the online documentation:

The startActivity(Intent) method is used to start a new activity, which will be placed at the top of the activity stack. It takes a single argument, an Intent, which describes the activity to be executed.

Very often you need to know what was the result of an activity. Suppose you have a list of item and you can edit them in another activity, you may need to know the result of the edit. Was the item changed? or was the edit canceled? To do that we can use startActivityForResultActivity


Gwt canvas a small example

Html Canvas
The canvas is part of the new group of tags coming with html 5. In particular the canvas gives you a way to draw stuff using javaScript. Within a canvas you have tools for:
  • Drawing : rectangles, arcs, lines drawing and more
  • Effects : Shadows, Alpha transparency …
  • Transformations : Scaling, rotation, translation ...

In html 5 you can specify a canvas very easily like in this example: