Miles to go …

July 31, 2007

Transcript of Sun and Microsoft Interoperability Exchange Forum

Filed under: webservices — arungupta @ 11:00 pm

A complete transcript of the Sun/Microsoft Expert Exchange Forum is now available. And if you still have questions, feel free to post them to or Metro Forum.

Try 3 things today:

  1. Download GlassFish V2.
  2. Develop and Deploy a Reliable Web service using NetBeans IDE following this screencast (complete list).
  3. Read more details about Project Tango in this 26-page article.

Technorati: wsit metro webservices glassfish netbeans sun microsoft interoperability

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

July 30, 2007

Completed San Francisco Marathon 2007

Filed under: Running — arungupta @ 7:00 am

4 hours, 4 mins, 33 secs – yeah, that’s what it took me to complete my first San Francisco Full Marathon.

I did First Half Marathon 2 years ago and First Full Marathon last year, but this was the first Full Marathon on the hills of San Francisco. Even though I could not complete within less than 4 hours but I was happy that I took only 3 short walk breaks and maintained my pace as planned. There was San Francisco characteristic-fog all through the course with no Sun shine anywhere at all, and in a way that helped. Here is the complete breakdown from the official results (bib# 1378):

Distance » 7.5 miles Half 20.7 miles Finish
Time 1:01:35 1:48:49 3:03:12 4:04:33
Pace 8:13 8:18 8:51 9:20

Some other stats are:

Place Overall 1317 out of 4250
Men 1058 out of 2805
M 30-34 178 out of 436
Age Grade 51.38%

The fastest male runner clocked 2:25:57 and the fastest female runner was 2:43:41.

The race was very well organized and some of the highlights that I liked are:

  • The course was very well marked and the local crowd support was very supportive. This was much better than Silicon Valley Marathon last year where the course was lonely at quite a few spots. Today the course was well guided by cops or event team.
  • There were ample water stations and each station was accompanied with a medical aid staff as well. This proved out to be a boon at Mile 23 where they applied Biofreeze to my sore thighs. And there was no stopping after that at all.
  • There were music stations all through out the course and the frequency of stations increased during the last miles. This helped me maintain the rhythm closer to the stations. Kudos to all the bands for playing early in the morning.
  • National Holistic Institute, College of Massage Therapy were giving a free massage to all the runners after the race. This helped a quick recovery of my sore body parts.

With my son before Start

Start Line

Right after the Finish

In front of the Bay Bridge

2007 Finisher Pose

With my wife and son after the Finish

And lastly, my wife and 4-year old son drove me to the race early morning and cheered for me at the start and the finish line. This was the biggest morale booster!

I read it somewhere "The only thing that does not hurt after a Marathon is your Pride". And I completely felt it today right after the race and the massage turned out to be a big blessing :)

Technorati: running runsfm marathon

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

OSCON 2007 Trip Report

Filed under: web2.0 — arungupta @ 12:02 am

As reported earlier jMaki and GlassFish, along with a host of other Sun-led open source technologies (NetBeans, OpenJDK, OpenDS, Project Indiana, etc.), were present at OSCON 2007 last week. I spent my entire 2 days at the jMaki booth which had a consistent stream of visitors on both the days. In case you are interested, here is what I presented:

  • What is jMaki ?
  • Running Mashup with jMaki
  • Displaying RSS feed in jMaki widgets
  • jMaki on Rails

The videos of other demos shown at the pod will be made available on this blog in the next few days.

I could not attend any of the sessions except some of the keynote sessions on second day. Of all the keynote videos the one I’d like you to watch is Overcoming Bias by Prof Robin Hanson. The professor, an Economic Theorist, talks about how cognitive bias cause software projects to slip. Some of the quotes from his talk are "Be more honest about writing code" and "If you really care about truth, you’ll work at it and try to overcome bias".

Here are some pictures.


Sign Board

List of sponsors

Welcome Sign

jMaki and NetBeans booth

Sun booth

Sun booth

Sun booth

Marguerite @ Sun desk

Job Board

Mozilla Booth

An old friend – Tim Riley

Myself explaining jMaki

Cool give-away

