29 January 2005

My SWT/JFace/Eclipse blogs are all gone!

My 2 other blogs, http://blogs.application-servers.com/roller/page/jaredflo and from pikko-software are all inactive blogs. But my mistake I forgot to transfer SWT/JFace/Eclipse related blogs here.

Now, I am going to rewrite my "Let's JFace It" article that I have posted years ago. My latest project with our client is to transform our web-based management application to a native one. This might be the first SWT-based project in full commercial scale level in the telecommunications industry. But I digress, my teammates are not up to SWT yet. So we'll have to start with Swing for now, so that they will have a better grasp on how to do native GUI in Java.

But all I need is to spend a day to transform what I have done in Swing to JFace. For them to appreciate it.

27 January 2005

Chernobyl Recently

I thought this site went off forever. It's up again. Chernobyl today is the symbol of ultimate freedom. If you'll ask me what will I do if I ever get the chance to be there. I'll zoom in with a bigger wheels like a Benz C220 at 80mph, I wonder how it feels driving down those radioactive-planed roads, smooth like no other roads in the world.

Second, I'll buy a flat and setup a software development office. With the value of the real estate there, it's almost like giveaway. I think I could get 3 floors/dime there :)). And electricity of course is very, very cheap.

What's your Chernobyl Dream?

25 January 2005

Free Java 2 Certification at Brainbench this January

More difficult than SCJP 1.4, with broader topics.

With 6 million registered users, Brainbench is the leading provider of online testing and certification, with over 600 tests available across a variety of skill areas, including IT, computer software, financial, health care, management, office skills, and more. Whether you are looking for a job or trying to advance in your career, these challenging tests measure practical, real-life skills rather than book knowledge, making them an ideal way to ensure that your skills are up-to-date.

More and more of today's leading organizations, including
Booz Allen Hamilton, CACI, EDS, Ford Motor Company, H&R Block, IBM, Interwoven, JPMorgan, Kaiser Permanente, Manpower, Prometric, SAIC, Seimens, TAC Worldwide, U.S. Government Agencies, Verizon, and Wells Fargo recognize Brainbench as the authority in online skills measurement. And because all tests are administered in a secure online environment, you have the convenient 24/7 access, enabling you to take tests wherever you like, whenever you like.

To get started with Brainbench, you simply need to register for a free online account. You'll then be able to begin taking tests, including, several dozen that are free. To register for an account now, go to:
http://www.brainbench.com/links/toreg.html?vid=frnd708239

Your free online account includes a personalized online transcript that immediately stores your test results. For each test you pass, you'll receive a free certification logo in your transcript as well as a free paper certificate for every paid test. You can select whether your test results are available to the public or kept private, and add other information such as your resume. Test results include an overall score, strengths and weaknesses, and suggestions on learning materials to help you improve. You can even see where you stand against previous test takers.

To register now and get started, go to:
http://www.brainbench.com/links/toreg.html?vid=frnd708239

24 January 2005

Clustering with ActiveMQ

I have discussed previously the additional info for ActiveMQ. If you're really serious about using JMS, buy an expensive one(e.g. Fiorano, SonicMQ, iBus etc.) or you can settle for ActiveMQ. The fun part with ActiveMQ is you "drop it in" to any application servers like JBoss. But please do not run ActiveMQ with JBoss, it only helps tarnish ActiveMQ's reputation with that of JBoss, not a good move.

While reading thru the examples of ActiveMQ's clustering features. It definitely looks simple, what pisses me off is its obsession with Maven, it seems they have a very low regard for intelligent beings. As an additional task I will be building my own clustering examples using java's main(). Yes, the main executable. Geez, I really don't know what's the point of Mavenizing an executable.

Stay tuned.

Slackware Terminal MOTD

I think I should post on of these from time to time.

"I have never seen anything fill up a vacuum so fast and still suck.
-- Rob Pike, on X.

Steve Jobs said two years ago that X is brain-damaged and it will be
gone in two years. He was half right.
-- Dennis Ritchie

Dennis Ritchie is twice as bright as Steve Jobs, and only half wrong.
-- Jim Gettys"

20 January 2005

Additional Info for ActiveMQ

ActiveMQ is cool. Imagine building destinations for queues and topics without touching the JMS Provider or the MQ server, has a small footprint, uses a tried and tested embedded database. These create-on-the-fly destinations are truly an intelligent feature every JMS vendor should include in their products. Let's try a simple example.

ActiveMQ supports JNDI, just like any other J2EE components. So for this example we will use JNDI for looking up destinations and connection factories.

Listing 1: jndi.properties



java.naming.factory.initial = org.codehaus.activemq.jndi.ActiveMQInitialContextFactory

# use the following property to embed a broker inside this JVM
#useEmbeddedBroker = true

# use the following property to specify a class path resource or URL
# used to configure an embedded broker using the XML configuration file
#brokerXmlConfig = file:src/conf/sample-conf/default.xml

