Saturday, December 30, 2006

Entity Management for EJB3 Stateless Session Beans

@Stateless
public class StatelessSessionBean implements LocalInterface {
@PersistenceUnit(name="PUName")
private EntityManager em;
// operations on the entities, such as creating, editing, destroying, and finding.
}
  • Creates a container-managed entity manager.
  • Entity manager is transaction-scoped (meaning persistence contexts are managed by a container-controlled JTA transaction).
  • Entity manager is stateless (which is why they can be stores in any Java EE component).
  • Transaction initiated when the session bean is first invoked, and its lifecycle managed by the container.

Friday, December 29, 2006

17 Things Linux Does Better Than Windows

In June 2007, the French parliament is moving their computing base to the Linux operating system, Firefox browser, and OpenOffice.org productivity suite. It's not clear whether the whole government will eventually move away from Windows, but this is law in France.
I've had a love-hate relationship with Linux over the years, and although I still develop/run everything on Windows, there's a lot Linux offers that I wish Windows would do better:
  1. More flavors of Linux from different vendors = more competition = better software. With Windows, you are stuck with only Microsoft. Linux flavors include Linspire, Red Hat, SuSE, Ubuntu, Mandr*, Slackware, etc.
  2. Customizability to special purpose builds. If I am installing a server, I probably need less than the bulk Windows forces you to install for the same purpose. Linux builds exist that can run off floppies; with Windows, even installs can no longer be initiated from floppies.
  3. Optional GUI for a fully functional OS means increased efficiency and allows for easier remote control administration. With Windows, the GUI is pretty much required for everything; DOS and the Recovery Console might help, but we all know how limited they are.
  4. More robust shell in Linux and the option to use multiple shells. In Windows, DOS is all you got. Their new WSH is heavily dependent on Windows itself that it's almost a program within Windows than a standalone framework.
  5. Linux is essentially free for a basic home machine. You purchase support and extra packages for server platforms, but all in all, for the same level of performance and features, you spend about 1/7 the cost of Windows on Linux. Windows desktop versions start at $200. Then there's the question of ongoing costs - maintenance, bugs, viruses, and upgrades - Linux costs less in this regard.
  6. More freedom with the software you purchase: Windows allows one copy per machine (WPA/Genuine Windows) and still essentially owns your copy of the OS. With Linux you can install any number of bases with no strings attached.
  7. Smarter installs to multihomed systems: if you ever need to install Windows and Linux operating environments, you start with Windows, then Linux. Somehow, Windows kills off bootstraps of OSes it does not recognize (read non-Microsoft), whereas Linux accommodates other OSes with customizable booters.
  8. Fewer viruses, spyware, and adware. And contrary to the myth that it's because the installed base is larger, consider the Apache web server (60% of web servers) which gets significantly fewer security problems than Microsoft's IIS. Thus, Linux is more secure. Also, some default installations of Windows allow a no-password account (with Admin rights).
  9. Certification stability. For those that have navigated the certifications world, you know how soon Windows OS certification expire. Microsoft releases a new OS every 3-5 years, making certifications on older OSes obsolete. A Linux certification goes much further.
  10. I've been irked by the option to buy support and patches from Microsoft - for Windows! What the hell is wrong with this picture? If you make software, please don't charge people for fixes to your won mistakes. Sure lost updates are free, but as a developer, I know I've hit the price wall in this regard. Linux support through forums and other user bases removes this problem (though sometimes hard to come by).
  11. Wider diversity of hardware. Windows no longer runs on MIPS and Alpha processors, for example. Linux can run on even the oldest and slowest of machines - has fewer hardware requirements. Have you heard of Linux fro iPods? Try iPodLinux ... an OS that can run on iPod power.
  12. Better clustering support - you can essentially run a supercomputer using Linux for a small fraction of the cost of using windows solutions.
  13. Linux is the original true multiuser environment. Windows was originally designed as a single-user environment, but has made strides with Terminal Services/Remote Desktop/Remote Assistance. Only the latest (Windows 2003 or later) have come close.
  14. Unlimited logical partitions in Linux, as opposed to 32 for Windows. Well, there are theoretical limits (and those imposed by hardware/software constraints), but it's good to be able to create 100 small partitions that can all be used in the OS. Windows limits you to what you can name them (A-Z) - DFS may add some capabilities.
  15. Ability to schedule (and even abort) shutdowns. I can't tell you how many times I've wished I could stop a shutdown or set it to run at a certain time (without having to create a batch file and use the Scheduler program to set it - not streamlined).
  16. Linux is modular by design, so plugins and failures are localized. Windows was originally a monolithic design, although 'modular' features are offered though DLLs and COMs, and other 'plug in' models. Still, when one area suffers, it can be felt everywhere in Windows (think Blue Screens).
  17. Linux is not constrained by the RPC model, which runs all programs as network components. It makes it easier to locate programs/services across the network, but for applications without networking features, there's no need to be 'network borne' locally. Like, there's shouldn't be a need to rely on ports/sockets when 2 applications only need to run and communicate on the same machine, networkless.
That's my two cents. In the coming year, I am brushing up again on my Linux skills (hot in the job market right now) and might even pursue a Linux certification. We shall see.

Friday, December 22, 2006

Customizing Simple EJB 3.0 Entities and Tables

The Java Persistence API does a good job mapping entities and fields in default mode to tables in a database. But sometimes you need to specify the name and columns of a table (maybe to take advantage of an existing schema). Using annotations in your entities makes this easy to implement. As an example, let us suppose you need to represent an employee in a database:
With EJB 3.0, you begin by writing an entity for the employee. The Employee class is a basic POJO, but annotations added to it are what make it persistable as we desire.

@Entity
@Table(name="EMP")
public class Employee implements Serializable {
@Column(name="NAME")
private String name;
@Column(name="SAL")
private long salary;
@Column(name="COMM")
@Basic(fetch=FetchType.LAZY)
private String comments;
@Basic(fetch=FetchType.LAZY)
@Column(name="PIC")
@Lob
private byte[] picture;
@Column(name="HIRED")
@Temporal(value = TemporalType.DATE)
private Date dateHired;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="EMP_ID")
private Long id;
@Transient
private transient String nameString;

@Override
public int hashCode() { ... }
@Override
public boolean equals(Object object) {...}
@Override
public String toString() {...}
}

The simple class above is much of what you need to represent an entity in a database. @Entity tells the persistence provider that the data of this class shall be saved in the database. @Table specifies which table shall be used. The entity must be serializable so that RMI and reflection features of Java technology can be used.
Within the table, @Column names the column for each of the attributes that shall be persisted. You can use lazy fetching to improve performance when reading entities from databases - lazy fetching skips reading columns in regular reads until the attribute is actually accessed. So it is recommended for attributes that will not be used much - in our example, pictures and comments.
The API makes it really easy to work with large objects (BLOBs and CLOBs). When we upload a picture for an employee, it'll be a huge resource. @Lob is used to indicate that a special column be allocated in the table for this kind of data.
@Temporal is used to convert dates to and from SQL types. I would not need it if I used javax.sql.Date type to represent dates in my application.
@Id specifies that the attribute/column is the primary key in the table. @GeneratedValue indicates that the primary key should be automatically generated for us. AUTO allows the persistence provider to choose a strategy (either SEQUENCE, IDENTITY, or TABLE), although you can use them directly yourself.
@Transient or the transient qualifier for properties indicates that the attribute should not be persisted. Variables like this are used to hold results of processes that use other variables and not expected to change much - helps improve efficiency if you don't have to recalculate data every time it is requested.
As usual, you need to implement hashCode(), toString(), and equals(), overriding what Object provides. Also advisable is implementing the Comparable interface on the class for sorting algorithms.

