Grails 2 End of Life (EOL)

There is no information Grails End of Life or even End of Support for the matter. While Grails 2 (and 1) were developed with the support of Pivotal, Grails is being further developed in Branch 3.

Considering that the switch from Grails 2 to Grails 3 is not trivial, we were wondering if one should take the burden of the upgrade, or leave projects in 2.x branch for some more years.

It all depends on the commitment and the plans of the Grails team. Reading through the documents of Grails, you cannot find any foreseen EOL information for any of the projects.

In Tweeter thought, there was this conversation with the Grails Framework.

The answer of Grails team indicates that Grails 2.x will continue to be support for critical issues (such as security flaws). There is no ETA or deadline for the End of Life Support and that is a pitty.

After reviewing the tweet, we decided that projects that we have on 2.5.x branch will not be upgraded in the near future. Seems Grails Team will support on the long run security concerns. Grails 3 offers some nice features, therefore if a project is relatively with not so many plugins, an upgrade might be worth the trouble.

About Me

I am a Software Engineer and internet enthusiast. I have worked with many different technologies and like to blog for little things on software development, domaining, seo and other challenging topics.

As a software engineer, I have worked with custom made CMSs, have been engaged in government projects and private solutions from simple business page up to solutions for flight companies. As a domainer I have sold domains for as much as 50,000$, but I suck in SEO.

This blog is all about personal experiences, and small victories. Will welcome any one challenging my topics.

Handling Exceptions in Grails

Improve error handling – Exceptions

The Error Handling in Grails has changed with the latest support from Groovy. In this case we will make use of the “Declarative Controller Exception Handling” feature of Grails.

“Grails controllers support a simple mechanism for declarative exception handling. If a controller declares a method that accepts a single argument and the argument type is java.lang.Exception or some subclass of java.lang.Exception, that method will be invoked any time an action in that controller throws an exception of that type. See the following example”:

class ElloController  {
    def index() {
        def message="Resource was not found"
        throw new NotFoundException(message);
    }

    def handleNotFoundExceptio(NotFoundException e) {
        response.status=404
        render ("error found")
}

In the previous example, a simple blank page will the message Error not found will be shown on the invocation of the controller
Important:

