Compile Ruby on Solaris 10

I downloaded ruby-1.9.1-p243 and gunzip/tar’ed it. When doing

./configure -prefix=/usr/bin -enable-pthread; make; make install

(BTW, I should have used /usr as bin dir is implied in the build)

[note: Second time when I did it, I ran the following command to compile ruby in Solaris 10:

./configure --enable-pthread --prefix=/usr --exec-prefix=/usr
make
make install

--enable-pthread is not needed if your tck/tl did not compile with this option.
]

It spits error like “no output file specified”. Looking into the C codesm under lib, I chnaged several lines in mkmf.rb, which solved the problem. The chnaged line as reflected in diff:

/home/ror/ruby-1.9.1-p243# diff lib/mkmf.rb lib/mkmf.rb.orig
1918,1919c1918,1919
< COMPILE_C = config_string(‘COMPILE_C’) || ‘$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG) $@ -c $<‘
< COMPILE_CXX = config_string(‘COMPILE_CXX’) || ‘$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG) $@ -c $<‘

> COMPILE_C = config_string(‘COMPILE_C’) || ‘$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<‘
> COMPILE_CXX = config_string(‘COMPILE_CXX’) || ‘$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<‘
1921c1921
<   “$(CC) #{OUTFLAG} conftest $(INCFLAGS) $(CPPFLAGS) ” \

>   “$(CC) #{OUTFLAG}conftest $(INCFLAGS) $(CPPFLAGS) ” \

/home/ror/ruby-1.9.1-p243# uname -a
SunOS zone100-246 5.11 snv_79a sun4v sparc SUNW,Sun-Fire-T200

Did a sym link to make ruby in PATH again:

ln -s bin/ruby ruby

Now I have the newest ruby on Solaris!

:/home/ror/ruby-1.9.1-p243# /usr/bin/bin/ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [sparc-solaris2.11]

Click Framework And Jsp: Notes

ClickFrameworkAndJsp

===========
Rendered page example:
http://www.avoka.com/click-examples/jsp/customer-table.htm
Source:
http://www.avoka.com/click-examples/source-viewer.htm?filename=/jsp/customer-table.htm

customer-table.jsp (src code) ==============>when accessing from browser: it should be accessed AS

customer-table.htm—this auto mapped to

customer-table.jsp-map to

CustomerTable.java

(if accessing it as .jsp, page is not rendered correctly)

This will first invoke customer-table.jsp,

-then invoke CustomerTable.java

-then invoke border-template.jsp as indicated in getTemplate method in above .java

– then render customer-table.htm (mapped to .jsp) via ${forward} in border-template.jsp when rendering border-template.jsp

