15 TED talks that will change your life

Posted by batman on Jul 12th, 2013
2013
Jul 12

Feel like getting inspired, motivated or just looking for a feel-good cry? Then look no further. There’s no better way to start your day than with a fresh cup of coffee and a nice TED talk to make you feel ready to take on your day. TED – which stands for Technology, Entertainment and Design – features “ideas worth spreading.” The speaker series launched in 1984, and there are now more than 1,400 TED talks available online.

But don’t feel overwhelmed, we’ve rounded up 15 of the most inspirational, tear-jerking and downright beautiful TED talks out there. So sit back, relax and get ready to listen to some of the most courageous and fascinating people in the world. Each talk is shorter than 30 minutes, so feel free to bookmark for later consumption.

This post unashamedly taken from Mashable – all credit due to the writer. These talks are just really worth listening to.

Jill Bolte Taylor: A Stroke of Insight
Brené Brown: The Power of Vulnerability
Elizabeth Gilbert: Your Elusive Creative Genius
Meg Jay: Why 30 Is Not the New 20
Amy Cuddy: Your Body Language Shapes Who You Are
Dan Pink: The Puzzle of Motivation
Deb Roy: The Birth of a Word
Nilofer Merchant: Got a Meeting? Take a Walk
Ken Robinson: Schools Kill Creativity
Elon Musk: The Mind Behind Tesla, SpaceX and SolarCity
Simon Sinek: How Great Leaders Inspire Action
Sheryl Sandberg: Why We Have Too Few Women Leaders
Andrew Solomon: Love, No Matter What
Bryan Stevenson: We Need to Talk About an Injustice
Rita Pierson: Every Kid Needs a Champion

Powered by Zoundry Raven

Technorati :
Del.icio.us :
Zooomr :
Flickr :

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

Subversion repository maintenance

Posted by batman on Nov 28th, 2011
2011
Nov 28

Upgrade to Subversion 1.7

I recently upgraded to Subversion 1.7 (if for no other reason than to keep up to date). I use VisualSVN (2.5.1), and the upgrade was seamless and painless – literally nothing more than running the installer (msi). At the same time I upgraded TortoiseSvn (1.7.1.xxx), and it too was seamless. The only thing I needed to do was upgrade my working copies of code under svn control.

Maintenance

Once I had completed this upgrade without pain, I decided to re-organise my repositories. My current repository structure looked similar to

tags
branches
trunk
    clientA
        projectA1
        projectA2
    clientB
        projectB1
        projectB2
    clientC
        projectC1
        projectC2

Now this is fine, except for the fact that over the years, it has gotten quite big. Additionally there is just something awkward about creating a tag “clientA-release” which will include clientB and clientC projects (apart from probably being a bad practice). It was clearly time for a split.

svnadmin dump %REPO_PATH%/repos > repos.dump
svnadmin dump %REPO_PATH%/repos -r162:178 > repos-162.dump

This will dump the entire repository in text format (with embedded binary) – which we will use later on. If nothing else it serves as a backup, albeit a rather large one. The first command will dump the entire repository, while the second one will only dump changes from revision 162 to 178. Be warned – this can take quite a while, so don’t start with it unless you have time to waste.

svndumpfilter --renumber-revs include /trunk/clientA /tags/clientA < repos.dump > clientA.dump
svndumpfilter --renumber-revs include /trunk/clientB /tags/clientB < repos.dump > clientB.dump

This will read from the dumpfile created in the previous step, and write only that specified in the “include” parameter.

  • Remember to specify tags and branches as well
  • There is also an “exclude” parameter available
  • I liked the “renumber_revs” option, that renumbers the revisions for this particular client, removing any revisions applicable to other code

sed.exe -b s/path:.trunk\/clientA/path:\x20trunk/g clientA.dump > clientA.mod.dump
sed.exe -b s/path:.trunk\/clientB/path:\x20trunk/g clientB.dump > clientB.mod.dump

At this point you may choose to modify your dumpfile, although please be aware it is very easy to mess it up – please create backups of it. In your new “clientA” repository you will probably not want the root folder “clientA” – as it was in your original repository. You must modify “trunk/clientA” to become “trunk” – in other words move everything up a level. Problems I encountered include the following :-

  • My favourite editor Notepad++ had a ceiling as to the maximum size dumpfile it could accommodate
  • Other editors that could handle large files e.g. ConTEXT messed up CR and LF special characters, rendering the dumpfile useless. I’m not saying ConTEXT is bad – I probably just wasn’t using it properly
  • WinVI worked fine for me, but was just really slow to open, modify and save large files
  • Be careful of just modifying “trunk/clientA” to become “trunk” – this combination may be in the content of a file e.g. batch file, or document, and will then cause the job to fail with inconsistent checkdigit counts. This is why I chose to replace “path: trunk/clientA” with “path: trunk”
  • Gnuwin SED was my solution – a commandline utility that worked really well, and quickly too – this is used in the scriptlet above

svnadmin create clientA
svnadmin load --ignore-uuid clientA < clientA.dump

svnadmin create clientB
svnadmin load --ignore-uuid clientB < clientB.dump

This will create a new respositories “clientA” and “clientB” and load them from the dumpfiles, including trunk, all tags and branches, with neatly re-ordered revision numbers.

Voila!

Powered by Zoundry Raven

