Monday, August 27, 2007

validate rss and atom

validate rss and atom
================


http://feedvalidator.org/

http://rss.scripting.com/

http://www.walidator.com/

http://www.ldodds.com/rss_validator/

http://feeds.archive.org/validator

http://www.ldodds.com/rss_validator/1.0/validator.html

http://aggregator.userland.com/validator

http://www.w3.org/RDF/Validator/ (RDF validator)

Web Syndication with RSS and ATOM

Web Syndication with RSS and ATOM
===========================



Syndication lets sites share information across the Web, making it easy to do things like display headlines from a site or collection of sites. Most of the syndicated feeds are written in RSS, a simple XML vocabulary (in several varieties) for summarizing information about a site. Several popular flavors of RSS are leading the pack, with upstart Atom growing in acceptance

Eg: news feeds you might find in news site, blogs etc.

There are accepted standards for syndication:


1) RSS

* RSS 0.91 (Rich Site Summary) and RSS 0.92
* RSS 1.0 (RDF Site Summary)
* RSS 2.0 (Really Simple Syndication)


2) ATOM


Formats:

For RSS 0.91
============


<rss version="0.91">

<channel>

<title>Computer Bapus Post</title>

<link>http://computerbapu.blogspot.com</link>

<description> All computer related discussions</description>

<language>en-us</language>

<image>

<url>http://computerbapu.blogspot.com/myimage.jpg</url>

<title>C# hello world</title>

<link>http://computerbapu.blogspot.com</link>

</image>

<item>

<title>C# hello world</title>

<link>http://computerbapu.blogspot.com</link>

<description>console.writeline("i am good");</description>

</item>

</channel>

</rss>

Explaination :

title
A descriptive title for this channel. This should usually be the same as the content of the HTML element title on your main site page
(maximum length : 100)

link
A URI for the channel. This should be a link to the web site that originates the feed
(maximum length is 500 characters)

description
A description of the channel, usually answering the question "What's this site all about?" Limited to 500 characters.


copyright
Copyright notice for the channel

docs
Documentation for the RSS format used by the channel

