Pages

Saturday, 16 July 2011

Cloud Computing

Introduction

A definition for cloud computing is the use of multiple servers on a digital network as if they were one computer. The term is become more frequently used for anything that provides hosted services on the internet. A wide variety of services are already available on the cloud. Examples are Google Docs and Microsoft Sky Drive and on-line Office which provide similar tools to an offline office application. The introduction of cloud computing is becoming more and more common and some application developers are moving towards the cloud distancing themselves from the offline applications.

Advantages

Well advantages are easy to image. I think the most important one is the ability to access you work or application from anywhere given a good internet connection. As internet connections become more easy to get with the improvements of mobile networks, cloud computing can become the way to go. Cloud computing put most of the processing on the servers and thus allow for thinner clients such as newer generation mobile phones and tables to make use of such technologies. Nowadays mobile technology is powerful enough to run decent web browsers and thus make it possible to use cloud services.

Cloud computing brings the ability of platform independence. Although in some cases due to browser conflicts, this is just an illusion cloud services are mostly accessed through web browsers, so as long as your cloud app is compatible with the most common browsers, platform independence becomes less of an illusion. HTML5 should also help lower this gap as its introduction should help reduce 3rd party tools such as flash which may not be available in all device (apple ipads and iphone).

Another advantage of cloud computing is the fact that hardware and software need not to be managed. When you use a cloud service you only pay for what you use and need and upgrades are automatic, and scaling up or down is easier if your cloud is structured in the right way. The user of the cloud does not need to update his software repeatedly as the pp is not local. The app can be upgraded once from the cloud and all users are automatically updated.

Security is another important fact. Although Cloud services give the sense of less security, these systems seem to be quite secure and reliable. Sometimes they are even considered more secure than traditional systems, as they are more available and reachable and eliminate the need to manual print and display the data or sent it (by email) to others. These tasks can be a threat to privacy especially email, whereas access to that data directly through the cloud from anywhere is surely more secure than email.

Another advantage of using good and reliable Cloud provides is the no-need for backups. These providers ensure a high level of fault tolerance and take regular backups that ensure no data is lost. Usually these service providers can provide much better fault tolerance and information recovery than  other companies do.

Disadvantages

Although I think there are much more advantages than disadvantages to use cloud computing, One must also mention the disadvantages. The most obvious disadvantage is the reliance on a network connection. Cloud computing means no network, no nothing, slow network, frustrating slow work.

Another disadvantage to cloud computing is the connection of peripherals. Although the cloud is available from anywhere not all devices may be recognised by the cloud. Integrating devices such as bulk printers or normal USB devices can become much more difficult. If integration is done through a specific software connection, then although the cloud is accessible from anywhere, only those engines with the software installed can use those services.

Cloud computing may render huge benefits in the long term but may not be the cheapest solution to set up, especially for small scale businesses with a lower profit margin. Fortunately, cloud services are becoming cheaper as we speak and as they become more common, they become even cheaper.

A thing to consider in cloud computing is security. Earlier I mentioned that cloud computing is safe both in terms of security and in terms of availability and backup. Although the cloud can result in less data loss because of its frequent backup's, the fact that its servers are interconnected means there is a high risk for data when it comes to attacks and intrusions.

Conclusion

I think that in most cases cloud computing is the way to go. The idea of implementing an application that is available and functional to a wider range of devices is in itself intriguing . Not having to care about back ups and easier updates seem also good ideas to me. But anyway, before implementing a system, you might always want to weigh the pros and cons of your situation realising that the good of the majority might not necessarily mean your good.

Friday, 15 July 2011

Social Networks

Brief History

This week's post is very interesting as social networks are very common amongst net users. From the beginning of the internet and even before social networking was always present in the digital world. Social networking in the PC is the interaction of users using computer networks so the early Bulletin Board Systems can also be considered as Social networking tools. There were various attempts to create social networking sites, and some were very successful in their era. I don't remember any old social networking tools and I don't know how they  worked or their capabilities.