OpenSolaris and OpenJDK booth

Joyent booth

Sun Microsystems in the keynote

Greg @ NetBeans booth

Ken @ GlassFish booth

Technorati: oscon sun jmaki glassfish opensolaris openjdk

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

July 27, 2007

Jaane Bhi Do Yaaron!

Filed under: General — arungupta @ 6:08 am
"Jaane Bhi Do Yaaron" in the English language means "Let It Go Friends". The Indian Film Industry (aka Bollywood) has produced one of the most hilarious movies by this name. The video snippets below from the movie are meant for readers who understand Hindi language.

Found the link through an internal alias.

 

Ahuja Drunk and Fixing D’Mello’s "car"
 
Mahabharat Climax

Technorati: movies bollywood youtube

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

jMaki – Accessing External Services

Filed under: web2.0 — arungupta @ 12:02 am

A jMaki widget in a page can communicate with:

  • Other widgets on the same page using publish/subscribe mechanism
  • Services in the application domain using service="data.jsp".
  • Services outside the application domain using proxy (xhp).

This blog entry explains how external services are accessed by jMaki widgets.

This image shows a Web application with multiple pages (Page1, Page2, Page3) where one of the page (Page2) contain at least one jMaki widget. For a BlockList widget, the generated code fragment looks like:

<a:widget name="jmaki.blockList" value="[
    {title : 'jMaki Project Home', link : 'https://ajax.dev.java.net', description : 'Where to go for the latest jMaki.' },
    {title : 'jMaki Widgets Home', link : 'https://widgets.dev.java.net', description : 'The source for the latest jMaki widgets.' },
    {title : 'jMaki-Charting Home', link : 'https://jmaki-charting.dev.java.net', description : 'Enables complex charts rendered on the client in any modern browser.' }
]" />

This code fragment populates the widget with static data specified in the value attribute. In order to populate the widget with data from an external service, such as an RSS feed, the value attribute needs to be replaced with service="/xhp?id=rss". Let me explain how that works.

If any page consists of a jMaki widget then the jMaki runtime is bundled with the application. The runtime consists of jmaki.xhp.XmlHttpProxyServlet class that maps to "/xhp" URL pattern within the application context. The id specified in the URL, "rss", is configured in a configuration file named "xhp.json". This file consists of a list of default external services that can be accessed by the widgets in a page. Each entry in this file can can be specified using up to 5 different parameters:

  • ID (required parameter, unique identifier for the entry)
  • URL (required parameter, location of external service)
  • Parameters (optional parameters specifying the default values passed to URL)
  • API Key (optional parameter to invoke the service with a specific key)
  • Stylesheet (optional parameter to process the response)

So if BlockList widget needs to access the RSS feed, then the code fragment needs to look like:

<a:widget name="jmaki.blockList" service="/xhp?id=rss" />

The corresponding entry in xhp.json is:

{"id": "rss",
    "url":"http://weblogs.java.net/blog/ludo/index.rdf",
    "xslStyleSheet": "rss.xsl"
}

The tag and the default entry tells the jMaki runtime to fetch the RSS feed from http://weblogs.java.net/blog/ludo/index.rdf, apply the ‘rss.xsl‘ stylesheet (that understand the multiple RSS/Atom formats) to the received response and convert the data into into a common JSON data format of the type "dataType" : "jMakiRSS". The BlockList widget knows how to convert jmakiRSS data to its specific data model.

This approach allows all widgets, that take a "value" attribute, to consume data from external services.

Technorati: jmaki rss services web2.0

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

July 26, 2007

jMaki “SpeedGeeking”

Filed under: web2.0 — arungupta @ 10:48 am

What is jMaki ?

If you have been following my blog, then you know it already. But a picture is worth a thousand words so here it is.

One-liner: jMaki is a light-weight framework for building Web 2.0 applications. The "j" is for JavaScript and "Maki" means to wrap in Japanese. The logo is a Kanji symbol that means to wrap.

