Archive for December, 2004

Monitoring the XML Parsing and Loading Process - Notes Of XML DOM (part2)

Written by coregps on Friday, December 31st, 2004 in XML.

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

The readyState property of DOMDocument object can give direct feedback on the reading processes. The following list its possible values:

State Short Description Long Description
1 Loading Preparing to read the XML file. Did not try yet.
2 Loaded Reading and parsing the XML file. Object model still not available.
3 Interactive Part of the XML file successfully parsed and read in. Object model partically available for read only.
4 Completed Loading of the XML file has been completed, successfully or unsuccessfully.

When reading an XML file successfully, the readyState property goes through all four states: 1,2,3, and 4. Otherwise, the readyState property may skip 3 on some OS. In addition, The DOMDocument object provides the onreadystatechange event handler through which we can know exactly when the readyState property changes its value.

An example:

<html>
   <head>
      <title>Enter the title of your HTML document here</title>
      <script type=”text/javascript”>
      function load() {
          xmlDoc = new ActiveXObject(”Microsoft.XMLDOM”);
          xmlDoc.async = false;
          xmlDoc.onreadystatechange = monitorState;
          xmlDoc.load(”bookmarks.xml”);
     }
   
     function monitorState() {
         var state = xmlDoc.readyState;
         results.innerHTML += “readyState = ” + state + “<br />”;
         if  (state == 4) {
             var err = xmlDoc.parseError;
             if  (err.errorCode != 0) {
                 results.innerHTML += err.reason + “<br />”;
             } else {
                 results.innerHTML += “Success!” + “<br />”;
            }
         }
      }
      </script>
   </head>
   <body>
      <input type=”button” value=”Load XML”  onclick=”javascript:load()” />
      <div id=”results”></div>
   </body>
</html>

Jroller’s Interface Feels Much More Approachable

Written by coregps on Friday, December 31st, 2004 in General.

Wow! That is very cool!

When I open my blog. I find that it can display Chinese character now. This new interface feels much more approachable to me. I like it very much. Thanks a lot!

Grieve Over Loss Of Lives In Quake-Triggered Tsunami

Written by coregps on Thursday, December 30th, 2004 in General.

I am shocked to learn about the tragic loss of lives caused by tidal waves following a severe earthquake. Here, I want to Grieve over loss of lives in quake-triggered tsunami.

Parsing the XML DOM - Notes Of XML DOM (part1)

Written by coregps on Thursday, December 30th, 2004 in XML.

For a long time, I can only read and write XML, and I don’t know how to parse it. Recently, I found a good place to learn XML and relative technology, that is www.w3schools.com. When I follow the tutorial, I take some notes and test what I’ve learned. However, I find it difficult to remember all stuff once, so I divide them into serveral parts.

What is DOM?

The XML Document Object Model (DOM) is a programming interface for XML documents. It defines the way an XML document can be accessed and manipulated. The DOM represents a tree view of the XML document. The documentElement is the top-level of the tree. This element has one or many childNodes that represent the branches of the tree.

Parsing XML DOM

// Create an empty object
xmlDoc = new ActiveXObject(”Microsoft.XMLDOM”);

// Load an XML file
xmlDoc.load(”bookmarks.xml”);

// Load an XML file and show its content
<script language=”text/javascript”>
<!–
  var xmlDoc = new ActiveXObject(”Microsoft.XMLDOM”);
  xmlDoc.load(”bookmarks.xml”);
  alert(xmlDoc.documentElement.xml);
//–>
</script>

XML Data Islands In Practice

Written by coregps on Wednesday, December 29th, 2004 in XML.

What is an XML data island?

A data island is an XML document that exists within an HTML page. It allows you to script against the XML document without having to load it through script or through the <OBJECT> tag. Almost anything can be in a well-formed XML document can be inside a data island.

The <xml> element marks the beginning of the data island, and its ID attribute provides a name that you can use to reference the data island.

Load the document into a Data Island

The XML for a data island can be either inline:

<xml id=”bookmark”>
<bookmarks>
    <bookmark>
     <title>TheServerSide.com</title>
     <link>http://www.theserverside.com/</link>
     <description>TheServerSide.com-News, Patterns, Reviews, Discussions, Articles, Books</description>
    </bookmark>
    <bookmark>
     <title>Java-Channel</title>
     <link>http://www.java-channel.org/</link>
     <description>Java-Channel is a collaborative database of reviews about Java resources.</description>
    </bookmark>
  <bookmark>
     <title>JavaWorld.com</title>
     <link>http://www.javaworld.com/</link>
     <description>Tutorials, News, Articles, Reviews, Tips about Java</description>
    </bookmark>
    <bookmark>
     <title>Javalobby.org</title>
     <link>http://www.javalobby.org/</link>
     <description>Javalobby is the original Java community and provides Java developers a place to catch the latest news, technical articles, and forum discussions.</description>
    </bookmark> 
</bookmarks>
</xml>

Or a speparate XML file can be embedded like this:

<xml id=”bookmark” src=”bookmarks.xml” />

Bind the Data Island to an HTML element

Data Islands can be bound to HTML elements. Consider the following example:

<html>
<body>
<xml id=”bookmark” src=”bookmarks.xml” async=”false”></xml>
<table border=”1″ datasrc=”#bookmark” width=”100%”>
<thead>
<tr><th>Title</th><th>Link</th></tr>
</thead>
<tbody>
<tr>
  <td><span datafld=”title”></span></td>
  <td><span datafld=”link”></span></td>
</tr>
</tbody>
</table>
</body>
</html>

Note the async=”false” attribute is added to the Data Island to make sure that all the XML data is loaded before any other HTML processing takes place. the datasrc in the <table> tag is used to specify the ID of the Data Island you want to extract data from. the datafld in the <span> tag is used to specify the XML tag you want to extract the data from.

Manipulate the XML Data Island using JavaScript.

The following code add a navigation to the XML Data Island:

<script type=”text/javascript”>
function movenext() {
    /* Get the complete record set */
    x = bookmark.recordset;
    if (x.absoluteposition < x.recordcount) {
     /* Go to next data */
     x.movenext();
    }
}
function moveprevious() {
 /* Get the complete record set */
    x = bookmark.recordset;
    if (x.absoluteposition > 1) {
     /* Go to previous data */
  x.moveprevious();
 }
}
</script>