My earliest form of contact to these tools was MIRC with which I used to chat every now and then. I didn't use MIRC much since back then I only had access to a dial-up modem and using the internet was expensive. My real exposure to social networking started when I created a Hi5 account. In Malta Hi5 was very popular and nearly all of my friends had a hi5 account. Hi5 was more conform with the modern idea of Social networking and each user his own profile and virtual friends. Then Facebook popped up and most of my friends migrated to Facebook. I didn't want to switch to FB at first but when nearly all my friends switched I also created a profile. In the same period I tried MySpace, which at the time was very common especially amongst artists. More Recently I created Twitter and Linkedin accounts and Managed to make an account on Google+.

Social Networking

Modern social networking sites offer many interesting features such as photo and video sharing, photo tags, live chat and nowadays video and group video chats. Some of these web sites have a particular theme or purpose. An example is Twitter. This micro blogging site is mostly used to diffuse information. I don't use twitter that often, but when I am waiting for a particular news or information I usually go to twitter as information flows quickly there. When MySpace was more common, it was an idea place to go to look for information about your favourite artists and also listen to their music in case of musicians.

I consider myself a moderate social networking user as I like to use these services but not too much. I like the idea of sharing information over the internet, but sometimes I am a bit concerned. On tools such as Facebook, anyone can take you a photo and upload it to his profile and put your tag on it. This might not always be a good thing as your private life starts to disappear. There are however benefits of putting up a public profile. For example with Facebook you may keep in touch with friends that you no longer meet often and may also help you make new friendships. Linkedin is also a very common social network but focusses more on business networking which can expose it's users to potential employers.

Technological View

In terms of technology social networks are very interesting. As time passes competitors start to show up and thus major social networks  keep to improve. All social networks that rise amongst the others are destined to fall someday. Currently Facebook is doing pretty well and it is the world's largest social network. Apart from the profile and stream sharing, Facebook has a good layout and is constantly improving and updating. One thing that failed on the previous network MySpace was the ability of the users to create their own style. Since not all users are IT experts, lots of pages were created with erroneous code which might not be interpreted by all browsers, and some pages not readable by screen readers. Custom good looking professional layout is important to a social network such as FB. An interesting feature of FB is the auto tagging when an album is uploaded. Faces on the photos are recognised and tagged temporarily until confirmation from user. Recently Facebook is also rolling video chat to its users and word says that it is doing so in an attempt to counter Google+'s video features. For video chat Facebook uses Skype technology in another Facebook-Skype agreement. These networks already share some chatting features. Facebook Video chat is currently available to a limited number of users. Fortunately mine is available and I already tried it. I must say that it worked good as it should but it is nowhere as interesting as Google Hangouts on Google+.

A newly emerged, but still exclusive social network is Google+. This social network offers interesting features and new concepts. G+ introduced the concept of Circles where contacts are not all considered the same and therefore not given the same level of sharing. With this interesting feature, one could upload and show photos of Saturday nights to his friends without his family(other circle) being able to see them. This improves  the concept of privacy, if any exists on the internet. Another interesting feature is the Google hangout. People are allowed to join in a hangout and video chat, or text chat with a group of friends in a very cool environment. I managed to get invited in to Google+. I liked it a lot and I am very interested to see if these networks will be able to coexist like Facebook and Twitter or if one will crush the other like Facebook crashed MySpace. In my opinion G+ may be a valid competitor with FB, but currently all users seem to be computer experts or work in computer related environments. For Social network to become large it needs more normal casual users.

Another rumour is out saying that Microsoft are coming up with their own social network. Given how their previous attempts failed  (windows live spaces and windows live network) I am interested to see what are they up to.

A little Experiment

Recently I made a little experiment to try Some services offered by social networks and their connection to peripherals.  More exactly, I needed to video chat but had no webcam and I needed a quick fix. Having an android phone really helped, as I downloaded an App to make my phone work as an IP camera. Then I used a special ds filter to turn the IPcam into a sort of webcam. The experiment worked on local applications. For testing I tried Facebook and Google+. This virtual webcam was recognised and worked on skype and facebook video chat, but to my disappointment did not work on G+ hangouts or Google talk. My thinking was that if the cam is recognised locally and by Skype, it should be recognised by everything, well apparently I was wrong. Facebook video chat has a similar experience to video chat on Skype, obviously because they use the same technology. Later I tried Hangouts with a real webcam, and it is quite cool. I did not hang out with many users to test its capabilities, but with a few users it worked well.