# use the following property to configure the default connector
brokerURL = tcp://10.121.54.70:61616

# use the following property to specify the JNDI name the connection factory
# should appear as.
#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry

# register some queues in JNDI using the form
# queue.[jndiName] = [physicalName]
queue.MyQueue = example.MyQueue


# register some topics in JNDI using the form
# topic.[jndiName] = [physicalName]
topic.MyTopic = example.MyTopic



We have registered a queue and a topic. But for the example, we will use the queue. The code listing below shows a simple JMS message producer that uses Sun's j2ee.jar library.

Listing 2: SimpleProducer.java


import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
* A simple polymorphic JMS producer which can work with Queues or Topics
* which uses JNDI to lookup the JMS connection factory and destination
*
* @version $Revision: 1.1 $
*/
public class SimpleProducer {

/**
* @param args the destination name to send to and optionally,
* the number of messages to send
*/
public static void main(String[] args) {
Context jndiContext = null;
ConnectionFactory connectionFactory = null;
Connection connection = null;
Session session = null;
Destination destination = null;
MessageProducer producer = null;
String destinationName = null;
final int NUM_MSGS;

if ((args.length < 1) || (args.length > 2)) {
System.out.println("Usage: java SimpleProducer []");
System.exit(1);
}
destinationName = new String(args[0]);
System.out.println("Destination name is " + destinationName);
if (args.length == 2) {
NUM_MSGS = (new Integer(args[1])).intValue();
}
else {
NUM_MSGS = 1;
}

/*
* Create a JNDI API InitialContext object
*/
try {
jndiContext = new InitialContext();
}
catch (NamingException e) {
System.out.println("Could not create JNDI API context: " + e.toString());
System.exit(1);
}

/*
* Look up connection factory and destination.
*/
try {
connectionFactory = (ConnectionFactory) jndiContext.lookup("ConnectionFactory");
destination = (Destination) jndiContext.lookup(destinationName);
}
catch (NamingException e) {
System.out.println("JNDI API lookup failed: " + e);
System.exit(1);
}

/*
* Create connection.
* Create session from connection; false means session is not transacted.
* Create sender and text message.
* Send messages, varying text slightly.
* Send end-of-messages message.
* Finally, close connection.
*/
try {
connection = connectionFactory.createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
producer = session.createProducer(destination);
TextMessage message = session.createTextMessage();
for (int i = 0; i < NUM_MSGS; i++) {
message.setText("This is a schmuck message " + (i + 1));
System.out.println("Sending message: " + message.getText());
producer.send(message);
}

/*
* Send a non-text control message indicating end of messages.
*/
producer.send(session.createMessage());
}
catch (JMSException e) {
System.out.println("Exception occurred: " + e);
}
finally {
if (connection != null) {
try {
connection.close();
}
catch (JMSException e) {
}
}
}
}
}



If we run the message producer above it will register the queue name specified in the command line argument and optionally the number of times it will send the message. Notice that in the ActiveMQ's Getting Started guide, nothing was mentioned about configuring queues or topics in the server. So the code will just create the destination if it does not exist yet and send the message.


ActiveMQ's documentation for JNDI support only showed the SimpleProducer.java example. The listing below will show how the message sent by SimpleProducer will be consumed.


Listing 3: SimpleConsumer.java



import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
*
* Created Jan 20, 2005 10:41:06 AM
* @author Jared Odulio
*
* Description:
*
*/
public class SimpleConsumer {

/**
*
*/
public SimpleConsumer() {
super();
// TODO Auto-generated constructor stub
}

public static void main(String[] args) {
Context jndiContext = null;
ConnectionFactory connectionFactory = null;
Connection connection = null;
Session session = null;
Destination destination = null;
MessageConsumer consumer = null;
TextMessage message = null;
String destinationName = null;
final int NUM_MSGS;

if ((args.length < 1) || (args.length > 2)) {
System.out.println("Usage: java SimpleProducer []");
System.exit(1);
}
destinationName = new String(args[0]);
System.out.println("Destination name is " + destinationName);
if (args.length == 2) {
NUM_MSGS = (new Integer(args[1])).intValue();
}
else {
NUM_MSGS = 1;
}

/*
* Create a JNDI API InitialContext object
*/
try {
jndiContext = new InitialContext();
}
catch (NamingException e) {
System.out.println("Could not create JNDI API context: " + e.toString());
System.exit(1);
}

/*
* Look up connection factory and destination.
*/
try {
connectionFactory = (ConnectionFactory) jndiContext.lookup("ConnectionFactory");
destination = (Destination) jndiContext.lookup(destinationName);
}
catch (NamingException e) {
System.out.println("JNDI API lookup failed: " + e);
System.exit(1);
}

try {
connection = connectionFactory.createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
//producer = session.createProducer(destination);
consumer = session.createConsumer(destination);
connection.start();
//message = session.createTextMessage();
for (int i = 0; i < NUM_MSGS; i++) {

Message msg = consumer.receive();
if (msg instanceof TextMessage){
message = (TextMessage)msg;
System.out.println(message.getText());

}
}

/*
* Send a non-text control message indicating end of messages.
*/

}
catch (JMSException e) {
System.out.println("Exception occurred: " + e);
}
finally {
if (connection != null) {
try {
connection.close();
}
catch (JMSException e) {
}
}
}
}


}




