Archive for the 'technology' Category

PHP/MySQL Basics

August 1, 2009

Basic SQL Commands:

    mysql> show databases;
    mysql> use [db name];
    mysql> show tables;
    mysql> describe [table name];
    mysql> DELETE from [table name] where [field name] = ‘whatever’;
    mysql> create database [databasename];
    mysql> drop database [database name];
    mysql> drop table [table name];
    mysql> SELECT * FROM [table name];
    mysql> show columns from [table name];
    mysql> SELECT * FROM [table name] WHERE [field name] = “whatever”;
    mysql> SELECT COUNT(*) FROM [table name];
    mysql> SELECT SUM(*) FROM [table name];mysql> INSERT INTO user (Host,User,Password) VALUES(‘%’,’username’,PASSWORD(‘password’));
    mysql> flush privileges;

    # mysqladmin -u root password newpassword

* to do: create a function to dump db connectivity details 🙂

<Form action=”contact.php” method=”post”>
First Name: <input type=”text” name=”fname” />
Last Name : <input type=”text” name=”lname” />
<input type = “submit” name = “submit” value = “Echo Values” />
<input type = “submit” name = “update_db” value = “Update Database” />
<input type = “submit” name = “display_db” value = “Display Records” />

if (isset($_POST[‘submit’]))
echo ‘Your First Name Is: ‘.$_POST[‘fname’].'<br />’;
echo ‘Your Last  Name Is: ‘.$_POST[‘lname’].'<br />’;

// mail(‘’,’PHP mails’,$_POST[‘fname’].$_POST[‘lname’],’ayanthi’);

if (isset($_POST[‘update_db’]))

$host = “localhost”;
$username = “root”;
$password = “”;
$db_name = “contact”;
$tbl_name = “contact_details”;
$fname = $_POST[‘fname’];
$lname = $_POST[‘lname’];

$con = mysql_connect(“$host”, “$username”, “$password”) or die(“cannot connect”);
if (!$con)
die(“could not connect: ” .  mysql_error());

mysql_select_db(“$db_name”) or die(“cannot select DB”);

$insert_query = “insert into $tbl_name values(‘$fname’, ‘$lname’)”;
$result = mysql_query($insert_query);

if ($result != 1)
echo “insert fail”;


if (isset($_POST[‘display_db’]))

$host = “localhost”;
$username = “root”;
$password = “”;
$db_name = “contact”;
$tbl_name = “contact_details”;
$fname = $_POST[‘fname’];
$lname = $_POST[‘lname’];

$con = mysql_connect(“$host”, “$username”, “$password”) or die(“cannot connect”);
if (!$con)
die(“could not connect: ” .  mysql_error());

mysql_select_db(“$db_name”) or die(“cannot select DB”);

$select_query = “select * from $tbl_name”;
$result = mysql_query($select_query);

while ($newArray = mysql_fetch_array($result))
$first_name = $newArray[‘first_name’];
$last_name = $newArray[‘last_name’];
echo $first_name.” “.$last_name.'<br />’;



Drupal Drupal Drupal Drupal Dru-pal…!!

July 27, 2009

Came across an interesting interview with Dries Buytaert (Founder, Drupal CMS), in which he talks about Drupal readiness for the cloud computing age.
Didn’t realize there was commercial support for the open source content management system with the company Dries co-founded Acquia. Basically, this is a distribution that Acquia does the work to determine which modules and their version are ready for general inclusion across a couple of thousand of Drupal modules available. It is much the same way a Red Hat as a Linux vendor decides what’s going the Red Hat distro.

“We track and improve the stability, security, and scalability of their modules, we do integration testing to make sure they work well with other modules, we provide configuration support, module selection advice, and so on. In other words, we make sure that our customers are set up for long-term success with Drupal.”, Dries says.

“Instead of generating pages with very few semantic clues, I do think we have an opportunity to turn the Internet into what behaves essentially as a very large database that is very easy to access and parse using crawlers, search engines, and so forth. That’s a tremendous opportunity.”
It sure looks like interoperability, data portability and semantic technologies are set to revolutionize the world in the cloud era.

Last, but not lease – didn’t realize Drupal has such a cool theme song! This one’s a blast!!

Drupal on Mac

May 9, 2009

Tried and tested, here are the steps:

  1. Download MAMP (Macintosh, Apache, Mysql and PHP) and is the Apache, PHP and MySQL stack for Mac OS X!
  2. Download latest Drupal (6.11 as of today)
  3. Install MAMP by
    • double-clicking the zip file do to extract the dmg file.
    • double clicking on the dmg file to mount it.
    • move the resulting MAMP folder into the applications folder, and unmount the disk image.
  4. Now, prepare for Drupal installation by following the steps below:
    • double-clicking the zip file do to extract the dmg file.
    • double clicking on the dmg file to mount it.
    • move the resulting Drupal folder into the applications folder.
    • you could alternatively rename the folder to drupal by removing version numbers.
  5. Start MAMP, by selecting the MAMP favicon for the application (found in ~/applications/MAMP/). Both Apache and MySQL servers should be running with green lights on.
  6. Point the browser to http://localhost:8888/MAMP/drupal/ and you are ready to go.
  7. Make sure to verify requirements displayed on the initial screens (relating to renaming the default.settings.php to settings.php and increasing PHP memory limit) along the way.

Wanna Write In Sinhala?

May 8, 2009

සිංහලෙන් ලියමු.

    Install a sinhala font. On MacOS X, just drop the font in ~/library/font folder.
    Install FireFox Plugin Sinhala Transliteration
    Use F8 to toggle language
    As you type, browser will display text in Sinhala. Off you go!

Podcast: Enterprise Use of Mashups and Upcoming WSO2 Mashup Server Release

May 5, 2009

In mashup 2.0 podcast, Keith Chapman talks to OxygenTank on the role of mashups in an enterprise setting and the upcoming componentized release of the WSO2 Mashup Server.

OSGi, Componentization, Virtualization and Dashboards

May 1, 2009

In yesterday’s Web panel discussion, WSO2’s Paul Fremantle and Sanjiva Weerawarana did a brilliant job answering questions from audience on contemporary topics in relation to SOA, middleware and the WSO2 stack. Initial discussion covered ground on the OSGi hype, WSO2’s adoption of the OSGi technology with its release of WSO2 Carbon, and its limitations. Sanjiva stated that pragmatic Carbon installations tends to take off with the adoption of a single product, which is then extended as per additional needs – rather than an installation that begins with the Carbon core, an enhanced with components. This seems more evident when we dive into popularus use cases driving middleware componentization. They are:

  • those who do not want to run separate products in multiple server instances in order to get a job done.
  • users who were frustrated with having to make a all-or-non decision taking on propriety middleware solutions – which meant they’d have to throw away all of their existing middleware in order to accommodate a new vendor.

The value of componentization, as Sanjiva pointed out, does not stop there. In fact, componentization has enabled innovative combinations of components in customer sites, that’s fused much more value added usage of WSO2 middleware, that was not envisioned at the point these compoenents were written. This to me is one of the greatest joys of technology. To watch new technology come out of research is certainly exciting, however, it is much more exciting to see the actual usage of a technology as it reaches the end users, which at time is far more outreaching that the technology initially planned. These innovative use cases then fuels additional research in that area of technology adoption.

Enforcing this cycle more rapidly means, there is constant feedback that results in continuous improvement to the technology in question. It is the value proposition behind the concept “release early, release often“.

As Paul and Sanjiva pointed out, componentization fits in very well with cloud computing and on-demand computing arena, in which users try squeeze in more and more value out of a single instance. With multiple virtualized platforms sitting in a single instance, virtualization stands to benefit greatly from componentization that leaves out having to live with fat and bloated solutions in cloud instances that would takes up considerable administrative efforts related to management and scalability.
On the cloud front, Sanjiva also emphasized the need to go a step forward from simply using it to host applications, which on its own clearly have merits, to actually host applications that are componentized. He referred to these as appliances – application component configurations that are assembled to meet very specific usage requirement,  reducing the total foot print of the installation. Along the same path, Paul mentioned that cloud computing with componentization could actually make the running of a data center a lot more efficient. They revealed WSO2 plans to offer its entire middleware stack on Amazon and Eucalyptus cloud infrastructures, just this same way.

In the presentation frontier, Paul mentioned WSO2 efforts in building a Carbon UI. He illustrated the the need for a business health monitoring portal requirement within an SOA. Such a system would then alert the health status of component deployments while exposing services that are otherwise distributed. A JSR-168 and iGoogle compatible personalized and componentized UI server solution is already in WSO2 agenda.

What Componentization Means For Your Enterprise SOA

April 29, 2009

Componentization of Service Oriented Architecture (SOA) middleware holds the promise to significantly simplify service oriented architecture deployments. By implementing interlocking functional components rather than disparate products, enterprises and their IT teams can greatly reduce time and resources required to learn, integrate and manage multiple solutions. However, there is still a great deal of confusion about this emerging approach to SOAs.

WSO2 has set a new milestone with WSO2 Carbon, the industry’s first fully componentized SOA framework. IT developers now can choose to use components rather than entire products, for example, a mediation component instead of a full enterprise service bus to customize deployments and seamlessly add product capabilities as their implementations grow. WSO2 has developed a brief slideshare presentation and an eBook to explain the architectural concepts behind Carbon. Both can be accessed from the WSO2 Oxygen Tank developer portal.

Web services pioneers at WSO2, will host a live interactive Web panel discussion on best practices, and also to answer participants’ questions on how a componentized approach to SOAs can help enterprises become more agile and effective.

Topic: “What does componentization really mean for your SOA?”
When: Thursday, April 30, 9:00-10:00 a.m. Pacific / 12:00-1:00 p.m. Eastern
Where: Via the Web at or by phone at (724) 444-7444, Call ID: 48043

Simplenews: Newsletter Module for Drupal

April 27, 2009

We use the Drupal module Simplenews for sending out our monthly OxygenTank newsletters.
If you are considering e-mail campaign using the any newsletter module, make sure to read this guide to learn about How Spam Filters Think.

Administration and Newsletter Creation Using Simplenews
Compatible with the Drupal Taxonomy module, Simplenews makes a ‘newsletter’ category of content to allow author newsletter issues. Content in this category is sent as email (a configurable cron is available for large, >500, message sets), in addition to publishing it on the hosted site.


  • Test newsletters issues can be sent to a mailing list prior to the final issue.
  • Newsletter issues can be looked at filtered by newsletter, draft or send status
  • Logged in users are able to manage their newsletter subscriptions through account settings.
  • Newsletters can be sent as plain text or HTML. HTML formatted newsletters require the Mime Mail module.
  • Subscription list can be filtered based on newsletter
  • Subscription list management between newsletters is also available.

Statistics Monitoring
Since our initial efforts we have been quite eager to find out how effective our newsletter issues have been and was looking for options to figure out open rates, click-through rates, click-to-open rates (CTOR) etc.
Just realized that there’s a couple of Drupal modules that perform related tasks:

  1. Simplenews Statistics – gather newsletter statistics such as open rate and click-through rates (CTR)
  2. Simplenews Analytics – adds Google Analytics tags to links in all Simplenews emails

Additionally, it of course is free and open source.

WSO2 Rapid Fire QA Video Blast

April 17, 2009

In this session of RFQA Paul talks about WSO2 and what makes this open source company unique.

All about the app server, high availability, clustering, the future of UIs and more

In this episode of Rapid Fire Q&A with Paul Fremantle, we uncover how WSO2 competes with the big guys like Oracle, whats different about the WSO2 App Server, how WSO2 deals with high availability and clustering, as well as get an insight on the future of Web UIs.

Paul talks about SOA, OSGi, Web services vs. Rest and Cloud Computing

Presentation at SOA Symposium: Scalable SOA in Your Own Open Source Cloud

April 17, 2009

Just before the April break, Dr. Sanjiva Weerawarana did a presentation on setting up open source SOA cloud platforms to eliminate current proprietary vendor solutions. It was presented at the SOA symposium that was held in Arlington, VA.

“Cloud computing is primarily about three things: on-demand scaling for peak load management, multi-tenant sharing, and parallel execution. On-demand scaling refers to the ability of the cloud to allow an application to consume more resources as the demand on the application increases and for this to happen without over participation from the developer. Multi-tenancy relates to how a single application can be shared and used securely (and independently) by different consumers. Finally, parallel execution enables an application to request additional hardware and to execute in the entire set of nodes as a parallel computer. The most challenging part of the puzzle is providing a single programming model for application developers.”

“Proprietary clouds such as Amazon EC2, Google AppEngine and Microsoft Azure do offer many of these capabilities. However, signing up to a proprietary cloud is like checking into the proverbial Hotel California: “You can check out but you can never leave!” During this presentation we will look at how a collection of open source components can be combined to form an open source cloud that addresses all aspects of cloud computing but that also leverages open standards to establish a model whereby applications running on open source clouds can fully interoperate with other cloud platforms as well.”

“The US DoD has embarked on a path to implementation of SOA as a primary means to deliver increased capability by improving the efficiency and effectiveness of business operations.”
The conference and workshop consisted of top SOA experts representing industry, government, and vendors. The following slides are from Sanjiva’s presentation.