Sunday, November 29, 2009

Mach-II 1.8 Release Candidate Available


Team Mach-II (which is now six people strong!) is pleased to announce the immediate availability of Mach-II 1.8 RC1. Download Mach-II 1.8 RC1 now.



Mach-II 1.8 introduces numerous new features and also sets the stage for us to move forward to 1.9 code named "Integrity" and the big 2.0 release code named "Velocity".



New features and enhancements include:




In addition to these "marquee" features, Mach-II 1.8 includes a ton of smaller improvements that will make building Mach-II applications even faster and easier than before, so make sure and check out the "What's New in Mach-II 1.8" page on the wiki for all the details.



And there's the usual round of bug fixes and performance improvements of course. You can see the details in the CHANGELOG, but we do want to point out some highlights:


We can't thank our community enough for all the fantastic feedback and assistance they offer on the development of Mach-II. From questions on aspects of the framework that aren't as clear as they should be, to bug reports, to feature requests, to testing on real-world Mach-II applications, this is all vital to the continued progress and success of Mach-II. We couldn't do what we do without the active participation of our vibrant, smart community.



I'm so excited because we're starting a whole new development cycle for Mach-II. Mach-II Simplicity (1.8) has been development for an entire year now and having a new features is going to be a lot of fun. We're moving to a milestone type releases so look for new features soon in Mach-II 1.9 code named "Integrity".

Wednesday, November 25, 2009

A bit of levity - Muppets: Bohemian Rhapsody

Because everybody needs a bit of levity in their day.  Without a good laugh, it is easy to make every little thing seem like life or death.  Enjoy a brand new Muppets!

[youtube http://www.youtube.com/watch?v=tgbNymZ7vqY?wmode=transparent]

P.s. I didn't expect the chickens or the penguins.

Tuesday, November 24, 2009

Slow Custom Domain on GAE

I recently deployed an application to Google App Engine (GAE). Accessing the application via the appspot.com subdomain was fast however the custom domain consistently was slower (sometimes 5 seconds versus 200ms). I believe the issue is that custom domain was set up on the same day and that the DNS has not propagated through the internet completely. This leads to some crazy routing to Google's network.

I'll wait a while longer because I ask the Google App Engine group (not much else other than this explanation is mentioned in the searches I've done). I'm going to reboot my local wireless/wired routers.

SES URLs on OpenBD GAE

I've been working on a brochure style site for a friend this week.  The budget is nothing and I'm doing this as a favor for my friend so it's my time. Instead of doing the same old, I decided that I should try something new and learn since I'm donating my time.  I hope to be posting more about using Google App Engine (GAE) as free hosting for CFML applications.  GAE is cloud computing and it does turn the usual concept of building applications on its head.  Since GAE's daily http request limit for the free account is 1.3M requests, I don't foresee any issues with overing over our quotas.


The application I'm building is using Mach-II Simplicity (1.8) and is running on Open BlueDragon (GAE Edition).  My friend wanted to use SES URLs so I investigated to see if the SES URL filter that is usually bundled with Open BlueDragon was commented out in the web.xml file.  It was not even present in the file (whereas in the normal OpenBD edition it is commented out) so I was a little nervious this wasn't going to be possible.  Instead of wasting time researching, I used GAE's nifty one click (ok, it's two clicks and your Google account password) deployment option to just try by testing it.  Here is the snippet I added in my web.xml right at the top after the <web-app ...> node:





<filter>
    <filter-name>SearchEngineFriendlyURLFilter</filter-name>
    <display-name>SearchEngineFriendlyURLFilter</display-name>
    <description>SearchEngineFriendlyURLFilter</description>
    <filter-class>com.newatlanta.filters.SearchEngineFriendlyURLFilter</filter-class>
    <init-param>
        <param-name>extensions</param-name>
        <param-value>cfm,cfml</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>SearchEngineFriendlyURLFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>



Bam! I deployed it to the cloud and it worked.  SES URLs on OpenBD GAE is a go!  Thought I would share it with the world.

Wednesday, November 18, 2009

How to Apply the Apache 2.0 License to Your Project

Every once is a while I get asked the questions about open source licenses.  Here is a simple tutorial on how to apply the Apache 2.0 License to your project.