Technorati : , , ,
Del.icio.us : , , ,
Zooomr : , , ,
Flickr : , , ,

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

Apache Commons libraries

Posted by batman on Nov 26th, 2011
2011
Nov 26

I believe it is essential for any self-respecting Java developer to occasionaly browse through the Apache Commons library in order to determine whether there isn’t anything he could or should be using to assist with his coding. It happens to me each time I visit the site – I find something that I’ve either written myself, or found that could make my life a whole lot easier.

I sincerely apologize for my blatant “content-theft” – all credit and content belongs unreservedly to Apache Commons. All I have attempted to do is provide a short summary of what each of the libaries consist of, so that I can perhaps assist in redirecting more of you to the Apache Commons website.

I suspect some of these may be older and no longer in use, similarly some of them might have been incorporated into the official JDK. I have just attempted to take a snalpshot of what is on the Apache Commons website at this point in time.

Attributes

Commons Attributes enables Java programmers to use C#/.Net-style attributes in their code.

BCEL

The Byte Code Engineering Library (Apache Commons BCEL™) is intended to give users a convenient way to analyze, create, and manipulate (binary) Java class files (those ending with .class). Classes are represented by objects which contain all the symbolic information of the given class: methods, fields and byte code instructions, in particular.

Such objects can be read from an existing file, be transformed by a program (e.g. a class loader at run-time) and written to a file again. An even more interesting application is the creation of classes from scratch at run-time. The Byte Code Engineering Library (BCEL) may be also useful if you want to learn about the Java Virtual Machine (JVM) and the format of Java .class files.

BeanUtils

Most Java developers are used to creating Java classes that conform to the JavaBeans naming patterns for property getters and setters. It is natural to then access these methods directly, using calls to the corresponding getXxx and setXxx methods. However, there are some occasions where dynamic access to Java object properties (without compiled-in knowledge of the property getter and setter methods to be called) is needed. Example use cases include:

  • Building scripting languages that interact with the Java object model (such as the Bean Scripting Framework).
  • Building template language processors for web presentation and similar uses (such as JSP or Velocity).
  • Building custom tag libraries for JSP and XSP environments (such as Jakarta Taglibs, Struts, Cocoon).
  • Consuming XML-based configuration resources (such as Ant build scripts, web application deployment descriptors, Tomcat’s server.xml file).

The Java language provides Reflection and Introspection APIs (see the java.lang.reflect and java.beans packages in the JDK Javadocs). However, these APIs can be quite complex to understand and utilize. The BeanUtils component provides easy-to-use wrappers around these capabilities.

Betwixt

The Betwixt library provides an XML introspection mechanism for mapping beans to XML in a flexible way. It is implemented using an XMLIntrospector and XMLBeanInfo classes which are similar to the standard Introspector and BeanInfo from the Java Beans specification.

Betwixt provides a way of turning beans into XML as well as automatically generating digester rules in a way that can be customized on a per type manner in the same way that the BeanInfo mechanism can be used to customize the default introspection on a java object.

BSF

Bean Scripting Framework (BSF) is a set of Java classes which provides scripting language support within Java applications, and access to Java objects and methods from scripting languages. BSF allows one to write JSPs in languages other than Java while providing access to the Java class library. In addition, BSF permits any Java application to be implemented in part (or dynamically extended) by a language that is embedded within it. This is achieved by providing an API that permits calling scripting language engines from within Java, as well as an object registry that exposes Java objects to these scripting language engines.

Chain

A popular technique for organizing the execution of complex processing flows is the “Chain of Responsibility” pattern, as described (among many other places) in the classic “Gang of Four” design patterns book. Although the fundamental API contracts required to implement this design patten are extremely simple, it is useful to have a base API that facilitates using the pattern, and (more importantly) encouraging composition of command implementations from multiple diverse sources.

Towards that end, the Chain API models a computation as a series of “commands” that can be combined into a “chain”. The API for a command consists of a single method (execute()), which is passed a “context” parameter containing the dynamic state of the computation, and whose return value is a boolean that determines whether or not processing for the current chain has been completed (true), or whether processing should be delegated to the next command in the chain (false).

The “context” abstraction is designed to isolate command implementations from the environment in which they are run (such as a command that can be used in either a Servlet or Portlet, without being tied directly to the API contracts of either of these environments). For commands that need to allocate resources prior to delegation, and then release them upon return (even if a delegated-to command throws an exception), the “filter” extension to “command” provides a postprocess() method for this cleanup. Finally, commands can be stored and looked up in a “catalog” to allow deferral of the decision on which command (or chain) is actually executed.

CLI

The Apache Commons CLI library provides an API for parsing command line options passed to programs. It’s also able to print help messages detailing the options available for a command line tool.

Commons CLI supports different types of options:

  • POSIX like options (ie. tar -zxvf foo.tar.gz)
  • GNU like long options (ie. du --human-readable --max-depth=1)
  • Java like properties (ie. java -Djava.awt.headless=true -Djava.net.useSystemProxies=true Foo)
  • Short options with value attached (ie. gcc -O2 foo.c)
  • long options with single hyphen (ie. ant -projecthelp)

Codec

Commons Codec provides implementations of common encoders and decoders such as Base64, Hex, Phonetic and URLs.

Collections

The Java Collections Framework was a major addition in JDK 1.2. It added many powerful data structures that accelerate development of most significant Java applications. Since that time it has become the recognised standard for collection handling in Java.

