Monday, July 21, 2008

Monday, July 14, 2008

Media Feeds for Piclens Plugin using .NET 2.0

About this post
This post is about the "MediaRSS" standard and how you can use it for your own website. If you have never heard of it - never mind. But maybe you have heard of a really cool Firefox Plugin called "PicLens".

"PicLens" is a incredible surface for some internet services, like YouTube, Google picture search, Flickr, Amazon, Deviant Art. Now you can have your favorite sites in Full-screen. 3D.

Media RSS
The Piclens guys have implemented the "MediaRSS" standard - that means: Each site with an MediaRSS can be viewed in Piclens.
If you are a webmaster, you should take a look at this site.

Bellow is the Media Feeds Example for ASP.NET 2.0 C# you can create a file with name
MediaRss.ashx on the root of your site and following line of code in the Head section of your pages.
Put a Link tag with href="MediaRss.ashx" type="application/rss+xml" id="gallery" and that's all

Bellow is the code of the MediaRss.ashx

<%@ WebHandler Language="C#" Class="MediaRss" %>
using System;
using System.Xml;
using System.IO;
using System.Web;

[System.Web.Services.WebService(Namespace = "")]
[System.Web.Services.WebServiceBinding(ConformsTo = System.Web.Services.WsiProfiles.BasicProfile1_1)]
public class MediaRss : IHttpHandler {

string media = "";
string atom = "";

public void ProcessRequest (HttpContext context)
XmlDocument xmlDocument = new XmlDocument();
XmlDeclaration xmlDeclaration = xmlDocument.CreateXmlDeclaration("1.0", "UTF-8", "yes");

XmlElement rssElement = xmlDocument.CreateElement("rss");
rssElement.SetAttribute("version", "2.0");
rssElement.SetAttribute("xmlns:atom", atom);

XmlElement channelElement = xmlDocument.CreateElement("channel");

GenerateItems(channelElement, xmlDocument, context);

context.Response.ContentType = "text/xml";

public void GenerateItems(XmlElement channelElement,XmlDocument xmlDocument,HttpContext context)
string[] imageFiles = Directory.GetFiles(context.Server.MapPath("~/Images/"));

foreach(string imageFile in imageFiles)
FileInfo fileInfo = new FileInfo(imageFile);

XmlElement itemElement = xmlDocument.CreateElement("item");

XmlElement titleElement = xmlDocument.CreateElement("title");
titleElement.InnerText = fileInfo.Name;

XmlElement linkElement = xmlDocument.CreateElement("link");
string link = "http://localhost/myapp/Images/" + fileInfo.Name;
linkElement.InnerText = link;

XmlElement thumbnailElement = xmlDocument.CreateElement("media","thumbnail",media);
thumbnailElement.SetAttribute("url", link);
XmlElement mediaElement = xmlDocument.CreateElement("media","content",media);
mediaElement.SetAttribute("url", link);


public static string Utf8BytesToString(byte[] InBytes)
System.Text.UTF8Encoding utf8encoder = new System.Text.UTF8Encoding(false, true);
return utf8encoder.GetString(InBytes, 0, InBytes.Length);

public bool IsReusable {
get {
return false;

Friday, July 11, 2008

Free iPhone applications

Apple iTunes Remote
With Apple's new iTunes Remote app, you can control the music on your computer or Apple TV from your iPod touch or iPhone. Play, pause, skip, shuffle. See your songs, playlists and album art on your iPod touch or iPhone as if you were right in front of your computer.

Remote works with your Wi-Fi network, so you can control playback from anywhere in and around your home.

Features include:
- Control the music on iTunes or Apple lV
- See the album artwork on your Remote
- Search your whole iTunes library
- Control your AirTunes speakers


Mobile AIM lets you stay in touch with your friends and family right from your iPhone or iPod Touch. The app lets you communicate whenever you want, wherever you are, in whatever way that suits you best. Connect with friends and family and keep track track of status and presence updates in real time.

Features include:
-Send and receive messages over WiF, EDGE, or 3G networks.
-Connect to anyone on the AIM network worldwide, whether they're on AOL. AIM, ICQ, .Mac or MobileMe.
-Manage your Buddy List feature, choose Favorites, or add a new buddy anytime.
-Your changes are automatically synced with iChat and or Windows or Mac.
-View expressions and update status
-See who's available before you contact them
-Send IMs and SMS text messages -- even from an iPod Touch
-Take pictures with the built-in camera to use as your buddy icon

You can get started by signing in using your existing AOL, AIM, .Mac or MobileMe name, or register for a free screen name right from your device.


Facebook for iPhooe makes it easy to stay connected and share information with friends. Use your iPhone to start a conversation with Face book Chat, check your friends' latest photo, and status updates, look up a phone number, or upload your own mobile photos to Facebook while on the go.

Facebook promises even more features will be updated in the weeks and months ahead.

Google Mobile App

Google Mobile App for the iPhone or iPod Touch aims to make it fast and easy to search the Web.

Find web pages, business listings, phone contacts and more with Iess typing than ever before via Google's intelligent query completion and handy search shortcuts which appear as you type. You'll get suggestions to help you complete your query, and can see the results on a map in a single click.

MySpace Mobile

If you spend large chunks of your life hanging out on MySpace, you're "going to love Myspace Mobile for iPhone" and the iPod touch.

Features include:

- Send and receive messages
- Browse your network of friends and see their current status
- Upload and share photos from your iPhone
- Post comments on friends' profiles and photos
- Stay up-to-date with bulletins
- Search to find new friends

Thursday, July 10, 2008

How to Troubleshoot web pages in IE

Most of the Web Developers are using FireFox when developing their Web applications because their are number of plugins that can help them troubleshoot their pages. A good example for such plugin is FireBug.
Personally as a web developer i can't work without FireBug because i can debug and fix my problems very easily with FireBug.

As a cross browser developer i found many times my self in a situation where i need a FireBug like functionality for IE. After some surfing i found IEDevloper Toolbar, a good utility for this purpose made by Microsoft.

IEDevloper Toolbar is not that strong and powerful as FireBug but still provide developer a good support for debugging.

The Internet Explorer Developer Toolbar provides several features for exploring and understanding Web pages. These features enable you to:

  • Explore and modify the document object model (DOM) of a Web page.
  • Locate and select specific elements on a Web page through a variety of techniques.
  • Selectively disable Internet Explorer settings.
  • View HTML object class names, ID's, and details such as link paths, tab index values, and access keys.
  • Outline tables, table cells, images, or selected tags.
  • Validate HTML, CSS, WAI, and RSS web feed links.
  • Display image dimensions, file sizes, path information, and alternate (ALT) text.
  • Immediately resize the browser window to a new resolution.
  • Selectively clear the browser cache and saved cookies. Choose from all objects or those associated with a given domain.
  • Display a fully featured design ruler to help accurately align and measure objects on your pages.
  • Find the style rules used to set specific style values on an element.
  • View the formatted and syntax colored source of HTML and CSS

Download Internet Explorer Developer Toolbar

Wednesday, July 9, 2008

Usefull plugins for FireFox 3

I mainly used FireFox for web development because of many cool plug ins that provide a boost to the development for example the FireBug, WebDeveloper etc. Recently i have installed and using FireFox 3. I found some very cool plugins and want to share them with you. Please check the following plugins.

ScribeFire Blog Editor 2.2.9

ScribeFire is a full-featured blog editor that integrates with your browser and lets you easily post to your blog.

FireFTP 0.99.2

FireFTP is a free, secure, cross-platform FTP client for Mozilla Firefox which provides easy and intuitive access to FTP servers.

Codetch 0.4.1rc1

Get the feel of Dreamweaver in a Firefox extension. Edit your documents right next to your web pages as you surf.

Test web site for different versions of IE

Most of the time web developers come into a situation facing problems with the different versions of Internet Explorer. Where their site works fine for a specific version of IE but have some problems with other version. I my self faced this situation several times when my site just works fine for IE 7 but has many issues when i test it in IE6.
As we can only have a single version of Internet Explorer on our development machine and this issue creates a lot of panics for me. I have to configure different version of IE on different machines and then to test my code on these different machines for different IE versions.

Thanks GOD at last i found a good tool that help me get rid of this problem. This is the IETester WebBrowser.

IETester is a free WebBrowser that allows you to have the rendering and javascript engines of IE8 beta 1, IE7 IE 6 and IE5.5 on Vista and XP, as well as the installed IE in the same process.

Thanks to the
for creating such a cool WebBrowser and making it free for developers community. There is many more cool stuff available at
You can download latest version of IETester from here