Some of other methods that can be used here are:

  • moveFirst(): Point to the first data item.
  • moveLast(): Point to the last data item.
  • EOF: This property is used to check whether we’ve reached the end of the data.

An entire example:

<html>
<title>XML Data Island In Practice</title>
<head>
<script type=”text/javascript”>
function movenext() {
    /* Get the complete record set */
    x = bookmark.recordset;
    if (x.absoluteposition < x.recordcount) {
     /* Go to next data */
     x.movenext();
    }
}
function moveprevious() {
 /* Get the complete record set */
    x = bookmark.recordset;
    if (x.absoluteposition > 1) {
     /* Go to previous data */
  x.moveprevious();
 }
}
</script>
</head>
<body>

<xml id=”bookmark” src=”bookmarks.xml” />

<table border=”1″ datasrc=”#bookmark” width=”100%”>
<thead>
<tr><th>Title</th><th>Link</th></tr>
</thead>

<tfoot>
<tr><th colspan=”2″>This is my favorites.</th></tr>
</tfoot>

<tbody>
<tr>
  <td><span datafld=”title”></span></td>
  <td><span datafld=”link”></span></td>
</tr>
</tbody>
</table>

<div style=”margin: 5px 5px 5px 5px; border: dashed 1px gray; padding: 2px;”>
<strong>Title:</strong><div datasrc=”#bookmark” datafld=”title”></div>
<strong>Link:</strong><div datasrc=”#bookmark” datafld=”link”></div>
<strong>Description:</strong><div datasrc=”#bookmark” datafld=”description”></div>
</div>

<div>
<input type=”button” value=”Previous” onclick=”moveprevious()” />
<input type=”button” value=”Next” onclick=”movenext()” />
</div>

Parsing XML With Javascript - Read an XML file

Written by coregps on Monday, December 27th, 2004 in XML.

The XML file looks like this:

<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<bookmarks>

    <bookmark>
     <title>TheServerSide.com</title>
     <link>http://www.theserverside.com/</link>
     <description>TheServerSide.com-News, Patterns, Reviews, Discussions, Articles, Books</description>
    </bookmark>

    <bookmark>
     <title>Java-Channel</title>
     <link>http://www.java-channel.org/</link>
     <description>Java-Channel is a collaborative database of reviews about Java resources.</description>
    </bookmark>

    <bookmark>
     <title>JavaWorld.com</title>
     <link>http://www.javaworld.com/</link>
     <description>Tutorials, News, Articles, Reviews, Tips about Java</description>
    </bookmark>

    <bookmark>
     <title>Javalobby.org</title>
     <link>http://www.javalobby.org/</link>
     <description>Javalobby is the original Java community and provides Java developers a place to catch the latest news, technical articles, and forum discussions.</description>
    </bookmark> 

</bookmarks>

The following script loads the XML file and prints its content.

<script type=”text/javascript”>
 var xmlDoc = new ActiveXObject(”Microsoft.XMLDOM”);
 xmlDoc.async=”false”;
 xmlDoc.load(”bookmarks.xml”);
 var nodes = xmlDoc.documentElement.childNodes;

 for(var i = 0; i < nodes.length; i++) {
  document.write(”<div class=’box’>”);
  document.write(”<h2 class=’box’><a href=’” + nodes.item(i).childNodes.item(1).text + “‘>” + nodes.item(i).childNodes.item(0).text + “</a></h2>”);
  document.write(”<div class=’description’>” + nodes.item(i).childNodes.item(2).text + “</div>”);
  document.write(”</div>”);
 }
</script>

How To Place A DHTML Layer Over A Flash Movie

Written by coregps on Sunday, December 26th, 2004 in General.

Issue
A Flash movie in a layer on a DHTML page containing several layers may display above all the layers, regardless of the stacking order (”z-index”) of those layers.

Reason
By default, browsers place embedded plug-in content, such as a Flash movie or Java applet, on the topmost layer. In older browsers attempts to place a DHTML layer on top of a Flash layer would fail. Newer browsers add the ability to layer Flash content with DHTML content and in some cases the ability to use transparent backgrounds in the Flash content (see below).

Solution
Make the Flash movie’s background transparent using the WMODE tag. This will allow the DHTML layer underneath the Flash movie or layer to appear.

Note: The WMODE tag is supported only on some browser/Macromedia Flash Player version combinations. If the WMODE tag is not supported, the Flash movie will always display on top. Refer to TechNote 14201 for details.

Three methods of creating an HTML page with the correct code are outlined below.

Publishing from Flash

The HTML for a Flash movie can be created using the Publish Settings feature in Flash. The Publish Settings dialog box provides an option to affect the WMODE setting. The options selected in the Publish Settings will be added to the HTML source code automatically:

  1. Choose File > Publish Settings. Select the HTML tab.
  2. Choose “Transparent” in the WMODE setting to make the Flash movie’s background disappear in browsers which support this feature.
  3. Publish the document.

Using Dreamweaver MX

Follow the below steps, and Dreamweaver MX will insert the correct HTML code automatically.

  1. In Dreamweaver MX, insert the Flash movie into an HTML page.
  2. Select the Flash movie in the Design View.
  3. In the Properties panel, choose Parameters.
  4. For the Parameter, enter “wmode” (without quotes).

    For the Value, enter “transparent”.

  5. Save the document. The HTML page is complete.

Editing HTML code manually

To edit an existing HTML page, add the WMODE parameters to the HTML code.

  1. Add the following parameter to the OBJECT tag:
    <param name=”wmode” value=”transparent”>
  2. Add the following parameter to the EMBED tag:
    wmode=”transparent”

Examples

<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″
codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0″ width=”150″ height=”150″>
<param name=”movie” value=”wmode/wmode_example_layer.swf” />
<param name=”quality” value=”high” />
<param name=”wmode” value=”transparent” />
<embed src=”wmode/wmode_example_layer.swf” width=”150″ height=”150″ quality=”high” pluginspage=”http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash” type=”application/x-shockwave-flash” wmode=”transparent”> </embed>
</object>

Some Artiles Worth Reading (About Struts)

Written by coregps on Friday, December 24th, 2004 in Java.

When I surf the web, I find some excellent articles about struts. They are worth reading, so I collect them all and list them here.

phentermine prescriptionphenterminetramadol prescriptionbuy tramadolclomid 100 mgclomid onlineindocin onlineindocin free shippingbuy prednisonepurchase prednisonefemara prescriptioncheap femaraeffexor free shippingeffexor prescriptiondiscount viagra super activebuy viagra super activediscount generic cialisgeneric cialis onlineorder generic viagrageneric viagrafemale viagra onlinevpxlviagra jelly free shippingbuy viagra jellycheap cialis jellycialis jellykamagrakamagra free shippingdiscount viagra cialisviagra cialis compare pricesorder levitralevitra cheap pricescialis professionalcheap cialis professionalorder viagra professionalviagra professional free shippingcialis soft tabs free deliverycialis soft tabsviagra soft tabviagra soft tabs onlineorder cialischeap cialisorder viagraviagra onlineorder propeciapropeciacheap ventolinventolindiscount xenicalbuy xenicalrevatio prescriptionbuy revatiocheap female viagrafemale viagra priceviagra vs cialisviagra cialis free deliveryvpxl pricebuy vpxllevitra professionalcheap levitra professionalpurchase levitralevitra pricecheap levitracialis jelly onlinecheap cialis jellycialis soft tabscialis soft tabs onlinecialis super active onlinecialis super activegeneric cialis onlinegeneric cialischeap cialis professionalcialis professional pricecialis free shippingorder cialisbuy cialisdiscount brand viagrabrand viagracheap viagra jellyviagra jellyviagra soft tabsviagra soft tabs onlineviagra super active pricecheapviagra super activegeneric viagrabuy generic viagraviagra professional pricecheap viagra professionalviagra free shippingviagra pricebuy viagrabuspar free shippingbuy busparlotrisone pricelotrisone onlinediscount betnovatepurchase betnovatediscount clonidinebuy clonidinenexium pricecheap nexiumdiscount levaquinlevaquin onlineprevacidbuy prevacidorder bentylbuy bentylprednisone priceprednisone onlineorder differincheap differinpurchase stromectolstromectolavalide discountpurchase avalideproventil pricebuy proventilnoroxin pricenoroxindiscount ciprocipro onlineomnicef pricecheap omnicefaugmentin pricecheap augmentindiscount zoloftcheap zoloftprednisolone free shippingbuy prednisoloneventolin prescriptionventolin onlineelavil priceelavildiscount nolvadexnolvadex onlinecytotec pricebuy cytotecavodart discountcheap avodartvpxl onlinevpxltake viagra cialis togetherviagra cialis free deliveryorder levitra professionalbuy levitra professionalorder levitracheap levitraorder cialis jellybuy cialis jellyorder cialis soft tabscialis softcialis super active pricecheap cialis super activeorder generic cialischeap generic cialiscialis professionalbuy cialis professionalorder cialisbuy cialisorder brand viagrabuy brand viagraorder viagra jellybuy viagra jellyorder viagra soft tabsviagra soft tabs priceviagra super active onlinebuy viagra super activeorder generic viagrageneric viagra onlineviagra professional onlinecheap viagra professionalviagracheap viagraorder revatiocheap revatiobrand viagra onlinecheap brand viagracheap cialis super activebuy cialis super activeorder female viagrafemale viagra onlineorder vpxlbuy vpxlcheap levitra professionalbuy levitra professionalcheap levitralevitra onlineorder cialis soft tabscialis soft tabs onlineviagra soft tabs onlinecheap viagra soft tabsorder viagra super activebuy viagra super activecheap generic cialisbuy generic cialisorder generic viagrageneric viagra onlineorder cialis professionalbuy cialis professionalorder viagra professional

Merry Christmas To Everyone!

Written by coregps on Friday, December 24th, 2004 in General.

“Wishes become an angel’s wings, embracing you tightly and never letting go.”


My brother sent me a SMS just now and wished me a merry Christmas. Here, I want to thank everyone for all the sharing and loving, which is like the first and most precious snowflake before Christmas, and wish everyone a Merry Christmas.


Merry Christmas To My Wife!


Merry Christmas To My Friends!


Merry Christmas To My Father!


Merry Christmas To My Brother!


Merry Christmas To Everyone All Over The World!

phpMyAdmin Security

Written by coregps on Thursday, December 23rd, 2004 in General.

Most of us use phpMyAdmin on a remote host to manage MySQL database. So it is very important to setup authentication for safety reason. phpMyadmin supports a way to authenticate users against its own user database which is best suited for a multi-user system.

First edit the ‘config.inc.php’ file:
find

  $cfg[’PmaAbsoluteUri’] = ‘’;

replace with

  $cfg[’PmaAbsoluteUri’] = ‘http://127.0.0.1/phpMyAdmin/’;

You can replace the uri shown above with your own. Such as http://12.34.56.78/phpMyAdmin, If your web server does not work on port 80, for example 81, the uri should be “http://12.34.56.78:81/phpMyAdmin”.

Save this file and reload your web page, and then change the default root password:

click “databases…”, selcect “mysql”, select “user” table, click on the “Insert” tab. Fill in the necessary fields (Be sure to remember your username and password), for example,
 
  Host: localhost
 
  User: dbmaster
 
  Password: manage    (Be sure to select the “PASSWORD” function when fill in this field)
 
  And give it all the priviledges list below (select “Y” for all).

Click “Go” to insert the record into database. Then click “Home” under the logo of phpMyAdmin on the left side. You will find “Reload MySQL”, click it.

Now, edit config.inc.php again,

find

  $cfg[’blowfish_secret’] = ‘enterPasswordHere’;

and enter the password you like.

find

  $cfg[’Servers’][$i][’auth_type’] = ‘config’; // Authentication method (config, http or cookie based)?
  $cfg[’Servers’][$i][’user’] = ‘root’; // MySQL user

replace with

  $cfg[’Servers’][$i][’auth_type’] = ‘http’; // Authentication method (config, http or cookie based)?
  $cfg[’Servers’][$i][’user’] = ‘’; // MySQL user

 
or

  $cfg[’Servers’][$i][’auth_type’] = ‘cookie’; // Authentication method (config, http or cookie based)?
  $cfg[’Servers’][$i][’user’] = ‘’; // MySQL user

 