Compress

The Apache Commons Compress library defines an API for working with ar, cpio, Unix dump, tar, zip, gzip, Pack200 and bzip2 files.

Configuration

The Commons Configuration software library provides a generic configuration interface which enables a Java application to read configuration data from a variety of sources. Commons Configuration provides typed access to single, and multi-valued configuration parameters as demonstrated by the following code:

Double double = config.getDouble("number");
Integer integer = config.getInteger("number");

Configuration parameters may be loaded from the following sources:

  • Properties files
  • XML documents
  • Windows INI files
  • Property list files (plist)
  • JNDI
  • JDBC Datasource
  • System properties
  • Applet parameters
  • Servlet parameters

Different configuration sources can be mixed using a ConfigurationFactory and a CompositeConfiguration. Additional sources of configuration parameters can be created by using custom configuration objects. This customization can be achieved by extending AbstractConfiguration or AbstractFileConfiguration.

Daemon

Most multi-user operating systems already have a way in which server applications are started and stopped. Under Unix based operating systems non interactive server applications are called daemons and are controlled by the operating system with a set of specified signals. Under Windows such programs are called services and are controlled by appropriate calls to specific functions defined in the application binary, but although the ways of dealing with the problem are different, in both cases the operating system can notify a server application of its imminent shutdown, and the application has the ability to perform certain tasks before its process of execution is destroyed.

DBCP

Many Apache projects support interaction with a relational database. Creating a new connection for each user can be time consuming (often requiring multiple seconds of clock time), in order to perform a database transaction that might take milliseconds. Opening a connection per user can be unfeasible in a publicly-hosted Internet application where the number of simultaneous users can be very large. Accordingly, developers often wish to share a “pool” of open connections between all of the application’s current users. The number of users actually performing a request at any given time is usually a very small percentage of the total number of active users, and during request processing is the only time that a database connection is required. The application itself logs into the DBMS, and handles any user account issues internally.

Dbutils

The Commons DbUtils library is a small set of classes designed to make working with JDBC easier. JDBC resource cleanup code is mundane, error prone work so these classes abstract out all of the cleanup tasks from your code leaving you with what you really wanted to do with JDBC in the first place: query and update data.

Some of the advantages of using DbUtils are:

  • No possibility for resource leaks. Correct JDBC coding isn’t difficult but it is time-consuming and tedious. This often leads to connection leaks that may be difficult to track down.
  • Cleaner, clearer persistence code. The amount of code needed to persist data in a database is drastically reduced. The remaining code clearly expresses your intention without being cluttered with resource cleanup.
  • Automatically populate JavaBean properties from ResultSets. You don’t need to manually copy column values into bean instances by calling setter methods. Each row of the ResultSet can be represented by one fully populated bean instance.

Digester

Many projects read XML configuration files to provide initialization of various Java objects within the system. There are several ways of doing this, and the Digester component was designed to provide a common implementation that can be used in many different projects.

Basically, the Digester package lets you configure an XML -> Java object mapping module, which triggers certain actions called rules whenever a particular pattern of nested XML elements is recognized. A rich set of predefined rules is available for your use, or you can also create your own.

Discovery

The Discovery component is about discovering, or finding, implementations for pluggable interfaces. It provides facilities for instantiating classes in general, and for lifecycle management of singleton (factory) classes.

Fundamentally, Discovery locates classes that implement a given Java interface. The discovery pattern, though not necessarily this package, is used in many projects including JAXP (SaxParserFactory and others) and commons-logging (LogFactory). By extracting this pattern, other projects can (re)use it and take advantage of improvements to the pattern as Discovery evolves.

EL

EL is the JSP 2.0 Expression Language Interpreter from Apache.

Email

Commons Email aims to provide a API for sending email. It is built on top of the Java Mail API, which it aims to simplify.

Some of the mail classes that are provided are as follows:

  • SimpleEmail – This class is used to send basic text based emails.
  • MultiPartEmail – This class is used to send multipart messages. This allows a text message with attachments either inline or attached.
  • HtmlEmail – This class is used to send HTML formatted emails. It has all of the capabilities as MultiPartEmail allowing attachments to be easily added. It also supports embedded images.
  • EmailAttachment – This is a simple container class to allow for easy handling of attachments. It is for use with instances of MultiPartEmail and HtmlEmail.

Exec

Executing external processes from Java is a well-known problem area. It is inheriently platform dependent and requires the developer to know and test for platform specific behaviors, for example using cmd.exe on Windows or limited buffer sizes causing deadlocks. The JRE support for this is very limited, albeit better with the new Java SE 1.5 ProcessBuilder class.

Reliably executing external processes can also require knowledge of the environment variables before or after the command is executed. In J2SE 1.1-1.4 there is not support for this, since the method, System.getenv(), for retriving environment variables is deprecated.

FileUpload

The Commons FileUpload package makes it easy to add robust, high-performance, file upload capability to your servlets and web applications.

FileUpload parses HTTP requests which conform to RFC 1867, “Form-based File Upload in HTML”. That is, if an HTTP request is submitted using the POST method, and with a content type of “multipart/form-data”, then FileUpload can parse that request, and make the results available in a manner easily used by the caller.

Functor

A functor is a function that can be manipulated as an object, or an object representing a single, generic function.

Functors support and encourage a number of powerful programming techniques including:

  • programming in a functional style
  • higher order functions
  • internal iterators
  • reuse and specialization through composition rather than inheritance and overloading
  • generic “callback” or “extension point” APIs
  • generic “filters” or predicate APIs
  • many “behavioral” design patterns, such as Visitor, Strategy, Chain of Responsibility, etc.

IO

Commons IO is a library of utilities to assist with developing IO functionality.

There are six main areas included:

  • Utility classes – with static methods to perform common tasks
  • Input – useful Input Stream and Reader implementations
  • Output – useful Output Stream and Writer implementations
  • Filters – various implementations of file filters
  • Comparators – various implementations of java.util.Comparator for files
  • File Monitor – a component for monitoring file system events

JCI

JCI is a java compiler interface. It can be used to either compile java (or any other language that can be compiled to java classes like e.g. groovy or javascript) to java. It is well integrated with a FAM (FilesystemAlterationMonitor) that can be used with the JCI compiling/reloading classloader. All the currently supported compilers (even javac before java6) feature in-memory compilation.

JCS

JCS is a distributed caching system written in java. It is intended to speed up applications by providing a means to manage cached data of various dynamic natures. Like any caching system, JCS is most useful for high read, low put applications. Latency times drop sharply and bottlenecks move away from the database in an effectively cached system.

Jelly

Jelly is a tool for turning XML into executable code. So Jelly is a Java and XML based scripting and processing engine. Jelly can be used as a more flexible and powerful front end to Ant such as in the Maven project, as a testing framework such as JellyUnit, in an intergration or workflow system such as werkflow or as a page templating system inside engines like Cocoon.

Jelly borrows many good ideas from both JSP custom tags, Velocity, Cocoon, Ant. Jelly can be used from the command line, inside Ant and Maven or inside a Servlet, Web Service, JMS MessageListener or embedded directly into your software.

Jelly has native support for a Velocity-like expression language called Jexl which is a superset of the JSP, JSTL and JSF expression languages as well as support for other pluggable expression languages like XPath via Jaxen, JavaScript, beanshell and Jython.

JEXL

JEXL is a library intended to facilitate the implementation of dynamic and scripting features in applications and frameworks.

It is a small footprint “glueing” API – the core features fit in 3 classes and 10 methods – that can be used in various conditions:

  • Module or component configuration:
    • Your application has configuration files (eventually generated by a design module) consumed by the end-user module that would benefit from variables and expressions.
    • When it would be convenient to use IOC but overall complexity doesn’t require (or can’t depend upon) a full-blown library (Spring, Guice…).
  • Loose-coupling of interfaces and implementations or duck-typing:
    • You have optional classes that your code cant consider as compilation dependencies.
    • You have to integrate and call “legacy” code or use components that you dont want to strongly depend upon.
  • Basic scripting features:
    • Your application lets (advanced) users evaluate or define some simple expressions like computation formulas.
  • Simple template capabilities:
    • Your application has basic template requirements and JSPs or Velocity would be overkill or too inconvenient to deploy.

Its name stands for Java EXpression Language, a simple expression language inspired by Apache Velocity and the Expression Language defined in the JavaServer Pages Standard Tag Library version 1.1 (JSTL) and JavaServer Pages version 2.0 (JSP). JEXL 2.0 adds features inspired by Unified EL.

JXPath

The org.apache.commons.jxpath package defines a simple interpreter of an expression language called XPath. JXPath applies XPath expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet contexts, DOM etc, including mixtures thereof.

Consider this example:

Address address = (Address)JXPathContext.newContext(vendor).
         getValue("locations[address/zipCode='90210']/address");

This XPath expression is equivalent to the following Java code:

Address address = null;
Collection locations = vendor.getLocations();
Iterator it = locations.iterator();
while (it.hasNext()){
    Location location = (Location)it.next();
    String zipCode = location.getAddress().getZipCode();
    if (zipCode.equals("90210")){
      address = location.getAddress();
      break;
    }
}

Lang

The standard Java libraries fail to provide enough methods for manipulation of its core classes. Apache Commons Lang provides these extra methods.

Lang provides a host of helper utilities for the java.lang API, notably String manipulation methods, basic numerical methods, object reflection, concurrency, creation and serialization and System properties. Additionally it contains basic enhancements to java.util.Date and a series of utilities dedicated to help with building methods, such as hashCode, toString and equals.

Launcher

The Launcher Component is designed to be a cross platform Java application launcher.

Commons-launcher eliminates the need for a batch or shell script to launch a Java class. Some situations where elimination of a batch or shell script may be desirable are:

  • You want to avoid having to determining where certain application paths are e.g. your application’s home directory, etc. Determining this dynamically in a Windows batch scripts is very tricky on some versions of Windows or when softlinks are used on Unix platforms.
  • You want to avoid having to handle native file and path separators or native path quoting issues.
  • You need to enforce certain system properties e.g. java.endorsed.dirs when running with JDK 1.4.
  • You want to allow users to pass in custom JVM arguments or system properties without having to parse and reorder arguments in your script. This can be tricky and/or messy in batch and shell scripts.
  • You want to bootstrap system properties from a configuration file instead hard-coding them in your batch and shell scripts.
  • You want to provide localized error messages which is very tricky to do in batch and shell scripts.

Logging

When writing a library it is very useful to log information. However there are many logging implementations out there, and a library cannot impose the use of a particular one on the overall application that the library is a part of.

The Logging package is an ultra-thin bridge between different logging implementations. A library that uses the commons-logging API can be used with any logging implementation at runtime. Commons-logging comes with support for a number of popular logging implementations, and writing adapters for others is a reasonably simple task.

Applications (rather than libraries) may also choose to use commons-logging. While logging-implementation independence is not as important for applications as it is for libraries, using commons-logging does allow the application to change to a different logging implementation without recompiling code.

Note that commons-logging does not attempt to initialise or terminate the underlying logging implementation that is used at runtime; that is the responsibility of the application. However many popular logging implementations do automatically initialise themselves; in this case an application may be able to avoid containing any code that is specific to the logging implementation used.

Math

Commons Math is a library of lightweight, self-contained mathematics and statistics components addressing the most common problems not available in the Java programming language or Commons Lang.

Guiding principles:

  1. Real-world application use cases determine development priority.
  2. This package emphasizes small, easily integrated components rather than large libraries with complex dependencies and configurations.
  3. All algorithms are fully documented and follow generally accepted best practices.
  4. In situations where multiple standard algorithms exist, a Strategy pattern is used to support multiple implementations.
  5. Limited dependencies. No external dependencies beyond Commons components and the core Java platform (at least Java 1.3 up to version 1.2 of the library, at least Java 5 starting with version 2.0 of the library).

Modeler

Java Management Extensions (JMX) is an API that facilitates building management applications that can configure, and perform operations on, a server application. In general, each manageable component of the server application is represented by a Management Bean (or MBean, for short). JMX defines three types of MBeans, of which Model MBeans are the most flexible. Model MBeans provide a way to define MBeans for many different components, without having to write a specific MBean implementation class for each one.

However, this power comes at a price. It is necessary to set up a substantial amount of metadata about each MBean, including the attributes it should expose (similar to JavaBeans properties), the operations it should make available (similar to calling methods of a Java object via reflection), and other related information. The Modeler component is designed to make this process fairly painless — the required metadata is configured from an XML description of each Model MBean to be supported. In addition, Modeler provides a factory mechanism to create the actual Model MBean instances themselves.

Net

Apache Commons Net™ library implements the client side of many basic Internet protocols. The purpose of the library is to provide fundamental protocol access, not higher-level abstractions. Therefore, some of the design violates object-oriented design principles. Our philosophy is to make the global functionality of a protocol accessible (e.g., TFTP send file and receive file) when possible, but also provide access to the fundamental protocols where applicable so that the programmer may construct his own custom implementations (e.g, the TFTP packet classes and the TFTP packet send and receive methods are exposed).

OGNL

OGNL stands for Object-Graph Navigation Language; it is an expression language for getting and setting properties of Java objects, plus other extras such as list projection and selection and lambda expressions. You use the same expression for both getting and setting the value of a property.

The Ognl class contains convenience methods for evaluating OGNL expressions. You can do this in two stages, parsing an expression into an internal form and then using that internal form to either set or get the value of a property; or you can do it in a single stage, and get or set a property using the String form of the expression directly.

Pool

Pool provides an Object-pooling API, with three major aspects:

  1. A generic object pool interface that clients and implementors can use to provide easily interchangable pooling implementations.
  2. A toolkit for creating modular object pools.
  3. Several general purpose pool implementations.

Primitives

The Java language is mostly Object based, however the original designers chose to include eight primitive types – boolean, byte, char, double, float, int, long and short. Commons Primitives provides a library of collections and utilities specially designed for use with primitive types.

JDK 1.5 added auto-boxing to simplify working with primitive types. This is simply a mechanism of automatically converting a primitive to an Object and vice versa, an operation with potentially large memory and performance issues. Commons Primitives offers collections that hold the primitive type directly, and as a result they are usually smaller, faster and easier to work with than their purely Object based alternatives.

Proxy

The Proxy design pattern (GoF ) allows you to provide “a surrogate or placeholder for another object to control access to it”. Proxies can be used in many ways. Some of which are:

  • Deferred Initialization – the proxy acts as a “stand-in” for the actual implementation allowing it to be instantiated only when absolutely necessary.
  • Security – the proxy object can verify that the user actually has the permission to execute the method (a la EJB).
  • Logging – the proxy can log evey method invocation, providing valuable debugging information.
  • Performance Monitoring – the proxy can log each method invocation to a performance monitor allowing system administrators to see what parts of the system are potentially bogged down.

Commons Proxy supports dynamic proxy generation using proxy factories, object providers, invokers, and interceptors.

Sanselan

This Pure-Java library reads and writes a variety of image formats, including fast parsing of image info (size, color space, icc profile, etc.) and metadata.

This library is pure Java. It’s slow, consequently, but perfectly portable. It’s easier to use than ImageIO/JAI/Toolkit (Sun/Java’s image support), supports more formats (and supports them more correctly). It also provides easy access to metadata.

Although not yet version 1.0, sanselan is working and is used by a number of projects in production.

SCXML

State Chart XML (SCXML) is currently a Working Draft published by the World Wide Web Consortium (W3C). SCXML provides a generic state-machine based execution environment based on Harel State Tables. SCXML is a candidate for the control language within multiple markup languages coming out of the W3C (see Working Draft for details). Commons SCXML is an implementation aimed at creating and maintaining a Java SCXML engine capable of executing a state machine defined using a SCXML document, while abstracting out the environment interfaces.

Transaction

Commons Transaction aims at providing lightweight, standardized, well tested and efficient implementations of utility classes commonly used in transactional Java programming. Initially there are implementations for multi level locks, transactional collections and transactional file access. There may be additional implementations when the common need for them becomes obvious. However, the complete component shall remain compatible to JDK1.2 and should have minimal dependencies.

These are the initial parts in detail:

  • memory package: Contains a wrapper to make any map implementing interface java.util.Map transactional. Depending on the type of the map that is wrapped this can either work as a transactional cache or some sort of volatile memory store.
  • locking package: Interfaces and implementations for locks that can have more than one owner at different compatible levels.
  • file package: Implementation of transaction file access. Using a pessimistic locking schema this implementation features serializable transactions.
  • util package: Contains a collection of utility classes used by the transaction package itself. Of more general interest could be a rendezvous barrier and a file utility class.

Validator

A common issue when receiving data either electronically or from user input is verifying the integrity of the data. This work is repetitive and becomes even more complicated when different sets of validation rules need to be applied to the same set of data based on locale. Error messages may also vary by locale. This package addresses some of these issues to speed development and maintenance of validation rules.

VFS

Commons VFS provides a single API for accessing various different file systems. It presents a uniform view of the files from various different sources, such as the files on local disk, on an HTTP server, or inside a Zip archive.

Some of the features of Commons VFS are:

  • A single consistent API for accessing files of different types.
  • Support for numerous file system types .
  • Caching of file information. Caches information in-JVM, and optionally can cache remote file information on the local file system.
  • Event delivery.
  • Support for logical file systems made up of files from various different file systems.
  • Utilities for integrating Commons VFS into applications, such as a VFS-aware ClassLoader and URLStreamHandlerFactory.
  • A set of VFS-enabled Ant tasks .

Powered by Zoundry Raven

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

BWH-Online – Birth of a website

Posted by batman on Nov 23rd, 2011
2011
Nov 23

Introduction

I have been quietly working on a website that might one day evolve into something with commercial value for me. At this point it is nowhere near that, and I am just focussing on developing a framework that might enable my future vision, all the while gaining valuable learning and experience as to the various components of website setup, management, development, ecommerce, as well as gaining exposure to the various technical libraries and stacks that can be used. Should this venture become throwaway – then that is fine – I will still take something away with me, and at the minimum could be used to showcase something that I have done.

I have wanted to gain exposure to a.o. PayPal integration, registration and login authentication, protection against hackers/spammers, auditing and financial transactioning, and perhaps elementary website design using Html5, CSS3 and jQuery, to mention but a few.

By day I am a Java developer, writing (corporate/enterprise) applications for the giants of life assurance in sunny South Africa. From previous posts on this blog you may have guessed that I am employed by a company called Alacrity – I am very happy here, and they have given me many opportunties on various projects over the years. This venture gives me a stark contrast to that, since I get to decide what I want the application to do, how I want to do it, and when. I can choose the libraries, IDE, technology, etc., and I answer to no-one. It is what has kept me sane in the corporate world. I get some perverse satisfaction in deliberately writing a piece of code (not much mind you) in a manner that goes against restrictive corporate standards – just because I can!

I intend to write a few more articles in this series, including CodeIgniter PHP framework, Automated Web Testing using Selenium, security, PayPal integration, to mention a few.

Domain

I used GoDaddy to register my primary domain (brucewaynehart.com). I paid 9.99 USD, which is annually renewable. I use this domain to host primary blog website (Blog of Batman, using WordPress), as well as this blog (Batman @ Work, also using WordPress).

Hosting

I use Servage to host my domains. I paid 6.49 USD per month (I opted for the 6 month option, but will definitely renew after that). This includes 510GB of diskspace, 5010GB of data transfer per month, unlimited domains, virtual hosting, FTP, several useful automated installer scripts e.g. wordpress, mediawiki, openbook, etc.. and their response times are very good.

You will need to bring your domain across to your hosting provider – they will provide you with DNS settings (Name Servers) – that you will need to take back to the place where you registered your domain. This includes one domain with Servage, although I only realized that sometime later – I created a BWH-Online.com domain that I didn’t need back then, but envisaged that I might someday. I have since released a PHP application (although not yet for public consumption) at app.bwh-online.com, with a corresponding blog to document the app. It doesn’t lead to much yet – it’s just work-in-progress.

Services

Servage provides several services that I make use of – Apache WebServer to host my PHP website, MySQL database, Email and FTP for backups & deployment. In addition they provide a handy dashboard (probably not uncommon though) which allows me to manage my MySQL databases using phpMyAdmin (run scripts, add tables, columns, run backups), a view of my filesystem (create/delete/rename filenames/directories, modify ownership/permissions), manage email and FTP accounts and create tickets for e.g. my site becomes unavailable.

Links

GoDaddy.com

Servage.com

Alacrity (Pty) Ltd

brucewaynehart.com

Blog of Batman

Batman @ Work

BWH-Online.com

Blog of BWH-Online.com

Powered by Zoundry Raven

Powered by Zoundry Raven

Technorati : , ,
Del.icio.us : , ,
Zooomr : , ,
Flickr : , ,

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

Alacrity expands Gauteng, Cape Town footprints

Posted by batman on May 25th, 2011
2011
May 25

