Archive

Archive for the ‘Software Development’ Category

WebStocket in HTML5: Time to Give it a Try

June 3rd, 2013 2 comments

WebSocket is a new technology that is part of HTML5. It allows a browser (or an application that uses HTTP/HTTPS) to upgrade a HTTP/HTTPS connection to a full socket to the server so that both parties can send data at any time.

WebSocket Standard

The WebSocket protocol is defined in RFC 6455. The initial handshaking is a HTTP request with upgrade header like the following from the RFC:

GET /chat HTTP/1.1

Host: server.example.com

Categories: Software Development Tags: , ,

Better Way for Workflow Design in Orchestration and Automation?

May 28th, 2013 4 comments

In my last article on orchestration, I talked about the issues with the current workflow design. Although intuitive and easy to get started, it’s really inefficient and hard to handle for complicated workflows. A natural follow up question is, “is there any better way to design workflows?”

Like everything else, there is hardly an approach that is better than others in every aspect. The alternative approach, coding, may not be as intuitive as the visualized flow chart approach, but it’s highly productive. So the quick answer for the above question is yes if you can combine them together.

GIT Commands Using Java APIs

March 26th, 2013 9 comments

In previous posts, I’ve covered an Java API called JGIT for working with GIT. Besides the low level APIs, JGIT also supports high level command line like interfaces. If you know how to use the GIT command line, you can use the APIs. Note that it’s different from calling GIT commands or any other commands from Java code.

Here is a sample code I wrote to try out the APIs. Give it a try and you will like these high level APIs.

Categories: Software Development Tags: ,

Generating Checksum on Windows

March 4th, 2013 2 comments

I got an interesting request from one of the enterprises which uses vijava in their product. Although there are downloads for binary and source packages on the sourceforge Web site, they still would like me to create the checksum as I am the trustable source for that. As I was told, the checksum is required by their build team. I don’t know how is exactly used, but I decided to help out anyway.

How to Use GIT Java APIs to Diff Two Different Files

February 11th, 2013 1 comment

In my previous post, I introduced a sample showing how to use JGIT Java APIs to diff two versions of a same file in repository. The JGIT Java APIs can do more than that – it can actually diff two text files that are not even controlled by GIT.
Here is a short sample code on how to do this. Again, it’s not the main use case for the JGIT APIs. After all, it’s mainly for GIT source control system itself. You can always use other diff APIs for this purpose. However, if you already have JGIT included, this can be handy.

Categories: Software Development Tags: ,

How to Use GIT Java APIs to Diff Different Versions

February 3rd, 2013 5 comments

Last week I introduced the JGIT Java API with a simple sample illustrating how to read content from HEAD. If you have multiple versions of a source code or text file, you may want to see their differences. An easy tool for this is the standard diff.

The JGIT Java API has built-in support for you to generate diff between any two versions of a file, be it a source code, properties file, XML file, or any other text files. Here is a sample that shows how to do this.

Categories: Software Development Tags: ,

How to Read GIT Repository Using Java APIs

January 27th, 2013 13 comments

GIT is a source code control system created by Linus and others for managing Linux kernel development. It becomes one of the most popular version control systems especially in the open source community. Most developers use command line or the plugins to IDEs like Eclipse, NetBeans. I think even Microsoft VisualStudio has add-on for connecting to GIT, but I haven’t checked it.

Simple Logging in Java Application

January 21st, 2013 3 comments

Logging is a common requirement for application. In Java world, there are a few frameworks, the first and the most famous of which is the log4j from Apache foundation. Java included its own logging APIs afterwards. You can find many discussions which one is better in terms of use of use, flexibility, and performance. To reconcile the two APIs, a common abstraction called Simple Logging Facade for Java (SLF4J) was created. As SLF4J works with both log4j and Java logging, you can switch between them easily (in theory).

Categories: Software Development Tags: ,

Massive Scheduling with ScheduledExecutorService in Java

January 14th, 2013 2 comments

If you need to do certain things at certain points of time or intervals, you need scheduling capability. Don’t confuse the scheduling with multi-threading even though you can use multi-threading for scheduling but they are not equivalent. You can use single thread for many different tasks. Simply put, threads are executors, and tasks are jobs to be done by executors.

Developing Web Application with JQuery and Java Servlet

December 27th, 2012 6 comments

It’s been a while since I touched Web application development in 2009. Before the VMworld 2009, I created a simple Web Application for the keynote that collected the names and email for a raffle to go back stage with the famous foreigner. That Web application was so simple that it’s built using Java Servlet with a static home page. It’s hosted with Terremark (part of Verizon now) Enterprise cloud.

Encrypt and Decrypt Password in C#?

November 12th, 2012 2 comments

I just spent a little time playing with C# on password encryption. Here is a sample code I wrote to get myself familiar with related APIs. Overall it’s pretty straight forward – it first encrypts a clear text to an encrypted Base64 encoded string, then reverses it.

Hack Workspace in Netbeans IDE

July 18th, 2012 7 comments

As a long time Eclipse user, I like its workspace concept and the ease of switching workspaces among many other things. The workspace provides a simple yet powerful way to isolate groups of projects into different workspaces under different folders, so you’re not distracted by other un-related projects.

This feature is, however, not available in Netbeans IDE, which is not a big deal most of time. By default, the Netbeans IDE creates a folder under current user’s home directory as follows (yours could be different):

Review Board Virtual Machine for Code Review: The Missing Manual

July 2nd, 2012 No comments

Code review is important for the quality of a software product. It used to be a meeting activity where a small group of engineers walk through changes and provide the author feedbacks. This is highly effective but not flexible enough, especially when there are frequent code changes.

Getting started with Hadoop: My First Try

June 18th, 2012 5 comments

Given the growing popularity of Hadoop, I decided to give it a try by myself. As normal, I searched for a tutorial first and got one by Yahoo, which is based on Hadoop 0.18.0 virtual machine. I knew the current stable version is 1.x, but that is OK because I just wanted to get a big picture and I didn’t want to refuse the convenience of ready-to-use Hadoop virtual machine.

Best Tool to Compress Virtual Machines

June 11th, 2012 12 comments

While working in virtualized environments, we need to pass around virtual machines (a.k.a. virtual appliances) from time to time. Most of the virtual machines I’ve seen for downloading are compressed to save storage and network bandwidth.

Not all the compression algorithms are created equal in terms of compression ratio, compressing speed, and decompressing speed. In most cases, it doesn’t really matter that much with documents and small programs. But it matters a lot with virtual machines whose virtual disk files are much larger than normal files. Any small percentage improvement can result in significant saving on storage and bandwidth.

Redefining Software in Cloud Age

May 30th, 2012 2 comments

As software professionals, we may still use the same programming languages and tools as 10 years ago. But there has been a fundamental shift in how we think of software, and make and consume software.

Static blueprints

Traditionally software really means blueprints, which are used to construct running software instances. The blueprints include binary code, installer, and related documentations guiding the installation and configuration of the software. Software vendors make the software packages and sell them to customers who then deploy and run them.

What Is Missing in Current Software?

May 28th, 2012 No comments

If we look closely at the software today, we will find some important pieces missing. For example, the software code defines logical behaviors of a system, but not the performance and scalability aspects. In other words, the operational aspects of the software are not clear even if you have a software product.

More Development Jobs

May 11th, 2012 No comments

Last November I posted several jobs from our software team, they were all filled. As VCE grows rapidly at a runrate of $800M at the end of last year, we are now having more jobs. In my group, I have two development jobs opened. Should you be interested or know of someone who may be interested, please let me know. My VCE email account is like <firstname>.<lastname>@vce.com, and my twitter is here. Besides these two, there are many other jobs at VCE covering almost all technical aspects. I can help refer you to our recruiters directly as well.

View Driven Development

May 9th, 2012 No comments

In the world of VMware, “view” is an overloaded term which is used in desktop, vSphere APIs, and PowerCLI. Outside VMware, you can also find it in MVC architecture, which basically divides a software system into model, view, and controller. This separation has become a basic programming paradigm in modern software design and development.

Rethink About Test Driven Development and Unit Testing

April 30th, 2012 No comments

If you are familiar with agile processes, it’s most likely you also know of, or even practice, test driven development (TDD). Several years ago I read the book Test-Driven Development by Kent Beck, and found the idea pretty interesting. After that, I rarely found myself using or even thinking about this methodology. I am not saying that test driven development does not make sense, but that it is not the approach working for me, and maybe some others as well.