1. First you'll need a copy of the Apache 2.0 License for your project. Grab a copy by downloading in text form from the Apache Software Foundation.
2. Now, you need to modify a notice statement so you can add them to your files. We'll get to where you put the notice statement in step 3 so just hold your horses for a moment. Here is boilerplate notice which you will modify for your project:

   Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
   limitations under the License.


Some things you must do:

a) Replace all [bracketed] items in the above notice statement. There are only two of these items so should not be hard for you to do.
b) Do not leave the brackets in the notice. For example, "[yyyy]" would be replaced with "2009" (or what ever year you release in). Again, do not leave the brackets in the notice statement.

3. Apply the your notice statement to each and every file in which the Apache License applies. The most common mistake when applying the license that people think that supplying the license text is enough to make your the project licensed under the Apache License.  Again, you must place a copy of the notice statement (probably at the top) in the appropriate "comment syntax" for the file format.

4. Secondly, you need two files in the root or top directory of your distribution.  It's best to not deeply nest them in a some directory deep in your project.  Leave them in the root or top directory. One file should be named LICENSE (no file extension) in which you will place the text from the license you just downloaded in step 1. The other file that is required is a file named NOTICE in which you place a copy of your notice statement you modified above and a listing of the names of licensed libraries used in your project (be sure to list the names of the developers of those projects as well -- show your appreciation).

5. If use other code in your project that is licensed under a different license, I must make sure those libraries are compatible with the Apache 2.0 License.  For example, GPL version 2.0 is not compatible with the Apache 2.0 license. Also, you must leave any original copyright and patent notices in the code you redistribute.  It is important that you preserve this notifications and you must explicitly sate if you made changes to that file.

Presto! You're done!  The depending on the size of the project, adding the notice statement to each file will take you the most time.  I'd recommend against using a SVN keyword or other placeholder to dynamically insert the notice statement at build time because your notice would not be present when browsing code through a source code repository (such as SVN or CVS).

Internet Explorer 9 Wish List



According to Neowin's Tom Warren and Cnet News's Ina Fried, Microsoft will have something -- maybe just a little something, but something -- to say about its plans for Internet Explorer 9 at its Professional Developers' Conference in Los Angeles today. The company often briefs tech reporters in advance about major announcements, but it hasn't told me a darn thing about IE9. So I'm just as curious as anyone else to know what the upgrade is going to involve.


And for the next few hours, at least, I'm free to ponder the features that would get me excited about a new browser from Microsoft . . .




It's not like I'm terribly excited for IE9 to come out, because in corporate environments we have to support IE6, IE7, IE8 and IE9. I hope IE6 dies a quick death. However, the author of the post above does cite some items that would make -- at least for me -- IE9 less of bother as technologist (although it gives me no excitement in the end).


However I found one statement from a comment by user "obviocapitao" to be interesting:



The problem for Microsoft is that the world changed, and didn't wait for them.



I can't help but think there is a little bit of truth in that applied to the CFML world due to the introduction of the open source CFML engines. When the world changes, so do all of the rules which means the status quo no longer applies.


I'm all for heads down, get it done and live in your own world. However, every once in a while it's important to look up, break the surface of the water and grab a breath to reorient yourself. Software development of projects used by many and not just yourself is a tricky business of balance. I just think how the world looks to Microsoft and how the world looks to me are completely different.


Sunday, November 15, 2009

CFML Documentation core to Open BlueDragon


The journey has started. Let me present the official resource for CFML documentation for Open BlueDragon:



OpenBD CFML Documentation



Key features:



  • JavaDoc like interface

  • Produced from the raw Java code; no external XML/wiki/sites to keep in sync

  • Hot links to any particular function (CreateDateTime)

  • See other functions/tags that fall in that category

  • Quickly discover which parameters/attributes are optional

  • Real look-ahead search

  • See all functions/tags with their parameters/attributes

  • Hot links to the OpenBD WIKI

  • User contributed comments (Moderated)



We haven't finished annotating all the functions/methods yet, but even without that, you will find this an incredibly useful resource. I have even rediscovered functions I had completely forgotton existed!



In addition, the CFML app we developed for this, is already being bundled in the nightly build in the web-app folder. So you can even run your own internal documentation, complete with your own private notes.



We are annotating functions and tags as and when we get time, and already 80% of all the functions have been completed. For me, this is 10 years too late, for that I apologise. But we are here now. Never again will the documentation not match the implementation.




This is great -- not that it's just available via the web, but it comes bundled with the engine so it is available locally. Sometimes it's hard to get documentation on something if you're not currently tethered to the internet at the moment.

I've always thought it was strange that documentation in the CFML engine world is an "after" process. This approach is prone to error either from exemption (forgotten notes) or too much time elapsed. Unless you're a code maverick and dig around the CFML engine source code, documentation is the only way for people to understand new features and actually use them. Only after they are used do people find ways to improve them.

I hope to blog more in the future about open source, licensing and the world of CFML open source which I believe is currently in a positive flux. So check back often or subscribe to my RSS feed.

Saturday, November 14, 2009

FuseNG and therefore Fusebox by default are dead...


A few months back I tweeted that anyone can build a framework in CF; what we need is more good software out there. Given the choice between maintaining a framework and listening to the nagging whining community or developing an open source application and listening to nagging and whining community I'll take the application. My heart is just not in FuseNG, or any other framework, and I can't hold onto the framework to make people happy or ensure it has a support person. That's just not what I want to do.

For those that thought it would never get off the ground congratulation you were right! To those that had new hope for the future of Fusebox, sorry FuseNG will not be it for you. You see over the past year my career has change drastically. I do not officially work on ColdFusion at work any longer and I never find myself in the situation where I am using Fusebox. I can not continue to develop a framework I don't use, it will stagnate. I hope someone else in Kroger will step up and take on Fusebox or revive the FuseNG fork, but that is up to the other individuals that originally looked to me for leadership of FuseNG. As much as I am sure some of you would like to leave feedback or comments I'd rather not open the potential for flames so comments are off. If you really must share your opinion feel free to email me.




FuseNG is dead and Adam was the one that said it. I totally get where Adam is coming from. If your heart is not in it then it is not something to not pursue. Our lives are short. Best of luck to you, Adam, with your new management career.

I truly believe that FuseNG was the only hope for Fusebox as I do not see much involvement from the current maintainers of Fusebox. Maybe somebody will swoop in and save FuseNG, but that would require a long term framework vision and big time commitment. Only time would tell...

I totally agree with Adam that the CFML world is missing really powerful, enterprise level, commodity applications that extremely mature and polished. I think the downfall as a community as a whole is we think about building new tools, but not full-blown open source applications. Sadly, other development languages like PHP are littered with big name applications that make it into the headlines. They have a huge head start on us (we're talking many years) in the terms of maturity and polish.

One thing we are not missing in the CFML world is a selection of frameworks. So jump on in; the water is warm! Just one word of advice, do not use this as an excuse to build yet another framework in CFML. You're just re-inventing the wheel with different paint or materials. Your time would be better spent (yours and everyone else that benefits from your time) by becoming involved with an open source framework / application by adding to the spit and polish of that chosen project. Think about the CFML community as a whole instead of scratching that "I think I can do it better in my own way" kind of itch.

Please no flames... (and yes, I think I can now be crowned the "X is dead..." king for those who have been around for long enough).

Thursday, November 12, 2009

We should start worrying about Y2K38 now


The Linux kernel always stores and calculates time as the number of
seconds since midnight of the 1st of January 1970 UTC regardless of
whether your hardware clock is stored as UTC or not. Conversions to
your local time are done at run-time. One neat thing about this is
that if someone is using your computer from a different timezone, they
can set the TZ environment variable and all dates and times will
appear correct for their timezone.



If the number of seconds since the 1st of January 1970 UTC is
stored as an signed 32-bit integer (as it is on your Linux/Intel
system), your clock will stop working sometime on the year 2038.
Linux has no inherent Y2K problem, but it does have a year 2038
problem. Hopefully we'll all be running Linux on 64-bit systems by
then. 64-bit integers will keep our clocks running quite well until
aproximately the year 292271-million.


Remember Y2K almost 10 years ago? It didn't make too big of a splash because of the media hype - at least me - encouraged companies to make sure things just worked. I like to think of that as the "odd man out" syndrome since no company wanted to consistently be cited as the example of the "big Y2K failure."

Well, we have another computer time death march coming up in 28 years in 2038. I really do hope that we're all running 64-bit operating systems by then, but considering big business it still running 1970s mainframes... I really do wonder. So let's start today by encouraging or in my case demanding 64-bit support of software and operating systems.

Wednesday, November 11, 2009

Prototype JS - Sleep Function

Every once in a while, you need to simulate network latency in an
application when you are doing AJAX. It's a hard thing to test unless
you actually are talking to a remote server. Yes, you could do it with
a proxy server and it's something I've done, but it's cumbersome at
best.

Here's a simple sleep() function written in prototype:


sleep: function(milliseconds) {
var start = new Date().getTime();

for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds) {
break;
}
}
}