  • The exception handler method names can be any valid method name. The name is not what makes the method an exception handler, the Exception argument type is the important part.
  • The exception handler methods can do anything that a controller action can do including invoking render, redirect, returning a model, etc.

We need to avoid including redundant methods in every class. Therefore traits in Grails provide a clever way to include some methods to a class. With regard to Exceptions, we create a traits groovy file including the neccessary Exception Handlers. Example:

package com.apo4.exception

trait NotFoundExceptionHandler {
    def handleNotFoundExceptio(NotFoundException e) {
        response.status=404
        render ("error found")
    }
}

This trait can be included in any controller through an implements directive. Thus our old controller becomes:

import com.apo4.exception.NotFoundExceptionHandler
import com.apo4.exception.NotFoundException

class ElloController implements NotFoundExceptionHandler {
    def index() {
        throw new NotFoundException("Resource was not found");
    }
}

As it can be seen, the methods are no longer in the controller but are moved into the traits and included from the implements directive.

Exceptions can easily be invoked in services as well. *Controllers consuming such services should have the implementation of the traits or a method to Handle the Exceptions.


import com.apo4.exception.NotFoundException
class ElloService {
    def serviceMethod() {
        throw new NotFoundException("Resource was not found - thrown from service");
    }
}

References

Dillinger uses a number of open source projects to work properly:

Is Facebook discriminating FB Pages!?

While doing some routine boredom visits on websites in social media, I realized something peculiar. The company I used to work has a FB page with over 170K followers. While I still have some access on their information channels, I realized that the visibility of a post on their FB page was very low. I checked the latest posts and it was never mora than 1000-4000 visitors and (almost?) never more than that!!

This seemed strange, especially since even my stream of statuses have been hiding their info for some time. I had to test if this makes any sense for other smaller pages as well.

So I decided to compare the reach and attraction of 2 different pages, a big and a small one. Just had to find a smaller page with same profile and see what happens. So I recalled an old friend who is a Radio Moderator and has a FB Profile (there is no Radio moderator without a FB Page as I know). I knew he would have a couple hundred of visitors. All I needed to do was to follow his statuses and launch a similar status for the FB Page with 170K visitors. He had a 10K followers! Great for my test.

So at a certain moment of the day, the Page with 10K followers pushed a status with a poll which definitely would attract attention since it was referring to a hot topic! As we had discussed we launched that same status on the page with 170K visitors and the results was astonishing! The 10K page had double the visibility of the 170K page… This had to be wrong! This virtual world of FB does not respect its own rules!

This probably is not new to many social media experts. I found out that this thing has been going on for some time. I found it totally unacceptable!

People join Facebook with the attention to follow their friends, or the prominent activities (such as FB Pages) which have information relevant for them. Some might say that Facebook and social media is about following people! I have a different perspective, we use Social Media to get new relevant information.
And if we decide that a certain source of information is relevant for us, than this is what we expect to follow. This is the promise where social media’s where born upon! You follow who you are interested! This is the never-written promise that made social media pages popular (and the vanity of our souls of course)!

Yes! I know what some might be thinking! A page which made it to 170K visitors did not made it by posting one status in 3 days! They did so by posting 10-20-30 statuses per day.

But it is up to the followers to decide if these statuses are becoming boring or not. Believe me, we all have removed people who post irrelevant noise on the social sites from our following streams… It is also expected that FB wants to tweak their algorithm to provide visibility to new pages as well. But this changes should not be discriminating… Especially to portals which have a lot of followers. Unless Facebook categorizes these pages as potential buyer for their ad system, and we are in another dirty discussion…

 

Tirana Startup Weekend

Nese po lexoni kete lajm, qofte nga nje lidhje e Twitter, Facebook apo direkt tek faqja e internetit, atehere duhet patjeter te regjistroheni tek Tirana Startup Weekend 2012. Nuk ka rendesi profesioni juaj, nuk ka rendesi ne jeni akoma student apo dhe nxenes. Nje Startup Weekend eshte nje vend ideal per ata qe duan te punojne, per ata qe kane nje ide e nje enderr per te ndryshuar dicka.

Tirana Startup Weekend eshte nje maratone 54 oreshe ku krijohen dhe implementohen projekte te reja. Gjithcka nis me nje prezantim te ideve (pitches) dhe gjate prezantimit behet ftese per persona me aftesi ne fusha te caktuara. Psh nje ekonomist me nje ide ne fushen e marketingut mund te kete nevoje per nje designer dhe nje zhvillues aplikimesh per te kthyer idene ne realitet. (Edhe nese nuk keni nje ide briliante, mund te beheni pjese e nje grupi qe do punoje per nje ide te tille.)

Personalisht jam shume entuziast per nje aktivitet te tille ne Tirane (entuziazem= 5000km rruge per te qene prezent). Entuziazmi lidhet me gjithe ato ide qe kemi pasur dhe akoma kemi. Shume inisiativa te vjetra shqiptare, me shume impakt ne vizitore nuk kane mundur te kthehen ne biznese te suksesshme.  Nje Startup Weekend ju ofron gjithcka normalisht ju duhet per nje biznes te mire: Ide, Skuader, nje keshilltar (mentor) dhe motivim! Me besoni qe secili nga faktoret me siper eshte i rendesisshem ne krijimin e nje projekti.

Studioni qe me pare Keshilltaret dhe zgjidhni me te pershtatshmin per projektin tuaj. (Personalisht mbaj akoma lidhje me “mentorin” tim). Per projekte marketingu do sugjeroja qe te zgjidhej Redon Skikuli i 1UP; per projekte interneti teper kreative mund te konsideroni Celik Nimanin apo dhe Flamur Mavrajn (sidomos nese jeni nje talent i design-it). Per projektet akademike keni shume mundesi mes disa ligjerues nga Universitete shqiptare Elton Domnori, Paul Neumann, Igli Hakrama, Edlira Kalemi;  Per projekte qe mund te angazhojne shoqerine civile, levizje qytetare apo qeverine mund te tentoni me Endri Matajn apo dhe me Fredrik Syversen. Nese vini i veshur me kostum dhe ndjeni qe deshironi te gjuani korporatat atehere mentori me i mire do ishte Dritan Mezini!

Sic e shihni lista e mentoreve te ketij Startupi eshte e gjate dhe do gjeni me verte njerez qe kane dicka per te dhene. Sa me shume t’i njihni e sa me shume te takoni, aq me shume do perfitoni! Pas disa vite ne drejtim te disa projekteve kam mesuar se nder gjerat me te rendesisshme ne nje biznes eshte rrjeti i njerezve qe njeh e te njohin!

OpenDNS vs. Google DNS vs. Norton DNS

There are a few posts around the internet aiming to push users to change their DNS for faster internet experience. Although this might be true in very (very) few cases, I believe the closest DNS server to you, are the fastest. That means your local ISP DNS servers. ISPs today serve to millions of DNS requests everyday. The fastest solution for DNS providers like Google would be to provde local DNS servers to your ISP (mainly through Akamai), but this is not always the case, especially if you are located outside US.

Nonetheless there are some cases when you still want to change the DNS server. Personally for me it was the number of advertising pages I was getting once a domain dns could not be resolved. My local ISP was practically making use of those bad requests and instead of a “server not found error”, it was pushing me toward a Google-Ads page which might help beginners, but upset more internet skilled users.

A few years ago I decided to use OpenDNS and just as I was getting satisfactory results, I started noticing that the service still failed to provide a transparent service. If a domain cannot be found, the service was still redirecting me to a search page with search results and advertising.

Then I decided to switch to Google DNS. Google DNS served as fast results as the Open DNS. Although Google claims that this service is better because it has no ads or redirection, recent policies changes in Google and their being the largest advertising company in the world makes people uncomfortable. Knowing that “big-brother” is watching them not only while they search, but also while their just browse the internet provides an uncomfortable feeling.

A few weeks ago I run into the Norton DNS service. Norton DNS is still in beta, but they provide for free a great service which not only resolves domains, but also blocks domains that contain malicious content or unwanted content such as pornographic information. These same services are also offered by the OpenDNS in their premium packages, but Norton offers them for free (at least for now).

Norton offers DNS service depending on the desired protection policy:

A – Security (malware, phishing sites, scam sites and web proxies)
Basic internet protection
198.153.192.40
198.153.194.40
B – Security + Pornography
Protection + filtering of Pornographic content (you know, all those unwanted sites and whatever undesired pictures pop-up to married guys)
198.153.192.50
198.153.194.50
C – Security + Pornography + Non-Family Friendly
Basically paranoid filtering for Grandma
198.153.192.60
198.153.194.60

Google DNS Servers.
8.8.8.8
8.8.4.4

Open DNS Servers:
208.67.222.222
208.67.220.220

I would recommend Norton DNS to anyone for the moment, although it is a beta service. Some restrictions apply as well for those willing to use a Juniper VPN (you will not be able to login to VPN if you use their DNS), but these are all trivial problems.

Official whois .al domain

Apparently AKEP is working for an official whois for the .al domains.

By navigating at www.nic.al/whois the visitors can see a whois form which contains a very small amount of domains from the .al zone.

There appears to be a partial database that is updated online. Some domains return a wrong result of “no domain found”, even if they exist.

Until the completion of the official whois for the .al domains, the unofficial whois at www.host.al contains a better result.