viperfx07 is here to blog about hacking, cracking, website, application, android, and many more.

Tuesday, October 19, 2010

RSS 2.0 vs Atom 1.0

11:05 PM Posted by viperfx07 No comments
This week's lecture is about jQuery and RSS. Since I've done a lot of jQuery in my project, let's talk about RSS. I've already used RSS since my bachelor (so around 4-5 years). I use RSS to get Manga update, read news, and get Android update (because I've got a new toy called Samsung Galaxy S). The RSS client I use is Opera (browser). I personally like Opera more than any RSS client such as Mozilla Firefox (browser) or Thunderbird. As a browser, Opera has mail client as well.

There is an alternative RSS standard called Atom. The following is a good comparison quoted from http://blog.webreakstuff.com/2005/07/rss-vs-atom-you-know-for-dummies/. According to the comparison, Atom wins most of the battles.


1. While RSS has two main publishing protocols, Atom has one standardized approach. This waives off some of the interoperability issues between using both the Blogger protocol and MetaWeblog (the two protocols for RSS publishing). Best approach: Atom

2. When it comes to required content on a feed, Atom is much more restrictive, needing more data in order to be valid. RSS has a more loose approach. This has generated some discussion: ultimately, I like how Atom requires “last update” timestamps, but I like how RSS isn’t as restrictive to be standard. Best approach: Both have their strong side

3. RSS requires escaped HTML or plain text, while Atom allows for other forms of data. This increases human-readability of an Atom feed, even though it complicates the publishing process (because you have to specify the kind of data you’re publishing). Best approach: RSS (assuming that a feed is meant for automated consumption – human readability is a task for the reader or aggregator)

4. Atom clearly distincts partial content from excerpts, while RSS doesn’t. This clearly makes a difference, because there’s no way to know when an item on an RSS feed is a full story or an excerpt (that requires loading the original page in order to continue reading). Best approach: Atom, clearly.

5.Auto-discovery is standardized in the Atom specification, whereas in RSS there have been several ways to discover feeds, to this date. Best approach: Atom even though it is not a grave situation for RSS.

6. Aggregating and extracting content is one of the most important issues, and the one that clearly gives Atom an advantage. RSS allows content only inside a single monolithic rss document including several entries. Atom on the other hand allows for single Atom Entry documents, that make syndicating, aggregating or reusing single entries of a feed a much easier process. Best approach: Atom


Examples of RSS & Atom:

RSS 2.0


<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
        <channel>
 
                <title>Example Feed</title>
                <description>Insert witty or insightful remark here</description>
                <link>http://example.org/</link>
                <lastBuildDate>Sat, 13 Dec 2003 18:30:02 GMT</lastBuildDate>
                <managingEditor>johndoe@example.com (John Doe)</managingEditor>
 
                <item>
                        <title>Atom-Powered Robots Run Amok</title>
                        <link>http://example.org/2003/12/13/atom03</link>
                        <guid isPermaLink="false">urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</guid>
                        <pubDate>Sat, 13 Dec 2003 18:30:02 GMT</pubDate>
                        <description>Some text.</description>
                </item>
 
        </channel>
</rss>

Atom 1.0


<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
        <title>Example Feed</title>
        <subtitle>Insert witty or insightful remark here</subtitle>
        <link href="http://example.org/"/>
        <updated>2003-12-13T18:30:02Z</updated>
        <author>
                <name>John Doe</name>
                <email>johndoe@example.com</email>
        </author>
        <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
 
        <entry>
                <title>Atom-Powered Robots Run Amok</title>
                <link href="http://example.org/2003/12/13/atom03"/>
                <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
                <updated>2003-12-13T18:30:02Z</updated>
                <summary>Some text.</summary>
        </entry>
 
</feed>

Saturday, October 16, 2010

Future Web Experience

11:59 PM Posted by viperfx07 No comments
I found this video when trying to relax my brain after studying for Contemporary Telecommunications. The video shows the Aurora ( Mozilla-Lab's concept ) and many future web applications that will WOW you...

Check this out...


Tuesday, October 5, 2010

jQuery plugins that I use on my project

1:59 PM Posted by viperfx07 No comments
To make life easier, I use some jQuery plugins to do my project website.
Note: I recommend that if you use jQuery as your Javascript library, don't use other Javascript libraries like prototype and scriptaculous. It may burden the users to load the scripts eventhough they have fast connection. Just stick with one Javascript library.
Find the alternative plugins that use your Javascript library.

For example: Lightbox 2 use prototype and scriptaculous as its main framework. If you use jQuery, you can use jQuery.lightbox.

There are 2 plugins that I wanna discuss:

1. FancyBox
A tool for displaying images, html content and multi-media in a Mac-style "lightbox" that floats overtop of web page. It was built using the jQuery library. Licensed under both MIT and GPL licenses. You can find the example on http://fancybox.net/.

It is a very good plugin and very easy to use when you want to make a picture gallery with decent animation. In my opinion, it's better than jQuery lightbox, because it can display html content and multimedia, not limited to image.

2. jShowOff
jShowOff is a jQuery plugin for creating a rotating content module. Basically, it's a great tool for making a slideshow of your pictures. It has nice effects and easy to implement.

Happy coding...

Week 9 Practice: Database

1:33 PM Posted by viperfx07 No comments
This week's challenge is not so hard, just basic queries that we might use on our project.

The challenge:
1. Use the INSERT command to create a couple of new books in the table
2. Use the SELECT command to find all books whose title begins with W
3. Use the SELECT command to find all books whose price is less than 10
4. Use a LIMIT clause on a SELECT command to just list the first two books
5. Use both LIMIT and ORDER BY in a SELECT command- which one happens
first? (hint: use ORDER BY bookid LIMIT 2)

If you wanna try the query, just go to http://www.w3schools.com/sql/sql_tryit.asp. Note: LIMIT clause doesn't exist on the website

The answer:
1. For number 1, you can copy and then modify the value of the following query.

INSERT INTO books (title, author, isbn, cost)
VALUES ('Managing Enterprise Content', 'Barry Liu', 363562425127189, 57)

2. SELECT * FROM books WHERE title LIKE 'W%'

3. SELECT * FROM books WHERE cost<10

4. SELECT * FROM books LIMIT 0,2 or SELECT * FROM books LIMIT 2
note: 0 means the starting row (the row starts with 0). 2 means how many records we want to
get from the starting row.

5. SELECT * FROM books ORDER BY bookid LIMIT 2.
The query shows the first 2 records of books table after it's sorted by its bookid,