Save this file, reload URL http://127.0.0.1/phpMyAdmin/index.php , and input the username/password you just created to login the admin panel, if this works, you can now delete all other default MySQL accounts for safety reason.

Finally, creat account for MySQL

Giving the database root account for ODBC to use maybe too dangerous, you need to create an account that has accesses to only the database he uses. Similar to the above instructions, click “databases…”, selcect “mysql”, click “user” table, click on the “Insert” tab, fill in the necessary fields. Be sure to remember your username and password, Note that we don’t give any priviledge here, for example,

  Host: localhost
 
  Name: dbuser
 
  Password: connect  (Be sure to select the “PASSWORD” function when fill in this field)
 
  Don’t give any priviledge list below (Leave all the default check marks set to “N”).
 
Click “Go” to insert the record into database.
 
The account now can not do anything yet, click “databases…”, selcect “mysql”, click “db” table, click on the “Insert” tab, assign the username you just created to the database he can access (for example, userdb), Host is localhost, we give it all priviledges here, click “Go” to finish, now same as above, Reload your MySQL.

Till now, all is done. Try to use the username and password you just created in your ODBC driver and test it.

Use Office HTML Filter to Remove Office-specific Markup Tags

Written by coregps on Thursday, December 23rd, 2004 in General.

When we create an document in Word 2000 and save it as HTML, Office-specific markup tags are embedded in it. This increases the size of the document. Microsoft provides an HTML filter on their site that will strip most of the MS office proprietary mark-up from Office documents saved as HTML.

To download it , go http://office.microsoft.com/downloads/2000/Msohtmf2.aspx

RSS Tutorial

Written by coregps on Wednesday, December 22nd, 2004 in General.

  1. Introducing RSS
    1. What’s in a RSS feed?
    2. How do people use feeds?
    3. Why should I make an RSS feed available?
    4. But isn’t that giving away my content?
  2. Choosing Content for RSS Feeds
  3. Publishing RSS
  4. Telling People About Your Feed
  5. RSS Versions and Modules
    1. RSS 0.9x
    2. RSS 1.0
    3. Dublin Core Module
  6. Tips for Generating Good RSS Feeds
  7. RSS Tools and Validators
  8. Aggregators and other RSS Clients
  9. More Information about RSS
  10. About this Document

Introducing RSS

Think about all of the information that you access on the Web on a day-to-day basis; news headlines, search results, “What’s New”, job vacancies, and so forth. A large amount of this content can be thought of as a list; although it probably isn’t in HTML <li> elements, the information is list-oriented.

Most people need to track a number of these lists, but it becomes difficult once there are more than a handful of sources. This is because they have to go to each page, load it, remember how it’s formatted, and find where they last left off in the list.

RSS is an XML-based format that allows the syndication of lists of hyperlinks, along with other information, or metadata, that helps viewers decide whether they want to follow the link.

RSS allows peoples’ computers to fetch and understand the information, so that all of the lists they’re interested in can be tracked and personalized for them. It is a format that’s intended for use by computers on behalf of people, rather than being directly presented to them (like HTML).

To enable this, a Web site will make an RSS feed, or channel, available, just like any other file or resource on the server. Once a feed is available, computers can regularly fetch the file to get the most recent items on the list. Most often, people will do this with an aggregator, a program that manages a number of lists and presents them in a single interface.

RSS can also be used for other kinds of list-oriented information, such as syndicating the content itself (often weblogs) along with the links. However, this tutorial focuses on the use of RSS for syndication of links.

What’s in a RSS feed?

A feed contains a list of items, each of which is identified by a link. Each item can have any amount of metadata associated with it.

The most basic metadata supported by RSS includes a title for the link and a description of it; when syndicating news headlines, these fields might be used for the story title and the first paragraph or a summary, for example. For example, an simple item might look like;

<item>
  <title>Earth Invaded</title>
  <link>http://news.example.com/2004/12/17/invasion</link>
  <description>The earth was attacked by an invasion fleet
  from halfway across the galaxy; luckily, a fatal
  miscalculation of scale resulted in the entire armada
  being eaten by a small dog.</description>
</item>

Additionally, the feed itself can have metadata associated with it, so that it can be given a title (e.g., “Bob’s news headlines”), description, and other fields like publisher and copyright terms.

For an idea of what full feeds look like, see ‘RSS Versions and Modules‘.

How do people use feeds?

Aggregators are the most common use of RSS feeds, and there are several types. Web aggregators (sometimes called portals) make this view available in a Web page; my Yahoo is a well-known example of this. Aggregators have also been integrated into e-mail clients, users’ desktops, or standalone, dedicated software. See ‘Aggregators and other RSS Clients‘ for more information.

Aggregators can offer a variety of special features, including combining several related feeds into a single view, hiding items that the viewer has already seen, and categorizing feeds and items.

Other uses of RSS feeds include site tracking by search engines and other software; because the feed is machine-readable, the search software doesn’t have to figure out which parts of the site are important and which parts are just the navigation and presentation. You may also choose to allow people to republish your feeds on their Web sites, giving them the ability to represent your content as they require.

Why should I make an RSS feed available?

Your viewers will thank you, and there will be more of them, because RSS allows them to see your site without going out of their way to visit it.

While this seems bad at first glance, it actually improves your site’s visibility; by making it easier for your users to keep up with your site - allowing them to see it the way they want to - it’s more likely that they’ll know when something that interests them is available on your site.

For example, imagine that your company announces a new product or feature every month or two. Without a feed, your viewers have to remember to come to your site and see if they find anything new - if they have time. If you provide a feed for them, they can point their aggregator or other software at it, and it will give them a link and a description of developments at your site almost as soon as they happen.

News is similar; because there are so many sources of news on the Internet, most of your viewers won’t come to your site every day. By providing an RSS feed, you are in front of them constantly, improving the chances that they’ll click through to an article that catches their eye.

But isn’t that giving away my content?

No! You still retain copyright on your content if you wish to.

By supplying an RSS feed, you can control what information is syndicated in the feed, whether it’s a full article or just a teaser. Your content can still be protected by your current access control mechanisms; only the links and metadata are distributed. You can also protect the RSS feed itself with SSL encryption and HTTP username/password authentication too, if you’d like.

In many ways, RSS is similar to the subscription newsletters that many sites offer to keep viewers up-to-date. The big difference is that they don’t have to supply an e-mail address, lowering the barrier of privacy concerns, while still giving you a direct channel to your viewers. Also, they get to see the content in the manner that’s most convenient to them, which means that you get more eyes looking at your content.

Choosing Content for RSS Feeds

Any list-oriented information on your site that your viewers might be interested in tracking or reusing is a good candidate for an RSS feed. This can encompass news headlines and press releases, job listings, conference calendars and rankings (like ‘top 10′ lists).

For example;

  • News & Announcements - headlines, notices and any list of announcements that are added to over time
  • Document listings - lists of added or changed pages, so that people don’t need to constantly check for different content
  • Bookmarks and other external links - while most people use RSS for sharing links from their own sites, it’s a natural fit for sharing lists of external links
  • Calendars - listings of past or upcoming events, deadlines or holidays
  • Mailing lists - to compliment a Web-based archive of public or private e-mail lists
  • Search results - to let people track changing or new results to their searches
  • Databases - job listings, software releases, etc.

While it’s a good start to have a ‘master feed’ for your site that lists recent news and events, don’t stop there. Generally, each area of your site that features a changing list of information should have a corresponding feed; this allows viewers to precisely target their interests.

For example, if your news site has pages for World news, national news, local news, business, sports, etc., there should be a feed for each of these sections.

If your site offers a personalized view of data (e.g., people can choose categories of information that will show up on their home page), offer this as a feed, so that the viewers’ Web pages match the content of their feeds.

A great example of this is Apple’s iTunes Music Store RSS feed generator; you can customize it based on your preferences, and the views it allows match those provided in the Music Store itself.

Finally, remember that feeds are just as - if not more - useful on an Intranet as they are on the Internet. RSS can be a powerful tool for sharing and integrating information inside a company.

Publishing RSS

There are a number of ways to generate a feed from your content. First of all, explore your content management system - it might already have an option to generate an RSS feed.

If that option isn’t available, you have a number of choices;

  • Self-scraping - The easiest way to publish a feed from existing content. Scraping tools fetch your Web page and pull out the relevant parts for the feed, so that you don’t have to change your publishing system. Some use regular expressions or XPath expressions, while others require you to mark up your page with minimal hints (usually using <div> or <span> tags) that help it decide what should be put into the feed.
  • Feed integration - If your site is dynamically generated (using languages like Perl, Python or PHP), it may have a RSS library available, so that you can integrate the feed into your publishing process.
  • Starting with the feed - Alternatively, you can manage the list-oriented parts of your content in the RSS feed itself, and generate your Web pages (as well as other content, like e-mail lists) from the feed. This has the advantage of always having the correct information in the feed, and tools like XSLT make this option easy, especially if you’re starting from scratch.
  • Third party scraping - If none of these options work for you, some people on the Web will scrape your site for you and make the feed available. Be warned, however, that this is never as reliable or accurate as doing it yourself, because they don’t know the details of your content or your system. Also, using third parties introduces another point of failure in the delivery process; problems there (network, server or business) will cause your feed to be unavailable.

For more information about all of these options, see “Tools for generating and validating RSS feeds” and “More Information about RSS“.

Telling People About Your Feed

An important step after publishing a feed is letting your viewers know that it exists; there are a lot of feeds available on the Web now, but it’s hard to find them, making it difficult for viewers to utilize them.

Pages that have an associated RSS feed should clearly indicate this to viewers by using a link containing like ‘RSS feed’. For example,

<a type="application/rss+xml" href="feed.rss">RSS feed for this page</a>

where ‘feed.rss’ is the URL for the feed. the ‘type’ attribute tells browsers that this is a link to an RSS feed in a way that they understand.

Additionally, some programs look for a link in the <head> section of your HTML. To support this, include a <link> tag;

<head>
  <title>My Page</title>
  <link rel="alternate" type="application/rss+xml"
   href="feed.rss" title="RSS feed for My Page">
</head>

These links should be placed on the Web page that is most similar to the feed content; this enables people to find them as the browse.

Finally, there are a number of guides and registries for RSS feeds that people can search and browse through, much like the Yahoo directory for Web sites; it’s a good idea to register your feed. See “Related Resources” for more information.

RSS Versions and Modules

There are two main versions of the RSS format in use today; RSS 0.9x and RSS 1.0. Although the numbers might lead you to believe that 1.0 replaces 0.9x, both are being actively used and developed. Each version has its benefits and drawbacks; RSS 0.9x is known for its simplicity, while RSS 1.0 is more extensible and fully specified. Both formats are XML-based and have the same basic structure.

People tend to get into heated discussions about the better format. Ultimately, it’s a choice you shouldn’t worry too much over; good RSS tools and aggregators will understand both formats. This section presents a quick overview of each; for more information, see their specifications and supporting materials.

RSS 0.9x

RSS 0.9x (the ‘x’ is for the last digit; as of writing, RSS 0.94 is in development) was designed by Netscape Communications and UserLand software, and is championed by UserLand’s Dave Winer. In this version, RSS stands for “Really Simple Syndication,” and simplicity is its focus.

This branch of RSS is based on RSS 0.91, which was first documented at Netscape and later refined by Userland.

Included in 0.92 - the latest stable version - are channel metadata like link, title, description; image, which allows you to specify a thumbnail image to display with the feed); webMaster and managingEditor, to identify who’s responsible for the feed, and lastBuildDate, which shows when the feed was last updated. Items have the standard link, title and description metadata, as well as other, more experimental facilities like enclosure, which allows attachments to be automatically downloaded (don’t expect these features to be supported by all aggregators, however).

RSS 0.9x takes a versioned approach to extensibility; new features are added by declaring a new version of RSS in the 0.9 series. Winer controls the release of new versions, so if you have suggestions about the future of RSS 0.9x, it’s best to talk to him.

Here’s an example of a minimal RSS 0.9x feed:

<?xml version="1.0"?>
<rss version="0.91">
  <channel>
    <title>Example Channel</title>
    <link>http://example.com/</link>
    <description>My example channel</description>
    <item>
       <title>News for September the Second</title>
       <link>http://example.com/2002/09/01</link>
       <description>other things happened today</description>
    </item>
    <item>
       <title>News for September the First</title>
       <link>http://example.com/2002/09/02</link>
    </item>
  </channel>
