What really is an RSS feed?

If you have been trying to make sense of all the Web 2.0 hype, you probably have wondered what RSS is. To me an RSS feed is:

  • a mechanism to inform people of changes to your website content
  • an XML document (that conforms to the RSS specification),
  • accessible over HTTP
  • that automatically updates when you update your website content

Let's use a sample from the RSS Specification page at Harvard. The location of the RSS feed file is:

http://media-cyber.law.harvard.edu/blogs/gems/tech/rss2sample.xml

Once you point your RSS Reader to the above location, it reads the feed and displays it in human readable format. Here is what my favorite Reader, Netvibes displays:

Feed Reader

Lets take the XML file apart. The channel represents a feed.

<title>Liftoff News</title>
    <link>http://liftoff.msfc.nasa.gov/</link>
    <description>Liftoff to Space Exploration.</description>
    <language>en-us</language>
    <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>

The title ("Liftoff News") usually shows up as the feed title in your reader. The link is a URL to your main site/blog etc.

The most important pieces in the feed are items. These show up as a list in your reader. If this was a feed of your blog, then each item would represent a blog post.

<item>
      <title>The Engine That Does More</title>
      <link>http://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp</link>
      <description>Before man travels to Mars, NASA hopes to design new engines
        that will let us fly through the Solar System more quickly.  The proposed
        VASIMR engine would do that.</description>
      <pubDate>Tue, 27 May 2003 08:37:32 GMT</pubDate>
      <guid>http://liftoff.msfc.nasa.gov/2003/05/27.html#item571</guid>
    </item>

Each item has a title, link, description and guid. The title ("The Engine That Does More") appears in the feed. The description is what appears when you hover your mouse over the item title in most readers. The link is where you are redirected to when you click the item (which is the whole purpose of publishing the feed if you ask me). I am assuming the guid is so that the reader can tell two posts apart even if they have the same title.

Resources

Leave a Comment

Monitor batch jobs with Oracle XE

Since installation, the Oracle 10g XE on my desktop has mostly been used for quickly testing how database stuff works. Last week I finally got around to digging a bit deeper into the HTMLDB/Application Express part.

Lets say you have batch jobs on your system. Every morning management requires a report of the previous day’s run. Fortunately, your batch jobs log their status in a table. Now you could always run a query against this table, spool the data and email it to management. Or you could create a report using Application Express. Consider:

  • No software to deploy on management desktops (need a browser though)
  • You aren’t the messenger that delivers bad news about batch job failures
  • A browser based report looks a lot more impressive than spooled CSV (especially when your boss is trying to impress his boss)
  • Not wastefully repetetive or mind numbingly boring

So here is how you go about impressing management:

  1. Login to your desktop Oracle XE instance as a user with DBA privileges
  2. Create a new user – say rss
  3. Create a database link to your application database(say remdb) that has the batch log table(app_batch_log)
  4. Create a public synonym (app_batch_log_remdb) for this remote table (app_batch_log@remdb)
  5. Grant select on app_batch_log_remdb to user rss
  6. Logout and login to Oracle XE as user rss
  7. Choose Application Builder >> Create Application >> Create Application from the (rather picturesque) XE menu
  8. Enter your application name and click Next
  9. Select Report as Page Type, SQL Query as Page Source and enter your query (SELECT * FROM app_batch_log_remdb). Click Add Page.
  10. Click Next thrice
  11. Change Authentication Scheme to No Authentication and click Next twice
  12. Click Create
  13. Click Run Application

Here is a screen capture of the application creation process (Steps 7 thru 13).

To deploy:

  1. Enable HTTP access to your XE instance as described here
  2. Copy the URL from the last step and replace the 127.0.0.1 with your desktop IP address/hostname
  3. Send off to those interested.

Leave a Comment

Socializing

Eddie Awad's blog posts have a nice row of social bookmarking icons at the bottom. These are courtesy of the Sociable plugin for WordPress. Each of these bookmarks the post at the associated social bookmarking site.

I have always thought it would be nice to have this on my blog. Since I can't use plugins willy nilly at WordPress.com, I had to find another way. Enter the Socializer by Pierre Far. Provides a way to bookmark your blog on a whole bunch (~40 at last count) of bookmarking sites. To make it easy to use:

1. I rolled my own chicklet : 69116222284211458404467ff.png
2. Created my custom URL http://ekstreme.com/socializer/?url=http%3A%2F%2F<my url>%2F&title=<my title>
3. Used the image and URL to create a Bookmark to my own blog

Not the same thing, but a pretty good hack even if I say so myself.

Comments (41)

Chicklets

i-found.png
a-wayto.png
roll-myown.png
chicklets.png

Here, here and here.

Comments (4)

Really Simple Syndication?

Everyone is a genius at least once a year. The real geniuses simply have their bright ideas closer together.
Georg Christoph Lichtenberg (1742 – 1799)

About 6 months ago, I moved. And a brilliant idea was born. Why get a landline when I can have a cell phone for the same cost? I promptly signed up for a wireless service. 1000 free minutes a month, with unlimited nights and weekends. For a few months I diligently monitored my usage on the providers website to ensure I stayed within the free minutes. Usually 600 to 700 minutes a month. Great !

Until last month. Usage 1500 minutes. $0.50 per extra minute. You do the math. No, the $0.50 is not a typo.

