Monday, December 29, 2008

Database Publishing Service used with Database Publishing Wizard

In the previous post (Useful SQL Database Transfer Tool) I mentioned Service that can be installed on a a server and receive requests directly from the Publishing Wizard.

This is an open source project. The compiled version can be downloaded from Microsoft SQL Server Database Publishing Services 1.1

I installed it using the defaults.

I had to change the IIS as follows to get it to run:

  1. Change the Virtual directory properties so that it is an application
    image
  2. Change to basic authentication
    image
    You can ignore the warning about passwords sent in free form because the service only accepts https: connections

Browse to https://localhost/SqlPublish/Publish/Service.asmx and you see these WEB Service methods:

  • BeginPublish
  • CancelPublish
  • EndPublish
  • GetServiceOptions
  • PublishData
  • PublishScript

I tested a transfer using a command line like:
SqlPubWiz publish -S QWERTY\SQLEXPRESS -d Northwind -RW https://localhost/SqlPublish/Publish/Service.asmx -RWU John -RWP hidden -RS QWERTY\SQLEXPRESS -RD Northwind2 -RU John -RP hidden

This failed because the certificate has an external name:

Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

I changed the URL in the command above to: https://testing.company.com/SqlPublish/Publish/Service.asmx

I now get a .NET error

System.Data.SqlClient.SqlException: Login failed for user 'John'. The user is not associated with a trusted SQL Server connection.

I create a nw login with server authentication (a no-no normally)
image

I also changed the server properties do that it also allowed SQL Server authentication and restarted the SQL Server
image

I then had to give 'myself' permission to do stuffimage

Then it couldn't find Nortwind2 so I foolishly made "master" the DB and it created the tables in master.

It seems you have to create the DB first (who knows how you do this remotely?)

In summary:
SqlPubWiz publish -S KENTSTREET09\SQLEXPRESS -d Northwind -RW https://direct.148kentstreet.com/SqlPublish/Publish/Service.asmx -RWU John -RWP hidden -RS KENTSTREET09\SQLEXPRESS -RD master -RU myself -RP hidden

Useful SQL Database Transfer Tool

Microsoft SQL Server Database Publishing Wizard 1.1 is a great tool for transferring databases between sites.

It generates a single SQL script file which can be used to recreate a database (both schema and/or data) on a remote location. This is often used in a shared hosting environment where the only connectivity to a server is through a web-based control panel with a script execution window.

Developers and support staff can also use it collect troublesome databases from remote sites via email and zip files. This will generally use less bandwidth than a zipped backup because it will have no indexes or logs.

There is a command line option which would allow users on a remote site to run a batch file and email the resulting ZIP back to the support centre:
      sqlpubwiz script ( -C connection_string | -d local_database_name )
                       (output_file) [switches]

At 2.1 MB, it has a small enough footprint to be included in the installation package of most software products.

There is a corresponding WEB Service that can be installed on a a server and receive requests directly from this tool via the following command: 
sqlpubwiz publish ( -C connection_string | -d  local_database_name ) 
                       ( web_service_options ) [switches]

This WEB Service is probably only useful in an operational environment if you are an ISP, but it could be useful in a development environment. See: Database Publishing Service used with Database Publishing Wizard

The readme.txt file (below) includes some simple command line examples:

SQL Server Database Publishing Wizard
(c) Copyright Microsoft Corporation, 2006. All rights reserved.
Website: http://www.codeplex.com/sqlhost

=======================================
What is the Database Publishing Wizard?
=======================================

The Database Publishing Wizard enables the deployment of SQL Server databases
(both schema and data) into a shared hosting environment. The tool supports
both SQL Server 2005 and 2000 and does not require that source and target
servers are the same version.

The tool provides two modes of deployment:

1) It generates a single SQL script file which can be used to recreate
a database when the only connectivity to a server is through a
web-based control panel with a script execution window.

2) It connects to a web service provided by your hoster and directly
creates objects on a specified hosted database

The tool may also be used by hosters to script out databases for backup or
transfer purposes.

=====
Usage
=====