Privacy Concerns

As social networks become more and more popular questions about their security and privacy start to arise. In my opinion one must be cautious as what to upload on social networks. Making too much information public on the internet might not be very good. You do not know how that information will be used and by who. Also some pictures might come to haunt you later on in your life or might be seen by people you wouldn't want them to. Some times websites like Facebook make photo sharing easy, but you might end up sharing photos that probably in your real life, you wouldn't. Although the new Social network G+ has features such as circles to limit the view of the posts, once pictures or posts are on-line, you have no control of what the other users might do with them. So I my opinion I would recommend the use trusted social network sites but the user should take special care of what to share, and now with G+ we can also include, with whom to share.

Monday, 4 July 2011

Mobile Phone Technology and Geolocation

Introduction

This is not the first time I am blogging about mobile phones and internet usage on Mobile Phones. There is a vast number of manufacturers providing powerful smart phones that are able to provide internet access. Most modern smart phone provide a comfortable view and use for surfing the web. The only problem is the internet itself. Most web pages do not fit the small screens on mobile phone and therefore they are not easily accessible. Fortunately, major companies are providing mobile versions of their services or mobile applications that allow smoother viewing of the sites content. The mobile version of a website is becoming more and more popular nowadays as people are moving towards mobile devices.

Although there are various different mobile brands, most mobiles use similar operating system, with some manufacturers adding a touch of their own. The most common OSes are Apple's IOS, Symbian, RIM, Windows Phone and Android. Most of the manufacturers are moving towards Android and Windows Phone. Even Nokia decided to go towards Windows Phone instead of continuing to develop their Symbian interface.

As mobiles become faster and better, so does their internet browser. Most mobile phones already have a browser that supports many HTML 5 features. HTML 5 was identified by many as the way to go for the future of the internet. Most smart phone also make use of Geolocation features that find the exact location of the device using a GPS system. For this pot I experimented with some geolocation API and also I decided to use some Google map APIs as well.

Using the Geolocation Features

Getting a Geolocation is easy. The following code shows you how to get the longitude, latitude and time of location of a device using geolocation.

<script type="text/javascript">
navigator.geolocation.getCurrentPosition(userLocated, locationError);

function userLocated(position){

var lat = position.coords.latitude;
var long = position.coords.longitude;
var timeOfLocation = position.timestamp;
document.write(lat+"<br/>"+long+"<br/>"+timeOfLocation);
}


function locationError(error){
alert(error.code);
}

By calling navigator.geolocation.getCurrentPosition(userLocated, locationError); the function userlacated is called if a location is found, while locationError is called if an error occurs.The function userLocated has position as parameter. From this parameter, the coordinates and other data can be obtained.
This Link should return the geolocation of the device http://mark-galea.webs.com/Geolocation.html.

Using Google Maps together with Geolocation

After a bit of research I decided to use google maps. To display the map with the current location, is easy as the code is provided by google in a way that copy and paste does it all. Then I decided to display the name of the location of the coordinates being displayed. This was slightly harder for me as I took the wrong approach.

While reading the google maps documentation I read that I needed to make an XML http request to get the data and display it. This worked only in internet explorer locally. This is because Chrome does not allow requests from local files. When I uploaded the file to a web server, the code didn't work on any browser. This was due to the limits in the cross-domain requests that do not allow requests from different domains. I was stuck for hours trying to find a solution for the problem, until I realised I was looking at the problem the wrong way. Looking further in the documentation I found that Google created JavaScript API for usage on the client side and what I was doing was only required for some server side processes.