lastBuildDate
Last time channel content changed, in RFC 822 format, Sat, 01 Jan 05 00:00:27 PST (see http://www.ietf.org/rfc/rfc822.txt)

managingEditor
Email address of managing editor for the channel

pubDate
Publication date of channel, in RFC 822 format, Sat, 01 Jan 05 00:00:27 PST (see http://www.ietf.org/rfc/rfc822.txt)

rating
Platform for Internet Content Selection (PICS) rating (http://www.w3.org/PICS/)

skipDays
Days to skip reading channel

skipHours
Hours to skip reading channel

textInput
A text input box for the channel, such as a search box (required children include title, description, name, and link)

webMaster
Email address of webmaster for the channel



For RSS 1.0 format
=================


XML API

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns="http://purl.org/rss/1.0" xmlns:rdf="http://www.w3.org/1999/02/22

-rdf-syntax-ns#">

<channel rdf:about="http://computerbapu.blogspot.com/computerbapu.rss">

<title>Computer bapu</title>

<link>http://computerbapu.blogspot.com</link>

<description>Computer help</description>

<items>

<rdf:Seq>

<rdf:li rdf:resource="http://computerbapu.blogspot.com/myhelp.html"/>

</rdf:Seq>

</items>

</channel>

<item rdf:about="http://computerbapu.blogspot.com/myhelp.html">

<title>C# snippet for email</title>

<link>http://computerbapu.blogspot.com/email.html</link>

<description>hello world ()...</description>

</item>

</rdf:RDF>



Explaination:

rdf:RDF
The rdf:RDF element from the RDF namespace (http://www.w3.org/1999/02/22-rdf-syntax-ns#) is the document element. This element must have exactly one channel child and one or more item children (these elements are in the default namespace, http://purl.org/rss/1.0). The rdf:about attribute on channel, from the RDF namespace, identifies the feed with a URI.

title
A descriptive title for this channel.

link
A URI for the channel.

description
A description of the channel.

items
Contains the RDF elements Seq and li. The resource attribute on rdf:li contains a URI that identifies an item used later in the document

Two other possible children of channel are image and textinput, which link by means of rdf:resource attributes to other image and textinput elements, optionally used in the document as children of rdf:RDF (i.e., you can have one without the other). The image element links a graphic to the channel and must contain the trio title, link, and url; the textinput element contains a script or form that relates to the site and contains title, link, name, and description elements.


For RSS 2.0 format (quite popular now - successor of rss 0.91.)
===================================================


Example:

<rss version="2.0">

<channel>

<title>computer bapu</title>

<link>http://computerbapu.blogspot.com</link>
<pubDate>Mon, 05 Feb 2007 0:00:01 GMT</pubDate>

<description> computer help</description>


<item>

<title>RSS Help</title>

<link>http://computerbapu.blogspot.com/rsshelp.html</link>

<description>Latest News Feeds....</description>

</item>

<item>

<title>Atom Help</title>

<link>http://computerbapu.blogspot.com/atomhelp.html</link>

<description>Latest RSS News Feeds....</description>

</item>


</channel>

</rss>





Explaination:

Child element of channel:

title
Title of channel
(Required)

link
Link to channel
(Required)

description
Description of channel
(Required)

language
Language code for channel
(optional element)

image
Image that represents the channel (required children url, title, and link; optional children description, width, and height)
(optional element)

copyright
Copyright notice for the channel
(optional element)

managingEditor
Email address of managing editor
(optional element)

webMaster
Email address of webmaster
(optional element)

pubDate
Publication date of channel in RFC 822 format, Sat, 01 Jan 05 00:00:27 PST; though not specified in RFC 822, a four-digit year is allowed (see http://www.ietf.org/rfc/rfc822.txt)
(optional element)

lastBuildDate
Last time channel content changed in RFC 822 format, Sat, 01 Jan 05 00:00:27 PST; though not specified in RFC 822, a four-digit year is allowed (see http://www.ietf.org/rfc/rfc822.txt)
(optional element)

rating

Platform for Internet Content Selection (PICS) rating (http://www.w3.org/PICS/)
(optional element)

docs
Documentation for the RSS format used by channel
(optional element)

textInput
A text input box for the channel, such as a search box (required children include title, description, name, and link)
(optional element)

skipDays
Days to skip reading channel
(optional element)

skipHours
Hours to skip reading channel
(optional element)

category
One or more channel categories
(optional element)

generator
Name of generator program
(optional element)

cloud
Specifies a protocol for publishing and subscribing to feeds
(optional element)

ttl
Time to live in minutes
(optional element)


Child element of item:


title
Title of item

link
Link to item

description
Description of item

author
Email address of author of item (optional element)

category
One or more item categories (optional attribute domain)
(optional element)

comments
URL for comment page for item
(optional element)

enclosure
Describes an object attached to item (required attributes url, length, and type)
(optional element)

guid
Globally unique identifier
(optional element)

pubDate
Publication date in RFC 822 format
(optional element)

source
RSS channel the item came from (required attribute url)
(optional element)


Format of ATOM :
==============


<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en">

<title>Computer Bapu</title>

<link rel="alternate" type="text/html"

href="http://computerbapu.blogspot.com/"/>

<author>

<name>Computer Bapu SG</name>

</author>

<tagline>This discusses about computer topics</tagline>

<modified>2007-05-14T08:56:00-01:00</modified>

<entry>

<title>C# snippet</title>

<link rel="alternate" type="text/html"

href="http://computerbapu.blogspot.com/mySnippet.html"/>

<id>http://computerbapu.blogspot.com/mySnippet.html</id>

<issued>2007-04-14T08:56:00-01:00</issued>

<modified>2007-05-14T08:56:00-01:00</modified>

</entry>

</feed>


Title: title of the document. There can be only one title.
link: Link of the resource. There can be multiple links. Type denotes media type.
Author: Author of the resource. There can be one author container within which there can be name, url, email
tagline : feeds description

show detailed error in asp.net 2.0 web.config

show detailed error in asp.net 2.0 web.config
====================================


In web.config do the following

<customErrors mode="Off" />

This is handy for developers and testers in case when they are unable to exactly find the cause of an error. When in production this should not be used since it will show the entire detail to the laymen.

In such case use <customErrors mode="On"> to hide the detailed error.

You might want to keep show the error when run locally and hide the error when run remotely. You may achieve this using <customErrors mode="RemoteOnly">


Also if you want to redirect to a particular page when there is a error then you might use the below option:

<customErrors mode="On" defaultRedirect="ErrorTemplate.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>


what a basic hardware technician / pc technician must know

what a basic hardware technician / pc technician must know :

BASICS:

Hardware Industry
General Concepts about Hardware Parts
Hardware Jargon
Hardware components (detail discussion)
- motherboards, cpu, ram, drives, Add-on Cards, BIOS details, different types of cards available, cabinets etc
Power Supply
Peripherals latest rates and commercial information
Handling hardware components
Hardware repairing and assembling tools
Peripheral Drivers


HARDWARE INSTALLATIONS:

Hardware Assembling
Assembling Steps and Procedures
Testing of H/W before Assembling
Installation of External Peripherals such as printers, modem, LAN card, joystick, UPS, scanner, webcam etc.
Core Details:
Fixing of Mother Board, Cards etc.
Connecting Jumper Wires, Checking of AC/DC voltage, Serviceability Checks, Wire setting, Power LED-ON , Speaker Beep, Memory Testing, Error Codes.
Upgrading old pc into latest pc

PREVENTIVE MAINTAINANCE:

Hardisk Maintenance, Printer Maintenance, other peripheral maintenance briefings
Use of UPS
Use of Stabilizer
Cleaning Techniques: Internal System Components & Peripheral Components
Antivirus software

TROUBLESHOOTING:

Do and Don’t of Assembling
Various Jumpers/switches
ROM BIOS configuration
Compatible Hardware Part identification to prevent mismatch with older pc or pc with different motherboard or cpu
CD ROM & other peripheral repairing (core)
Printer cartrage fitting
Checking of COM and LPT ports
Connecting PDA’s to computer via port
Other repairing Techniques
Finding defective components (most probable problems for a particular fault)
Repairing boot faults
Finding input device problem, drives problem, power problems, modem problems, boot problems, adapter card and pc card problem etc.
Partitioning techniques
OS installations, formatting, dual boot
Modem , sound and display driver installtion
Defragmentation and Scandisk
Troubleshooting utilities and software
Troubleshooting remotely and handling people
Data Transfer Techniques


NETWORK BASICS:

LAN setup
Hardisk data transfer
Internet Connection – dial-up, cable connection, using mobile phone
cabling, labtop overview


Get a A+ certification in short. You may also give an exam at brainbench and check whether you pass / fail..The above you can easily cover in 1 and a half month or even less


php simple paging example

php simple paging example
======================


The below code is self explanatory for a coder

<?
function Connect() {

$hostname = "localhost";
$database = "mmm";
$db_login = "";
$db_pass = "";

$ad_login = "";
$ad_pass = "";


$dbase_link = mysql_connect($hostname, $db_login, $db_pass) or die("Could not connect");
mysql_select_db($database) or die("Could not select database");

}
?>

<?php

//Set the page size
$PageSize = 10;
$StartRow = 0;

//Set the page no
if(empty($_GET['PageNo'])){
if($StartRow == 0){
$PageNo = $StartRow + 1;
}
}else{
$PageNo = $_GET['PageNo'];
$StartRow = ($PageNo - 1) * $PageSize;
}

//Set the counter start
if($PageNo % $PageSize == 0){
$CounterStart = $PageNo - ($PageSize - 1);
}else{
$CounterStart = $PageNo - ($PageNo % $PageSize) + 1;
}

//Counter End
$CounterEnd = $CounterStart + ($PageSize - 1);
?>

<html>
<head>
<title>Paging Example By Nasa</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="include/style.css" type="text/css">
</head>
<?php

connect();
//query trick
$strSQL = "select * from bike where Type='$type'
AND Brand='$brand' AND City='$city' ORDER BY area LIMIT $StartRow,$PageSize";

$result = mysql_query($strSQL) or die("Query failed");
$TRecord = mysql_query("SELECT * FROM bikes");

//Total of record
$RecordCount = mysql_num_rows($TRecord);

//Set Maximum Page
$MaxPage = $RecordCount % $PageSize;
if($RecordCount % $PageSize == 0){
$MaxPage = $RecordCount / $PageSize;
}else{
$MaxPage = ceil($RecordCount / $PageSize);
}
?>
<body>
<table width="100%" border="0" class="InternalHeader">
<tr>
<td width="24%">LIST.....</td>
<td width="76%">
<div align="right">
<?php print "$RecordCount record(s) founds - You are at page $PageNo of $MaxPage" ?></div>
</td>
</tr>
</table>
<br>
<table width="100%" border="0" class="NormalTableTwo">
<tr>
<td width="4%">ID</td>
<td width="36%">NAME ID</td>
<td width="20%">CONTACT</td>
<td width="20%">PHONE</td>
</tr>
<?php
$i = 1;
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
$bil = $i + ($PageNo-1)*$PageSize;
?>
<tr>
<td width="4%"><?php echo $bil ?></td>
<td width="36%"><?php echo $row["ID"] ?></td>
<td width="20%"><?php echo $row["Name"] ?></td>
<td width="20%"><?php echo $row["contact"] ?></td>
<td width="20%"><?php echo $row["phone"] ?></td>
</tr>
<?php
$i++;
}?>
</table><br>
<table width="100%" border="0" class="InternalHeader">
<tr>
<td>

<div align="center">
<?php
//Print First & Previous Link is necessary
if($CounterStart != 1){
$PrevStart = $CounterStart - 1;
print "<a href=ok1.php?PageNo=1>First </a>: ";
print "<a href=ok1.php?PageNo=$PrevStart>Previous </a>";
}
print " [ ";
$c = 0;

//Print Page No
for($c=$CounterStart;$c<=$CounterEnd;$c++){
if($c < $MaxPage){
if($c == $PageNo){
if($c % $PageSize == 0){
print "$c ";
}else{
print "$c ,";
}
}elseif($c % $PageSize == 0){
echo "<a href=ok1.php?PageNo=$c>$c</a> ";
}else{
echo "<a href=ok1.php?PageNo=$c>$c</a> ,";
}//END IF
}else{
if($PageNo == $MaxPage){
print "$c ";
break;
}else{
echo "<a href=ok1.php?PageNo=$c>$c</a> ";
break;
}//END IF
}//END IF
}//NEXT

echo "] ";

if($CounterEnd < $MaxPage){
$NextPage = $CounterEnd + 1;
echo "<a href=ok1.php?PageNo=$NextPage>Next</a>";
}

//Print Last link if necessary
if($CounterEnd < $MaxPage){
$LastRec = $RecordCount % $PageSize;
if($LastRec == 0){
$LastStartRecord = $RecordCount - $PageSize;
}
else{
$LastStartRecord = $RecordCount - $LastRec;
}

print " : ";
echo "<a href=ok1.php?PageNo=$MaxPage>Last</a>";
}
?>
</div>
</td>
</tr>
</table>
<?php
mysql_free_result($result);
mysql_free_result($TRecord);
?>
</body>
</html>

Quickly make a deploy folder using ASP.NET 2.0.

Quickly make a deploy folder using ASP.NET 2.0.
=======================================


run the below command a folder will be created (as specified). Also mysite is the path of your website

asp_compiler -v mysite c:\folder -f -u

Register an activex component

Register an activex component

look for regsvr32.exe in system/system32 folder in windows (note down the path)

Open dos prompt and do it!

C:\system32>regsvr32 c:\youractivex.ocx

A messagebox will appear if the ocx gets registered.