Sunday, November 21, 2010

Project status

Hi all,

This week I tried to put maven for the "sweetydontforget" project without success ... So I've create a classical structure for GWT project and add the first login box. Now I add to learn more with GWT.

Sunday, November 14, 2010

Project status

- Source code has been commit.(It's only the source code you obtain when you create a new Google web application)
- First documentation of the project about installation.(on the project's wiki).

So now the project does nothing ...

News

For now tasks are :
- Configure project.
- Begin installation documentation.

Saturday, November 13, 2010

Sweety Don' t forget ....

Every time, I hear something like :
Sweety , after work, don't forget to take the bread ...

And every time, I forget ! So I decided to create a we project that will resolve my problem ! Ambitious ? isn't it !
I have just created a new project on google code
In this project, we will use GWT, java and many many cool things !
All the project news will be publish on sweetydontforget label.

Note about project status : I will try to be regular in work and to produce code and documentation often ... ( At the project's beginning it's always like that ...)

Saturday, June 12, 2010

java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType

Problème


java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType

Solution
        <version name="version" type="string">
           
        version>


I rename version in property and i also rename the field of my table.

In file.hbm.xml :

        <property name="arteVersion" type="string">
           
        property>

In Mysql :  alter table t_dependency CHANGE version dep_version VARCHAR(150);

Monday, March 15, 2010

Install Maven with a Proxy


First install Maven. For example on Ubuntu 9.10 :

sudo apt-get install maven2


Then we will create the directory $HOME/.m2 :

mvn archetype:create -DgroupId=be.peopleware.training.maven -DartifactId=helloWorld
=> It will create .m2 automaticaly.

Note : Perhaps you can do by hand but I've not tested.You have certainly to check rights.
Note : It could be long and it will make an error but it will create the .m2 directory.


After that you had to create settings.xml in the .m2 directory like that :

vi settings.xml


        /home/drieu/.m2/repository
       
               
                        optional
                        true
                        http
                        proxy.test.fr
                        8080
                        localhost|127.0.0.1
               
 


To resume, you have a .m2 directory similar to that :
$HOME/.m2/settings.xml
$HOME/.m2/repository

Then go on your workspace directory (ex :$HOME/workspace) and launch the following command : mvn archetype:create -DgroupId=be.peopleware.training.maven -DartifactId=helloWorld

Monday, March 8, 2010

Thanks

I just come back from my holiday and I saw nice comment on my blog.
So thanks for these comments ! If you wan to see some article or you prefer other subject, tell me !
I will be happy to publish them.

Android books

To learn android, I've bought a books.This book is "L art du developpment Android".
This book was write by Mark Murphy.So fo the US, search Marc Murphy and you should see an equivalent.I put some links on my android blog MyAndroidBlog
So I will just summary advantages and drawbacks of this books :

Advantages :
- A lot of small chapter with exercises.
- Good explanation.
- Not too much eclipse 's configurations.Be careful, a lot of android's books speak a lot of about eclipse but not about developing with android.

Drawbacks.
- Some class are not write with best practices.
- Eclipse configuration.

So if you love developing java and you want to learn something different (Android) with me, you can see my blog : MyAndroidBlog

Wednesday, March 3, 2010

SCJP exercise : initialisation

Exercice :

 

Given the following :

public class Test {

    private int myvar=3;
    public Test(int myvar) {

        if (myvar == 5) {
            myvar = 2;
        } else {
            myvar =3;
        }
    }

    public void show() {
        System.out.println("myvar:" + myvar);
    }

    public static void main(String[] args) {
        Test test = new Test(4);
        test.show();
    }
}


What is the result (choose one) :
A: myvar:2
B: myvar:3
C: myvar:4
D: myvar:5
E: Compilation fails
F: An exception is thrown at runtime










Solution :

Thursday, February 25, 2010

Linux 2.6.33 released !

New linux kernel version : Annonce
If you want to have more details see : survey


Eclipse survey

An interesting survey about eclipse's use in the world was publish.It shows that Linux is use more and more (Linux 43%, Windows 41%).We learn also that Subversion is the source control that is the most use.And to finish,  89% of users are happy to use eclipse.Here is the complete survey :


SurveyEclipse


Wednesday, February 24, 2010

SCJP exercise : operators

Exercise :

public static void main(String [] args) {

int val = 5;
if ( (val && 7) == 2) {
System.out.println("Good");
} else {
System.out.println("Bad");
}
}

A Good
B Bad
C Compilation fails
D An exception is thrown at runtime










Solution :


The solution is C.The && oeprator can be use only with boolean.

Monday, February 22, 2010

Android

In this time, I prepare a blog about android.In this blog we will learn together android.I don't know android.So I will learn with you and I will put all my notes on my android blog : androidKillerApps

Wednesday, February 17, 2010

SCJP exercise : instanceof

Exercise :

public class Test {

public static void main(String [] args) {

Integer test = new Integer(5);
if (null instanceof Integer) {
System.out.println("null is an integer");
} else if ( test instanceof Integer) {
System.out.println("test is an integer");
} else {
System.out.println("Hello");
}
}

}


What is the result ? (choose one)

A
null is an integer
B test is an integer
C
Hello
D Compilation fails
E An exception is thrown at runtime





Solution :


The solution is B.You can write null instanceof integer with no compilation error.

Wednesday, February 10, 2010

SCJP exercise : enum

Exercise :

public class Test {

enum Animal { "CATS", "DOGS", "ELEPHANT"};
public static void main(String [] args) {

Animal myAnimal = Animal.CATS;
if ( myAnimal == Animal.CATS) {
System.out.println("It's a CATS");
} else if (myAnimal.equals(Animal.DOGS)) {
System.out.println("It's a DOGS");
} else {
System.out.println("It's an elephant");
}
}

}


What is the result ? (choose one)

A It's a CATS
B It's a DOGS
C It's an elephant
D Compilation fails
E An exception is thrown at runtime





Solution :


The solution is D.There is an compilation error because the enum syntax is wrong.
It should be : enum Animal { CATS, DOGS, ELEPHANT};

Wednesday, February 3, 2010

SCJP exercise : enum

Exercise :



Given the following :

public class Test {

enum Animal { CATS, DOGS, ELEPHANT};
public static void main(String [] args) {

Animal myAnimal = Animal.CATS;
if ( myAnimal == Animal.CATS) {
System.out.println("It's a CATS");
} else if (myAnimal.equals(Animal.DOGS)) {
System.out.println("It's a DOGS");
} else {
System.out.println("It's an elephant");
}
}

}


What is the result ? (choose one)

A It's a CATS
B It's a DOGS
C It's an elephant
D Compilation fails
E An exception is thrown at runtime






Solution :


The solution is A.There is no errors.You can use enum with == or with the method equals.

Wednesday, January 27, 2010

SCJP exercise : operators

Exercise :



Given the following :

public class Test {


public static void main(String [] args) {

int num = 1;
if ( num == 'a') {
System.out.println("Good result !");
} else {
System.out.println("Result:" + num);
}
}

}


What is the result ? (choose one)

A Good result !
B Result:1
C Compilation fails
D An exception is thrown at runtime






Solution :


The result is C.There is no compilation error.You can compare 1 with 'a' because the comparison use the unicode value of a.So it's correct to compare 1 with 'a'.

Wednesday, January 20, 2010

SCJP exercise : operators

An other exercise ! The goal is practice and learn commons java certification SCJP questions.

Exercise :



Given the following :

public class Test {

public static void main(String [] args) {


int num = 1;

if ( num = 2) {

System.out.println("Result:" + num);

}

System.out.println("Result:" + num);

}

}



What is the result ? (choose one)


A Result:1

B Result:2

C Compilation fails

D An exception is thrown at runtime






Solution :


The solution is C.In fact we set num to 2 with num=2.
So the result of the setting is an int.Or the if is waiting a boolean so the compilation fails.

Thursday, January 7, 2010

Good year

Hi !

This year we will see many things like certification exercise, Java tips, Go langage ...
So it's exiting !