Thursday, May 26, 2011

Gnome 3 New Features and Does It Look Like Windows 7 ?


As most of you all know Gnome 3 is released (http://gnome3.org/) so as always I wanted to try it out, so I installed it on my fedora 14, and then wanted to check it out with fedora 15. After messing around with it for some time, It was okay but not that great, For the most part of it I could notice the similarities to Windows 7s normal theme. So went around searching to see what were others opinion about it, but tomy surprise there were NO or just a bit of talk about it, This gave me no other option but to write something for myself.

I'm not going to compare in detail and break down the things, maybe that's for another post. This will be a comparison between the major functionalities shown on the home page of Gnome 3 (you can checkout the videos)

Feature 1:  Instance Messenger Notification

Who are you kidding?? I have not come across a messenger which actually distracts me while I'm working all the messengers I have worked with just gives a small notification on the right side corner with the beginning of the message. What is the use of putting this as a feature on Gnome 3 ?? I seriously don't get that. If any of you disagree with me on this think about a messenger which does not actually do this. I do get, Integrating the messenger to Gnome might be a good thing, but the problem is if all my messengers notification look alike its just going to be dull in the end. Sometimes it is nice to have your mind distracted with Messenger specific notification than having a black themed notification.

Feature 2:  Easier Window Management

The next video goes on to say if you drag the window to the top it gets maximized and if you drag it to the left it goes to left, ext.. First thing that pop into my head was 'This is just the same feature Windows 7 gives' So whats the big deal?

Feature 3:  App-based Window Management

There is nothing to be said on this. This is no other than 'Quick Launch' feature introduced in Windows Vista. I dint not see anything new here. Its just the same old thing.

Feature 4:  Deeper Hardware Integration

'We only show Suspend option if it's supported by you hardware' That was there even on Windows XP which is more than ten years old. Showing options that are supported by your hardware was already available in Gnome 2. Firmware is not done by Gnome it just front ends it, so even how much support you have on this first the Firmware has to be updated if you want to use this at all.

Feature 5: Create Workspaces

Well this is actually good, but I still feel the static workspace is better. The problem with this is, I actually need to do another mouse move or a keyboard shortcut to see the workspaces that I have used. Anything that makes me do one more step is something thats not worth it.Workspace is something that we use a lot so I want to be able to see the free workspaces like on Gnome 2 without another command involved.

Where the Hell is the Task-bar ?

At first  you will see is that the task-bar is missing. Whats the point? I don't want to move my mouse or do a keyboard shortcut to see the programmes that are running I want to just see it in one glance when I want to, Its not worth to remove something just to save like 10 px of space. Again anything that makes me to something more is not worth it.


I'm not trying to persuade that all features are bad, there are some good features as well, but Gnome 3 was a disappointment for me. I was expecting more than what I received. Alas, none of the features were good enough for me to switch from Gnome 2 to Gnome 3.

Tuesday, May 17, 2011

Spring Security and CAS Integration with Vaadin

We have been working with Vaadin for some time now. We have done multiple websites and admin applications. There was a customer who requested a SSO (Single Sign On) to be added to one of the new website we are creating. So we thought its not that big of a deal; we just needed to add Spring security and then do the CAS filter and we are all done. Well the solution is striaght forward but don't even try to search this on the web, there is not even one fully integrated working solution out there, so what I did was I sat down and did a Vaadin wrapper with spring security integrated. I have used Spring 3.0.5 so all spring security tags are written for that.

This is how it looked like in the end

public class SampleVaadinApplication extends VaadinApplication {

    private UriFragmentUtility fragmentUtility;
    private VerticalLayout layout;

    @Override
    public void init() {
        final Window mainWindow = new Window("Vaadin Cas Sample");
        fragmentUtility = new UriFragmentUtility();
        mainWindow.setSizeFull();
        mainWindow.addComponent(fragmentUtility);
        layout = new VerticalLayout();
        mainWindow.addComponent(layout);
        setMainWindow(mainWindow);
    }
}


public void buttonClick(Button.ClickEvent event) {
     final String path = getURL().getPath();
     if (!hasAnyRole("ROLE_DEFAULT_ACCESS")) {
        getMainWindow().open(new ExternalResource(path + "do-something/"));
     } else {
        fragmentUtility.setFragment("do-something");
     }
 }


web.xml you just need to add this to be the wrapper (and of cos the spring tags ;) ).

<servlet>
    <servlet-name>vaadin-loader-with-cas</servlet-name>
    <servlet-class>hailu.vaadin.authentication.core.VaadinApplicationServlet</servlet-class>
    <init-param>
        <param-name>application</param-name>
        <param-value>hailu.vaadin.authentication.sample.SampleVaadinApplication</param-value>
    </init-param>
</servlet>

<servlet-mapping>
    <servlet-name>vaadin-loader-with-cas</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>