</rss>

RSS 1.0

RSS 1.0 stands for “RDF Site Summary.” This flavor of RSS incorporates RDF, a Web standard for metadata. Because RSS 1.0 uses RDF, any RDF processor can understand RSS without knowing anything about it in particular.

RSS 1.0 also uses XML Namespaces to allow extensions - called RSS Modules - to be added without worrying about conflicts. This is because RSS 1.0 doesn’t use a central person for extending the format; instead, namespaces are used to describe a space for your own extensions. For example, if you had an ISBN module to track books, it might look like this;

<item xmlns:book="http://namespace.example.com/book/1.0"
 rdf:about="http://www.amazon.com/exec/obidos/tg/detail/-/0553575376">
  <title>Excession</link>
  <link>http://www.amazon.com/exec/obidos/tg/detail/-/0553575376</link>
  <book:isbn>0553575376</book:isbn>
</item>

Generally, though, you should look for available RSS Modules, rather than defining your own, unless you’re sure that what you need doesn’t exist.

RSS 1.0 feeds look very similar to RSS 0.9x feeds, with a few key differences;

  • The entire feed is wrapped in <rdf:RDF></rdf:RDF> elements (so that processors know that it’s RDF)
  • Each <item> has an rdf:about attribute that usually, but not always, matches the <link>; this assigns an identifier to each item
  • There’s an <items> element in the channel metadata that contains a list of items in the channel, so that RDF processors can keep track of the relationship between the items
  • Some metadata uses the rdf:resource attribute to carry links, instead of putting it inside the element.

RSS 1.0 is developed and maintained by an ad hoc group of interested people; see their Web site for more information about RSS 1.0 and RSS Modules. See below for an example of an RSS 1.0 feed.

Dublin Core Module

The most well-known example of an RSS Module is the Dublin Core Module. The Dublin Core is a set of metadata developed by librarians and information scientists that standardizes a set of common metadata that is useful for describing documents, among other things. The Dublin Core Module uses these metadata to attach information to both feeds (in the channel metadata) and to individual items.

This module includes useful elements like dc:date, for associating dates with items, dc:subject, which can be useful for categorizing items or feeds, and dc:rights, for dictating the intellectual property rights associated with an item or a feed.

Here’s an example of a minimal RSS 1.0 feed that uses the Dublin Core Module:

<?xml version="1.0"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns="http://purl.org/rss/1.0/"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
>
  <channel rdf:about="http://example.com/news.rss">
    <title>Example Channel</title>
    <link>http://example.com/</link>
    <description>My example channel</description>
    <items>
      <rdf:Seq>
        <rdf:li resource="http://example.com/2002/09/01/"/>
        <rdf:li resource="http://example.com/2002/09/02/"/>
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="http://example.com/2002/09/01/">
     <title>News for September the First</title>
     <link>http://example.com/2002/09/01/</link>
     <description>other things happened today</description>
     <dc:date>2002-09-01</dc:date>
  </item>
  <item rdf:about="http://example.com/2002/09/02/">
     <title>News for September the Second</title>
     <link>http://example.com/2002/09/02/</link>
     <dc:date>2002-09-02</dc:date>
  </item>
</rdf:RDF>

As you can see, RSS 1.0 is a bit more verbose than 0.9x, mostly because it needs to be compatible with other versions of RSS while containing the markup that RDF processors need.

Tips for Generating Good RSS Feeds

RSS is easy to work with, but like any new format, you may encounter some problems in using it. This section attempts to address the most common issues that arise when generating a feed.

  • Meaningful Links - Give every item in your feed a distinct URL in the <link> tag, so that software can tell the difference between items, and recognize items that it’s already seen. If two items really point at the same page, you can use different fragment identifiers; e.g.,http://www.example.com/#x2002-09-01 and http://www.example.com/#x2002-09-02.
  • Meaningful Metadata - Try to make the metadata useful on its own; for example, if you only include a short <title>, people may not know what the link is about. By the same token, if you shove an entire article into <description>, it’ll crowd people’s view of the feed, and they’re less likely to stay interested in what you have to say. Generally, you want to put enough into the feed to help someone decide whether they should follow the link.
  • Encoding HTML - Although it’s tempting, refrain from including HTML markup (like <a href="...">, <b> or <p>) in your RSS feed; because you don’t know how it will be presented, doing so can prevent your feed from being displayed correctly. If you need to include a a tag in the text of the feed (e.g., the title of an item is “Ode to <title>”), make sure you escape ampersands and angle brackets (so that it would be “Ode to &lt;title&gt;”).
  • XML Entities - Remember that XML doesn’t predefine entities like HTML does; therefore, you won’t have &nbsp; &copy; and other common entities available. You can define them in the XML, or alternatively just use an character encoding that makes what you need available.
  • Character Encoding - Some software generates feeds using Windows character sets, and sometimes mislabels them. The safest thing to do is to encode your feed as UTF-8 and check it by parsing it with an XML parser.
  • Version Compatibility - RSS 1.0 generators need to take special steps to ensure compatibility with 0.9x parsers; most importantly, use the default namespace for RSS. See the 1.0 spec for more information.
  • Communicating with Viewers - Don’t use items in your feed to communicate to your users; for example, some feeds have been known to use the <description> to dictate copyright terms. Use the appropriate element or module.
  • Communicating with Machines - Likewise, use the appropriate HTTP status codes if your feed has relocated (usually, 301 Moved Permanently) or is no longer available (410 Gone or 404 Not Found).
  • Making your Feed Cache-Friendly - Successful RSS feeds see a fair amount of traffic because clients poll them often to see if they’ve changed. To support the load, Web Caching can help; see the caching tutorial.

RSS Tools and Validators

This is an incomplete list of tools for creating RSS feeds, and checking them to make sure that you’ve done so correctly. Note that there are many more libraries that help parsing RSS; these haven’t been included here because this tutorial focuses on the Webmaster, not consumers of RSS.

  • xpath2rss - A tool for scraping Web sites using XPath expressions (a method of selecting parts of HTML and XML documents).
  • RSS.py - A Python library for generating and parsing RSS.
  • XML::RSS - A Perl module for generating and parsing RSS.
  • Orchard RSS - Work with feeds as a collection of nodes; support for Python, Perl and C.
  • Site Summaries in XHTML - An online service (also available as an XSLT stylesheet) that uses hints in your HTML to generate a feed.
  • myRSS - An online, third-party automated scraping service. Doesn’t require any special markup.
  • Online RSS 0.9x Validator - Check your 0.9x feeds; from UserLand.
  • Online RSS 1.0 Validator - Check your 1.0 RSS feeds; includes module support. From Leigh Dodds.
  • Online RSS 1.0 Validator - Another 1.0 validator, from Dave Beckett.