The Database Publishing Wizard provide both a graphical and a command-line
interface. To use the graphical interface, simply execute "sqlpubwiz.exe"
without any arguments.

To retrieve details on the arguments supported by the command-line
interface, execute the following command:

sqlpubwiz help


The tool also integrates directly into Visual Web Developer 2005 Express
Edition and all non-Express SKUs of Visual Studio. Right click on any
SQL Server database connecton and select "Publish to provider..." to launch
the wizard.

For further details on usage please see:

http://www.codeplex.com/Wiki/View.aspx?ProjectName=sqlhost&title=Database%20Publishing%20Wizard

======================================
Simple Command Line Scripting Examples
======================================

The following command will script the FooDB database existing on the local
machine and default instance using the Windows credentials of the executing
user to C:\FooDB.sql:


sqlpubwiz script -d FooDB C:\FooDB.sql


The following command will script the FooDB database from the default
instance on a machine named MYSERVER using SQL Server authentication with
the username "Alice" and the password "7h92-v6k3" to the file C:\FooDB.sql:


sqlpubwiz script -d FooDB -S MYSERVER -U Alice -P 7h92-v6k3 C:\FooDB.sql

============
Known Issues
============

For a list of known issues, please see:
http://www.codeplex.com/Wiki/View.aspx?ProjectName=sqlhost&title=DPW%20Known%20Issues

================================================
Support, Feedback, Bug Reports, Feature Requests
================================================

For support and any feedback on the tool, please use the following forum:
http://www.codeplex.com/Project/ListThreads.aspx?ProjectName=sqlhost&ForumId=1807

Friday, December 5, 2008

VB6 Developers - Can't use WebBrowser Control since IE7 installed

This should not happen for run time users.

When you open a project that is using the class SHDocVwCtl.WebBrowser (SHDOCVW.dll), you might get this error message:

File Not Found ieframe.dll\1

If you didn't save your project file after you got the error message:

  1. Exit VB6
  2. Run regedit
  3. Edit | Find
    image
    ieframe.dll\1
  4. You should find:
  5. Change the default value by removing "\1"
    image
  6. Open the project in VB6 and everything should be fine

If you saved the project after the error message, the vbp file will be damaged

FIRST FIX THE REGISTRY AS ABOVE

Option 1:    go to your backup vbp

