feedback
Nov 28 2005

Google Analytics "Hack" to Add More Sites

by John Dyer

Google released Google Analytics (a website metrics tool based on Urchin) only to remove the ability to add new sites when it recieved too much data (cnet article). There used to be an 'Add Website Profile' link on the main admin page, but it is now removed. Humorously, the link to add a new site has only been commented out. If you View Source (Ctrl+U for Firefox users) and search (Ctrl+F) for "Add Website Profile" you can find a link that looks like "admin?vid=1151&scid=XXXXX" (XXXXX is your google analytics ID and 1151 is the code for adding a site). Just paste that into your address bar so that it looks like:

https://www.google.com/analytics/home/admin?vid=1100&scid=XXXXX

I'm not yet sure if your data will show up immediately... but at least you can add the site and start collecting data.

Happy googling!

Nov 22 2005

Transcribe Your Podcasts with Microsoft Speech SDK

by John Dyer

I am writing some automation tools for transcribing and indexing a series of audio files (i.e. podcasts). The Microsoft Speech SDK 5.1 is great for speech-enabling desktop applications and adding creating automated phone systems and I thought I'd try to use it to analyze the podcasts. Here's the code needed:

using SpeechLib;

void Transcribe (string inputFilename) {
    SpInprocRecognizer recognizer = new SpInprocRecognizer();
    fileStream = new SpFileStreamClass();       
    fileStream.Open(inputFilename,SpeechStreamFileMode.SSFMOpenForRead,true);

    recognizer.AudioInputStream = fileStream;

    SpSharedRecoContext recoContext = (SpSharedRecoContext) recognizer.CreateRecoContext();
    recoContext.Recognition += new
        _ISpeechRecoContextEvents_RecognitionEventHandler(recoContext_Recognition);

    SpeechLib.ISpeechRecoGrammar grammar = objRecoContext.CreateGrammar(0);

    grammar.DictationSetState(SpeechRuleState.SGDSActive);
}

void recoContext_Recognition(int streamNumber, object streamPosition, SpeechRecognitionType recognitionType, ISpeechRecoResult result) {
    string recognizedText = result.PhraseInfo.GetText(0, -1, true);
    // DO SOMETHING WITH TEXT
}

The only problem is that the recognition is ... not that good. One way to increase recognition is to add a discreet set of grammar rules. My current goal is to make our database of audio files searchable, so I am looking to index only a few hundred words. Limiting the vocabulary in this way drastically increases recognition. Here is the code:

using SpeechLib;

void Transcribe (string inputFilename) {
    SpInprocRecognizer recognizer = new SpInprocRecognizer();
    fileStream = new SpFileStreamClass();       
    fileStream.Open(inputFilename,SpeechStreamFileMode.SSFMOpenForRead,true);

    recognizer.AudioInputStream = fileStream;

    SpSharedRecoContext recoContext = (SpSharedRecoContext) recognizer.CreateRecoContext();
    recoContext.Recognition += new
        _ISpeechRecoContextEvents_RecognitionEventHandler(recoContext_Recognition);

    SpeechLib.ISpeechRecoGrammar grammar = objRecoContext.CreateGrammar(0);

    ISpeechGrammarRule simpleRules = grammar.Rules.Add("simpleRules",SpeechRuleAttributes.SRATopLevel|SpeechRuleAttributes.SRADynamic,1);
    object PropValue = string.Empty;

    simpleRules.InitialState.AddWordTransition(null,"Genesis"," ",SpeechGrammarWordType.SGLexical,"Genesis", 1, ref PropValue, 1.0F );
    simpleRules.InitialState.AddWordTransition(null,"Adam"," ",SpeechGrammarWordType.SGLexical,"Adam", 2, ref PropValue, 1.0F );
    simpleRules.InitialState.AddWordTransition(null,"Eve"," ",SpeechGrammarWordType.SGLexical,"Eve", 3, ref PropValue, 1.0F );
    simpleRules.InitialState.AddWordTransition(null,"Moses"," ",SpeechGrammarWordType.SGLexical,"Moses", 4, ref PropValue, 1.0F );
    simpleRules.InitialState.AddWordTransition(null,"Exodus"," ",SpeechGrammarWordType.SGLexical,"Exodus", 5, ref PropValue, 1.0F );
           
    grammar.Rules.Commit();
    grammar.CmdSetRuleState("simpleRules", SpeechRuleState.SGDSActive);
}
void recoContext_Recognition(int streamNumber, object streamPosition, SpeechRecognitionType recognitionType, ISpeechRecoResult result) {
    string recognizedText = result.PhraseInfo.GetText(0, -1, true);
    // DO SOMETHING WITH TEXT
}

Hope that helps someone!

Nov 12 2005

Flash 8 JavaScript Communiation: Problems with IE and ASP.NET

by John Dyer

If you happen to use Flash 8 JavaScript communication (which completely rocks), make sure you don't put the Flash object/embed tags within a <form> tag or else IE will freak out. This is import for ASP.NET developers because it's very common to put and opening <form> right after the <body> tag covering the entire page.

Our new podcast page (www.dts.edu/podcast) uses Flash 8 with JavaScript communication and the script.aculo.us library for effects.

Nov 8 2005

FreeTextBox 3.1.1 Released

by John Dyer

Bug fixes and ASP.NET 2.0 final.

  • Native ASP.NET 2.0 version now included (not Beta 1 or 2)
  • BUG: fixed problems when FreeTextBox was in a INamingContainer (such as a MasterPage or DataGrid)
  • BUG: DesignModeBodyTagCssClass was using ResolveUrl, now it is not
  • BUG: Refreshing toolbars could cause problems when switching from html to design mode (thanks to Telligent)
  • BUG: Reference to FtbWebResource.axd is now prefixed by ResolveUrl("~/") by default. AssemblyResourceHanlder is still an available setting AssemblyResourceHandlerPath to something else.
  • CHANGE: Moved some resource code to ClientScriptWrapper class so that .NET 1.x and .NET 2.x code could be separated
  • CHANGE: dlls were named according to MAJOR.MINOR.DOTNETVERSION.SUB (FreeTextBox 3.0.4 on ASP.NET 1.0 was 3.0.3300.4). Now they are named according to MAJOR.MINOR.SUB.BUILD to help better track release versions.
  • ADDITION: there is now an examples folder with several ASP.NET configuration and JavaScript API examples.

Nov 5 2005

Man (and machine) Back up!

by John Dyer

Thanks for those of you that sent emails and such. I had quite a fiasco with the Dell techs, but yesterday they finished replacing the motherboard and power brick and my machine is back up. DNN 3.2 is due out on Monday, so I've gotta get to it!