Three key points about jMaki:

  1. Toolkits – It allows to create Ajax-enabled widgets and provide a JavaScript wrapper over widgets from existing toolkits such as Dojo, Yahoo, Script.acualo.us and many others. The key advantage is that it provides a standard data model for each widget such as DataTable, Tree and Menu. This shields the developer from dissimilar data models of these widgets from different toolkits.
  2. Languages – jMaki-enabled web applications can be deployed on the Java platform, for example Java Server Pages (JSP) or Java Server Faces (JSF). They can also be deployed on Phobos - a server-side scripting environment that runs on the Java platform. And jMaki widgets can be embedded in PHP or Rails applications. It provides a natural format to the developers’ language of choice.
  3. Tools – jMaki comes with NetBeans and Eclipse plug-ins that allow you to drag/drop widgets in a page and generate the appropriate code fragments. And for non-IDE developers, there is an Ant task that allows you to create a project with the appropriate library dependencies.

This is my "speedgeeking" @ OSCON 2007.

And for those with a "serious" interest, I’m showing how some of the cool mashups are empowered by jMaki. Couple of them are available as screencasts at:

  • Display RSS feed in jMaki widgets (running log mashup)
  • jMaki: Visually appealing Views for Rails

And more videos will be available later.

Technorati: jmaki netbeans oscon oscon07

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

July 25, 2007

Ready For San Francisco Marathon

Filed under: Running — arungupta @ 8:00 am

4 – days to San Francisco Marathon
24 – weeks of Training (including this one)
2 – weeks of Taper Down (including this one)
656 – miles of Running (excluding this week, once again jMaki helped me calculate the total mileage)
6 – long runs
4 – Personal Records (PG&E, PG&E again, 7-mile, PG&E yet again)
4 – fellow runners from Family & Friends

And I’m ready.

For friends who’d like to cheer me up in person, here is some information:

  • Course – Text-based description and RunningMap.com-based map
  • Spectator Guide (Suggested Spectator Viewing Location, Spectator Bus Options – Two spectator bus options that run in full loop around the course. You can purchase tickets online or at the registration area.)
  • Parking and Transportation
  • Street Closures and Traffic Impacts
  • And then of course, you’ll see me in the following gear (picture before last year’s run) with my bib# 1378.

For fellow runners, wish you all good luck and here are few references:

  • Packets can be picked at One Market Plaza on July 27th (11am-6pm) or 28th (9am-5pm) and find your bib# here. Race shirt is available at the Expo after packet pickup (Justin Herman Plaza).
  • Full Marathon Pace Groups are available with a finish time from varying from 3hr to 5hr 30 min. First Half and Second Half pace groups are available as well.
  • Pace Calculator – This tool calculates split times for Aid stations along the marathon course based on a desired finish time. It accounts for uphill and downhill, as well as increased fatigue that might be expected later in the race, by applying different “weights” to each section. A more generic version of this tool is available at Marathon Pace Band.

And for those whose wishes are always with me and will not be able to participate in person:

  • Live results will be available here and you’ll hear my story afterwards on this blog and whenever we meet :)

Wish me luck, my goal is to finish the marathon in less than 4 hours.

Technorati: running runsfm

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

Total Running Mileage Mashup with jMaki

Filed under: Running — arungupta @ 12:02 am

I updated the running log filter to the one given below. This allows me to generate the total running mileage of all the weeks. The changes are highlighted in this color:

jmaki.namespace("jmaki.filters");

myDays= ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];
oneDay = 24*60*60*1000;

function addDays(myDate, days) {
    return new Date(myDate.getTime() + days*24*60*60*1000);
}

function formatDate(myDate) {
    var dateString = String (myDate.getDate());
    dateString = (dateString.length == 1 ? "0" + dateString : dateString);
    return (myDate.getMonth()+1) + "/" + dateString + "/" + myDate.getFullYear();
}