This is a basic single-entity implementation; we know that seldom do applications have single entities like this, so in the next few posts, relationships will be summarized.

Saturday, December 09, 2006

Part III(a): Entertain(r) to Become User-Based - Requirements

The Entertain(r) application we've been developing (see Part II) has a new set of requirements - apart from managing movies only:
(1) It needs to become user-based. This includes the ability to add, edit, delete, and find users.
(2) Users must be logged in to view pages or do anything else on the system.
(3) All pages should have a standard menu that includes links to lists of users, movies, and the home page.
(4) Have a generic error page for the application.
(5) Handle database cell overflow problems.

Fullfilling these requirements will demonstrate how to use servlet filters, call JavaBeans from JSP pages, use EJB 3.0 stateless beans, and configure a generic error page for the application using NetBeans 5.5. At the end of the exercise, a basic infrastructure will exist that we can use to further explore EJB 3.0 features.

#1: a user entity must be created, with an accompanying session bean. It'll use the persistence unit we already have. Also, a servlet that does user-oriented business logic needs to be created (adding, editing, deleting, finding).
#2: Create a servlet filter that checks all requests for authentication and redirects to the login page if not logged in.
#3: Create a servlet filter that uses a response wrapper to add the menu to the response.
#4: Configure a JSP page as the error page and update the web descriptor for the web module.
#5: Check for content length and truncate, or redirect to the error page.

An auterior goal is also to find out how long it takes to add such support to an application

Friday, December 08, 2006

Part II: Creating a Simple Persistence Layer for an EJB3 Application


Follows [Part I] ...

The Entertain(r) application stores (or persists) data in a database. For now, the only data we need to store is about movies, including the title, the MPAA rating, the DVD number in my library, the date added to the library, the genre, and a short synopsis. The movie data will be represented in a Movie class, which will be annotated to become the entity.
Tools: NetBeans 5.5, Sun Java System Application Server 9, MySQL 5.

Create the Persistence Unit
Persistence units describe the datasource to the application.
- Right-click the ejb module > New > File/Folder | Persistence > Persistence Unit > [Next]. Datasource=jdbc/entertain. [Finish]. A persistence.xml descriptor file is created.

Create the Entity
An entity is a representation of an object in the datasource. Since we plan to persist movies, it's only appropriate that we call the movie entity Movie. Entities are POJOs that are annotated to indicate that they should be persisted into the database.
- Right-click the ejb module > New > File/Folder | Persistence > Entity Class > [Next]. Class Name = Movies; Package = movie.ejb. [Finish]. An entity class is created and opened in the IDE. It already has the @Entity annotation, along with @Id/@GeneratedValue (auto-generated primary key), is serializable, overrides equals(), toString(), and hashCode() methods - all requirements for an entity class.
- Add the entity's fields:
String title;
String genre;
String rating;
String synopsis;
Date dateAdded;
int dvdNumber;
- Generate bean-style getters and setters for the fields: right-click in the source file > Refactor > Encapsulate Fields ...
- Add the @Temporal(value = TemporalType.DATE) annotation for the dateAdded field. This is so that the persistence provide can translate dates correctly to the TIMESTAMP data type used in most databases.

Create the Session Bean
The session bean provides a facade that can be used to perform CRUD operations.
- Right-click the ejb module > New > File/Folder | Persistence > Session Beans for Entity Classes > [Next]. From the available list, select 'Movie (movies.ejb)' and click [Add] then [Next], then [Finish]. A stateless session bean is created and includes methods to create, edit, destroy, find, and find all movies.
** Fix:: Change the destroy() method to ensure that we operate on a managed object:
public void destroy(Movie movie) {
Movie managed = em.merge(movie);
em.remove(managed);
}

Create the Servlet
We'll use a servlet to test the persistence layer (model, par MVC), which includes the data source, persistence unit, entity class, and session bean - so far all defined in the context of the EJB module. The servlet shall exist in the web module, however.
- Right-click the war module > New > File/Folder | Web > Servlet > [Next]. Class Name = MovieServlet; Package = movie.servlet; [Finish]. A servlet class is created an opened in the IDE.
- Inject the session bean resource: right-click in the source > Enterprise Resources > Call Enterprise Bean. Select MovieFacade, click [OK]. This create an @EJB annotated reference to the session bean.
- Enter some useful code in the processRequest() method (to which all POST and GET requests are redirected). In this application, we will enter decision logic for the CRUD operations we need to test. To add, edit, remove, and find a movie, call the movieFacade methods. [Full servlet code]
- Remember to change the servlet's URL pattern to something simpler, like /Movie
- The application should be deployable now, accessible at something like http://localhost:8080/Entertain-war/.

Results:
The servlet is nowhere near perfect (for example, it does not check data lengths before posting to database fields - defaults are 255 characters), and has a lot of hard-coded lines. But it serves the simple purpose of testing the persistence layer, now composed of the data source, persistence unit, entity class, and session bean. If you are into MVC development, that layer is the model part, and the servlet serves as both the controller and view.

Part I: Creating the Entertain(r) Project

The Entertain project will be used to create the Entertain(r) web application, which contains MyMovies. As introduced earlier, MyMovies is a simple application used to manage/catalog my growing library of movies on DVD. It is a learning project meant as a simple how-to for those just starting to program with Java EE 5 technologies (especially JDK 1.6 and EJB 3). It focuses on using the NetBeans 5.5 IDE, Sun Java System Application Server 9, and MySQL 5.

Setup the database in MySQL
- Open MySQL Administrator and click on Catalogs. Right-click the bottom left pane and choose "Create New Schema" from the popup menu. Name the schema "entertain". This will be the database to use for the Entertain application, which contains MyMovies.

Add a JDBC resource in Sun Java SAS
- Copy the MySQL Connector/J JDBC driver JAR (mysql-connector-java-5.0.4-bin.jar) into ${SJSAS}/domain/domain1/lib/ext. This ensures that driver classes are included in the application server's classpath for the domain.
- Start the application server, if it not yet started, and log in using the Admin Console.
- Select Resources > JDBC > Connection Pools. Click [New...] to create a new pool. Name=EntertainDB; Resource Type=javax.sql.ConnectionPoolDataSource; Database Vendor=mysql. Click [Next]. Datasource Classname=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource. Down under Properties, databaseName=entertain; serverName=localhost; port=3306; user=root; password=[whatever you assigned to the DB for root]. Click [Finish].
- Back in the list of connection pools, select the EntertainDB pool link and click [Ping]. If the connection was successfully set up, you will see a "Ping Successful" message.
- Now set up the JNDI resource that will be referenced in the application: select Resources > JDBC > JDBC Resources and click [New...]. JNDI Name=jdbc/entertain; Pool Name=EntertainDB. Click [OK] to create the resource.