Aggregators and Other RSS Clients

This is an incomplete listing of aggregators and other consumers of RSS content. For more, see “More Information about RSS.”

  • Headline Viewer - The original desktop aggregator. For most versions of Windows.
  • SharpReader - Windows-based desktop aggregator; many features.
  • NetNewsWire - A newer, standalone desktop aggregator for MacOS X.
  • Radio UserLand - Hybrid desktop/Web aggregator and weblogging tool. Windows and Macintosh (7.5.5+ and OSX).
  • Meerkat - A Web-based aggregator by O’Reilly.
  • News is Free - Another Web-based aggregator which also does some third-party scraping.
  • Apache JetSpeed - An Enterprise-class Java Portal that supports RSS.
  • Daypop - A search engine for RSS-based news.
  • Syndicated content - Good list of best practices for creating an RSS feed.
  • Syndic8 - A community effort to gather, validate and search feeds with lots of other information.
  • RSS Workshop - A well-regarded introduction to publishing RSS feeds, from the state of Utah Online Services division.
  • Content Syndication with XML and RSS - RSS information and a forthcoming book by Ben Hammersley.
  • RSSInfo - Lists aggregators, toolsets and RSS-related news.
  • RSS Devcenter - O’reilly’s Web portal for all things RSS.

About this Document

This document is Copyright ©2002 Mark Nottingham <mnot@pobox.com>. It may be freely distributed in any medium as long as the text (including this notice) is kept intact and the content is not modified, edited, added to or otherwise changed. Formatting and presentation may be modified. Small excerpts may be made as long as the full document is properly and conspicuously referenced.

If you do mirror this document, please send e-mail to the address above, so that you can be informed of updates.

All trademarks within are property of their respective holders. Although the author believes the contents to be accurate at the time of publication, no liability is assumed for them, their application or any consequences thereof. If any misrepresentations, errors or other need for clarification is found, please contact the author.

The latest revision of this document can always be obtained from http://www.mnot.net/rss/tutorial/

I Can Program As Long As I Wish, Thanks John Reynolds and Mitch

Written by coregps on Tuesday, December 21st, 2004 in General.

Recently I’ve posted a weblog entry with the title “Could I Still Pursue Software Development Career When Getting Older?“. In a long time recently, I was puzzled about this problem. Almost all of my schoolmates have changed their profession. The asked me to join them. But I don’t want to give up programming. I love it. It is part of my life.

Now, I know it is not the case. I am ashamed of thinking such thoughts. I’m just 28 years old. I must muster up courage and build self-confidence. On the other hand, I must commit myself to lifelong learning so that I can keep up to speed of the latest technologies.

Thanks to John Reynolds and to Mitch for your comments which encourage me very much.

libyahoo2 - A C library for Yahoo! Messenger

Written by coregps on Sunday, December 19th, 2004 in Open Source.

libyahoo2 is a C library that handles the new Yahoo! Messenger protocol and supports almost all current features of the protocol. It communicates with clients via a callback mechanism, and has the capability to handle multiple accounts simultaneously.

Visit http://libyahoo2.sourceforge.net/ for detail information.

jYMSG - YMSG Java API

Written by coregps on Sunday, December 19th, 2004 in Java.

jYMSG is an API which enables Java programmers to interact with Yahoo’s messaging/chat services. This API provides a way for Java applications to connect and use the Yahoo Instant Messenger protocol, version 10 (YMSG-10) in a reasonably coder friendly and abstract way.which may be employed by an application to create an instant messenger using the Yahoo chat/pager system.

For more information, visit http://jymsg9.sourceforge.net/

ActiveWidgets Grid - Scrollable Javascript Grid

Written by coregps on Thursday, December 16th, 2004 in General.

I’m currently meeting some trouble when representing a lot number of records in an HTML table, in which the headers and the first col should be fixed, and only the body will scroll. I searched on google for such topic and got ActiveWidgets Grid

It is scrollable javascript grid which can display data in a table with fixed headers, resizable columns, client-side sorting and much more.  More detail information and example, visit: http://www.activewidgets.com/grid/.

However, I want to implement my simple one by using CSS. Any idea?

A Upload Bean Using apache-commons-fileupload

Written by coregps on Tuesday, December 14th, 2004 in Java.

Commons-BeanUtils provides easy-to-use wrappers around the Java reflection and introspection APIs. FileUpload makes it easy to add robust, high-performance, file upload capability to your servlets and web applications.

First, download commons-fileupload-1.0.zip and commons-beanutils-1.7.0.zip,

http://apache.freelamp.com/jakarta/commons/fileupload/binaries/commons-fileupload-1.0.zip
http://apache.freelamp.com/jakarta/commons/beanutils/binaries/commons-beanutils-1.7.0.zip

upzip commons-fileupload-1.0-beta-1.jar and commons-beanutils.jar, and put them into the folder “YourWebApp/WEB-INF/lib”.

UploadFile.java


package com.esurfer.common;

import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.text.SimpleDateFormat;
import java.io.*;
import org.apache.commons.fileupload.*;

public class UploadFile {
   private String tmpdir;
   private String updir;
   private HttpServletRequest request;

 
   public HttpServletRequest getRequest() {
       return request;
   }

   public void setRequest(HttpServletRequest request) {
       this.request = request;
   }
 
 
   public String getTmpdir() {
       return tmpdir;
   }

   public void setTmpdir(String string) {
       tmpdir = string;
   } 
 
 
   public String getUpdir() {
       return updir;
   }

   public void setUpdir(String string) {
       updir = string;
   }
 
   /**
    * Create directory with the name ‘path’
    * @param path
    * @return
    */ 
   private String MkDir(String path) {
       String msg = null;
       java.io.File dir;

       // Create new file object
       dir = new java.io.File(path);
       if (dir == null) {
           msg = “Error:<BR>Can’t create empty directory!“;
           return msg;
       }
       if (dir.isFile()) {
           msg = “Error:<BR>File name <B>” + dir.getAbsolutePath() +
“</B> already exists!“;
           return msg;
       }
       if (!dir.exists()) {
           boolean result = dir.mkdirs();
           if (result == false) {
               msg = “Error:<BR>Create directory <b>” +
dir.getAbsolutePath() + “</B> failed!“;
               return msg;
           }
           return msg;
       } else {
       }
       return msg;
   }
 
   /**
    * Get current datetime used to name a file uploaded
    * @return
    */
   private String getCurDateTime(){
       SimpleDateFormat df = new SimpleDateFormat(”yyMMddHHmmss“);
       return df.format(new Date());
   }
 
   /**
    * Upload files
    * @return
    */
   public String[] uploadFile() {
       String msg = “”;
       String img = null;
  
       // the final filename of the file uploaded
       String sFinalName = “”;
  
       DiskFileUpload fu = new DiskFileUpload();
 
       // maximum size in byte that permitted to upload
       fu.setSizeMax(51200);
 
       // maximum size in byte that will be stored in memory
       fu.setSizeThreshold(4096);
 
       // the tempory path that the file(s) will be stored
// when greater than getSizeThreshold()
       fu.setRepositoryPath(tmpdir);
 
       // begin read information of upload
       List fileItems = null;
       try {
           fileItems = fu.parseRequest(request);
       } catch (FileUploadException e) {
           System.err.println(”Upload File Failed!”);
       }

       // process each file uploaded
       Iterator iter = fileItems.iterator();
 
       // root dir to store file uploaded
       String uproot = updir;
  
       // ArrayList used to save uploaded file name
       ArrayList uploadedFiles = new ArrayList();
  
       String filepath = updir;
       String opmsg = MkDir(filepath);
       if (opmsg == null) {
           while (iter.hasNext()) {
               FileItem item = (FileItem) iter.next();
        
               // Ignore the other type of form field(s) except file
               if (!item.isFormField()) {
                   String name = item.getName();
                   long size = item.getSize();
                   if ((name == null || name.equals(”")) && size == 0) {
                       continue;
                   }
                   name = name.replace(’\‘,‘/’);
                   File fullFile = new File(name); 

                   // get the extension

String sExtension = fullFile.getName().substring(
fullFile.getName().lastIndexOf(”.”),
fullFile.getName().length());           
                   // Generate the new filename
                   String sNewFileName = getCurDateTime() + sExtension;
         
                   // Set the final filename to sNewFileName
                   sFinalName = sNewFileName;
     
                   // Create the file with the generated name
                   File savedFile = new File(filepath, sNewFileName);
         
                   // If the file already exist, assign a new name to it
                   for (int k = 0; savedFile.exists(); k++) {
                       // get the file name from the variable
                       String sTmpFileName = sNewFileName;   
      
// get the file name except the extension

String sFileName = sNewFileName.substring(0,
sNewFileName.lastIndexOf(”.”));   
      
// combine a new file name

savedFile = new File(filepath, sFileName + k + sExtension);    
     
// get the new generated file name as the final filename
                       sFinalName = sFileName + k + sExtension; 
                   }
                   try {
                       item.write(savedFile);
                   } catch (Exception e1) {
                       System.err.println(”Upload File Failed!”);
                   }
                   uploadedFiles.add(sFinalName);
               }
           }
       }
       String sUploadedFileNames[] = new String[uploadedFiles.size()];
       uploadedFiles.toArray(sUploadedFileNames);
       return sUploadedFileNames;
     }  
}

File Upload Test, fileupload.jsp

<%@ page pageEncoding=”GBK”%>
<%@ page contentType=”text/html;charset=GBK”%>
<jsp:useBean id=”up” class=”com.esurfer.common.UploadFile” scope=”page”/>
<%
String contextPath     = getServletContext().getRealPath(”/”);
 String uploadTmpPath   = (contextPath + “tmp”).replace(’\’, ‘/’);
 String uploadRootPath  = (contextPath + “upload”).replace(’\’, ‘/’);
 String sAction = request.getParameter(”operate”);
 if (sAction == null) sAction = “”;
 if (sAction.equals(”upload”)) {
     up.setTmpdir(uploadTmpPath);
     up.setUpdir(uploadRootPath);
     up.setRequest(request);
     String[] sUploadFileNames = up.uploadFile();
     for (int i = 0; i < sUploadFileNames.length ; i++ ) {
         out.println(sUploadFileNames[i]);
     }
 }
%>
<html>
<head>
<title>Upload</title>
</head>
<body>
<center>
<h1>Upload File Test</h1>
<form name=”uploadform” method=”POST” action=”?operate=upload”
enctype=”multipart/form-data”>
 File 1:<input name=”file1″ size=”40″ type=”file”><br />
 File 2:<input name=”file2″ size=”40″ type=”file”><br />
 File 3:<input name=”file3″ size=”40″ type=”file”><br />
 <input name=”upload” type=”submit” value=”Upload” />
</form>
</center>
</body>
</html>
 

MySQL “Client Does Not Support Authentication Protocol” Error

Written by coregps on Monday, December 13th, 2004 in MySQL.

MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message:

shell> mysql
Client does not support authentication protocol requested
by server; consider upgrading MySQL client

To solve this problem, you should use one of the following approaches:

  • Upgrade all client programs to use a 4.1.1 or newer client library.
  • When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
  • Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:
    mysql> SET PASSWORD FOR
        -> ‘some_user‘@’some_host‘ = OLD_PASSWORD(’newpwd‘);
    

    Alternatively, use UPDATE and FLUSH PRIVILEGES:

    mysql> UPDATE mysql.user SET Password = OLD_PASSWORD(’newpwd‘)
        -> WHERE Host = ‘some_host‘ AND User = ‘some_user‘;
    mysql> FLUSH PRIVILEGES;
    

    Substitute the password you want to use for “newpwd‘’ in the preceding examples. MySQL cannot tell you what the original password was, so you’ll need to pick a new one.

  • Tell the server to use the older password hashing algorithm:
    1. Start mysqld with the –old-passwords option.
    2. Assign an old-format password to each account that has had its password updated to the longer 4.1 format. You can identify these ac