(template is also a .jsp file.

…………….

<%@taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core”%>
<%@taglib prefix=”fmt” uri=”http://java.sun.com/jsp/jstl/fmt”%>

<style type=”text/css”>
th { color: white; }
</style>

<p>
Example JSP customers table.
</p>

<table style=”border: 1px solid black;” cellpadding=”6″ cellspacing=”0″>
<tr valign=”baseline” bgcolor=”404060″>
<th align=”center”> ID </th>
<th align=”left”> Name </th>
<th align=”left”> Email </th>
<th align=”center”> Age </th>
<th align=”left”> Category </th>
<th align=”center”> Portfolio </th>
<th align=”right”> Date Joined </th>
<th align=”center”> Active </th>
</tr>

<c:forEach var=”customer” items=”${customers}” varStatus=”lineInfo”>

<c:choose>
<c:when test=”${lineInfo.count % 2 == 0}”> <tr bgcolor=”#f7f7e7″> </c:when>
<c:otherwise> <tr bgcolor=”white”> </c:otherwise>
</c:choose>

<td align=”center”> ${customer.id} </td>
<td align=”left”> ${customer.name} </td>
<td align=”left”> <a href=”${customer.email}”>${customer.email}</a> </td>
<td align=”center”> ${customer.age} </td>
<td align=”left”> ${customer.investments} </td>
<td align=”right”> <fmt:formatNumber value=”${customer.holdings}” type=”currency”/></td>
<td align=”right”> <fmt:formatDate value=”${customer.dateJoined}” pattern=”dd MMM yyyy”/> </td>

<td align=”center”>
<c:choose>
<c:when test=”${customer.active}”> <input type=”checkbox” checked=”checked”/> </c:when>
<c:otherwise> <input type=”checkbox”/> </c:otherwise>
</c:choose>
</td>

</tr>

</c:forEach>

</table>

<p>&nbsp;</p>

The <tt>CustomerTable</tt> page is automatically mapped to the request:

<pre class=”codeConfig”>
GET customer-table.htm </pre>

When pages are configured to use automapping the <tt>ClickServlet</tt>
will automatically associated the file path <tt>customer-table.jsp</tt>
with the page class <tt>CustomerTable</tt>.

===========
http://www.avoka.com/click-examples/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/page/jsp/CustomerTable.java

package org.apache.click.examples.page.jsp;

import java.util.List;

import org.apache.click.examples.page.BorderPage;

/**
* Provides JSP Page example where a JSP page and JSP border template is used to
* render a table.
*
* @author Malcolm Edgar
*/
public class CustomerTable extends BorderPage {

public List customers = null;

/**
* @see org.apache.click.Page#onRender()
*/
public void onRender() {
customers = getCustomerService().getCustomersSortedByName(10);
}

/**
* Returns the name of the border template: &nbsp; <tt>”/border-template.jsp”</tt>
*
* @see org.apache.click.Page#getTemplate()
*/
public String getTemplate() {
return “/border-template.jsp”;
}

}

======================
This is the template file:

http://fisheye6.atlassian.com/browse/click/trunk/click/examples/webapp/border-template.jsp?r=787399

<!doctype html>
2
sabob 724639 3 <!–
4 Licensed to the Apache Software Foundation (ASF) under one
5 or more contributor license agreements.  See the NOTICE file
6 distributed with this work for additional information
7 regarding copyright ownership.  The ASF licenses this file
8 to you under the Apache License, Version 2.0 (the
9 “License”); you may not use this file except in compliance
10 with the License.  You may obtain a copy of the License at
11
12 http://www.apache.org/licenses/LICENSE-2.0
13
14 Unless required by applicable law or agreed to in writing,
15 software distributed under the License is distributed on an
16 “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 KIND, either express or implied.  See the License for the
18 specific language governing permissions and limitations
19 under the License.
20 –>
malcolm_edgar 715468 21
22
sabob 787399 23 <%– Menu –%>
24 <table id=“menuTable” border=“0” width=“100%” cellspacing=“0” cellpadding=“0” style=“margin-top: 2px;”>
25 <tr>
26 <td>
27 <div class=“menustyle” id=“menu”>
28 <ul class=“menubar” id=“dmenu”>
29 <c:forEach items=“${rootMenu.children}” var=“topMenu”>
30 <li class=“topitem”>${topMenu}
31 <ul class=“submenu”
32 <c:forEach items=“${topMenu.children}” var=“subMenu”>
33 ><li>${subMenu}</li
34 </c:forEach>
35 ></ul>
36 </li>
37 </c:forEach>
38 <li class=“topitem”><a target=“_blank” href=“${context}/source-viewer.htm?filename=WEB-INF/classes/${srcPath}” title=“Page Java source”><img border=“0” class=“link” alt=“” src=“${context}/assets/images/lightbulb1.png”/> Page Java</a>
39 </li>
40 <li class=“topitem”><a target=“_blank” href=“${context}/source-viewer.htm?filename=${path}” title=“Page Content source”><img border=“0” class=“link” alt=“” src=“${context}/assets/images/lightbulb2.png”/> Page HTML</a>
41 </li>
42 </ul>
43 </div>
44 </td>
45 </tr>
46 </table>
47 </div>
malcolm_edgar 715468 48
sabob 787399 49 <%– Page Content –%>
50 <div class=“content”>
51 <h2>${title}</h2>  <============ from BorderPage.java
52 <p/>
sabob 782056 53 <jsp:include page=${forward} flush=“true”/>  <============= htm equivalent of path; the .htm page requested, in this case it renders requesing .htm page: customer-table.htm
sabob 787399 54 </div>
55
56 </div>
malcolm_edgar 715468 57
sabob 757699 58 ${jsElements}
59
malcolm_edgar 715468 60 </body>
malcolm_edgar 716421 61 </html>

=========imports for jsp==========
http://incubator.apache.org/click/docs/click-api/org/apache/click/util/PageImports.html

public class PageImportsextends Object

Provides a utility object for rendering a Page’s HTML header imports and its control HTML header imports.

A PageImports instance is automatically added to the Velocity Context for Velocity templates, or as a request attribute for JSP pages using the key name “imports“.

PageImports Examples

To use the PageImports object simply reference it your page header section. For example: <html>
<head>
$imports
</head>
<body>
$form
<body>
</html>
imports” include all javascript and stylesheet imports.
PageImports also provides a way of including the javascript and stylesheet separately using the key names “cssImports” and “jsImports“.

You should follow the performance best practice by importing CSS includes in the head section, then include the JS imports after the html body. For example:

<html>
<head>
$cssImports
</head>
<body>
$form
<br/>
$table
<body>
</html>
$jsImports
Please also see Page.getHtmlImports() and Control.getHtmlImports().

Palm Pre vs. iPhone

I just heard about Palm Pre this afternoon on my way home through NPR. It loks like finally we got a competitor for IPhones. Palm is a great company who invented Palm Pocket PC or Parl Pilot.

I hope to buy an iPhone before but the subscription is a little bit expensice. Palm Pre is to be 30 dollars less than iPhone’s AT&T service through Sprint.

What I want from myvidoop

I am a heavy myvidoop user. This is a great tool to store passwords online. However, as my password list is getting larger, it loads slow and keep lots of duplicate passwords. So What I wnated most now is another plugin to remove duplicate entries – This makes it easy to merge databases and clean up (import, then remove).

If myvidoop is improving and listening to its users, here is the one.