Wednesday, December 9, 2009

Glassfish 2.1 vs Glassfish 2.1.1

I recently encountered an error on deployment for Glassfish v2.1.1. I developed my WAR on v2.1 and works properly.. Maybe there are just some libraries that are incompatible with 2.1.1. :) IASDeploymentException FTW!

Thursday, November 12, 2009

Mercurial and #!CRUNCHBANG Linux

I thought getting this to work was difficult regarding the HG VIEW command. Well it seems not.
Here is how I got it to work.

Download mercurial

sudo apt-get install mercurial

Download wish

sudo apt-get install tk8.5

Add a ~/.hgrc file and add the following code:

[extensions]
hgk=

having hgk have an empty value allows it to search for the path itself.

Then go to your repository and type in

hg view

and there you go!

Tuesday, November 10, 2009

Quartz and Google Guice

Got a really hard time looking for resources from the net regarding its integration. But good thing i found this really helpful link from another blog. quartz&guice

Also, I needed to get the injections working within my job. Also took me time to realize what to really search for.. My workaround was to pass the Injector object to the jobDataMap of the jobDetail.


jobDetail.getJobDataMap().put("Injector", jobFactory.guice);


And within my Job class, i can use the getInstance of the injector. :)


Injector guice = (Injector) arg0.getJobDetail().getJobDataMap().get("Injector");


So those objects that handle my Storage and some of my utils are done like this.


mailSender = guice.getInstance(MailSender.class);
loadersStorage = guice.getInstance(LoadersStorage.class);


Here's what my quartz code looks like.


QuartzScheduler


public class QuartzScheduler {

private final Scheduler scheduler;

@Inject
public QuartzScheduler(final SchedulerFactory factory, final GuiceJobFactory jobFactory) throws SchedulerException, ParseException {
scheduler = factory.getScheduler();
scheduler.setJobFactory(jobFactory);
//...
JobDetail jobDetail = new JobDetail("myJob", null, FileWatcherJob.class);
jobDetail.getJobDataMap().put("Injector", jobFactory.guice);
CronTrigger trigger = new CronTrigger("myCronTrigger", "cronGroup");
trigger.setCronExpression("your cron expression");
trigger.setStartTime(TriggerUtils.getEvenMinuteDate(new Date())); // start on the next even minute
trigger.setName("myTrigger");
scheduler.scheduleJob(jobDetail, trigger);
// scheduler.start();
}

public final Scheduler getScheduler() {
return scheduler;
}

public void shutdown() {
try {
scheduler.shutdown();
} catch (SchedulerException e) {
// ... handle it
}
}

public void start() {
try {
scheduler.start();
} catch (SchedulerException ex) {
Logger.getLogger(QuartzScheduler.class.getName()).log(Level.SEVERE, null, ex);
}
}


GuiceJobFactory


public class GuiceJobFactory implements JobFactory {

public final Injector guice;

@Inject
public GuiceJobFactory(final Injector guice) {
this.guice = guice;
}

public Job newJob(TriggerFiredBundle bundle) throws SchedulerException {
JobDetail jobDetail = bundle.getJobDetail();
jobDetail.getJobDataMap().put("Injector", guice);
Class jobClass = jobDetail.getJobClass();
Job job = (Job) guice.getInstance(jobClass);
guice.injectMembers(job);
return job;
}
}


Quartz Module


public class QuartzModule extends AbstractModule {

@Override
protected void configure() {
bind(SchedulerFactory.class).to(StdSchedulerFactory.class).in(Scopes.SINGLETON);
bind(GuiceJobFactory.class).in(Scopes.SINGLETON);
bind(QuartzScheduler.class).in(Scopes.SINGLETON);
}
}


My Job


public class FileWatcherJob implements Job {
//... declarations here
public void execute(JobExecutionContext arg0) throws JobExecutionException {
System.out.println("Execute");
try {
Injector guice = (Injector) arg0.getJobDetail().getJobDataMap().get("Injector");

mailSender = guice.getInstance(MailSender.class);
loadersStorage = guice.getInstance(LoadersStorage.class);
entityManagerFactory = guice.getInstance(EntityManagerFactory.class);
persistenceContextHelper = guice.getInstance(PersistenceContextHelper.class);
long newTimeStamp = file.lastModified();
if (FileWatcherJob.timeStamp != newTimeStamp) {
FileWatcherJob.timeStamp = newTimeStamp;
onChange(file);
}
} catch (NullPointerException ex) {
ex.printStackTrace();
}
}

public void onChange(File file) {
//some logic
}
//...
}

Monday, October 19, 2009

Blackberry Javaloader

For faster loading of apps for blackberry use this simple commands.

Pre-reqs: Set up environment variable for jde's bin folder.
1. Right Click on My Computer
2. Click Properties
3. Go to Advanced tab
4. Click Environment Variables
5. Go to System Variables
6. Select Path variable
7. Click on Edit
8. Add path of jde's bin folder (e.g. C:\Program Files\Research In Motion\bin)
9. Click Ok.

Now you can go to command line:
To load the cod file to the device:
javaloader -usb load .cod
To erase the cod file from the device:
javaloader -usb erase -f .cod
To get the event log for debugging:
javaloader -usb eventlog > dumpfile.txt


Note:
replace the to your apps file name
replace dumpfile with any file name you want.


Enjoy!

Friday, August 7, 2009

Mark A. Ramos



Mark Alcala Ramos


Educational Background

2005 – 2009 STI College-Legazpi, 692 Rizal St. Legazpi City
Bachelor of Science in Computer Science – CUM LAUDE
2001 – 2005 Aquinas University Science High School, Rawis, Legazpi City
High School Diploma
1995 – 2001 Bicol University College of Education Laboratory School, Legazpi City
Grade School Diploma

Work Experience
Novare Technologies Inc.
April 2009 - Present - Software Engineer

snap

Part of the team developing the SnAP - mobile SAP. snap, or mobile SAP, is an affordable, off-the-shelf and ready-to-use mobile SAP product that aims to cultivate a more productive and mobile workforce. snap understands the importance of mobilizing your business processes, allowing one's business to increase its revenue. This mobile offering will integrate SAP with BlackBerry's native applications which leverages on the push-based architecture of BlackBerry Enterprise Server to automate data synchronization.

snap allows SAP users to view, forward and approve workflow items and requests while away from a desktop or laptop. It is built to support data integrity, validation, scalability and maintainability.


STI College-Legazpi

June 2005 – 2009 – Student
Has actively participated and contributed to the following thesis/projects:

6th Philippine National Corn Congress Registration System
Currently leading a team for developing a registration system for the upcoming conference. The software will be used for the registration of the attendees of the congress and be able to track down their participants from the different regions and provinces.

Internet Café Management Software with Accounting and Remote Monitoring
Part of the team who developed a generic Internet Café Management Software with Accounting and Remote Monitoring for different internet cafés. The study unlike other internet café software is composed of all the necessities of an internet café especially on the monitoring of the business. The accounting and remote monitoring are incorporated in the system for the monitoring of the business and track down the transactions of the business. The remote monitoring encompasses the mobile and web monitoring which will be used by the owner to keep them posted on the business’ financial status.

Search for Mutya ng Ibalong 2008 Tabulation System
Part of the team who developed the tabulation system for the search for Mutya ng Ibalong 2008. The system is composed of the processing of scores given by the judges. It helps the processing of the results become faster and easier.

Internet Café Management Software with Accounting for Ramskie I-café and Gen. Mdse.
Part of the team who developed an internet café management software with accounting especially for Ramskie I-café. The software includes the basic features of internet software with an integrated accounting system for the tracking down of the transactions of the café.

Mini Library System

Guided a team developing a mini library system as their project in Visual Basic 6 and served as a tutor and project manager of the team. The software includes basic features of a library system like borrowing and returning of books, monitoring of delinquent borrowers, maintenance of borrowers and books.

GMailClient for Mobile Devices
Part of the team who developed a GMailClient that can be used through a java powered mobile device. The freeware software is used view e-mail messages from the GMail server via mobile phones. The software can also be used to send e-mail messages to other e-mail accounts by using a GMail account. The software unlike other is able to store messages on the phone and does not consume too much phone RAM.

Thesis
Internet Café Management Software with Accounting and Remote Monitoring