// convert Running blog feed to the jMaki table format
jmaki.filters.tableModelFilter2 = function(input) {

    var startDate = new Date();
    startDate.setFullYear(2007,1,12); // Feb 12, 2007
    var _columns = [
        {title: 'Title'},
        {title: 'Day of The Week'},
        {title: 'Date'},
        {title: 'Mileage'}
    ];
    var _rows = [];

    var totalMileage = 0;
    for (var _i=0; _i < input.channel.items.length;_i++) {
        var weekNumber = input.channel.items[_i].title.split(' ')[1];
        var weekStartDate = addDays(startDate, (weekNumber-1)*7);
        var desc = input.channel.items[_i].description;
        desc = desc.slice(0, desc.lastIndexOf("</span"));
        var spanArray = desc.split("<span");
        for (var _j=1; _j < spanArray.length; _j++) {
            var span = spanArray[_j].split("</span>")[0];
            if (span.search(/run/) == -1)
                continue;

            var runDay = myDays[_j-1];
            var runDate = addDays(weekStartDate, _j-1);

            mileageInt = parseInt(dayMileage);
            totalMileage += mileageInt == "nan" ? 0 : mileageInt;
            var row = [
                'Week ' + weekNumber,
                runDay,
                formatDate(runDate),
                span.split(': ')[1]
            ];
            _rows.push(row);
        }
    }

    var summaryRow = [
        'Final Week',
        'Last Day',
        formatDate(new Date()),
        totalMileage
    ];

    _rows.push(summaryRow);
    return {type : 'jmakiModelData', columns : _columns, rows : _rows};
}

The updated web page looks like given below. Notice the first row of the table gives the total mileage:

Technorati: jmaki mashup running web2.0

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

July 24, 2007

Screencast #Web4: Creating Mashups with jMaki – Display RSS feed in jMaki Widgets

Filed under: web2.0 — arungupta @ 12:02 am
jMaki provide a flexible framework to create mashups very easily. Today, I’m starting a series of screencasts that will focus on this aspect of jMaki.

The first one in the series is a very simple mashup that pulls RSS feed from a blog entry and display it in two different widgets, without any extra effort. The NetBeans IDE is used for tooling and the jMaki-enabled Web application is deployed on GlassFish.

Enjoy it here!

The key message is jMaki + NetBeans IDE + GlassFish provides a complete platform for creating and deploying powerful mashups, quickly and effectively!

Technorati: jmaki mashups netbeans screencast glassfish jmakimashups

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

July 23, 2007

jMaki on Rails – Updated for NetBeans 6 M10

Filed under: web2.0 — arungupta @ 11:21 am