Basically, we are exploiting the ability to get the current system time
in milliseconds and comparing the current time in the loop against the
time in milliseconds when we started to get a difference. This function
is not appropriate if you want an action to occur is X number of
milliseconds because this function delays execution of code due to the
loop. Use a setInterval() or setTimeout() function that is part of
Javascript to "schedule" when a method should be executed.

Tuesday, November 10, 2009

Prototype JS - Tab to next text element on enter

I'm no Prototype JS wizard but I thought I'd post this little tidbit on my blog since it stumped me for a while.


I needed to "tab" to the end field in a form when a person pressed enter in a text field. The problem was that I didn't want to manually set this up on each page and I didn't know the id of the form since it varied.  This is what I came up with:





$(document.forms[0]).getInputs('text').each(function(input) {
    input.observe('keypress', function(e) {
            if (e.keyCode==13) {
                var inputs = $(document.forms[0]).getInputs('text');
                var idx = inputs.indexOf(this);
               
                if (idx == inputs.length - 1) {
                    inputs[0].select()
                } else {
                    inputs[idx + 1].focus(); // handles submit buttons
                    inputs[idx + 1].select();
                }
                return false;             
            }
        }
    );
});



Essentially this is what is going on:



  1. Get all the "text" type form elements in the first form. We're using the DOM with some prototype goodness by using the $() selector.

  2. For each text input, interate over it with the each() function. On each iteration, the text element is called "input".

  3. Attach an "keypress" observer to each input and a callback function to call when a keypress ocurrs.

  4. Now in the main callback, we're looking for an "enter" (which is key code 13).

  5. We get all the form elements again and stash them into the variable named "inputs".

  6. We need to figure out the next text element in the array, so we find the index of the text element in which this event was observed using indexOf(...).

  7. Some magic goes on here so that if we're the at the last element, we loop back to the first form element.


Voila! There it is and I hope this helps somebody figure out what is going on.  Feel free to rip this code apart and tell me how to make it leaner and meaner.

Open BlueDragon - Array Functions Added



We've just added a bunch of new array functions, some bringing compatibility with other engines and others suggested by Peter through discussions on the issue tracker.


  - ArrayFirst()
  - ArrayLast()
  - ArrayFind()
  - ArrayFindNoCase()
  - ArrayContains()
  - ArrayContainsNoCase()
  - ArrayGet()


and recall the OpenBD function that was always there


  - ArrayTrim()


All to be found in the nightly build.




This is where the miracles of open source shows. What Alan did not mention is that the ticket I mentioned some of these items on was only from a day ago. Now Open BlueDragon has an array function group that matches the available function group for structs. These little things are what makes a language a joy to work with. I like to call this the spit and polish functionality. Most open source CFML projects never get to this stage so kudos to the Open BlueDragon team for listening and more importantly being proactive on user suggestions.


Monday, November 9, 2009

How to publish code samples to Posterous?



I've just popped an early version of it live for you to try out. All you have to do is surround your code block with the following tags:



[code] 
your code here
[/code]



Additionally, if you want to get fancy, you can specify a language with the following syntax:

 [code lang='java']
public static boolean isAwesome = true;
[/code]




The available list of languages is: 'cpp', 'c', 'c++', 'c#', 'c-sharp', 'csharp', 'css', 'delphi', 'pascal', 'java', 'js', 'jscript', 'javascript', 'php', 'py', 'python', 'ruby', 'rails', 'ror', 'sql', 'vb', 'vb.net', 'xml', 'xhtml', 'xslt', 'html', 'xhtml'


Current known issues: HTML formatting might be a little spotty at the moment. Will be fixing asap. I also see some intermittent errors where the code isn't getting properly recognized.


Please report any bugs to me at garry@posterous.com. Thanks for all the support and ideas. Please do keep the feature ideas coming -- the best way to reach us is to email help@posterous.com, but voting up to the top of Hacker News works too. ;-)



-----




It took a Google search to find out, but man that is slick. Let's see if CFML works:



<cfset pleaseWork = "I work!" />


Using ANT to replace tokens

Just thought I would post this little snippet from an ANT build file.  I wanted to literally copy code into a file during the build instead of using a <cfinclude> in my code. This eeked out a 2-3% faster performance.  Basically the <loadfile> loads the contains of the file into a property and then I use the <replace> task to look for a token and replace it with the value from the property.  Hope this helps somebody else.





<echo message="Converting custom tag library includes to inline."/>
<loadfile srcfile="${dest}/MachII/customtags/baseTagBuilder.cfm" property="include.baseTagBuilder" />
<replace dir="${dest}/MachII/customtags/"
    includes="**/*.cfm"
    value="${include.baseTagBuilder}">
    <replacetoken><![CDATA[<cfinclude template="/MachII/customtags/baseTagBuilder.cfm" />]]></replacetoken>
</replace>
<loadfile srcfile="${dest}/MachII/customtags/form/helper/formTagBuilder.cfm" property="include.formTagBuilder" />
<replace dir="${dest}/MachII/customtags/"
    includes="**/*.cfm"
    value="${include.formTagBuilder}">
    <replacetoken><![CDATA[<cfinclude template="/MachII/customtags/form/helper/formTagBuilder.cfm" />]]></replacetoken>
</replace>
<loadfile srcfile="${dest}/MachII/customtags/view/helper/viewTagBuilder.cfm" property="include.viewTagBuilder" />
<replace dir="${dest}/MachII/customtags/"
    includes="**/*.cfm"
    value="${include.viewTagBuilder}">
    <replacetoken><![CDATA[<cfinclude template="/MachII/customtags/view/helper/viewTagBuilder.cfm" />]]></replacetoken>
</replace>


Protecting your CFML apps with CFTHROTTLE


You may have heard about the recent high profile attacks on celebrity accounts on Twitter, where by a young (enterprising?) chap simply pointed a brute force password dictionary attack to their login process. Twitter had no throttling process here to stop this from happening.



How can you protect your own CFML applications from such an easy attack?



BlueDragon introduced the CFTHROTTLE tag a number of years ago and naturally is available now in the core distribution of OpenBD. CFTHROTTLE was designed to stop repeated requests coming from a single source consuming too many resources. Developed for Blog-City.com and modelled on the (at the time) well known Apache mod_throttle module.




Huh? How did I miss this (from last January)? I definitely going to check this out for an application I have on Open BlueDragon. I'll probably do this as a Mach-II filter as we've had some problems in the past with *bad* bots hitting the login page with bad credentials.

Sunday, November 8, 2009

Watch YouTube Videos Without Flash in HTML5 — The NeoSmart Files


Running on Mac or Linux and tired of Adobe Flash eating up all your CPU cycles while you're watching YouTube? Buggy plugins that crash your browser and freeze your PC? Proprietary formats that get in the way? Want to embrace HTML5 and the future? Well, now you can... one YouTube video at a time.


We've written an HTML 5 Video Viewer for YouTube, and you can use it to browse YouTube in true 21st Century HTML5 quality. And it's super-simple to use.


Flash has been the bane of online websurfers ever since the 90s, especially on platforms where Adobe doesn't bother to go the extra mile to ensure that their proprietary, binary implementations are stable and efficient. On Linux and Mac OS X, the flash implementation takes up over half the available CPU and at high-resolutions stuttering occurs. HTML5 poses the answer providing a way for browsers to use the native implementations to render videos directly in the browser without resorting to ActiveX and 3rd-party browser plugins... it just has yet to be embraced.