  • “Best Thesis Award” – STI College Legazpi
  • Nominated for “Most Outstanding Thesis Award” – National Level

Educational Achievements
  • Bachelor of Science in Computer Science, Cum Laude
  • Student of the Year Award 2009 STI College Legazpi
  • Programmer of the Year Award 2009 STI College Legazpi
  • Dean’s Lister S.Y. 2008-2009 1st and 2nd Semester
  • Dean’s Lister S.Y. 2007-2008 1st and 2nd Semester
  • Dean’s Lister S.Y. 2006-2007 1st and 2nd Semester
  • Dean’s Lister S.Y. 2005-2006 1st and 2nd Semester
  • Worked with the following softwares/technology: JAVA, J2ME, J2EE, MS Access, Windows XP/Vista, Ubuntu Linux, Kubuntu Linux, Mac OS X Leopard, Netbeans IDE 6.0,Eclipse, Visual Basic 6, My SQL, Turbo C, Netbeans IDE 6.5, Subversion, Trac, VisualSVN Server, TortoiseSVN, Adobe Photoshop, Android OS, Windows Mobile, Symbian, Struts 2, JAX-WS, HTML, JSP, GoogleGuice, Maven, Netbeans IDE 6.7, Eclipse Ganymede, CSS, SLF4j, Blackberry JDE 4.3-4.5.
  • 1st Runner-up in Cluster II Competition Tagisan ng Talino 2006
  • Most Valuable Programmers (Senior Level) August 4, 2006
  • 2nd Place in the 14th Philippine Statistics Quiz (PSQ) Provincial Elimination held
  • on October 7, 2005
  • 1st Runner-up for the “WEB PAGE DESIGN COMPETITION to the First-Ever
  • YOUTH AMBASSADOR SEARCH”, held on September 8, 2006
  • Have good communication skills.
  • Hard Working, fast-learner and can work under pressure and with minimal
  • supervision.
  • National Certificate in Computer Hardware Servicing NCII Passer
  • (TESDA)Certificate No. 070501025119
  • National Certificate in PC Operations NCII Passer (TESDA)Certificate No. 070501024501