Secure RSS feeds anyone?

  • If the phone company had one, I wouldn't have to give up my morning coffee after the phone fiasco.
  • If my bank had one, I wouldn't have to login to their website to know I was penniless.
  • If my credit card had one, I would instantly know about all my spouse's shopping sprees. I could then perfectly time the fight for reinstatement of coffee privileges.
  • If the credit bureaus had one, I would have a good laugh at any identity thieves without waiting for the annual report.

My stroke of genius for the year! I had grand plans for a patent, lawsuits and millions. Unfortunately, google reveals that someone else stole my ideas before they were born. :|

Leave a Comment

Three Men in a Boat

Growing up, some of my favourite reads were newly purchased English texts for the year. One chapter that I remember is "Packing" – an extract from Jerome K. Jerome's "Three men in a boat". I happily stumbled on the same at the Literature Page recently.

I just can't fathom how they can have such a great collection of literature for free (was too busy reading the literature to research their "about" page). So I'll just consider it another wonder of the Interweb for now.

Leave a Comment

Dumb databases

Mark Rittman's post on Oracle pet peeves linked to Jeff's original list for SQL Server. Hardened by constant exposure to brilliant ideas (such as the comma separated list in a column), I was only mildly amused. I am still not sure what is scarier: the mildness of my amusement or these comments from a guy who claims to be an OCA/OCP?

Leave a Comment

Goodbye Yahoo Plus

This news item from Yahoo says

Yahoo notified Yahoo Plus subscribers that the service will terminate on April 22.

Maybe it is good news. POP access to Yahoo mail (on the yahoo.com domain) used to be part of this service. So I hope this means POP access to Yahoo mail will be free after April 22. Well it could also mean that POP access will be offered as a cheaper stand alone service, but I am really hoping for the former.

Why? So that I can monitor my Inbox using Netvibes of course. Paying for POP just for this reason bothers the miser in me.

Leave a Comment

Locking in Oracle – DML Locks

DML Locks

These are the locks that Oracle places on your behalf when you execute DML. For the purposes of this post (and my sanity), let’s divide DML into 2 categories: Regular DML (the garden variety of INSERT, UPDATE, DELETE, SELECT FOR UPDATE) and Exotic DML (LOCK TABLE …)

This post describes the most common types of locks i.e. locks that are automatically placed on your behalf when you execute Regular DML.

1. Row Locks

These are the simplest part of the Oracle locking scheme to understand. Every row is either locked or it is unlocked. That’s it (no lock types to consider). When you execute regular DML, row locks are obtained on the affected rows.

A salient feature of Oracle’s locking mechanism is the the way row locks are recorded. The fact that a row is locked by a transaction is NOT stored in a centralized list of locks. Rather, the transaction id is stored as part of the row data itself. When your transaction needs to lock a row, Oracle inspects if the transaction specified on the row is still active. If yes, the row is locked by that transaction and your transaction is blocked. If not, the row is locked by your transaction and your transaction id is now stored on the row.

2. Table Locks

These are the ones that come in various modes. When a DML Table lock is in place, another session cannot execute DDL on this table, thus preventing alteration of the table structure while you still hold a table lock. DML table locks are also referred to as TM locks.

The fine Oracle manual tells you that Table locks can be taken in 5 different modes:

RS: row share
RX: row exclusive
S: share
SRX: share row exclusive
X: exclusive

However if you look closely, you will notice that you have to explicitly lock a table (using LOCK TABLE …) to get a lock in any of the last 3 modes (S, SRX, X). The other two modes (RS and RX) are the only ones automatically taken when you execute regular DML. So for now, let’s just consider these two.

The RS (row share) table lock is taken when you execute a SELECT … FOR UPDATE. This is in addition to the row locks on whatever rows are selected as a result of this statement. When this lock is in place other transactions may obtain RS, RX, S and SRX locks on this table. No X locks can be obtained though.

The RX (row exclusive) table lock is taken when you execute an INSERT, UPDATE or DELETE. Again, this table lock is in addition to the row locks on affected rows. When this lock is in place other transactions my place RS and RX locks but not S, SRX and X.

As far as regular DML is concerned there is no difference between the RS and RX locks. The difference only comes into play if you execute LOCK TABLE. This should be pretty rare anyway.

Anything else? Err, yes. In addition to the RS and RX locks on regular DML, S (share) table locks are taken on your table if all of the following conditions are satisfied:

  1. Your table has FKs to other tables (i.e. it has parent tables).
  2. You are updating the PK/UK columns or deleting on a Parent table of this table
  3. The foreign key from your table to this Parent table in unindexed

Usually you do NOT update the PK columns of a table. You usually index your FKs. So you shouldn’t hit the issue of this kind of lock when you execute regular DML, right? Well, almost. There is a little issue with the 9i Merge statement that might unexpectedly cause share table locks to appear.

Update: Applies only to 9.2.0.4 or earlier. See this discussion for details.

Comments (4)

New York City

The best thing about a digital camera – you can click away till the battery or room on the SD card run out, without much regard for money or talent. Here are some pictures from a clicking spree at the Big Apple.

Copy of 100_0659.JPG Copy of 100_0649.JPG Copy of 100_0614.JPG

Copy of 100_0478.JPG Copy of 100_0477.JPG Copy of 100_0629.JPG

Comments (2)

« Newer Posts · Older Posts »