All I have to say is it's about time. Flash on my Linux based netbook is slow because Adobe has not spent the time optimizing there player and the GNU Gnash player is not really really for prime time since it is really only compatibility to Flash 7.

Saturday, November 7, 2009

Interoperability Happens - The Vietnam of Computer Science


Two years ago, at Microsoft's TechEd in San Diego, I was involved in a conversation at an after-conference event with Harry Pierson and Clemens Vasters, and as is typical when the three of us get together, architectural topics were at the forefront of our discussions. An crowd gathered around us, and it turned into an impromptu birds-of-a-feather session. The subject of object/relational mapping technologies came up, and it was there and then that I first coined the phrase, "Object/relational mapping is the Vietnam of Computer Science". In the intervening time, I've received numerous requests to flesh out the discussion behind that statement, and given Microsoft's recent announcement regarding "entity support" in ADO.NET 3.0 and the acceptance of the Java Persistence API as a replacement for both EJB Entity Beans and JDO, it seemed time to do exactly that.

This is one of the best articles on the ORM in which the whole thing is compared to the Vietnam War. Above is the just short teaser. Grab a cup of coffee and enjoy the read. And for those that get through the whole thing, I guess I fall into category #3 - "Manual Mapping." Remember, in war -- there is nothing glamorous about it.

SourceForge Acquires Ohloh


Today SourceForge has acquired Ohloh. We at Ohloh are pretty awed and excited at the opportunity (and challenges) ahead. I plan on blogging more deeply over the next few weeks but I wanted to give you some background on why this makes sense.



Most developers know that SourceForge is primarily a 'forge' (duh!) - providing open source developers free tools and services to help them succeed. However, for many less-tech savvy people, SourceForge is actually thought of as an open source directory. As a result, SourceForge has found itself in the middle of a lot of software-related activity, from downloading to source code management (and almost everything in between).




Ok, it didn't happen today, but I'm a bit ashamed I missed this announcement from May 2009. I like ohloah (please at CFML code to your reader system BTW) and we use at Mach-II. I'm sure this is a good thing for the guys at ohloh and SourceForge.

Friday, November 6, 2009

Why Open Source Misses the Point of Free Software


When we call software “free,” we mean that it respects
the users' essential freedoms:
the freedom to run it, to study and change it, and to redistribute
copies with or without changes. This is a matter of freedom, not
price, so think of “free speech,” not “free
beer.”



These freedoms are vitally important. They are essential, not just
for the individual users' sake, but for society as a whole because they promote social
solidarity—that is, sharing and cooperation. They become even
more important as our culture and life activities are increasingly digitized.
In a world of digital sounds, images, and words, free
software becomes increasingly essential for freedom in general.




A somewhat older article (2007) by Richard Stallman, but very relevant today. There is a big difference between open source and free software. Open source is a development methodology while free software is a social movement and "ethical imperative." I like that Stallman indicates that open source is a philosophy on "how to make software 'better' - in a practical sense only."

Thursday, November 5, 2009

How To Apply GPL v3.0 and Optionally the Classpath Exception License to Your Project

Recently, an open-source project (Mach-II Framework for CFML) I am involved with decided to change the license we use from Apache 2.0 to GPL v3.0 with Classpath Exception.  The team had many discussions on what we should change, but the the main reasons for changing to the GPLv3 License with Classpath Exception is because it allowed us to:



  • Ensure that changes made to Mach-II are contributed back to the project. We hope this will help foster and grow the community around the Mach-II project, which will benefit all Mach-II users.

  • Allow us to leverage additional existing open source libraries when needed. The GPL license and its variants are the most predominant licenses used in open source projects. With an Apache 2.0 License, Mach-II is not able to take advantage of any existing GPL code. With the GPL License, Mach-II will be able to leverage open source code released under practically any license.

  • Reduce the potential for forks and derivative projects. The development of Mach-II has required more than nine man years and nearly $700,000 of effort (based on COCOMO) to date. We want to protect that investment for the benefit of the project and our users.