So who needs a JMS implementation where you have to define the queues and topic thru the some XML configuration file in order to use them?

19 January 2005

Digital Pinay ka ba?

What the FUCK is going on? No, I am not going to link it. What happen to Philippine Computer Society? Are they caught with this "search quest" fever? By simply looking at the criterias for candidates, this whole crap is nothing but another beauty pageant in the guise of representing the industry of the Philippine I.T., what a pathetic scam. To tell it frankly, 5 years in any engineering or CS related course barely manifests any "Digital Pinayable" beauties(maybe digitally enhanced, hehehe). Chances are, there is 1 to 100(or more) ratio and those 1's usually drops out at the second year or shift to an easier course. So who will be this mysterious Digital Pinay? Even the deserving ones I bet my ass will not join this contest.

And the prize as far as I can remember is PHP25,000(!). Hey! That's the minimum starting pay of the true Digital Pinay if she decides to cut it out in the corporate world hehehehe. "...translates to high visibility in the job market". I think the people who thought this down were on drugs, or whatever sleazy substance they got their hands on. Job market of what? I am sure it's not I.T. related, but my uncle DOM will sure be interested.

18 January 2005

Testimonial and Certification

Forgive me, I am in a comprehension-starved mode today combined with rush and confusion in quest to do things right. So what is a testimonial? A testimonial is a factual statement gathered from a passive witness expressed orally or in written form. So what's a certification? A certification is a proof in behalf of the actual evidence that something exists or something has taken place and is recognized by the signatories who are not necessarily witnesses to the event that has taken place or the existence of the matter. A certification is normally expressed in written form.

What?!? Does it clear the difference? Maybe. Geez, some people are really so damn lucky they got away with certifications! :))

17 January 2005

Sex and Prevayler

One of the reasons I got the drive to blog is when I got the time to read some of Fate's blog entries.

Like this one is so fucking hilarious. I would admit that I've used Prevayler and that stuff is not purely an in-memory database system it uses I/O and uses lots of it. But comparing Prevayler with sex, I think Prevayler is like masturbation without the payoff. *LOL*.

Dig and Drag

Yes, that's what I literally did this morning I dug the grave of my old dog and dragged his remains there and grieved a little. Hey, what does it has to do with software development? Well, as workers of technology we have one thing in common with them, we're expendable no matter how we justify it.

12 January 2005

Dual Licensing Scheme(Bringing Open Source to the Bank)

Ever wonder how SleepyCat Software, the maker of the most powerful open source embedded database called BerkeleyDB, is purring all the way to the bank? And how about MySQL AB and Trolltech the makers of QT are cashing in from open source?

Fortunately, I was able to read the hard copy of this Linux Magazine article during a power failure. Most of us are familiar with typical business models that is associated with open source known as consulting, subscription and support. It's all too familiar that almost everybody will adapt these revenue models in order to make money for open source.

But there's another one, it's called duelling licensing. So what's the big deal with dual licensing? Dual license enable us software developers to distribute or publish commercial software license for a fee or royalty. Dual License provides a low-cost alternative to open source. While giving the software away for free to wider community. With dual license, publishers can distribute low-cost version of the open source product, extend it or modify it without having to publish the modifications. Vendors can redistribute dual-licensed product even in pure binary format. Of course, it is the vendors' responsibility to warrant the usability and merchantibility of the product.

As stated in the article; "Moreover, a dual license model can deliver higher margins than an open source subscription model. For instance, Red Hat sells subscriptions to Red Hat Enterprise Linux and Red Hat Network. However, competition with SuSE, Miracle Linux, and Red Flag, and Red Hat's high list price for its premium offerings (which, in a number of cases, is significantly discounted), limits Red Hat's ability to attain volume sales and market saturation." I would like to add that JBoss, Hibernate and other Java-based Open Source Trying-Hard-Frameworks does not adapt this kind of business model. The inferior JBossMQ will not even qualify for QA for it to be dual-licensed. Thank goodness.

11 January 2005

SuperWaba Revisited

First of all, Happy New Year! It's 2005 and guessed what, it's five years after the birth of the SuperWaba project. Five years then that we're so frustrated we could not take advantage of The Real Power of SuperWaba because hardwares during that time couldn't still catch up, therefore limiting commercial potential. Now with handheld/PDAs almost on steroids and the emergence of multigigabyte subinch hard drives is getting closer, the SuperWaba will be very ready for primetime. So what will be the future of SuperWaba for another five years? My take, it will kick the ass of J2ME in the Handheld/PDA category over and over again.

And when I go back to mobile programming, SuperWaba will again be part of the arsenal.