Code for obtaining an address from coordinates and vice versa can be found in the documentation. I didn't notice immediately what I was doing wrong because of my lack of experience in some JavaScript features which I never used before. Also the Google maps documentation I was reading only states that there is another approach for JavaScript client side users, in a small paragraph , which I missed because of my habit to just skim through documents. I must say the tools provided by Google make it very easy to display items on the map. Since I read how to extract addresses using XML requests I will also show some code to get coordinates from addresses using an XML HTTP Request.

A get request to the following address returns an XML file containing a list of possible addresses and coordinates.

http://maps.googleapis.com/maps/api/geocode/xml?address=Valletta,Malta,+CA&sensor=true

<GeocodeResponse>
  <status>OK</status>
  <result>
   <type>locality</type>
   <type>political</type>
   <formatted_address>Valletta, Malta</formatted_address>
   <address_component>
    <long_name>Valletta</long_name>
    <short_name>Valletta</short_name>
    <type>locality</type>
    <type>political</type>
   </address_component>
   <address_component>
    <long_name>Malta</long_name>
    <short_name>MT</short_name>
    <type>country</type>
    <type>political</type>
  </address_component>
  <geometry>
   <location>
    <lat>35.8977900</lat>
    <lng>14.5141060</lng>
   </location>
   <location_type>APPROXIMATE</location_type>
   <viewport> 
   <southwest>
     <lat>35.8887508</lat>
     <lng>14.4980986</lng>
   </southwest>
   <northeast>
     <lat>35.9068282</lat>
     <lng>14.5301134</lng>
   </northeast>
  </viewport>
  <bounds>
   <southwest>
    <lat>35.8924169</lat>   
    <lng>14.5042573</lng>
   </southwest>
  <northeast>
   <lat>35.9036630</lat>
   <lng>14.5207773</lng>
  </northeast>
 </bounds>  
</geometry>
 <partial_match>true</partial_match>
 </result>
</GeocodeResponse>

An XML Similar to the one above is obtained from the request. By reading through the XML data can be taken. The above example shows results for the address Valletta, Malta. There are other approaches other than XML, in fact Google recommends JSON. This approach cannot be used however in javascript as corss-Domain Requests are not allowed and therefore the HTTP Request is ignored.

Google Created Javascript APIs which include methods that return these results without needing to make any request.


function getLocaFromCoord(latlng)
{
var geocoder = new google.maps.Geocoder();
   geocoder.geocode({'latLng': latlng}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        if (results[1]) {
          map.setZoom(11);
          marker = new google.maps.Marker({
              position: latlng,
              map: map
          });
          infowindow.setContent(results[1].formatted_address);
          infowindow.open(map, marker);
        }
      } else {
        alert("Geocoder failed due to: " + status);
      }
    });
}

The function above puts a map marker and displays a particular location, including, its name, given the exact coordinates.

function getCoordFromAddress(address)
{
 var geocoder = new google.maps.Geocoder();
    if (geocoder) {
      geocoder.geocode({ 'address': address }, function (results, status) {
         if (status == google.maps.GeocoderStatus.OK) {
             getLocaFromCoord(results[0].geometry.location);
         }
         else {
            alert("Geocoding failed: " + status);
         }
      });
   }
}

The Function above searches for a particular address, and gets, its coordinates if found. Then calls the previously explained function to display the coordinates as a place on the map.

Below are some screen shots of a small website that I made. This site, identifies your geolocation and displays it on the map. If the location is wrong, you can type your exact address and your location should be displayed on the map.



The Website is on-line at this link: http://mark-galea.webs.com/MapsAPI.html

The Site is styled to work on most mobile phones, but I only tested it on an Android Desire S and it worked perfectly showing my exact location and displaying its name in the info window.

Conclusion

Working with geolocations and Google maps was quite entertaining for me. Although I got confused at first, Google maps are quite easy to work with and a lot of help is provided on-line, with a lot of code ready made. Geolocation can be uses to make location based services which are much more accurate than those used by ip locations. This is improved especially in mobile devices as these are usually equipped with GPS devices that offer very accurate positioning. Location data however can be used badly in the wrong hands so attention should be taken before allowing any location to be given.