I have hosted it in git you can have a look at the sample to get your self up and running.
https://github.com/jasondevj/cas-integration-with-vaadin

Saturday, May 14, 2011

5 Reasons Why I Changed from Linux to Windows

I'm sure the heading is going to make some people go, 'This guy is nuts' specially me being a Java developer. Let me explain why I chose to change from Linux to Windows.

1) Hardware Support

The biggest problem I had running Linux (I use Fedora 14) on my laptop is the hardware support. I agree Linux has come to a point where it supports most of the drivers (and yes Ubuntu has more support) the problem is the drivers are done by third party developers and companies and not from the actual vendors. The drivers work fine I'm not complaining about that, but it does not support the hardware fully to a point I would prefer it to. It is evident as the laptop heats up.

2) Flash and Video Streaming

One of the second most thing that I do when I'm not coding is streaming Movies and TV series. Have you even tried it? let me tell you what happens, It sucks your processor usage at-least to 70-80% I can check for prime numbers on Java programme and it still would not have to take so much, and yes I have tried it on Firefox 4 and Chrome 11 this is because of Flash. If you search for a solution regarding this on the net, you will see a lot of people have complained about this but there is no proper solution to this. Maybe this is because of the hardware support.

3) Programmes and Games

I am not much into games, but once in awhile (once in three months ;) ) I just like to play a game. With linux its not possible, just the option knowing I can is more then enough, and yes Linux has its games but nowhere close to the once you have on windows.

yum and apt-get are really powerful and I'm definently going to miss this on Windows, but I'm sure I can download any programme that I want to install on Windows. I have still not come across programme that is available in Linux but not available in Windows (the functionality vice).

4) MS Office and Graphical Programmes

Open Office is really good, but no where close to as MS Office, you can argue much as you want but if you use it couple of times you will feel the difference, and when specially all the customers documents are done using MS Office.

Gimp is good, but not as Photoshop and other programmes like Dreamweaver and Flash you cant find it on Linux

5) Intellij Idea and Visual Paradigm

As you guessed it correctly I use them more then any other programe. VP is defiantly faster on Windows than on Linux it's even faster if you run it on VMware on the same machine. Same applies to Idea, it runs faster on Windows but this has not as much differences as VP but it is defiantly faster.


That raps it up. The above reasons are more then enough for me to switch to Windows. Definently there are some things I will miss in linux following are some ;)

1) All shell commands and the linux terminal, windows powershell does not come close to it but cygwin will fix that.
2) You can delete a file while its been executed on linux, specially commands like mvn clean and remove can be done without any problem in linux, but if you do that on windows there could problems like file been access by some other programme errors.
3) I'm into bit of Ethical Hacking most of the hacking tools are in linux so that will be a definite disadvantage.
4) Most spoken thing when comparing linux and windows is the boot time. linux could be couple of seconds faster, but until now I have never sat in-front of my laptop waiting it to start I have more than enough things to do at that time, and be honest with your self. when was the last time you shutdown your computer?


Windows does all the things I need better than linux and some things that I cant do in linux. So why do I still need to be in linux?

Wednesday, May 11, 2011

Clojure and Vaddin

I been working on Clojure and Vaadin for some time now and I think It's right about time I write a blog on how to do it. This is a really simple example for someone to get start on.

First thing that we need to do to get things started is to create a servlet clojure file which will load the Vaadin application.

(ns example.vaadin-servlet
  (:gen-class
    :extends com.vaadin.terminal.gwt.server.AbstractApplicationServlet
    :name example.VaadinServlet))

(defn ^Class -getApplicationClass [this]
  example.VApp)

(defn ^hms.appstore.ui.main.VApp -getNewApplication [this request]
  (example.VApp.))

This will be the servlet that you will add into the web.xml keep in mind the java class name will be example.VaadinServlet.

Next is to create the Vaadin Application which would look something this.

(ns example.vapp
  (:gen-class
    :extends com.vaadin.Application
    :name example.VApp
    :init cjinit))

(defn -cjinit []
  [[] (ref {})])

(defmacro window [name caption container & body]
  `(let [caption# ~caption
         container# ~container
         ~name (com.vaadin.ui.Window. caption# container#)
         ~(symbol (str name "-" "container")) container#]
    ~@body))

(defn -init [this]
  (println "=== Initiating Vaadin Application ==")
  (let [comps (transient {})]
    (window w "Clojure Vaadin Application" (com.vaadin.ui.VerticalLayout)
      (.setSizeUndefined w-container)
      (.setMainWindow this w)
      (let [layout (com.vaadin.ui.VerticalLayout.)])
      (.addComponent w-container layout)
      (.addComponent layout (com.vaadin.ui.Label. "Test Message")))))


Thats all. I have used a macro for the window can do without that as well.