Based upon a user request, this is a follow up entry to show how jMaki on Rails For Dummies work on NetBeans 6 Milestone 10. Some of the steps are simplified and more details are provided. The updates from the previous blog entry are highlighted in this color.

  1. Download NetBeans 6.0 M10 (Full version) and configured to install only “Base IDE”, “Java IDE”, “Web and Java EE” and “Ruby” modules. A cutting-edge build can be obtained from the hudson build.
  2. Download and install jMaki plug-in in NetBeans update center.
    1. In NetBeans ‘Tools‘, ‘Plugins‘, select ‘Downloaded‘, click on ‘Add Plugins ...‘.
    2. Select the downloaded .NBM module, click on ‘Install’ button (bottom left corner). Follow the next few instructions to install jMaki plug-in and restart the IDE.
    3. To verify, go to ‘Tools‘, ‘Plugins‘, select ‘Installed‘. It should show ‘jMaki Ajax support‘ with today’s installation date.
  3. Create a new "Ruby on Rails Application" Project, lets say named ‘jmaki_ror‘. Take everything else as default.
  4. Create a new controller by right-clicking the project, select ‘Generate ...‘, select ‘controller‘, specify the Name as ‘jmaki‘ and Views as ‘yahoo‘.
  5. jMaki-enable the Rails app
    1. Right click on your Rails project, select "Rails Plugins …".
    2. Select the "Repositories" tab.
    3. Click "Add URL" and specify "http://jmaki-goodies.googlecode.com/svn/trunk/rails_plugins".  This adds the plug-in registry to the list of repositories used for searching plug-ins.
    4. Now install the jmaki runtime. Select the "New Plugins" tab .
    5. Multi-select jmaki_core and jmaki_yahoo and press "Install". Follow the instructions and the two plug-ins will be installed. After the installation is complete, you’ll see the following:

      and click on ‘Close’.

    6. Expand ‘Views‘, right-click on ‘layouts‘, select ‘New‘, select RHTML file .... Enter the ‘File Name‘ as ‘standard‘. This will add ‘standard.rhtml‘ in layouts sub-tree. Enter the following fragment before <body>:

      <head>
        <%= stylesheet_link_tag "jmaki-standard", :media => "all" -%>
        <%= javascript_include_tag "jmaki" -%>
        <%= jmaki_setup -%>
      </head>

    7. Within <body>, add the following fragment:

      <%= @content_for_layout %>

    8. In ‘Controllers‘, ‘jmaki_controller.rb‘, add the following fragment before ‘def yahoo‘ line:

      layout "standard"

  6. Download and Configure the MySQL database
    1. Download MySQL 5.0 Community Server and install by taking all the default values.
    2. In a command prompt window, Start MySQL server using the command: ‘mysqld-nt --user root‘.
    3. Create database using the command: ‘mysqladmin -u root create jmaki_ror_development‘. You need to make sure that the database name in this script is changed to match the project name.
    4. Right select the NetBeans project, select ‘Generate‘, select ‘model‘, specify the arguments as ‘grid‘, click ‘OK‘. This will generate, in NetBeans project, Database Migrations, migrate, 001_create_grids.rb.
    5. Open 001_create_grids.rb, change self.up helper method such that it looks like:

      def self.up
        create_table :grids do |t|
          t.column :company, :string
          t.column :price, :float
          t.column :change, :float
          t.column :percent_change, :float
          t.column :last_updated, :string
        end
      end 

    6. Right-select NetBeans project, select ‘Run Rake Target‘, ‘db‘, ‘migrate‘. This generates the database table.
    7. Execute the query to insert data into the table.
      1. The easiest way to run this query is to run mysql client in the command prompt window as: ‘mysql --user root‘.
      2. Enter the command as ‘use jmaki_ror_development‘ to see the following interaction:

        mysql> use jmaki_ror_development;
        Database changed

      3. And then execute the query given below:

        insert into grids values (1, 'A Co', 71.72, 0.02, 0.03, 'Jan 1, 2007, 10:00am' );
        insert into grids values (2, 'B Inc', 29.01, 0.42, 1.47, 'Feb 1, 2007, 10:00am' );
        insert into grids values (3, 'C Group Inc', 83.81, 0.28, 0.34, 'Mar 1, 2007, 10:00am' );
        insert into grids values (4, 'D Company', 52.55, 0.01, 0.02, 'Apr 1, 2007, 10:00am' );

  7. Add jMaki-wrapped Yahoo DataTable widget
    1. In NetBeans project, in ‘Views‘, ‘jmaki‘, ‘yahoo.rhtml‘, drag-and-drop ‘Data Table‘ widget from the ‘Yahoo‘ category of jMaki palette.
      1. Until the jMaki data model for grid and data widgets is consistent between Java and JRuby, you need to replace the generated code in ‘yahoo.rhtml‘ with the following:

        <%= jmaki_widget 'yahoo.dataTable',
            :args => {
                :columns => [
                    { :title => 'Company', :width => 200, :locked => false },
                    { :title => 'Price', :width => 75, :renderer => 'usMoney' },
                    { :title => 'Change', :width => 75, :renderer => 'change' },
                    { :title => '% Change', :width => 75, :renderer => 'pctChange' },
                    { :title => 'Last Updated', :width => 85, :renderer => 'italic' }
                ]
            },
        :value => @table_data
        -%>

      2. @t
        able_data
        ‘ is defined in ‘jmaki_controller‘ in ‘def yahoo‘ as:

        def yahoo
            @table_data = []
            Grid.find_all().each do |data|
              @table_data << [ data.company, data.price, data.change, data.percent_change, data.last_updated]
            end
        end

  8. That’s it, run your app and view the page at ‘http://localhost:3000/jmaki/yahoo‘. Now jMaki-wrapped Yahoo DataTable widget is picking data from the MySQL database. 

And as a next step, you can WAR’up this RoR application and deploy it on GlassFish V2 using these instructions.

Technorati: jmaki rubyonrails ror netbeans mysql glassfish

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Older Posts »

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress