Tuesday, December 6, 2011

Oracle Certified Master, Java EE 5 Enterprise Architect OCMJEA (SCEA5) part1 passed

On 29 October 2011 I passed OCMJEA part 1, it was quite tricky exam but I enjoy it and everything went fine, I also completed required hands on training and subscribed for part 2 assignment which I must complete until may 2012.
I'm very happy now:).

Using thread pool starting from java5

import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;

/**
* Processing jobs thread pool
*/
public class ProcessingJobExecutorService {
private static ProcessingJobExecutorService _instance =null;
private ExecutorService executorService;

private ProcessingJobExecutorService(){
executorService = new ScheduledThreadPoolExecutor(500);
}

public static ProcessingJobExecutorService getInstance(){
if(_instance==null){
_instance=new ProcessingJobExecutorService();
}
return _instance;
}
public void execute (Runnable r){
executorService.execute(r);

}

}

Sunday, October 23, 2011

Developing Applications for the Java EE 6 Platform Oracle training

This week I completed this training from Oracle. It was a pleasure to listen and do some exercises with Netbeans and Glassfish. The course was quite expensive but I chose it for mandatory course attendance requirement in case of jee architect certification.

Friday, September 16, 2011

java to javascript in wicket

//

//---- code in wicket page constructor ----
//internationalised message to javascript visible in html page
String contributor = "";
add(new StringHeaderContributor(contributor));
//

Domain driven vs service oriented architecture/design

Domain driven design and service oriented design are opposite approaches, while service oriented approach is more stateless (SOA) and more procedural programming like, the domain driven approach is more stateful and object oriented.
The best practices in each case tend to become anti-patterns in the other case.

Thursday, September 15, 2011

md5 in java whitout reading file in a buffer


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Scanner;


public class MD5 {

/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
String[] cmd = new String[]{"md5sum","/home/user/workspace/project/buildfile"};
ProcessBuilder pb = new ProcessBuilder(cmd);
Process p = pb.start();
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
StringBuffer sb = new StringBuffer();
String line;
while ((line = br.readLine()) != null) {
sb.append(line).append("\n");
}
String answer = sb.toString();

int val = p.waitFor();
String md5 ="";
if(val == 0){
Scanner s = new Scanner(answer);
if(s.hasNext()){
md5 = s.next();
System.out.println(md5);
}
}else{
System.out.println("Error executing command md5sum");
}

}


}


Thursday, September 1, 2011

JQuery - select html elements with id starting with given string


//select all divs with id starting with 'jpassword'

$("div[id^='jpassword']").style.display = 'none';

Wednesday, August 24, 2011

Exit on ESC in Wicket ModalWindow


//Every modal dialog will extend this class
public class ModalPanelContainer extends ModalWindow implements IHeaderContributor {

//the magic is in this method
@Override
public void show(final AjaxRequestTarget target) {
if (!isShown()) {
final AppendingStringBuffer buffer = new AppendingStringBuffer(500);
buffer.append("function mwClose(ev) {\n" +
"var code = ev.keyCode || ev.which;\n" +
"if (code == 27) { " +
getCloseJavacript() +
"};" +
"}");
buffer.append("jQuery(document).keypress(mwClose);\n");
target.appendJavascript(buffer.toString());
}
super.show(target);
}



}

Custom 404 error page in Wicket

In web.xml you must have something like this:


WicketFilter
org.apache.wicket.protocol.http.WicketFilter


applicationClassName
com.yourproject.FrontendWebApplication



WicketFilter
/*
REQUEST
ERROR


404
/error404



After this create a page with mounting point "errror404".

That's it.

Monday, April 12, 2010

Design Patterns

 

I decided to start study for SCEA part 1 with design patterns, I will post my study notes for each pattern. Let’s start with  listing GoF patterns and j2ee patterns (I don’t find any new patters introduced to jee 5 so all j2ee patterns apply to jee).

Purpose

Name

Creational Factory Method
Abstract Factory
Builder
Prototype
Singleton
Structural Adapter
Bridge
Composite
Decorator
Facade
Flyweight
Proxy
Behavioral Chain of responsibility
Command
Interpreter
Iterator
Mediator
Memento
Observer
State
Strategy
Template Method
Visitor

 

 

JEE Patterns:(jee patterns catalog)

figure06_02

Friday, April 9, 2010

Publish Source code in Blogger

Many thanks for this

Test:
// Comment
//

public class Testing {
public Testing() {
}

public void Method() {
/* Another Comment
on multiple lines */
int x = 9;
}
}
//




bash
## lala
##

##

Thursday, April 8, 2010

SCJP 6



From January I'm Sun certified programmer for java se 6, after a week I received the badge and the big diploma in a mail.
I read only from SCJP Study Guide Katherine Sierra, Bert Bates and I use the simulator (free) from examlab.tk, and javaranch forums (very helpful). It was not an easy exam and you must prepare carefully, study each topic with maximum attention.

Next step (4me): SCEA (Sun certified enterprise architect) I will start soon to study for SCEA, I'm not so confident because current scea is outdated the new JEE 6 specs are here from December 2009, but the update certification I think will appear more lately, another concern is about oracle that own sun now how will they modify the scea...will they focus more this certf on their products ? will they constrain further jee evolution to own view ?...and how valuable will be this cert on the market ?
However I think prepare for scea is a very good reason to be motivated to learn essential sw arhitecture topics ...

Wednesday, December 2, 2009

New born

Yesterday a little budgie was born in my budgie family, my female budgie still has 5 eggs and I waiting for new friends to face this world

Wednesday, October 28, 2009

Ubuntu 9.10 still not for me


Yesterday I tried Ubuntu 9.10 64 bit release candidate on my old laptop HP NX6325 I have 3G of ram installation was realty fast but my wireless network was not detected :(, after installation I had problems with suspend/hibernate my laptop freezes after suspend ..after many hours of search solution on net without success I decided to test jboss with eclipse ...after starting jboss with jdk 6 64 bit ~700 M of RAM was used which is much more than was in win xp.
Another problem I had with my creative web cam ..my hp scanner was not working also so I decided to go back to win xp sp3 with this os my laptop rocks !
Many problems on Ubuntu I had also with software ..for e.g. I tried to use Wolfram Mathmematica 7 linux version after I applied all patches I still had ~20% of cpu usage on idle state of mathmeatica :( ...also many problems with linux software incompatibility with new kernel.

My final conclusion : linux evolution is remarkable but is still not a solution for home/multimedia pc

Friday, October 16, 2009

Free as a bird

I’m quit my job on October 9 mainly because of no perspective to learn something new and advancing in carrier. Doing bug fixing every day and just a bit of development…spending most of the time on configuring things and figuring out what’s wrong without creativity  is no more interesting for me…

Another aspect of this is the financial part my salary is the same in RON as 2 years ago  while euro exchange rate is approximately 25% higher than two years ago …so my real salary decreased with  25%..and because of financial crisis (in my opinion only a pretext) there is no chance of adjustment or renegotiation.

Besides I started my master study at technical university department of mathematics and I want to take it in seriously Raised Eyebrow … I must refresh topics in math Tongue.

For the future I want to develop a framework for 3D animation in ActionScript also I want to learn Papervision 3D.

…hm many plans … I must take my scjp 6 certification I have purchased the voucher but have no time to learn for it.

Tuesday, February 24, 2009

Bugs


In last period I done a lot of bugfixing ..stil there is a lot of work in this area in my work project .. today I encountered a bug when I tried to access my gmail ... in my opinion there is no perfect software ... one of reasons ... there are no perfect developers :)

Tuesday, February 10, 2009

Starting SpringSoft comunity

at the end of december I brought a domain and hosting for springsoft.ro, my plans was to open a software company this year, but things move slowly so I thing about spring soft to be a comunity of open software.
By the way I just finish the design of the layout this is a vision of mine about this site: www.springsoft.ro

Learning for SCJP Sun Certified Programmer for Java 6 (Exam 310-065)

Yesterday I decided to get scjp for java 6. I emailed to sun greece centre and they send me a bank acount that I must use to pay the exam voucher 235euro. I registred in prometric centre and I start reading Sun Certified Programmer for Java 6 study Guide by Katty Sierra & Bert Bates, also I got wizzlab simulator for scjp 5 which I will use for exam preparation.
In future I intend to get SCJD and SCEA

Friday, August 15, 2008

Trip to Bratislava

Two weeks ago I was in my holidays in Bratislava, in Bucharest were I'm working on NPLE project until september only now I got a decent internet connection in my flat so now I'm posting some nice photos from there. Bratislava is very nice city especially the old town a place full of history with medieval air. Photos were made with my old sony ericsson k750 phone ..so the quality is not the best :).

DSC01165 DSC01068 DSC01024 DSC01022 DSC01020 DSC00972

DSC00973

DSC00990

DSC00991 DSC00995 DSC01004 DSC01012 DSC01016 DSC01017 DSC01023 DSC01024 DSC01028

DSC01040 DSC01043 DSC01061 DSC01066 DSC01077 DSC01079 DSC01081

DSC01088 DSC01099

DSC01096 DSC01102 DSC01100 DSC01107 DSC00972 DSC01167 DSC01166 DSC01165 DSC01159 DSC01156 DSC01155 DSC01154 DSC01152 DSC01151 DSC01146 DSC01145 DSC01146 DSC01143 DSC01142 DSC01138 DSC01139 DSC01115 DSC00973DSC01040 DSC01099 DSC01100 DSC01116 DSC01167