Option 2:   

  1. edit the vbp file with notepad
  2. insert the following line in the top section
    Object={EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0; shdocvw.dll

Good Luck.

Thursday, December 4, 2008

Google v Microsoft "Chart" Components

 

Microsoft is offering Chart Controls "free". See: New ASP.NET Charting Control: <asp:chart runat="server"/>

In the mean time Google provides the same thing via their online API: See Google Chart API. The 3d piechart on the right is built dynamically using the is url: http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World

Change to a Two dimensional pie chart (cht=p): http://chart.apis.google.com/chart?cht=p&chd=t:60,40&chs=250x100&chl=Hello|World

Or a barchart (cht=bvs): http://chart.apis.google.com/chart?cht=bvs&chd=t:60,40&chs=250x100&chl=Hello|World

Or a QR code (cht=qr): http://chart.apis.google.com/chart?chs=150x150&cht=qr&chl=Hello%20world&choe=UTF-8

QR code

And if you're building a dashboard, what about a Google-o-meter (cht=gom): http://chart.apis.google.com/chart?chs=225x125&cht=gom&chd=t:70&chl=Hello

Google-o-meter with default red to green coloring

Thursday, November 13, 2008

Use Fiddler to explore HTTP GZIP compression

Once you've installed Fiddler (see Fiddler helps you analyse HTTP traffic) it's worth looking at the data savings using GZIP compression.

The above URL uses GZIP and delivers 57,127 bytes using just 12,320 bytes.

image

image

Certainly worth exploring your WWW site.

See the later post: Safari Browser provides Web Inspection Tool

Fiddler helps you analyse HTTP traffic

 

4 Guys From Rolla.com have published a helpful article on Microsoft's free HTTP traffic debugger "Fiddler" Troubleshooting Website Problems by Examining the HTTP Traffic.

You can download the latest version here.

Hints:

  1. Fiddler works fine in IE, but is hardwired to ignore traffic on localhost or 127.0.0.1

    You can debug local site traffic by using the machine name as in http://MyDevPC:8081/
  2. If you want to use Fiddler in Firefox (instead of Firebug) ,  Steve Smith shows how to do it here: Fiddler for Firefox.
    Basically you change Firefox to use Fiddler as a proxy.

 

See the later post: Safari Browser provides Web Inspection Tool.

Thursday, October 23, 2008

Cannot update/(un)install VMware - already installed

Sometimes you get this message when updating VMware Workstation:

"A previous version of VMware Workstation is already installed. Setup will uninstall the previous version before proceeding with the installation."

Try the steps in Cleaning Up After Incomplete Uninstallation on a Windows Host or go directly to VMware_Install_Cleaner.exe link at the bottom of the page.

It worked for me...

Windows Installer CleanUp Utility

If your registry becomes corrupted during installation or software upgrade, you can get into a loop of

  • Can't install because
  • Can't uninstall because

The Windows Installer CleanUp Utility does a very nice job. It even tidies up any broken uninstalls while its actually installing itself.

See http://support.microsoft.com/kb/290301

Download:http://download.microsoft.com/download/e/9/d/e9d80355-7ab4-45b8-80e8-983a48d5e1bd/msicuu2.exe

image

One wonders why "Control Panel" » "Add Remove Programs" doesn't incorporate the same functionality.

Wednesday, October 22, 2008

linuXploit_crew attacked my WEB Server using FrontPage Extensions

My test WWW site (hosted on Windows XP) recently had the start page replaced by a page that includes the following text in the first line:

[linuXploit_crew]

The full HTML of this file is included at the bottom of this post.

The offending files were written on 17-Oct-2008 [UTC +11]

image

Examination of the IIS log file (ex011016.log) shows that the files were put in place (POSTed) via author.dll which is part of the FrontPage extensions.

image

I have uninstalled FrontPage extensions using

Control Panel -> Add Remove Programs -> Windows Components ->
   IIS -> Details ->
image

I suggest you do the same.

The offending HTML

<html>
<head>
<title>linuXploit_crew</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
<div align="center">
<p>[linuXploit_crew]</p>
<p>O grupo linuXploit_crew foi criado em 05/04/2007. </p>
<p>Os membros da época Hualdo / c0d3_bl4ck_ninja / _seri4l_kill3r_ /
lordx / derf-</p>

<p>Atualmente ano de 2008 tem Hualdo / derf- e o lordx que voltou ao grupo e
_Seri4l_Kill3r_ esta off</p>
<p>O nome você criado meio na loucura e sem frescuras</p>
<p>Na época foi criado devido a revolta contra o grupo core-project um
membro antigo do grupo core-project se achou o grande hacker so porque catavamos
maquinas windows e disse que não aceitava isso porém estranhamente
eles mesmos criarão 1 ferramenta para catar pdw</p>
<p>Um dos motivos de aparacer mais um grupo brasileiro defacers é não
aceitar postar subdir em nome do grupo ou seja somente página principal
alterada ou seja a index</p>

<p>Sempre acreditei que deface é a pagina principal alterada e não
www.site.com/blablabla.htm lembro do site alldas somente index alteradas porém
um dia acabou o alldas</p>
<p>Entrava em cena o site zoneh muito bom no começo depois de um tempo
começou aparecer grupos postando /subdir na grande maioria turcos e
chineses postando para crescer no hank</p>
<p> linuXploit_crew não é o melhor ou pior somente tentando fazer
a diferença nos defacers</p>

<p>-----------------------------------------------------------------------------------------------------------------</p>
<p>The group was created linuXploit_crew on 05/04/2007. </p>
<p>Members of the season Hualdo / c0d3_bl4ck_ninja / _seri4l_kill3r_ / lordx
/ derf - </p>
<p>Currently year 2008 has Hualdo / derf-lordx and he has returned to the group
and _Seri4l_Kill3r_ This off </p>
<p>The name was created in madness and a half without fanciness </p>
<p>At the time it was created due to revolt against a group core-project former
member of the core group-project found the hacker so great because windows
machines and said it did not accept it but strangely themselves create 1 tool
to attract PDW </p>

<p>One of the reasons come from another group Brazilian defacers is not post
SUBDIR accept on behalf of the group or whether only main page changed ie
the index I have always believed that deface and the main page changed and
not www.site.com / blablabla.htm remember the site alldas index only changed
but a day just to alldas</p>
<p> Entered the scene at the site zoneh very good start after a while groups
began appearing posting / SUBDIR mostly Turkish and Chinese posting to grow
in the Hank </p>
<p>linuXploit_crew is not better or worse just trying to do the difference in
defacers</p>
<p>:: Membros:: </p>
<p>Hualdo - _Seri4l_Kill3r_ - DeRf- - LordX </p>
<p>Greetz Elite Top Team - OutLaw - Spykids - Red Eye - H4ckersBr </p>

<p> </p>
<p> </p>
</div>
</body>
</html>


Saturday, October 11, 2008

Google's Dynamic Feed Control Wizard - Put feeds on Your Web Page - makes life easy.

I used this feed control to provide a preview of stories on my Creative Writing WEB log (see http://blog.johnsawyer.info/) image

It's pretty easy with the wizard they provide at http://www.google.com/uds/solutions/wizards/dynamicfeed.html.

  1. Choose "Vertical Stacked"
    image
  2. Add the name of your Feed to the Feeds Expression
    image
    The wizard is pretty smart and finds the URL for us
    image
    Your site is now part of "Hollywood News" 
    image
  3. Now Generate the code
    image
  4. Copy it
     





    Loading...














  5. Paste it to your blog widget

    image


  6. And fix this important unkown bug


    Change feed-control to feedcontrol

SpringWidgets - An RSS reader and consolidator - Part 2 "How to add more than one feed"

See Google's Dynamic Feed Control Wizard - Put feeds on Your Web Page - makes life easy. for another (pure JavaScript) feed reader/consolidator.

SNAG-0947

Click on the gear wheel under the widget - up pops another window.

SNAG-0948

Click "Prefs" and manage away to your heart's content

SNAG-0950

From JavaScript Widget

You'll see in the snippet below that the feeds are separated by a "|" [concatenate] character.
[<feed1>|<feed2>]

<!-- SpringWidgets | RSS Reader (#23) | Blogger | Generated on 09/18/2008 -->
<object allownetworking="all" allowscriptaccess="always" align="middle" data="http://downloads.thespringbox.com/web/wrapper.php?file=RSS Reader.sbw"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
type="application/x-shockwave-flash" height="318" id="springwidgets_23" allowfullscreen="true"
width="230">
<param value="all" name="allowNetworking" />
<param value="always" name="allowScriptAccess" />
<param value="true" name="allowFullScreen" />
<param value="http://downloads.thespringbox.com/web/wrapper.php?file=RSS Reader.sbw"
name="movie" />
<param value="param_param=http%3A%2F%2Ffeedproxy.google.com%2FJohnSawyersLatestWriting|http%3A%2F%2Ffeeds.johnsawyer.info%2FLglf|http%3A%2F%2Ffeedproxy.google.com%2Fjohnsawyer%2FJkyY¶m_style_borderColor=0x33FFFF¶m_style_brandUrl=¶m_compactView=false¶m_blurbLength=256"
name="flashvars" />
<param value="high" name="quality" />
<param value="transparent" name="wmode" />
<param value="0x000000" name="bgColor" />
</object>
<div style="font: 11px/12px arial; width: 250px;">
<a href="http://www.springwidgets.com/widgets/view/23/?param_param=http%3A%2F%2Ffeedproxy.google.com%2FJohnSawyersLatestWriting|http%3A%2F%2Ffeeds.johnsawyer.info%2FLglf|http%3A%2F%2Ffeedproxy.google.com%2Fjohnsawyer%2FJkyY¶m_style_borderColor=0x33FFFF¶m_style_brandUrl=¶m_compactView=false¶m_blurbLength=512&width=250&height=300"
target="_blank">Get this widget!</a></div>
<div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal;
font-size: 11px; line-height: 12px; font-size-adjust: none; font-stretch: normal;
-x-system-font: none;">
</div>
</div>

Sunday, September 21, 2008

How To Set the Default Spellchecker Dictionary in Microsoft Word 2003

If you find the default language changing in MS Word 2003, you need to change the normal.dot template.

To do this, open a new Microsoft Word document, cut and paste some text into it from somewhere, and then click on Tools/Language/Set Language and select English (whatever).

Next, whilst English (whatever) is highlighted, and the option Detect language automatically is selected, click on the Default button.

You should get a message indicating that the template.dot template will be changed and that all new documents from now on will use the whatever dictionary by default. NB: New documents.

I suspect that this needs to be done each time you change the underlying template.

Thanks to Liz Jamieson: How To Set the UK Dictionary as Default Spellchecker in Microsoft Word 2003

Thursday, September 18, 2008

SpringWidgets - An RSS reader and consolidator

See Google's Google's Dynamic Feed Control Wizard - Put feeds on Your Web Page - makes life easy. for another (pure JavaScript) feed reader/consolidator.

SNAG-0908

SpringWidgets has given me a tool that I can put on my traditional site at http://johnsawyer.info/.

It contains 3 feeds, My Traditional Site, My Techo Blog, and my creative writing blog.

You can select the feed via the arrows or via the menu.

You can get a copy of this widget by using the "Options" button. SNAG-0909

 

 

 

I got one for my Google home page

SNAG-0910

and my desktop.

SNAG-0911

 

 

I also got a reskined  copy of this widget for the side bar of this blog.

Try It!

Wednesday, September 17, 2008

Windows Live Writer is a pretty good tool for making and updating BLOGs on Blogger.com

After a few weeks struggling with JavaScript rich text editors, I found  Windows Live Writer. It allows me to write my post in windows using familiar tools.

I can view the post

  • normally,
    SNAG-0898
  • in a web layout using the style sheets on the target blog
    SNAG-0899 
  • on as a WWW preview or HTML
    image
  • HTML

I can

  • publish
    SNAG-0901 ,
  • choose my BLOG
    SNAG-0902 
  • Edit or delete an existing post
    SNAG-0903

Excellent

There are two features that I found to be particularly useful:

  • Paste special has a number of paste options
    SNAG-0904
    I use the Thinned HTML method.
    The Writer's built in editor is pretty good for my techo blog but I need the research and lookup features of MS Word for my Creative Writing blog. When I'm ready to publish, I just save the word document as HTML, copy the data from MS Word & paste special into Writer.
  • the Insert Syntax Highlighter is a much safer method of pasting in code snippets without the danger of breaking the HTML on the target page
    SNAG-0905 
    You still have to include styles and script in the Blog's main template. I describe that in my earlier How to highlight code in a blog post. That's just a one off exercise.

There are lots of Plug-ins that are worth exploring.

One negative

I could not install the program without rebooting the PC. It got to 99% and then it just hung.
image Other than that it's been great and I've been far more productive.

Build your own VB.Net Search Engine (Part 1)

I wanted to produce my own site search engine using VB.net and I chose
  • Html Agility Pack  for HTML page parsing
      - Extract word list for indexing
      - Extract a list of embedded links
  • lucene.Net as the search engine

This post shows the steps I took to

  • parse the the document
  • produce a word list
  • hint at how to add the word list to lucene
    (Part 2 is to come)
  • extract each link

Part 2 will describe the lucene.Net

  • Indexing
  • Lookup
The Main Process

When the HTML has been obtained, text is passed to ProcessHTML below.

  • The document is parsed with LoadHtml
  • The words are extracted with ConvertContentTo
  • a collection of links is built using SelectNodes("//a[@href]")
    Sub ProcessHTML(ByVal html As String, ByVal url As String)
Dim doc As New HtmlDocument
doc.LoadHtml(html)
Dim sw As New StringWriter
ConvertContentTo(doc.DocumentNode, sw)
Dim wordlist As String = sw.ToString
Dim lDoc As New Lucene.Net.Documents.Document
lDoc.Add(New Field("text", wordlist, Field.Store.YES, Field.Index.TOKENIZED))
lDoc.Add(New Field("url", url, Field.Store.YES, Field.Index.TOKENIZED))
iw.AddDocument(lDoc)

For Each link As HtmlNode In doc.DocumentNode.SelectNodes("//a[@href]")
Dim att As HtmlAttribute = link.Attributes("href")
Dim a As String = att.Value
If Not a.StartsWith("#") Then
Extracting a list of words

The following code builds a list of words. It has been adapted from C# code here.
It is also one of the samples in the download.

   Sub ConvertContentTo(ByVal node As HtmlNode, ByVal tw As TextWriter)
For Each subnode As HtmlNode In node.ChildNodes
ConvertTo(subnode, tw)
Next
End Sub
Sub ConvertTo(ByVal node As HtmlNode, ByVal tw As TextWriter)
Dim html As String
Select Case node.NodeType
Case HtmlNodeType.Document
ConvertContentTo(node, tw)
Case HtmlNodeType.Text
' script and style must not be output
Dim parentName As String = node.ParentNode.Name
If parentName = "script" Or parentName = "style" Then
Return
End If
' html = node.
html = node.InnerText
' is it in fact a special closing node output as text?
If (HtmlNode.IsOverlappedClosingElement(html)) Then
Return
End If
' check the text is meaningful and not a bunch of whitespaces
If (html.Trim().Length > 0) Then
tw.Write(HtmlEntity.DeEntitize(html) + " ")
End If
Case HtmlNodeType.Element
If node.Name = "p" Then
tw.WriteLine("")
End If
If node.HasChildNodes Then
ConvertContentTo(node, tw)
End If
End Select
End Sub

The HTML parsing was pretty quick - much quicker than an earlier approach using regular expressions.

Tuesday, September 16, 2008

Found It: The list of email subscribers in FeedBurn

I spent ages looking for the list of email subscribers in the FeedBurn Dashboard.
I did find FeedBurner Email Overview and FAQ, but it didn't actually say what to do.

Its real easy when you know how.

Feedburner --> Dashboard --> Publicise --> Email Subscriptions



Then right down the bottom - just above Save

Click View Subscriber Details


There they all are


Maybe I'll write about using Excel (2003) to collect the data regularly.

Monday, September 15, 2008

Adding "Email this post" to each Blogger post


Feedburner does have a "FeedFlare" facility that allows users to email an individual post but it means that they have to fill out a form and type a "Captcha".

Most people resist this.

Thanks to Ben Hall's 'Add link building links your blogger posts' I added a more conventional href="mailto:..." entry to the bottom of each post.

The following code goes just before <div class='post-footer-line:

<a expr:href='"mailto:?body=Thought you might like this: " + data:post.url + "&amp;subject=" + data:post.title'>Email It!</a>

NB: it is pretty important that you use the string &amp;Subject= when pasting in the HTML template

Thursday, September 11, 2008

Overcoming Problems with AdSense for Search

sourcehealer.net has a Google Custom Search on each of its pages. This is implemented via personalised code javascript code generated by Google as you create each new ad channel.

Search Box

The snippet is pasted to the page where you want it.
We also need to place the style import on the page:
There was a problem with the search box. It was caused because ASPX Master Page generated
tags in unexpected places and this meant that the
tags had to be rearranged carefully or the wrong form was submitted or it used the 'put' method (which is the ASPX default)

The Results Page

The snippet is pasted where you want Google to display the results (and targeted ads).
This all works well until you attempt to have a page that resizes itself to match the browser.
  • changing var googleSearchFrameWidth = 800; to less than 800 will not display results if you are using FORID:9 (Ads on the right only)
  • resizing after download proved particularly difficult
  1. the results are displayed in an iframe which can't easily be controlled using CSS
  2. IE7 treats offsetLeft differently than the others
  3. detecting the browser caused a long search but resulted in a very simple result, see
    another way to detect IE7 in Javascript
  4. finding the iframe was supplied by Changing properties for the search results iframe

The resulting code is driven by <body onload="myOnLoad();" onresize="myResize();" ...

See the resulting resizable page in action.

Tuesday, September 9, 2008

How to highlight code in a blog

When you want to include a Code Snippet in your blog, it looks better like this:

Dim dt As New DataTable
With dt.Columns
.Add("Title")
.Add("Start", Type.GetType("System.DateTime"))
.Add("End", Type.GetType("System.DateTime"))
.Add("Content")
.Add("Location")
End With

You can do this by:
Step 1
Obtain the syntax highlighter from here
Step 2
Copy the compressed js and the css files to some friendly WWW site
Step 3
Change your Blogger HTML template to include a css link just after the head tag

Step 3

You then copy the following JavaScript links after the outer wrapper

Step 4
You then add the following javascript:

All done!

Now when you include a snippet in your a blog, just surround it with pre tags as follows:


NB: Push past this error message, but check that your blog still displays.

Google Calendar Service hosts a Gig Guide

Google Data APIs allow your client applications to interact with Google services such as Picassa Web Albums, Blogger Data and Calendar Data.

The .NET version of the API can be downloaded from here.

When Yarra Community Music Network wanted a Gig Guide on their site, I provided it by


  • using the Google Calendar service to maintain a list of events via a browser and
  • accessing this from the WEB application using Google.GData.Calander namespace in the API (see code snippet below)

SecurityException:

Everything worked well on the local development site, but when it was loaded to the GoDaddy virtual WEB hosting, the page failed with a message like:

“System.Security.SecurityException: That assembly does not allow partially trusted callers”

This was finally overcome by using the Google API that was generated using “Allowing Partially Trusted Callers”.

It is in the “\Program Files\Google\Google Data API SDK\Redist\ASP.NET” folder







You must use the 1.2.2 (or later) version of the API. Earlier versions do not work.

(and explanation of sorts is in the README.TXT file)


WARNING

Those assemblies here are identical to the assemblies in the Release directory, with the exception of being marked as PartiallyTrusted. If you
do not know what this means, or what the potential implications are for your website, refer to MSDN and search for

AllowPartiallyTrustedCallers

to get the information you need to use this correctly.

Note, while we believe that the Google Data assemblies follow security protocol, they do allow to call other websites directly, and hence
it is up to you, the developer of the website, to make that final judgement call. The assemblies in this directory are provide as is, and
just as a matter of convienience, as it is easy enough to recompile the code yourself.



A preliminary code snippet





With query
.Uri = New Uri("http://www.google.com/calendar/feeds/default/private/full")
.StartTime = Now.AddDays(-28) ' Set the date range
.EndTime = Now.AddMonths(6)
End With
Dim feed As EventFeed

With service
.setUserCredentials("me", "secret") ' *** you know what to do
feed = .Query(query)
End With
Dim dt As New DataTable ' store the results in a table for sorting
With dt.Columns
.Add("Title")
.Add("Start", Type.GetType("System.DateTime"))
.Add("End", Type.GetType("System.DateTime"))
.Add("Content")
.Add("Location")
End With
While feed.Entries.Count > 0
For Each entry As EventEntry In feed.Entries
With entry
For Each w As Object In .Times
If .Status.Value.Equals(EventEntry.EventStatus.CONFIRMED_VALUE.ToString) Then
' Only process confirmed events (in case a date in a repeating event has been deleted - say because of holidays)
Dim dr As DataRow = dt.NewRow
dr!Title = .Title.Text
dr!Start = w.StartTime
dr!End = w.EndTime
dr!Content = .Content.Content
dr!Location = .Locations(0).ValueString
dt.Rows.Add(dr)
End If
Next
End With
Next
If feed.NextChunk = Nothing Then
Exit While ' the data is delivered in "chunks"
End If
query.Uri = New Uri(feed.NextChunk)
feed = service.Query(query)
End While
For Each dr As DataRow In dt.Select("", "Start") ' now get the events based on start time
With dr



See: Sorting photo data from Google's Picasa API for a later description of the API.