Create a new project in NetBeans 5.5
- File | New Project ... > Enterprise > Enterprise Application > [Next]. Name="Entertain", other defaults ok [Finish].
The enterprise project created will be used to create the EJBs and webapps that we need to implement MyMovies.

Create a user-friendly URL
Just so we don't forget to deal with it later, we need to set the web module URI for the application to /entertain so that from a web browser, it can be accessed as "http://localhost:8080/entertain" (assumes SJSAS listens on its default HTTP port 8080).
- In Netbeans, right-click the Entertain-war webapp node and select Properties from the menu. Select the Run node and set Context Path=/entertain, then click [OK].

Clean up the welcome page
A index.jsp page already exists in the web module (Entertain-war > Web Pages) that will be opened when the above URL is sent from a browser. You can edit it to better suit requirements as the home page of the application.

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Entertain(r)</title>
</head>
<body>
<h1>Welcome to Entertain</h1>
Entertain is a web-based application used to manage personal entertainment artifacts.
</body>
</html>

Deploy and Test
The application cannot be deployed at this time because Java EE 5 enterprise application require at least a Session bean or Message-Driven bean.

Wednesday, December 06, 2006

Developing a Simple EJB 3.0 Application: Introducing MyMovies

In an attempt to make life easy for myself, I've decided to develop a small web application that I'll use to manage my growing list of movies. Enter MyMovies, which will be allow adding movie information, updating, deleting, searching, and listing. In the initial release, movie information will include the title, the DVD media number where the actual movie is burned, its MPAA rating, genre, date it was added to my labrary, and a brief synopsis.
Beyond these simple details, the application is meant to demonstrate using the NetBeans 5.5 IDE to develop applications for the Sun Java System Application Server 9.0 update 1 and the MySQL 5.0 database application. All the steps will be posted here for those just getting started with EJB 3.0 and other exciting Java EE 5 technologies that I may choose to play with in this application. This is my way of brushing up and learning some of the new features in Java.
At the conclusion of this track, I should have a fully functional web application that:
(1) allows me to add movie information
(2) allows me to search and list the movies
(3) allows me to update or delete movie information
(4) uses a pure Java EE 5 solution based on EJB 3.0.
I'm turning out to be the free movie rental service for people on my block, so I figured this site might as well help me keep track of who's borrowed my movies. I could also extend it to a multiuser environment, where friends can recommend movies to each other freely or keep track of what they've watched or want to watch. Then what would be cool is to port it as a plug-in for other applications and link it to big movie databases out there somehow. I'd have learned a great deal by that time, I suppose.

Tuesday, December 05, 2006

Using MySQL5 with NetBeans5.5 and Sun Java System AS 9.0u1