Mach-II itself is not a standalone application.  It allows you to build applications on top of it and so there was a problem with switching to straight GPL because the license would stop people / companies from selling or distributing a proprietary product built on top of Mach-II.  This was a deal breaker for us and that is why we decided to use the Classpath Exception modifier available. The GPL v3.0 License is itself a copyleft license, but due to the Classpath Exception included in the new Mach-II license, all of our users are free to use unmodified versions of Mach-II in any project, whether it be open source or closed source, free or commercial.

After much internal discussion and a public call for comments, we decided all was well to proceed and apply the license to the new version of the project that will be releasing soon.  However how to do it?  I must admit that the Apache 2.0 license instructions are a bit easier to understand due to the use of bullet points instead of prose as the GPL uses.  Also, there is very little information on how the Classpath Exception modifier should be applied to the code. I had to look at the GNU Classpath project source code to see how they did it.

Things You'll Need



How to Apply GPL

1. You should bundle a copy of the GPL v3.0 your source code and executables if your application is also distributed as an executable. You should put an unmodified copy of the GPL in a file named COPYING in the root of your project.  This file should be all capitals and easy to find.  Do not nest in sub-directories.

2. Apply the notice to all source files.  This is important as bits of your project may float around the internet or an user may look at a source file but not look at the root of your project for a license.  The notice should be placed at the top of all your source text files (you may have to enclose it in some sort of comments depending on the language being used).  As in our case with Mach-II, we replaced the Apache 2.0 notice information in our source files with the GPL.  You may or may not have to do this depending on whether or not your project has been licensed under another license before.  As an aside, it would be impossible to apply this to binary files (such as images) since those files are not human readable.

The notice should contain the name of the project, copyright and copyright year(s).  Below is a template that you would need to change.  Just look for the < > placeholders:




<one line to give the program's name and a brief idea of what it does.>Copyright (C) <year(s)> <name of author or company>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.




3a. Now if you are using a Classpath Exception, you need to put that exception with the notice declaration.  For example, it would look something like this (notice the additional special exception information at the bottom of the notice):




<one line to give the program's name and a brief idea of what it does.> Copyright (C) <year(s)> <name of author or company> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.




3b. If you are using the Classpath Exception, you also need to put the exception in a file at the root of your project in a file called LICENSE. This file name should be all capitals with no file name extension.  In this file, you need to put in the exception with some other information (replace the < > placeholders where applicable):




The software in this package is distributed under the GNU General Public License (with a special exception described below).




A copy of GNU General Public License (GPL) is included in this distribution, in the file COPYING.  If you do not have the source code, it is available at:     <http://www.example.com>   Linking this library statically or dynamically with other modules is making a combined work based on this library.  Thus, the terms and conditions of the GNU General Public License cover the whole combination.As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module.  An independent module is a module which is not derived from or based on this library.  If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so.  If you do not wish to do so, delete this exception statement from your version.<name of project> also contains other (example) code distributed under other terms.  External libraries included with <name of project> may also be distributed under different licensing terms. The location and the exact terms of this other code is mentioned below if applicable.<list of other bundled code and location in distribution package here>




If you bundle other software with your code, such as build tool jars for ANT like we do, you will need to list those projects with their license name and the location within your project distribution.

4. This is purely optional, but you might consider writing FAQs in plain English about what rights an user has in the terms of GPL.  We did this because only few of us (myself not included) are geek enough to really understand the minutia of a license.  For an example, see the Mach-II License FAQs as an example.

5. Let everybody know by blogging, tweeting and talking to people that you decided to move to GPL.  You may want to reiterate their rights and why you decided to change which is a good reason to produce FAQs on the subject.

Personally, I find that the GPL is a more moral license than Apache because it protects the rights of everybody that contributes to a project.  Apache allows proprietary derivatives to be made and therefore somebody else may end up making a profit off the efforts of open source developers.  The classpath exception was important to us to because the GPL protected all the great people that contribute to Mach-II and allowed Mach-II to be distributed with close-sourced applications, but disallowed proprietary forks of the project. Plus, we can now leverage all the cool GPL code available.

6. Voila! You are done and it really is that easy.  Now, go off an woot in the glory of the GPL. It's time to celebrate, but before you do -- there are a few things you should:

Be aware of...



  • In our case, our project was released as Apache 2.0 (and 1.0 even farther back) and we just switched to GPL v3.0 with Classpath Exception.  Be aware at the GPL cannot be backdated to previous version and that previous licenses will still apply to legacy releases of your project.  The license you released under for a particular version cannot be revoked.

  • Do not just change to GPL or GPL with Classpath Exception just because Team Mach-II liked it and because we felt that open source licenses have evolved to a point where we felt it was beneficial for us to switch.  Weigh all the options carefully and involve your open source community especially if you are switching licenses after having at least one release.

  • I feel it is best to choose a common / standard license such as Apache, GPL, LGPL, etc. instead of writing your own license.  There are two reasons why this is good to choose a "commodity open source license": 1) Most companies have an approved list of licenses and therefore it may be easier for a company to use your project if they do not have to deal with the legal department. If you make it hard to start using your project, somebody might just choose a different product because it is easier. 2) A lot of the commodity licenses have had some legal attention paid to them - either in the courts or out of court deals.  Choosing a standard license gives you some prior case law in case you need to enforce your rights as a project on a license violator.


I hope this "how to" has been beneficial to you. Feel free to comment below with questions or comments.

Monday, November 2, 2009

Ubuntu 9.10 Upgrade - The Best Upgrade Experience

Last night, I upgraded my main development machine from Ubuntu 9.04 to 9.10.  Wow!  What a great experience and I'm not being facetious here.  Anybody who's ever done an upgrade on any operating system knows that upgrades tend to be a bit nail biting. I recall my first service pack 1 upgrade for Windows XP system.  Ouch!

So upgrading my Ubuntu installation was simply as easy as click upgrade and entering my system privilege password.  It took about an hour, but admittedly about 45 minutes of it downloading about 1500 packages over my slow internet connection.  The other option was to get a torrent file and that would have taken about 15 minutes to install, but I was being lazy and didn't want to fire up BitTorrent.  When it finished and it prompted me to restart my machine.  Voila! I was done -- Gossip Girl episode uninterrupted.

I was surprised by the faster boot time and barely got to see the new start up screen.  A bunch of security related changes were made including changes to how applications like CUPS are jailed via AppArmour.  However, the most interesting bundled change is the ability to encrypt your home directory:

During installation, Ubuntu 9.10 now offers the option of setting up an encrypted home directory. The technology required for this – eCryptfs, a stackable, encrypted file system that is placed on top of the home directory – has been part of Ubuntu for some time. However, the users of the distribution's desktop version previously had to set it up themselves on the command line; now, a simple mouse click during installation is all that is required
(via h-online.com)

Since I upgraded, I didn't get the option to turn on eCryptfs so I'm going to be looking to turn that on soon.  If my laptop was ever stolen, I'd like to have the peace of mind that my electronic bills and personal documents are not so easily accessed.

I haven't had the time to check out UbuntuOne which looks really cool akin to DropBox.  Looks like my LaunchPad account will be used for more than just filing tickets on Gwibber:

Ubuntu One is a new Canonical service for all Ubuntu users: It offers 2GB of free internet storage which can be used for tasks like synchronising data across multiple Ubuntu installations, making files available to other users, or simply backing up information. To take advantage of Ubuntu One, users need a Launchpad account – those who don't have one already can set up an account when first accessing Ubuntu One (under Applications/Internet in the start menu).
(via h-online.com)

So far I'm having a great Karmic Koala experience.  Now, have you thought about trying Ubuntu?  Try out a LiveCD version first to get a feel before replacing your jailed proprietary operating system with sweet satisfaction of freedom.

Not Surprised - Apple Blocks OSX on Intel Atom

In the current developer build of 10.6.2, Apple appears to have changed around a lot of CPU related information. One of the effects of this is Apple killing off Intel’s Atom chip.
(via Wired.com)

Not at all surprised that Apple is again moving to exclude people from using OSX on non-Apple approved hardware.  Looks like the franken-macintosh netbook hackers have lost on this round.

I am an open-source zealot admittedly.  I just don't get why any informed user would buy into Apple although it did take me years to get off Windows.  Unless you go open with great options like Ubuntu or CentOS, you're just buying into the next Microsoft.