Archive for January, 2010


Ruby and Rails….The Developers Choice….

January 31, 2010

The Rails framework is built using the Ruby programming language, and a better understanding of Ruby is essential to mastering Rails.The Rails framework is composed of several different Ruby libraries. Rails is a full stack framework , which means it contains all the tools needed to get a basic application up and running. The Rails stack is split into various components that we’ll often refer to by name.

Installation is different on various platforms , and there are some great packages that simplify the Rails install process. You can find the most up to date install process on the Rails download page. Although often thought of as a single unit , Ruby and Rails are two separate packages. Rails is a framework written in the Ruby language, not unlike frameworks such as Cake and the Zend framework in PHP. To get Rails working , your first step will be to get Ruby installed on your machine. I recommend installing Ruby version 1.8.6 or newer. Once you have Ruby installed , we have to take a quick look at package management in Ruby. The most common method of distribution for Ruby packages and libraries is through RubyGems. RubyGems is a package manager similar to PEAR for PHP , and Rails is most easily installed on your computer through gem. I recommend installing RubyGems 1.0.1 or newer , which you can download from the Ruby Forge website.

Rails is an opiniated web framework , and one of the opinions is that you will use Subversion. Doing so will reward you with nice features of Rails that integrate well with Subversion.Knowledge of Subversion will come in handy while deploying your application , installing third party plug ins ,and submitting patches to Rails itself if you decide to contribute to Rails.

David Heinemeier Hansson extracted Rails from an application he wrote for his company , 37signals. He released it as open source in 2004 , and there is now a group of developers on the core team actively applying features and patches to Rails. David’s original framework actually began in PHP , but he later found Ruby to be a much better fit for what he needed to do.

Rails is a web-application framework that includes everything needed to create database-backed web applications according to the Model-View-Control pattern.

This pattern splits the view (also called the presentation) into “dumb” templates that are primarily responsible for inserting pre-built data in between HTML tags. The model contains the “smart” domain objects (such as Account, Product, Person, Post) that holds all the business logic and knows how to persist themselves to a database. The controller handles the incoming requests (such as Save New Account, Update Product, Show Post) by manipulating the model and directing data to the view.

In Rails, the model is handled by what‘s called an object-relational mapping layer entitled Active Record. This layer allows you to present the data from database rows as objects and embellish these data objects with business logic methods. You can read more about Active Record in  files/vendor/rails/activerecord/README.html.

The controller and view are handled by the Action Pack, which handles both layers by its two parts: Action View and Action Controller. These two layers are bundled in a single package due to their heavy interdependence. This is unlike the relationship between the Active Record and Action Pack that is much more separate. Each of these packages can be used independently outside of Rails. You can read more about Action Pack in files/vendor/rails/activerecord/README.html.


Subversion Review…..

January 23, 2010

In software development, Subversion (SVN) is a version-control system initiated in 1999 by CollabNet Inc. Developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly-compatible successor to the widely used Concurrent Versions System (CVS).

The open source community has used Subversion widely: for example in projects such as Apache Software Foundation, Free Pascal, FreeBSD, GCC, Django, Ruby, Mono, SourceForge, ExtJS,, PHP and MediaWiki. Google Code also provides Subversion hosting for their open source projects. BountySource systems use it exclusively. CodePlex offers access to Subversion as well as to other types of clients.

The corporate world has also started to adopt Subversion. A 2007 report by Forrester Research recognized Subversion as the sole leader in the Standalone Software Configuration Management (SCM) category and as a strong performer in the Software Configuration and Change Management (SCCM) category.[1]

Subversion uses the Apache License, making it open source.


  • Commits as true atomic operations (interrupted commit operations would otherwise cause repository inconsistency or corruption).
  • Renamed/copied/moved/removed files retain full revision history.
  • The system maintains versioning for directories, renames, and file metadata (but not for timestamps). Users can move and/or copy entire directory-trees very quickly, while retaining full revision history.
  • Versioning of symbolic links.
  • Native support for binary files, with space-efficient binary-diff storage.
  • Apache HTTP Server as network server, WebDAV/Delta-V for protocol. There is also an independent server process called svnserve that uses a custom protocol over TCP/IP.
  • Branching and tagging as cheap operations, independent of file size (though Subversion itself does not distinguish between a tag, a branch, and a directory)
  • Natively client/server, layered library design.
  • Client/server protocol sends diffs in both directions.
  • Costs proportional to change size, not to data size.
  • Parsable output, including XML log output.
  • Open source licensed — Apache License in the projected 1.7 release; prior versions use a derivative of the Apache Software License, v1.1
  • Internationalized program messages.
  • File locking for unmergeable files (“reserved checkouts”).
  • Path-based authorization.
  • Language bindings for PHP, Python, Perl, and Java.
  • Full MIME support – users can view or change the MIME type of each file, with the software knowing which MIME types can have their differences from previous versions shown.

Development and implementation

Main article: Software that uses Subversion

CollabNet has continued its involvement with Subversion, but the project runs as an independent open source community. In November 2009 the project was accepted into the Apache Incubator, aiming to become part of the Apache Software Foundation‘s efforts [20].

In October 2009 WANdisco announced the hiring of core Subversion committers as the company moved to become a major corporate sponsor of the project. This included Hyrum Wright, president of the Subversion Corporation and release manager for the Subversion project since early 2008, who joined the company to lead its open source team[21].

The Subversion open-source community does not provide binaries, but potential users can download such from volunteers, from CollabNet, the initiator of the Subversion project or WANdisco. While the Subversion project does not include an official graphical user interface (GUI) for use with Subversion, third parties have developed a number of different GUIs, along with a wide variety of additional ancillary software.


Svn 3D-tree.svg

One can view the Subversion filesystem as “three dimensional”. In addition to the two dimensions of a standard directory tree (e.g., tree view), the Subversion filesystem’s third dimension is revisions. Each revision in a Subversion filesystem has its own root, which is used to access contents at that revision. Files are stored as links to the most recent change; thus a Subversion repository is quite compact. The system consumes storage space proportional to the number of changes made, not to the number of revisions.

The Subversion filesystem uses transactions to keep changes atomic. A transaction operates on a specified revision of the filesystem, not necessarily the latest. The transaction has its own root, on which changes are made. It is then either committed and becomes the latest revision, or is aborted. The transaction is actually a long-lived filesystem object; a client does not need to commit or abort a transaction itself, rather it can also begin a transaction, exit, and then can re-open the transaction and continue using it. Multiple clients can access the same transaction and work together on an atomic change.


Open MP review….

January 16, 2010

Open MP (Open Multi Processing ) is an open standard for writing shared memory parallel programming in C, C++ and Fortran, in the form of mainly compiler directives, library routines and environtment variables. This open standard is supported by multiple architectures/platform including UNIX/Linux and Windows NT.

Open MP follows the fork-join parallel execution model.An Open MP program starts its execution as a single thread (called initial

thread) and assumes the execution sequentially . This sequential program gradually evolves as a parallel program , as a `team of threads` is created when the master (or initial) thread comes across a parallel construct in the code to share the workload.Each task is assigned and tied to a different thread in the team. At the end of the parallel construct , all threads syncronise and get terminated. Only the master thread continues the further execution. Within a single program , you can mark any number of parallel construct.

When any thread team encounters a work sharing construct, the work inside the construct is offloaded and distributed among its members, and gets executed cooperatively, instead of the whole work being executed by every thread, multiple times. Each thread just has its portion of work, which it executes synchronously.


What’s new in Linux 2.6.32

January 9, 2010

3D support for newer Radeon graphics chips, better use of power saving features offered by the latest hardware and numerous enhancements to KVM and Btrfs are some of the outstanding items among the many thousands of changes undertaken for the latest kernel version. Various other improvements should also make Linux 2.6.32 more reactive and as a result, feel faster.

Nearly three months after the release of Linux kernel 2.6.31, Linus Torvalds has now put the lid on Linux 2.6.32 development. Like its predecessors in the main development tree, the new version includes a plethora of new features. The close collaboration between AMD’s graphics chip department and the open source community has borne further fruit, with Linux 2.6.32 now enabling 3D support and kernel-based mode setting (KMS) on the widely-used Radeon 2000, 3000 and 4000 series graphics cards.

Also new in Linux 2.6.32 is KSM, which merges identical memory pages from different userland processes to reduce memory usage in virtualised environments and make more efficient use of hardware. Devtmpfs should mean that the Linux kernel boots faster and no longer requires udev, while new make targets will allow testers to easily generate kernel configurations adapted to their systems.

There is also now support for Intel’s Moorestown platform, SFI (its alternative to ACPI), ACPI 4.0 and Trusted Execution Technology (TXT – previously known as ‘LaGrande’) Some major changes to the power management code lay the foundations for making better use of runtime power saving features on modern I/O devices. Various enhancements to the Cpuidle framework, the block layer and Btrfs also offer hope of higher data throughput rates. Linux 2.6.32 should not only allow PCs to push more data around, it should also feel faster, with changes to the block layer and the process scheduler promising better reactivity.

The Kernel Log which follows gives an overview of these and many other changes in the newly released Linux kernel. Even those Linux users who take little interest in their Linux distribution’s kernel will also eventually benefit from these changes, as future distributions will utilise Linux 2.6.32 or its successors.


The kernel and its Direct Rendering Manager (DRM) will now offer 3D support and kernel-based mode setting (KMS) for AMD’s series R600 and R700 GPUs. These are used in the Radeon series 2000, 3000 and 4000 models – which includes most of the Radeon graphics cards sold in the past couple of years as well as various AMD series 700 motherboard chip-sets. For the 3D support and KMS to function, however, suitable (developer) versions of Libdrm and Mesa 3D as well as Radeon graphics drivers for need to be installed. Compiling this software stack is a task for advanced users – the recently released Fedora 12 already has everything needed, post install only the experimental Mesa support must be added from the repositories.

The “video=” parameter in the KMS code can now be used for setting a specific output screen resolution for either individual monitors, or for all monitors. The Intel KMS code will now compress the frame buffer, which reportedly reduces power consumption by up to 0.5 watts; in addition, the new “Dynamic Clock Frequency Control” feature is intended to further reduce power consumption by reducing the LCD refresh rate, the memory’s self refresh and the clock rate to prolong notebook battery life.

The kernel hackers have also integrated the VGA arbitration patches (1, 2, documentation). In systems with several graphics cards, the patches cooperate with X Servers from version 1.7 to ensure that the respective graphics card will actually receive the VGA commands sent to it by the X Server – which reportedly allows much more flexibility when implementing multi-seat environments.