I've been using NetBeans 5.5 a lot lately, and I must say I like it and have decided to stick with it. NetBeans comes bundled with the Sun Java System Application Server, another product I have come to appreciate lately. These two are are the latest additions to my arsenal of development tools, alongside Eclipse and JBoss AS. I've all but dumped JBuilder (they are moving to an Eclipse base anyway).
The SJAS comes bundled with JavaDB, and open-source Java database. It's great I suppose, but without a management console, it hasn't been easy to use. So I'm switching to MySQL. The following steps are for setting up MySQL in SJSAS, and developing applications in NetBeans that'll use it.
  1. Ensure that the NetBeans 5.5 and Sun Java System AS 9u1 setup works, as in, you've done deployments to the server from the IDE. In NetBeans, you should be able to monitor and control the server from the Runtime view. You should also be able to debug easily on the server from NetBeans.
  2. Download the MySQL database driver for JDBC (Connector/J). Extract the JAR file to domains\domain1\lib\ext. In that location, it'll be included in the application server's classpath.
  3. Download and install MySql 5.0 and install it on your machine. I set mine to run as a service (though not at start up). Most defaults worked fine.
  4. Download and install MySQL Tools (which includes an administrative console). I used this to create a schema for development use (in Microsoft's world, these would be "databases").
  5. Open the web-based SJSAS console. Go to Resources -> JDBC -> Connection Pools -> New ... Provide a name, use the connection pool datasource for resource type and select mysql for vendor. Datasource class name = com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource. Add properties - user, password, server, schema (created in step #4), and port.
  6. Go to Resources -> JDBC -> JDBC Resources -> New ... to create a JNDI resource. Its name should start with jdbc/someName. Select the connection pool created in #5. If it starts without error, #2 is confirmed and you are on your way.

Saturday, December 02, 2006

Processing Input and Output with JavaServer Pages

Previous web applications I have built always did user input and output validation within the servlets that handled the particular request (of course, using utility classes accessible to the servlets). But combining JSP and servlets can reduce the overhead of input/output validation, making work a lot easier.
Validation can be done one of two ways, depending on the need. JSTL-based validation involves embedding JSP tags in HTML and having the page handle its own validation. This may be fine for an application with a few [unrelated] pages, but problems arise when you scale to multiple pages that may need to validate the same kinds of information. The solution: use JavaBeans to validate user input. With such a solution, changes are made in the beans only when validation requirements change - pages would not need to be edited.
When would your use JSTL versus JavaBeans validation? If you are only checking that fields have been filled in with certain data or selections made in a form, JSTL is best. However, if validation involves using external resources such as databases and special formating requirements, JavaBeans are best.
To protect against cross-site scripting attacks, JSP offers a great output function <c:out> that converts quotes and such to their HTML code equivalents. For example, if output text contains the '<' character, the HTML would contain the characters "& l t ;".
JSP also introduces its own set of operators to help ease coexistance with XML. If you develop a JSP/XML solution, it can become a pain to determine which operators apply to what domain, humany speaking. So, JSP allows the use of 'and' for '&&' and 'eq' for '==', for example. Essentially, you can write a JSP page that does not use the usual operators for equality and comparison.
I like the fact that JSP pages have access to the request object just as a servlet would. You can access a parameter using the implicit param object in a JSP page; example <c:out value="${param.variable}"/> for singular parameters, or paramValues for collections.
Beyond parameters, you can also access the request object itself for information sent from a client browser using "${pageContext.request.xxxxx}", where 'xxxxx' is a variable name. Such information may include character encoding, content length, content type, local/remote addresses and ports, locales, protocols, schema, security, and request headers.
The real strength of JSP and input processing is its ability to absort all request parameters into a JavaBean in a couple of lines of code:
<jsp:useBean id="beanId" class="package.BeanClass">
<jsp:setProperty name="beanId" property="*" />
</jsp:useBean>
When the number of parameters change, you only need to change the bean's methods and add/remove control names in the JSP pages. For rhis to work, parameter names in JSP must match bean properties, by case.
For most basic form input validation, you only need to be aware of a small set of JSP contructs: <c:out>, <c:forEach>, <c:if>, <c:when>, <c:choose>, and <c:set>. These and other core JSTL contructs come standard with any servlet container that can process JSPs.

JSTL <c:set> Tag

Sets values for variables.
Taglib
: http://java.sun.com/jsp/jstl/core (Core)
Prefix: c
Attributes:
value | * = value to set.
var | String = variable holding the value. If not used, target/property MUST be used.
scope | String = scope for var e.g. page, session, request, or application.
target | JavaBean object, Map = collection or bean specified by 'property' below.
property | String = name of the target above.
Example:
<c:set var="pizzaSelected" value="true" />

JSTL <c:choose> Tag

Selection/switching mechanism.
Taglib
: http://java.sun.com/jsp/jstl/core (Core)
Prefix: c
Attributes: none. Contains statements and an optional statement.
Example:
<c:choose>
<c:when test="${param.gender eq 'f'}">
// Stuff to do when gender = f
</c:when>
<c:otherwise>
// Stuff to do when none of the above when's tests true
</c:otherwise>
</c:choose>

JSTL <c:when> Tag

Tests for when an expression is set.
Taglib
: http://java.sun.com/jsp/jstl/core (Core)
Prefix: c
Attributes:
test | String = expression that evaluates to true or false.
Example:
<c:when test="${param.gender eq 'f'}>
// Things to do when parameter gender is 'f' ...
</c:when>

JSTL <c:if> Tag

Tests whether an expression is true.
Taglib
: http://java.sun.com/jsp/jstl/core (Core)
Prefix: c
Attributes:
test | boolean = expression that evaluates to true or false.
var | String = variable holding the result.
scope | String = scope for var e.g. page, session, request, or application.
Example:
<c:if test="${empty param.name}" >
// Stuff to do if the expression is true
</c:if>

JSTL <c:forEach> Tag

Used as a for loop in JSP to process elements of a collection.
Taglib
: http://java.sun.com/jsp/jstl/core (Core)
Prefix: c
Attributes:
items | String = collection to operate on.
var| String = variable holding the current item in iteration.
varStatus| String = variable holding the LoopTagStatus object.
begin| String = first index, 0-based.
end| String = last index, 0-based.
step| String = increment value, numeric.
Example:
<c:forEach items="${headerValues}" var="h">
<c:out value="${h.key}" />
</c:forEach>

JSTL <c:out> Tag

Taglib: http://java.sun.com/jsp/jstl/core (Core)
Prefix: c
Attributes:
value | String = the value to output as HTML.
[default] | String = the value to output if value is null.
[escapeXml] | boolean = whether to convert special characters to character entity codes. Default is true.
Example:
<c:out value="${param.name}" /> // To output the value of the name parameter.

Friday, November 24, 2006

Thanksgiving

Thursday, November 16, 2006

MP4 As The Next Popular Music Format?

In a sense, it already is. Apple's iTunes uses it as "m4a" files. But what exactly is it?
Mp4 is MPEG Part 14, an ISO standard for multimedia compression, authoring, and delivery. Released in 2000, it is steadily catching on as a preferred format for audio (based on AAC) and video. It uses the *.mp4 file extension, although numerous other extensions that support the standard are available - such as *.m4a (audio), *.m4b (podcast, audio books), *.3g* (3G mobile devices).
The mp4 standard was originally based on Apple's Quicktime format, but was later standardized to make it more versatile and non-proprietary. Microsoft still doesn't fully support it in their Media Player application (except for video, for which you must use 3rd party codecs e.g. Ligos LSX-MPEG or EnvivioTV). The big attraction with this format is how much more it can handle - 3D objects and sprites, for example. It can also be better streamed over the internet.
But why has adoption of this format been slow? Content restrictions (copyright/DRM issues) are largely to blame. But also, although it is an open standard, manufacturers of devices and software must pay license fees because mp4 is a patented technology.
This image shows the layers of an mp4 file. I've noticed in the past that files downloaded from iTunes embedded personal information in the music file, such that if you sent the file to someone, they'd be prompted to enter your password in order to play it. Well, all that information is stored in the Intellectual Property Management and Protection layer. Software that rips music knows how to manipulate this layer, and can successfully wipe the data embedded there to make music playable anywhere. In this day and age, it sucks that when you buy music from the iTunes store, it only plays in iTunes and the iPod. I think we should be more liberal to play music we have bought anywhere so that if iTunes sucks, I can move my music to the Zune and be happy.

Thursday, November 09, 2006

Life: My Own Background Check

A search for an ex-friend's last known address brought about the idea to do a background check on myself and see what people get when they do one on me. People meaning apartment owners, employers, creditors (banks), and non-profits that I have partnered with (mostly that deal with children).
Some observations:
  • So many variations on my names, including unknown initials and bad spellings. One report actually had my nickname, which I use when filling out non-essential web stuff. Web sharing of personal information?
  • Most addresses I've lived at are correct (missing apartment numbers and such on a few). I had a couple of unknown addresses though - one in Texas and another in Virginia - both places I have never lived or been! Identity theft?
  • Birthdates that make me anything from 20 years old to 53! I don't even know how to explain that.
  • One record (for which I paid $10) had the last 4 digits of my SSN. Now we are in trouble.
  • My credit report shows collections companies and government agencies requesting my credit. Since I have no debt, I have no idea why debt collectors would be looking at my credit. The government agency deal is understandable - I applied for a job a while back that require clearance.
  • One report attempted to figure out who my relatives are. Weird variations of my last name showed up, none of which is anyone I know. Good luck with that, data-mining tool.
  • Another report has me on the board of directors for a religious NGO operating in Uganda. I can see the relation, but I know nothing about it.
  • Not exactly up to date - almost all report were about 6-10 months old. So if someone moved quite often, some items may never show up [private investigator tip].
  • Schools and places of employment are also hinted at (names only). Are you getting scared yet?
So, with personal information on the internet like this, and easily accessible for less than $10, what protections do we have? I dare say none! I found a record from when I was 17 - the first phone service I ever signed up for through Sprint. Old information doesn't disappear on the web. For the possibility of making money on hard-to-find records, companies keep that data almost forever (storage is cheap). Since the sources are not published, you cannot petition for your information to be erased. It's a sort of hopeless situation. I can only think of bad things with such ease of getting people's information - stalkers, identity thieves, Big Brother, blackmail ...
I've got to enter the witness protection program ... I felt pretty vulnerable by how much the web knows about me, for cheap. Hack it.

Wednesday, November 08, 2006

Work: Patent Review Done, Now Filing

Totally a highlight of the day: my patent application review process is complete (Legal Department level) and a filing has been initiated! In the memo, all the important people now officially know, including my managers, the VPs, and HR. The first paycheck next month will include a monetary award, but also the paperwork and clarification process increase in volume.
It's been an interesting process so far, mainly teaching me the value of writing exactly what I mean/what is (technical details paramount), doing demos for whoever would ask, learning the ISO/IEEE processes of documentation, and basically growing professionally. Although I don't have a college degree [yet], a patent will indeed look good on my resume!
This patent is at the core of my Jaspora invention - a web-based workflow system used to gather (sometimes with automation), analyze, store/process, and report quality analysis/software test data. We've been using Jaspora at our company for a year now - total proof of concept.
This is excitement ...

Monday, November 06, 2006

PHP: A Primer And New Project

For the next few weeks, I will be dipping my toes in the world of PHP scripting and the MySQL database application. The application slated to replace Jaspora uses these technologies, and it's important that I become very familiar with them at this point. As a matter of common practice, I develop a real-world application while learning a new technologies - real hands-on. For this endeavor, I'll create a web-based application that keeps track of my projects, like my own personal SourceForge. It'll integrate Jaspora, my personal music site, and provide a portal for private projects I work on for Strive!. Should be simple enough, I suppose.
What you need to get rolling:
  • A PHP interpreter. The Windows version provides DLLs that can be referenced by the web server in order to interprete .php file scripts. Without it, the web server thinks the files are simple text files and may show them as such (in Firefox. IE just doesn't show anything inside tags it doesn't recognize). [version 5.2.0].
  • A web server - to dish out pages and content when requested from users' browsers. There are several free web server engines, but I chose to go with Apache's HTTPd - simple server that can run as a service on your Windows machine. I was surprised though that I could have chosen to use IIS (not a fan). [version 2.2.3].
  • An SQL database application - certainly MySQL, although I could have dumped this experiment to my network of Microsoft SQL 2000 machines. From brief research, MySQL is actually enterprise grade ... and is one of the most popular databases on the web. [version 5.0].
  • An intelligent PHP script editor. You could use Notepad if you want, but anyone that's used an IDE knows the value of keyword highlighting, debugging, code completion, etc. I found a free one at MPSoftware's website called PHP Designer 2007. Better than plain text for sure.
Already, I'm in need of a sort of deployer - some utility than knows what projects I am working on and that can keep the web folders on the server sync'd with my workspace (on the click of a button). I'm sure there's something out there - just haven't found it.
If you have programmed before, learning PHP is a simple affair of learning language rules. I'm working out of the reference "PHP and MySQL for Dymanic Web Sites". Pretty simple book for beginners.

Thursday, November 02, 2006

RE: The Compile Process

Creating a program involves writing [source] code and 'compiling' it into an executable program. This is a programmer's job, in a nutshell, but a lot goes into this process than may be suggested by the previous statement. To be good at software reverse engineering, you must understand how programs are made to be able to disassemble them properly.
For most programs, programmers use a development environment (IDE) to develop code in a language of their choice. My favorite IDEs include Dev-C++ (for C++ development, uses the gcc compiler), Eclipse/JBuilder/Sun Studio/NetBeans (for Java development). IDEs contain tools that convert high-level source code to machine-native instructions.
To build a program, two processes happen: compiling and linking. Compiling involves resolving syntax errors and creating object files. Linking involves using the object files to create a single executable file. In more detail the process in much more involved: from source code -> preprocessing -> parsing -> translation -> assembly -> linking -> loading. The process is mostly the same whether you compile on Windows or Unix - tools may differ. For example, gcc vs. cl.exe (compiler, parser, translator), or as vs. masm.exe (assembers), or ld/collect2 vs. link.exe (linkers). Microsoft compilers may additionally require .lib or .def files in addition to .dll files when linking though.
Interpreted programs like Java or Visual Basic ones are easier to disassemble because everything is initially compiled into bytecodes (for Java). For Java, the runtime environment (JRE) takes care of verifying bytecode, loading classes, and JIT-compiling before executing the resulting native code.
My focus will initially be on reverse-engineering Java programs since I am already a Java programmer. I'd like to work on larger programs thereafter, iTunes on top of my list.

Saturday, October 28, 2006

Jokes: Late Night TV - Week of Oct. 29

These are some of my favorites from this week from Jay Leno, Letterman, and Conan. Jimmy Kimmel has some good ones as well, but he comes on really late in the night for me to write them down. A laugh a night is totally worth it! Without much time to read the news these days, why not a good laugh and news bits?


Letterman

  • Halloween is coming up. That's one day every New Yorker looks forward to - going to your door in the dark and seeing people in masks.
  • Are you watching the World Series? The St. Louis Cardinals and the Detroit Tigers. The Tigers have a young team they say. In fact earlier today Madonna adopted a batboy.
  • Down in Washington, President Bush has approved a plan to build a 700 mile fence on a portion of the Mexican border. He said he also knows where he can find some cheap labor to build it. A long fence on the border. Something like this I just hope Halliburton can get some money out of the deal. Be nice to see something go their way for a change.
  • Tom Cruise and Katie Holmes are getting married next month in Italy. Their wedding is going to be at the Leaning Tower of Publicity. Tom Cruise is a thrifty and shrewd guy. To save money on the wedding he's going to stand on the cake.
  • Isn't politics just horrible these days? People are now saying that Hillary Clinton has spent millions of dollars on plastic surgery. She's so good looking now that her husband hit on her by accident last night.
  • O.J. Simpson is writing a novel. Things are going good so far. He's agreed to meet at a Barnes and Noble for a book stabbing.
  • This is Fashion Week in New York City. Fashion Week and the Red Sox have something in common - they both fall apart at the seams.
  • Big news! Britney Spears had her second baby. The mother and baby are doing fine and the baby is expected to drive himself home from the hospital today.
Leno
  • A new energy drink is coming out called "Cocaine". That's what it's called. It's made by the same people that came out with the "Black Tar Heroin Protein Bar". If this drink would have came out a week earlier it might have saved Bobby (Brown) and Whitney's (Houston) marriage.
  • According to "ESPN" magazine the Washington Redskins are the most profitable NFL franchise, worth $1.5 billion. The reason being is that in D.C. no one is used to an organization with a game plan and being able to execute it.
  • There are now 300 million people in the United States. That either means we are a strong democracy or we have a poor border patrol.
  • Kim Jung Il is reportedly ecstatic about North Korea's successful nuclear test. He's feeling five feet tall! He's a strange guy. What's up with the pompadour? He looks like Wayne Newton and William Hung had a kid.
  • Florida Congressman Mark Foley has completed one week of his rehab. He has gone seven days without a page.
  • The Army has changed their slogan from "Army of One" to "Army: Strong". A number of other countries have done the same. India is now "We fix more computer by 9:00 AM than most do all day." Switzerland is "See what a pocket knife, scissors, corkscrew and little nail file can do for you." Morocco, "Less talk, more rocco!" And Cuba, "Invading America one raft at a time."
  • Over the weekend Paris Hilton was arrested for driving under the influence. She was smart though. The second she was pulled out of the car she said, "Go Israel!" This time she was put into real handcuffs. Not those fuzzy pink ones she's used to. She's still a celebrity and you can tell she's spoiled. For example in the holding room she got one call and she called room service. This is the most embarrassing thing to happen to Paris Hilton since the release of her CD.
  • There is an initiative in the state of Nevada to legalize small amounts of marijuana. This is the first time marijuana and initiative has appeared in the same sentence. Opponents are afraid of the crime element that legalization would attract to the state. Yeah, between the hookers, alcoholics and degenerate gamblers those are the last people you'd want coming into the state.
  • The population of the United States is now at 300 million. It should be 400 million by Christmas. You can tell who the new people are too - they're the ones that aren't fat yet!
Conan
  • President Bush was in Mexico this week. While in Mexico he was greeted with protestors that were wearing George Bush masks. The president was overheard saying, "I don't know who those people are but they look familiar."
  • President Bush is working hard on the Iraq situation. Today he told the Iraqi people to "get governing". Then he went on to introduce his new speech writer, Larry the Cable Guy.
  • Major League Baseball has announced a formal investigation into Barry Bonds alleged steroid use. The investigation will involve looking at a photograph of Barry Bonds.
AND THAT'S NEWS FOR YOU ...!

Thursday, October 26, 2006

Blizzard to the Rescue

The sight of relief when I looked out of my window this morning! You know what this means: no school and no work today. I had to make sure though - UCCS is really closed for the day. Television reports show numerous other closures across town. There's probably a foot of snow sitting on my car (center foreground in the picture). Change of priorities ... sleep, homework, sleep, laundry, sleep. Thank you God!

Wednesday, October 25, 2006

Dating: How I Met My Dance Partner

This is how I spent today. Little Katie finally had her way. See, her mom left a mismatched pair of shoes for her when she dropped her off, and to get her to do anything or go anywhere this morning, it came down to a deal to do the 'mismatched shoes' thing.
Potentially embarrassing for a professional like myself, but it became a source of good humor. Mostly girls noticed the oddity and said something; guys just didn't care. But most interestingly, this is how I met my next dance date! How odd ... a very unscripted way to meet girls (idea!!).
Lots of lessons in this one - little Katie doesn't have to suffer her mother's mistake all alone. Her biggest fear was what other kids would think at daycare. Last I heard, no incidents.
Lucky for me, I can dance again [though I'm not sure whether I'll go at all - good to make preparations though].

When Morons Defend Our Country

This story [read it here] could go any number of directions blogwise: responsibility, honor, patriotism, stupidity, drugs, military ... but I'm too tired to write anything. All I can do is laugh at these morons who took a military jet all the way to Germany to pick up some ecstacy! Go army!

Monday, October 23, 2006

Lose the Cellphones, Dudes!

Finally a reason to stop the habit - the addiction to cellphones! Guys, your very fertility is at stake! What in the world shall we do? [Read full article here].
It actually isn't that bad a deal, as long as you hold the phone away from the crotch. Plus this is 'observational' research, so nothing scientific/causal has been established yet. Begs the question: won't the same radiation affect your brain if cellphones are held to the ear? I remember such a debate a few years ago, and it was largely dismissed that brain cancer could result from cellphone usage.

Things begin to get confusing when the same old news becomes, well, news.

Friday, October 20, 2006

Qwest for Good Free RSS Readers

A few things in this world are really free AND excellent. In the world of software, free mostly means poor quality or perhaps ad-driven - a catch somewhere. In my search for a good RSS reader, I came across several unmentionables, but here are a few that are free and good (except for the issues I mention against them). It is definately true that no free software is perfect!
  1. FeedReader: version 2.90. No simple way to delete headline you just read/don't want. Usually hitting the 'Delete' key takes care of it, but even the right-click popup menu doesn't have a delete option. You are stuck with what gets downloaded until the application purges it. Secondly, dates are displayed unconventionally such as "20:00 19.10." to mean 10pm Oct-19 (hopefully 2006?).
  2. RssReader: version 1.0.88.0. This was was just plain weird. For example, if you selected a headline, it shows that headline's summary in the browser pane (which is okay). Now if you 'Delete' the headline, the next headline automatically selected shows summaries of ALL headlines in the feed! In addition, feeds are organized under an unsightly 'My Feeds' directory which cannot be renamed. [We know these are your feeds ...]. The program doesn't allow you to create new top-level feed groupings to make things worse.
  3. Awasu Personal Edition: crashed as soon as I started it!
  4. HeadlineViewer: crashed every time I tried to delete categories (of feeds).
This short list shows the kind of readers you might come across on a typical search. The observations made are from using each application for less than 10 minutes. 10 minutes is enough time for an average user to accept a program; needless to say, I won't be using the above. The ones that crashed might just be unstable on my operating system (Windows Server 2003 SP1) or version of Internet Explorer (v7), as I didn't see them listed in support pages.
I've been using SharpReader (v0.9.7) for a while now, and I liked it until I began getting scripting problems. Pages that use ActiveX would encounter errors and you'd find yourself responding to several popups notifying you of script errors. Because I have debugger tools installed, it also attempted to 'debug' by opening Visual Studio. Non-programmer users will not appreciate this kind of functionality. Additionally, there's no way to suppress browser errors that happen within the context of the reader.
I highly recommend RSS Bandit (v1.3.0.42), which I started using a few days ago. This is so far the best of the bunch. It's clean and easy to use, and Windows users will like the Outlook lokk and feel. I also like the tabbing feature that allows you to view full stories separate from the headline/preview pane. It even keeps headlines you have deleted in a 'Deleted Items' folder just in case the deletion was a mistake. It's all-around the best reader I have encountered after toying with over 13 RSS readers.
One thing to remember is that all the [Windows] readers so far rely on Internet Explorer, and do not offer a means to change the default browser engine used. I'm a Firefox guy, and this irks me.
Also, a lot of readers come with predefined feeds. HeadlineViewer, for example, came with 738 feeds! Who in the world reads all those?
My reader of choice reads news feeds, blogs, secure sites, emails, and library archives. RSS Bandit even allows you to search amongst the headlines you have, and to bookmark headlines. How nice ... Best of all, this is a product of open-source software development - even more proof that proprietary software may one day cease to be the de facto development platform.
There's plenty of readers you can pay for as well, but I didn't care to review them. Prices are in the $30-$50 range. These likely add enterprise features not exactly avaialble in the free versions. If you hunger for information less than me, there's no need to buy anything.

Thursday, October 19, 2006

Tech: Serial-Attached SCSI Overview Notes (Part I)

SAS is the latest in storage technology. First there was IDE, then ATAPI, then SCSI and Fibre-Channel, then SATA. SAS is backward compatible with SATA and implements SCSI commands.
  • Devices connected together using phys. A phy is a connection to a physical link.
  • Port = group of one or more phys that share a common address. A port can be connected to multiple other ports as physical links will allow.
  • Protocols:
    • SSP = Serial SCSI Protocol -> communication between initiator and SAS device.
    • STP = Serial Tunneling Protocol -> communication between SAS host and SATA target.
    • SMP = Serial Management Protocol -> management of expanders and the service delivery subsystem.
  • Expanders can host up to 128 devices, but can also be cascaded to support up to 16385 devices.
  • Device = initiator, target, expander, or anything else that can be addressed (including virtually).
  • Expander routing:
    • Direct = when device is directly attached to expander.
    • Table = when device is known to expander via one of its phys/ports, not direct-attach.
    • Subtractive = not directly attached or routing table missing/no entry.
  • Types of expanders:
    • Fanout = addresses of all devices in the domain known to expander. Uses direct or table routing, no subtractive routing.
    • Edge = devices known to expander are direct-attach only. Uses subtractive routing for unknown addresses, table routing or direct addressing for knowns. Can have 0 or 1 subtractive ports.
    • Edge expander device sets = combination of fanout and edge working as one unit; follows edge expander rules.
  • Domain = contains all devices that can directly interface; logical representation of devices.
  • An expander without zoning can only exist in one domain; devices with multiple ports can exist in more than one domain.

Wednesday, October 18, 2006

Honorable Mention

There're very few days I find enjoyable and dreadful at the same time, and today was one of them. The highlights:
  1. The brainwashcafe blog recognizes my blog as one of the smartest. (#2 on their Editor's Top 10 Brainy Picks). Totally made my day. Their blog is a sort of 'blog police' with a diversity of topics and very entertaining. [Enjoyable].
  2. My patent has been accepted for review, which means I start getting monetary benefits of having an idea. Whether it gets ultimately approved or not by the US Patent Office remains to be seen. Because it is a matter of company confidence, it shall not be discussed here. Problem is ... this becomes the paperwork phase and we start the typical waiting period of 3 years before approval. [Enjoyable].
  3. I have 4 exams in the next 3 days! Physics, calculus, philosophy, and assembly language. 3-hour nights and a permanent membership at my favorite study spot (a coffee shop included) ensue. Then a zombie life ... and a full day of sleep on Sunday. If I miss any other appointments, excuse me. [Dreadful].
  4. Soggy brain syndrome - my term for attempting to study so much in so short a period and ending up with so little for so much time spent studying. Apart from school work, I do a lot of technology related studies and research for work. Retension begins to become a problem at this rate. Or maybe I'm growing too old for new stuff. [Dreadful]
  5. Friends - yay! All you friends that call me and cheer me up. Of all days, I received mail from two long-lost friends from high school. They say good news from afar is like a breathe of fresh air. [Enjoyable].

Monday, October 16, 2006

Hunger for Information

At some point last week, my RSS reader was monitoring 138 feeds! I don't now what's come over me, but I always want to be 'in the know', so I monitor everything from news feeds, friends' blogs, entertainment musings, jokes, devotionals, and other international items of interest.
The ease of reviewing all this information from one place (namely the RSS reader) helps, but it can become an obsession. I don't know how many hours I spend daily reading the latest, but it's getting to unacceptable levels. There's just too much interesting information out there that it'd become an almost part-time job to stay completely updated.

This week mission: to trim the number of feeds I read to less than 50! Still a lot by most people's standards, but I'll consider it the absolute information I need to gain some peace of mind. Plus I get to eliminate the numerous newsletters I had been receiving via email - most of them have RSS feeds that I can add to my reader.

Using a reader has also saved me countless hours that I'd have spent surfing the web to find these news items and other updates. Even with reduced surfing, the hunger for information seems to have increased ...

Music: With Mark Gersh

We host a lot of talented recording artists at my church (Woodmen Valley Chapel), but I've never been so completely enthralled by anyone - except Kim Hill - than I was this weekend with the Grammy-winning artist Mark Gersh. (ChristianityToday.com Review)
For a man with so many accolades and musical accomplishments, he is accessible, down-to-earth, and very personable. Backstage during services, I had the opportunity to chat with him and learn about his life and his experiences in big music. At that point, I didn't even know of all his accomplishments, but when I found out, I was struck by how humble he is.
Musically, he's an authority on how church music should be done. He did beautiful renditions of music we've overplayed that it always felt as if we were playing those songs for the first time. It gets even better - he gives the band total freedom to engage their instruments to their liking, as long as it fits musically. I went beserk on my bass guitar this weekend; in fact, I didn't even have sheet music because we all became non-conformist, playing by ear and from the heart more than anything. I'm sure everyone appreciated his criticing and arrangments - it was a truly amazing band experience.
He did his song "Breakdown" during the services, an emotional rollercoaster that spoke to many in the congregation.
It is for opportunities like sharing the stage with Christian recording artists that I'm inspired to continue to excel at my instrument and learn from these icons in Christian music. I feel blessed.

Thursday, October 12, 2006

Notes: The Power of Words

For many, the use of words in speech and text happens without a thought to the implications thereof, especially is social or casual environments. Professionally and academically, sufficient effort is supplied to proof reading and peer review to make sure the words express exactly what is intended.
Words are powerful - perhaps more powerful than we may realize.
  • Taming the tongue is vital to complete self control. A reckless tongue can corrupt a whole person. The tongue is full of poison; no man can tame it. (Jas. 3:1-12).
  • Words have the power of life and death. (Prov. 18:21).
  • Words have the power to do good - well-considered words are 'life to the soul' (Prov. 16:24).
  • Words have the power to do harm - inconsiderate words 'pierce like a sword' (Prov. 12:18) and careless talk like 'a sharpened razor' (Ps. 52:2).
Proper use of words requires some skill, especially in situations where admonition, correction, or contructive criticism are required. When directed to loved ones in that context, they are not intended to do harm because 'wounds from a friend can be trusted' (Prov. 27:6). Such use encourages growth and renewal, even if it might involve some pain. (2 Cor. 7:10).
Be careful how you communcate with people ... words can make or break, even when that's not the intent.

Wednesday, October 11, 2006

Entertainment: "Scrubs" (Season 1)

Just got done watching season one, and this show is hilarious. Ever thought of something and seen it with your mind's eye, and wished it could just happen? "Scrubs" makes it happen. Visual imagination, wicked comedy and hints at real issues are what make this show happen for me. Of course I'm a sucker for medical TV shows, but this one is really funny. In the end, you don't even remember the medical topics they covered. It all looks authentic though.
Favorites:
Male Character = Dr. Turk (Donald Faison)
Female Character = Dr. Elliot (Sarah Chalke)
Episode = One where they do a "West Side Story" musical piece - doctors vs. surgeons.
Moment = Final season scene that summarizes the whole season in 40 seconds.
Sizzle = Turk/Carla relationship.
Fresh Face = Jordan (Christa Miller Lawrence).
I'm certainly going to watch other seasons later. They are currently in Season #5. Beware the spoilers on the Wikipedia. This is one of the ways I de-stress ...

Tuesday, October 10, 2006

Dating: Breaking Up ...

My first post on dating starts with notes on breaking up! What an omen ... I don't know how people do it, but breaking up is hard! It sucks both ways - when you have to dump someone, or when you get dumped. I've had my fair share of both experiences, and I'd hate to put anyone through it. I'm tough, I say, because I can easily shrug off a relationship and move on. But by the time I actually get to do the deed, I find out that I care about this person a lot. I procrastinate, drag it out, and continue to lead her on.
Is there ever a good way to break up? Some things I've done:
#1. Stop communicating: you hope she'll get it that you are no longer interested.
#2. Give her a reason to dump you: so you don't have to do the deed yourself. She'll feel better that she got the final word.
#3. The friends corner: guys also have it. Very few friendships of this nature last at all, so you know she won't be around long. As Chris Rock rightly said it, women hate women - she won't stand your next girl.
#4. Being too busy: although I've really been busy sometimes to maintain relationships, there are times I used busyness to sabotage relationships. It works all the time because I really am busy.
These are all mean ways, I know, but no one ever gets schooled in the proper way to break up. Experts suggest that you be completely honest, avoid dating other girls until you complete the breakup, don't do it in a public place, write down what you feel, don't feel guilty, and don't pick a fight. All these are more work for a dirty deed, making it understandable that most people would rather do the mean-4.
The bottomline is this though: it's in both your interest to end the relationship cleanly. For me, most of the girls are people I encounter daily (at church, work, school, etc), so as good as a breakup can be, I try my best. Plus, your ex probably knows you better than your other friends, so why not stick around if only to prevent airing your dirty laundry or for some understanding when you really need to say something?
Oh, and remember to get all your stuff from her - including music, movies, books, and most importantly, money. Once it's over, you'll never see these things again - unless she's a nice girl.

Monday, October 09, 2006

Work: Jaspora Comments Module Upgrade

This week I start upgrading the comments module in Jaspora. This is no simple upgrade - I am also setting a precedence for future development on Jaspora. In this effort, the plan is to satisfy all user requirements, upgrade the code to the 1.x code path, dress up the module (presentation), and have all required documentation for the module and how it interacts with the rest of Jaspora.
Documentation is especially important because to this day, Jaspora is not documented. It'd be a nightmare for my successor - even the source code itself is largely not well documented. For an experienced software developer, this is a shame. I have my reasons, of course, but it's time I started doing things right.
First things first = creating a software requirements specification. I'm all over the web today looking at samples and learning how to write one for a real application. I took a Software Engineering class last semester and if I had been paying attention, I wouldn't need to waste time relearning how this is done.

Friday, October 06, 2006

Programming: Back to UML

When I took System Engineering I at school last semester, all I cared about was passing the class - not necessarily learning the material. I had already designed Jaspora and most of the material covered how to design enterprise projects like it. Consequently, I skipped class a lot and didn't care much for the notes - though I passed well in the end.
I'm beginning to redesign the Comments module in Jaspora, and the plan is to have it fully documented - complete with use case, class, activity, data flow, data source, and source code - in addition to the usual software development life cycle elements. I'm exploring whether using UML tools should be something I do regularly.
Tool of choice: Sun Java Enterprise Studio 8 (obviously built on NetBeans). It has an excellent assortment of UML tools, code synchronization, and reverse engineering of projects. Tutorial focus at http://developers.sun.com/prodtech/javatools/jsenterprise/learning/tutorials/index.jsp

Wednesday, September 13, 2006

Programming: Steps for Building an Enterprise Application for JBoss Using NetBeans

Summary of steps to create a working Java EE 5 application using NetBeans, to be deployed to a JBoss application server, and persist data in a Microsoft SQL Server 2000 database.

(1) Downloads: NetBeans 5.5 Beta 2 with JBoss 4.0.4GA, Sun Java EE 5 SDK. Must have a database. I use Microsoft SQL Server 2000. Install the IDE, JDK.

(2) Install a J2SE 1.5+-aware JDBC driver, such as jTDS (extract the archive to the application server library).

(3) Data source: In the AS deploy directory, create a *-ds.xml file with configuration and JNDI information for accessing the database. Suppose the database is called [JEE5], the file shall contain:
[datasources]
[local-tx-datasource]
[jndi-name]JEE5[/jndi-name]
[connection-url]jdbc:jtds:sqlserver://localhost:1433/JEE5;tds=8.0;lastupdatecount=true[/connection-url]
[driver-class]net.sourceforge.jtds.jdbc.Driver[/driver-class>
[user-name]sa[/user-name]
[password]*****[/password]
[/local-tx-datasource]
[/datasources]
(4) Follow the steps in the EJB 3.0 Enterprise Beans for JBoss Application Server tutorial.

Only disappointments so far: the JBoss application server is not fully Java EE 5 compliant. At this time, it only supports EJB 3.0 and Hibernate 3.0.
It is advisable that you restart the server after deploying your application. For a while, my tables remained empty (no exceptions for failure to create/insert entities) until I restarted JBoss.

Notes: In #3, the data source name to use is java:/JEE5.

Friday, September 08, 2006

Programming: Tools Update

Despite how busy I have become, I still get an hour or two to review what's new in the Java programming world. I've recently decided to adopt the NetBeans development environement (now as beta version 5.5), especially after they have made a version available that's integrated with the JBoss application server (version 4.0.4 GA) and supports the latest Java enterprise edition, JEE5.
The trick is how I'll actually get to learn this new material: since I virtually no longer have free time outside of work these days, I'll cheat a couple of hours at work for 'skills/technology improvement'. I mean, my pet project Jaspora would greatly benefit from advances in these technologies, so I have no qualms about how well I'm using my time at work. I'm especially attracted to the ease of programming data access, enterprise java beans, and annotations. I expect that with the latest tools for Java development available, I should cut development time by about half! What's more, I take this as an excuse to learn how to test my code using JUnit. Believe it or not, all code I've written to this day has never seen unit tested such as JUnit does. It'd be a great time to incorporate code profiling and other optimization tools.
It's an exciting world out there. Now if I could add an hour to my day, I'd totally sell out to it.

Saturday, August 19, 2006

T-Mobile Text Message Rip-off Catches Up With Me

I'm not one to complain much, but this one really pissed me off: starting sometime this month, T-Mobile started charging for incoming text messages. Not only is that a rip-off, but the cost was doubled for both incoming and outgoing text messages - to $0.10/message. My latest bill had $12 in text messaging charges, 40% of which were unsolicited (not from friends). Gone are the 5-cent outgoing-only days.
What does this mean? If someone out there has a vendetta against you, they can make you bleed money by sending you an endless stream of text messages. I asked customer service about how to prevent this, and they said you'd have to use their no spamming feature available through their website. Two problems I see here:
(1) They would have already charged you 10 cents before you get the opportunity to anti-spam the source.
(2) For those that don't have regular internet access, it is an unsolicited cost until you get the opportunity to anti-spam the source.
(3) The responsibility is shifted totally to the user, without recourse. A waste of my time - having to identify where unwanted text messages come from, and time spent patching up my spam filter with these sources.

I haven't used their spam filter feature, but I asked for one of four solutions:
(1) No charges for incoming text messages, even if it means trippling costs for outgoing text messages. Answer = cannot be done!
(2) A means to remove text messaging services from my account. Answer = cannot be done! All plans inherently have this feature, and it cannot be disabled.
(3) A means to disable text messaging from my phone. Answer = cannot be done! All their phones support text messaging, and it cannot be disabled.
(4) Word on whether a solution was in the works to give users the option of disabling the feature as needed. Answer = none whatsoever! The service rep had the nerve to try and sell me a messaging plan, $6 additional each month.

Do you see where I'm going with this? It's ridiculous that a service is forced on you when you don't need it, and you must pay for it. I wonder whether other wireless providers do the same, but I think the practice is unfair. Sure they might have it in their agreement/contract somewhere, but I wonder whether a court of law would honor a contract that promises death if a condition is not met.
I feel freakin' combative about this that I'm willing to do something and see how far I can push for a change. I think it's a worthy cause, something more than a few people may appreciate. Of course the juicy details of whatever I do and the results will be right here ...