Archive for January 2009
Eric Wendelin wrote:
I often use shell scripts to automate mundane, repeatable tasks on my computer. Since I’ve found Groovy, though, I have discovered a great way to make writing those scripts easier and more enjoyable. This is especially true if I have anything complex to do, and it saves me a LOT of time.
I couldn’t agree more. Also, I’m quite impressed how easy is to operate on an XML document with Groovy.
The Java platform will be celebrating its 14th birthday soon and one side-effect when a successful and ubiquitous language reaches this kind of milestone is the widespread proliferation of libraries, tools and ideas. In this article, Ted Neward tacks through the vast tides and presents a list of the key resources any up-and-coming Java developer should have.
During his keynote presentation at OSCON last year, Ubuntu founder Mark Shuttleworth described application extensibility as an important enabler of innovation and user empowerment. Citing the Firefox web browser and its rich ecosystem of add-ons as an example, Shuttleworth suggested that the Linux community could deliver a lot of extra value by making scriptable automation and plugin capabilities available pervasively across the entire desktop stack.
Mark Shuttleworth also described his strategy for accelerating the adoption of Linux. He discussed the importance of extensibility in open platforms, contemplated the challenges of adapting conventional software methodologies so that they can be used for community-driven development, and contended that the open source software community has the potential to deliver a user experience which exceeds that of Apple’s Mac OS X platform.
There’s a wide misconception that today’s technology and software have grown so complex that it’s impossible to teach children how to program them. Nonsense. “Snake Wrangling for Kids” is a printable electronic book, for children 8 years and older, who would like to learn computer programming. Written by Jason Briggs, the book covers the very basics of programming, and uses the Python 3 programming language to teach the concepts. There are 3 different versions of the book, one for Mac, one for Linux and one for Windows.
Jason Briggs is a writer with over 15 years experience in the IT industry. He has written for ONJava, ONLamp, Java Developers Journal, JavaWorld and Linux Devices, and worked on projects for clients such as HSBC Investment Bank UK.
I looked through this blog’s statistics to find out which posts got the most page views in 2008. Here are the top 10 posts:
- 30 Useful PHP Classes and Components
- Where is the include coming from?
- Open-source PHP applications that changed the world
- 10 great articles for optimizing MySQL queries
- 20 MediaWiki Extensions You Should Be Using
- Zend Framework Architecture
- Loading models within modules in the Zend Framework
- Scalable and Flexible Directory Structure for Web Applications
- BBC’s New Infrastructure: Java and PHP
- Code Refactoring Guidelines
Each post was written for a reason. “Open-source applications that changed the world” is my favourite one. It not only brings back good memories, but also shows our commitment to the open-source community and our passion for developing and supporting open-source software. Zend Framework was the most popular Web application in 2008. Yes, Dow Jones, HSBC and even the BBC is using it. In case you haven’t notice, I spent the last 12 months promoting the Zend Framework, reason why it gets mentioned in 6 of the posts. I’m also glad that “Code Refactoring Guidelines” made it to the top 10. It shows that the PHP community cares.
Among the branching models used in software configuration management, the branch-by-purpose model offers better support for parallel development efforts and improved control of both planned and emergency software releases. If you want to improve software quality, you must first understand your software. What are its pieces? How are they organized and related to one another? If you do not understand your code base, your odds of updating it without breaking something are poor.
Jetty Web server can be invoked and installed as a stand alone application server. It has a flexible component based architecture that allows it to be easily deployed and integrated in a diverse range of instances. The project is supported by a growing community and a team with a history of being responsive to innovations and changing requirements. More info here.
First you need to download Jetty. It’s distributed as a platform independent zip file containing source, javadocs and binaries. The most recent distro can be downloaded from Codehaus:
$ wget http://dist.codehaus.org/jetty/jetty-6.1.14/jetty-6.1.14.zip $ unzip jetty-6.1.14.zip $ cp -R jetty-6.1.14 /opt/ $ cd /opt $ ln -s /opt/jetty-6.1.14 jetty
Problems installing Jetty? More info here.
Running jetty is as simple as going to your jetty installation directory and typing:
$ cd /opt/jetty $ java -jar start.jar etc/jetty.xml
This will start jetty and deploy a demo application available at:
That’s it. Now stop Jetty with cntrl-c in the same terminal window as you started it.
Quercus is a complete implementation of the PHP language and libraries in Java. It gives both Java and PHP developers a fast, safe, and powerful alternative to the standard PHP interpreter. Quercus is available for download as a WAR file which can be easily deployed on Jetty:
$ wget -P ~/quercus http://quercus.caucho.com/download/quercus-3.2.1.war $ jar xf ~/quercus/quercus-3.2.1.war
Unpack the WAR file and copy all the jars to Jetty’s global library directory:
$ cp ~/quercus/WEB-INF/lib/* /opt/jetty/lib
Edit the web.xml file:
$ vi /opt/jetty/webapps/test/WEB-INF/web.xml
Add the following between the web-app tags:
<servlet> <servlet-name>Quercus Servlet</servlet-name> <servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Quercus Servlet</servlet-name> <url-pattern>*.php</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.php</welcome-file> <welcome-file>index.jsp</welcome-file> </welcome-file-list>
Create a PHP file inside the test application:
$ cat /opt/jetty/webapps/test/index.php <?php phpinfo(); ?>
This file will be available at:
It works! You are now ready to:
Instantiate objects by class name
<?php $a = new Java("java.util.Date", 123); print $a->time;
<?php import java.util.Date; $a = new Date(123); print $a->time;
Call Java methods
<?php import java.util.Date; $a = new Date(123); print $a->getTime(); print $a->setTime(456); print $a->time; $a->time = 456;
And much, much more.
Based on Stuart Langridge’s original script, Jason Field and Bruce van der Kooij created a set of Python scripts which integrate a load of Subversion functionality into the Gnome Nautilus browser. It’s basically a clone of the TortoiseSVN project on Windows.
NautilusSVN currently supports the following functionality:
- Diff (using Meld or gvimdiff)
- Log Viewer
- Revision and SVN User as columns in Nautilus views
- Emblems to show file status (though buggy)
- SSL authentication (buggy)
- Username and password entry dialog
- Editing Properties
Pádraic Brady announced the release of his online book: “Zend Framework: Surviving The Deep End”. Chapter 1, the Introduction, is first on the menu to open the new year. According to Pádraic, the next chapter should turn up within a few days. The book is still a work in progress. What’s cool about this site is that it allows you to comment on each paragraph.
The book is available online without charge. Of course, you are more than welcome to make a donation.