Software services and ventures company, Alacrity, has expanded its presence both in Gauteng and Cape Town as the company experiences tremendous growth across all areas of business.

“Following on from the merger of MagmaTec and Comprehend IT, which prompted the formation and rebrand to Alacrity, it was always the plan to combine staff into single offices in each region,” comments Brian Ford, CEO.

“We’re already seeing major benefit in how integrated the company has become throughout our operations and in delivering client solutions; the move to larger premises also came just in time to cater for additional staff that have come with recent business acquired through various support contracts.” The Cape Town office is now situated at Waterview Park, Century City, known as the IT hub of Cape Town.

Similarly, Alacrity’s Gauteng region is seeing an upswing in IT activity by the large corporates, hampered only by the scarcity of skilled IT professionals, especially software developers in the country. “The diversity in our model and the solutions we offer has been well received by CIOs and IT managers who not only need assistance in defining a technology strategy, but more importantly, in delivering on their mandate,” adds Ford.

“Alacrity has extensive experience in merging both legacy and emerging technology systems, which is especially relevant for companies going through mergers and acquisitions; in continuing to support legacy systems still required to operate; and in using the latest development technologies to integrate with systems or create products.”

Alacrity’s Gauteng operation is now based at Fourways Golf Park, overlooking a small mashie course for the golf enthusiasts, and will be introduced to clients at a ‘by invitation only’ gathering on 9 June 2011. For more information on the event, e-mail events@alacrity.co.za.

ITWeb Press Release

Alacrity Homepage

Powered by Zoundry Raven

Technorati :
Del.icio.us :
Zooomr :
Flickr :

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

Test Automation for Web Applications using Selenium 2

Posted by batman on Apr 18th, 2011
2011
Apr 18

Test Automation for Web Applications

Many, perhaps most, software applications today are written as web-based applications to be run in an Internet browser. The effectiveness of testing these applications varies widely among companies and organizations. In an era of highly interactive and responsive software processes where many organizations are using some form of Agile methodology, test automation is frequently becoming a requirement for software projects. Test automation is often the answer. Test automation means using a software tool to run repeatable tests against the application to be tested. For regression testing this provides that responsiveness. There are many advantages to test automation. Most are related to the repeatability of the tests and the speed at which the tests can be executed. There are a number of commercial and open source tools available for assisting with the development of test automation. Selenium is possibly the most widely-used open source solution.

Introducing Selenium

Selenium is set of different software tools each with a different approach to supporting test automation. Most Selenium QA Engineers focus on the one or two tools that most meet the needs of their project, however learning all the tools will give you many different options for approaching different test automation problems. The entire suite of tools results in a rich set of testing functions specifically geared to the needs of testing of web applications of all types. These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.

Selenium’s Tool Suite

Selenium is composed of multiple software tools. Each has a specific role.

Selenium 2 (aka. Selenium Webdriver)

Selenium 2 is the future direction of the project and the newest addition to the Selenium toolkit. This brand new automation tool provides all sorts of awesome features, including a more cohesive and object oriented API as well as an answer to the limitations of the old implementation.

Selenium 1 (aka. Selenium RC or Remote Control)

As you can read in Brief History of The Selenium Project, Selenium RC was the main Selenium project for a long time, before the WebDriver/Selenium merge brought up Selenium 2, the newest and more powerful tool. Selenium 1 is still actively supported (mostly in maintenance mode) and provides some features that may not be available in Selenium 2 for a while, including support for several languages (Java, Javascript, PRuby, HP, Python, Perl and C#) and support for almost every browser out there.

Selenium IDE

Selenium IDE (Integrated Development Environment) is a prototyping tool for building test scripts. It is a Firefox plugin and provides an easy-to-use interface for developing automated tests. Selenium IDE has a recording feature, which records user actions as they are performed and then exports them as a reusable script in one of many programming languages that can be later executed.

Selenium-Grid

Selenium-Grid allows the Selenium RC solution to scale for large test suites and for test suites that must be run in multiple environments. Selenium Grid allows you to run your tests in parallel, that is, different tests can be run at the same time on different remote machines.

An example using Selenium 2, Java and JUnit4

Download Selenium

Create a Java Project

  • Create a Java project using your favourite IDE – I’m using Netbeans 6.9.1, JDK 1.6 and JUnit 4
  • Add selenium-server-standalone-2.0b3.jar to your project classpath.

Create a Unit Test

public class GoogleTest {

    @Test
    public void test() throws Exception {

        WebDriver driver = new FirefoxDriver();

        driver.get("http://www.google.com");
        Assert.assertEquals("Google", driver.getTitle());

        WebElement element = driver.findElement(By.name("q"));
        element.sendKeys("Wikipedia");
        element.submit();
        Assert.assertEquals("Google", driver.getTitle());

        driver.quit();
    }
}
  • Here I am using Java to test a website written in PHP – the website language is actually irrelevant as it is basically html
  • There are of course benefits to having the selenium tests as part of the actual project (test driven development – TDD)
  • It’s comforting to use the visual FirefoxDriver(), but it is slower. For faster performance, use the HtmlUnitDriver() for in-memory testing
  • It really is this easy – try it 🙂

References

Selenium Website

Selenium Documentation

Powered by Zoundry Raven

Technorati : , , ,
Del.icio.us : , , ,
Zooomr : , , ,
Flickr : , , ,

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

Microsoft Excel CSE Functions

Posted by batman on Sep 16th, 2010
2010
Sep 16

Have you ever felt that, while the "SUMIF" and "PRODUCTIF" functions in Excel are great, there's just not enough of them? Wouldn't a "MINIF", or "MAXIF" or even an "AVERAGEIF" have been really nice as well? Or even the ability to have a custom "MYCUSTOMIF"?

Then welcome to CSE functions. CSE is an anagram for Control Shift Enter, and is named such because, unlike just typing in your formula and pressing Enter, you need to type it in, and press Control Shift Enter – or else it just won't work. And you'll need to make a note of this, because you probably won't remember this in a few years time.

OK, so what are CSE functions? By definition CSE functions are functions that operate on arrays (they are also known as array formulae). An array can be one-dimensional (single row or column), or two-dimensional (multiple rows or columns). An array formula is a formula that can perform multiple calculations on one or more of the items in an array. Array formulas can return either multiple results or a single result. For example, you can place an array formula in a range of cells and calculate a column or row of subtotals. You can also place a formula in a single cell and calculate a single amount. An array formula that resides in multiple cells is called (logically enough) a multi-cell formula, and an array formula that resides in a single cell is called a single-cell formula.

CSE functions can be identified by being wrapped with curly braces i.e. "{=MIN(IF($C$2:$C$20=A5,$I$2:$I$20))}", wheras a regular function would be "=SUM(A2:A20)".

I won't attempt to provide a tutorial on CSE's – no point in re-inventing the wheel. There are several really good resources already out there. You can try any of these to get a kick-start:-

 

Powered by Zoundry Raven

Technorati :
Del.icio.us :
Zooomr :
Flickr :

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

The world’s best countries

Posted by batman on Sep 4th, 2010
2010
Sep 4

I found this really cool interactive study of the world’s “best” countries, hosted by Newsweek. The analysis considers education, health, quality of life, economic dynamism and political environment. Countries can by grouped for example by sub-saharan african, all countries, EU and G7, to mention but a few.

To quote Newsweek – “A Newsweek study of health, education, economy and polictics rank’s the globe’s true national champions.”

But it wasn’t the informative nature, or the level of detail that caught my eye. It was the slick manner in which it was presented. I develop web applications for a living, and it has been a while since I have seen a web “application” that is just so “cool”…

Please click here to see for yourself.

Credits : Newsweek

Powered by Zoundry Raven

Technorati :
Del.icio.us :
Zooomr :
Flickr :

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

IT Salary Survey 2009

Posted by batman on Sep 3rd, 2010
2010
Sep 3

The gender gap remains one of the constants in a decade of doing this survey…

Those with degrees earn significantly more …

At executive level, the median salary is R59 000, followed by R35 000 for operational managers, R33 000 for IT specialists and R25 00 for general IT staff…

… over the past 18 months, many companies affected by the economic crunch have applied a salary freeze…

To read the full article – please click here

Credits : ITWeb

Powered by Zoundry Raven

Technorati :
Del.icio.us :
Zooomr :
Flickr :

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

MagmaTec, Comprehend-IT rebrand to Alacrity

Posted by batman on Jul 28th, 2010
2010
Jul 28

MagmaTec and Comprehend-IT have officially merged and rebranded to Alacrity with immediate effect; this final step marks the end of a year-long process to combine the services and competencies of these two organisations into a single entity offering MS.Net and Java software development services to an expanding range of blue chip clients.

Since announcing the deal in August 2009, both companies continued to operate as separate entities, although combining efforts where required.

“As technologies have converged it was no longer in our best interest to maintain our niche focuses,” comments Stuart Phillips, MD. “The technology environments of our clients are far more dynamic and require us to be as conversant in cutting-edge application development technologies and platforms, as well as being able to support legacy systems that need to be maintained to support their existing operations.”

Services

Alacrity is a software development company that offers consulting, development and support services to a broad range of clients.

Clients may need assistance in developing an IT strategy, competency-based resourcing covering the full SDLC either on- or off-site; or software developed for products or projects, or systems and software applications support.

The product division is geared to support technology entrepreneurs that need support services in addition to software development expertise to build and sustain the product or business. The company has an impressive array of clients, including Momentum, Discovery, Gallo Images, Paarl Media, Old Mutual, Metropolitan, Firstrand, Webber Wentzel and Media24 to name a few.

Leadership team

The Alacrity group will be lead by a combined management team: Stuart Phillips – Managing Director, Robert Marshall – Strategy & Business Development Director, Brian Ford – Sales & Marketing Director, Gerhard Pretorius – Technology Director, and Teresia Arendse – HR Director.

New brand

“Alacrity as a word is synonymous with agility, quick responding, efficient, flexible and engaging; important words when you consider the work that we do and the benefit offered to our clients,” adds Brian Ford. “Similarly, the corporate identity is more dynamic, using four colours interchangeably, as the IT in the word, it’s both simplistic and unsuspecting for a software development company.” The brand was launched internally to staff prior to the official market launch today.

ITWeb Press Release

Alacrity Homepage

Magmatec Homepage (limited time)

Comprehend IT Homepage (limited time)

Powered by Zoundry Raven

Technorati :
Del.icio.us :
Zooomr :
Flickr :

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Yahoo! Buzz
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • laaik.it
  • Google Buzz
  • Technorati
  • Slashdot
  • Reddit

Next »