July 26, 2009

Adding Street View Support to Google Maps

Google Maps API version 2.104 introduces new classes that allow you to integrate Google Street View into your Google Maps. Google Street View provides 360° horizontal and 290° vertical panoramic views for various streets around the world.

The following demos show how you can use the Google Maps API to integrate a Street View Panorama alongside a Google Map.

July 23, 2009

How to Get Feeds For Specific Labels in Blogger

Blogger generates feeds for various items on your blog including posts and comments. Not many people know that these feeds can accept certain filters. The labels filter is one of them.

You might want to publish feeds for specific labels for various purposes. As an example, Aspin.com allows coders to submit RSS file of asp related resources into their database. You can label ASP specific posts from your blog as "asp" and publish its feed. You can label php related posts as "php" and publish its RSS to another resource. You may also want to publish specific feeds for targeted audience. Labels are the suitable method to group your posts by topic. These topics can then have their individual feeds. Your visitors can subscribe to feeds of their choice. All you have to do is to publish appropriate feed URLs on a suitable location.

Here is how you can get post feeds for specific labels.

July 14, 2009

Export MySQL Data to CSV Using PHP

15 minutes into writing this article, I realized that PHP 5.1 now includes the fputcsv function that was missing from earlier versions of PHP. It formats a line (passed as a fields array) as CSV and write it (terminated by a newline) to the specified file handle. However, it is not properly documented what exactly is the "newline" character; is it CR, LF or CRLF.

I have a habit of re-inventing the wheel, so I've put together a substitute for this function that echoes the CSV data instead of writing to a file and (tries to) closely follow the recommendations described in RFC 4180.

July 9, 2009

Export Recordset Data to CSV Using ASP/VBScript

The CSV (Comma-Separated Values) file format is a text file format in which you can store tabular data, such as data from a database table. This format is can be read by various spread sheet programs such as Microsoft Excel and OpenOffice.org Calc. This format is not suitable for storing binary data.

The following ASP/VBScript code sample allows you to export data from a database table to a CSV file. The code accesses the table through an ADODB Recordset object, formats the data into the CSV format and sends the data to the browser along with appropriate response headers. This code should be saved as an ASP script on a webserver. You should see an "Open/Save As..." dialog when you access the script through a web browser.

July 4, 2009

VBScript Select Case Statement - Complete Syntax

The VBScript Select Case statement is a useful and more readable substitute for the VBScript If...Elseif statement. It allows you to execute one out of many blocks of code depending on the value of a variable.

While searching for example uses of this statement, I noticed that most of the examples available on the internet do not describe the complete syntax and usage of the statement. According to the MSDN VBScript reference, the syntax of the Select Case statement is: