Thursday, June 28, 2007

ASP.NET 2.0 and red box appearing

Ran into an issue today with a red box appearing inside of an <input type="image"> tag (which I rarely, if ever, use).  Anyway, I had it set up to use a css class that had a background-image declaration.  Apparently, there is an issue/bug with the <input type=image> tag in that you have to specify a "src=" value in the HTML to get an image to display.
 
Therefore, this will display a broken image link and does not work:
 
css declaration:
.imagelink {
  background-image: url(foo.gif);
  width:20px;
  height:20px;
}
 
html:
<input type=image class=imagelink/>
 
This does work:
<input type=image src=foo.gif />
shannon norrell


Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel
to find your fit.

Wednesday, June 27, 2007

How to mount an ISO disk image using Windows Vista

Use MagicDisc to mount an iso image on Vista http://www.magiciso.com/tutorials/miso-magicdisc-overview.htm.  Don't worry about the "Known Compatability" warning; the thing works.
 
shannon norrell

Thursday, June 7, 2007

Javascript Example code for creating "Private" member variables using closures and JSON notation:

Title: Javascript Example code for creating Objects with Public and Private “member” variables, using closures and JSON notation:

 

Wrote this bit of cool code today to rotate through a series of third party quotes .  Figured I should make a post of this most excellent function structure.

 

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////

// SETTINGS - change these values to alter the behavior of how,what and when QuoteSwapper displays quotes

// --------

var g_FirstQuoteToDisplay = 4;          // Sets what quote number is first displayed when the page loads

var g_QuoteRotationEnabled = true;      // Setting this to false will prevent QuoteSwapper from rotating and will; only display the first quote specified

var g_SecondsToDisplayEachQuote = 3;    // How many seconds each quote is displayed before rotating to the next

var g_Quotes = [

  { // Quote #1                

    quoteText: "thanks to thinkingVOICE's Call Tracking Platform we can demonstrate added value to our participating merchants every day",

    quoteSource: "Kendall Fargo CEO",

    quoteLogo: "logo_stepupCommerce.gif",

    quoteLogoX: 101,

    quoteLogoY: 53,

    quoteLogoAlt: "StepUp Logo (an Intuit Company)",

    quoteURL: "http://www.stepup.com/",

    quoteTagLine: "an Intuit Company",

    specialFrameAction : null  

  },

  { // Quote #2

   quoteText: "ThinkingVoice enables Commercial Direct to qualify leads to our sales reps and close the deal quickly. By offering timeliness and convenience to our prospects, thinkingVoice has paid off big time",

   quoteSource: "Jonathan Mirabito",

   quoteLogo: "logo_commercialdirect.jpg",

   quoteLogoX: 160,

   quoteLogoY: 52,

   quoteLogoAlt: "Commercial Direct Loans Logo",

   quoteURL: "http://www.commercialdirectloans.com/index.jsp?pageId=home",

   quoteTagLine: "",  

   specialFrameAction : null  

  },

  { // Quote #3

   quoteText: "With a simple click, potential customers connect to a live sales representative, get immediate answers to their questions and can register for a WebEx Live! service with confidence",

   quoteSource: "Alfred Pong",

   quoteLogo: "logo_webex.gif",

   quoteLogoX: 160,

   quoteLogoY: 60,

   quoteLogoAlt: "WebEx Logo",

   quoteURL: "http://www.webex.com/",

   quoteTagLine: "",

   specialFrameAction : null     

  },

  { // Quote #4

   quoteText: "adding thinkingVOICE to my email signature just makes good business sense.  And it works so easy with PLAXO.",

   quoteSource: "Mark Goldstein",

   quoteLogo: "logo_loyaltylab.gif",

   quoteLogoX: 160,

   quoteLogoY: 42,

   quoteLogoAlt: "LoyaltyLab, a division of InStoreCard",

   quoteURL: "http://www.instorecard.com/",

   quoteTagLine: ""  

  },

  { // Quote #5  

   quoteText: '<span style="font-weight:bolder;color:brown;font-family:arial mt rounded; font-size:1em;line-height:.9em;text-align:center;vertical-align:baseline;">Breaking News<br/></span><span style="line-height:1em; font-size:10px; font-family:lucida sans unicode, tahoma;margin:0;">ThinkingVoice announces deals with <a href="http://www.clearchanneloutdoor.com/" target="top" class="announcement_link">ClearChannel Outdoor</a>, <a href="http://www.servicemagic.com/" target="_top" class="announcement_link">Service Magic</a></span>',

   quoteSource: '',

   quoteLogoX: 194,

   quoteLogoY: 290,

   quoteLogo: "images/CLearChannelBillboard.gif",

   quoteLogoAlt: "ThinkingVoice announces deals with ClearChannel outdoor and Service Magic",

   quoteURL: "http://sev.prnewswire.com/advertising/20070605/AQTU18605062007-1.html",

   quoteTagLine: "source: prnewswire",

   specialFrameAction : null  

  }

]

/////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////////

// QUOTESWAPPER - this Object cycles through and displays an array of quotes, images and hyperlinks.

// ============   DO NOT MODIFY CODE IN THIS SECTION  

var QuoteSwapper = function() {

  var self = this;

  var _swapperThread = null;

  var _bRotationEnabled = g_QuoteRotationEnabled;

  var _currentItem = g_FirstQuoteToDisplay;

 

  function public() {}

 

  public.displayQuote = function( itemToDisplay ) {

    itemToDisplay = (("" + itemToDisplay!="undefined") ? itemToDisplay : g_FirstQuoteToDisplay ) % g_Quotes.length;  // stay within limits of array

    document.getElementById('quoteText').innerHTML = (g_Quotes[ itemToDisplay ].quoteText.length > 0) ? g_Quotes[ itemToDisplay ].quoteText : "";

    document.getElementById('quoteSource').innerText = (g_Quotes[ itemToDisplay ].quoteSource.length > 0) ? " - " + g_Quotes[ itemToDisplay ].quoteSource : "";

    document.getElementById('quoteLogo').src = g_Quotes[ itemToDisplay ].quoteLogo;

    document.getElementById('quoteLogo').width = g_Quotes[ itemToDisplay ].quoteLogoX;

    document.getElementById('quoteLogo').height = g_Quotes[ itemToDisplay ].quoteLogoY;

    document.getElementById('quoteLogo').alt = g_Quotes[ itemToDisplay ].quoteLogoAlt;

    document.getElementById('quoteURL').href = g_Quotes[ itemToDisplay ].quoteURL;

    document.getElementById('quoteTagLine').innerHtml = g_Quotes[ itemToDisplay ].quoteTagLine;

    _currentItem = itemToDisplay;

  }

 

  public.start = function() {

    clearInterval( _swapperThread );

    if ( _bRotationEnabled ) {

      _swapperThread = setInterval("QuoteSwapper.next()", g_SecondsToDisplayEachQuote * 1000);   

    }

    this.displayQuote( g_FirstQuoteToDisplay );   

  }

 

  public.next = function() {

    this.displayQuote( _currentItem + 1 )

  }

 

  public.stop = function() {   

    clearInterval( _swapperThread );

  }

 

  return public

}();

Sunday, June 3, 2007

Windows XP File Association Fixes - .reg files for

My Explorer Window kept on opening up to a search dialog whenever I clicked on certain types of file folder icons. I would have to right-click and choose "Explore" every time I wanted to open a folder. As annoying as this was, I continued to live with it for a number of days.


Here is a great resource for .reg files that help you to reset file associations for Windows XP.

http://www.dougknox.com/xp/file_assoc.htm


I used the one for "Directory" and all was corrected!

-shannon norrell

--
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com

Powered by Outblaze

Saturday, June 2, 2007

My thoughts on interfacing with Amazon.com through mobile devices



theWebDood <thewebdood@yahoo.com> wrote:
Date: Sat, 2 Jun 2007 19:23:37 -0700 (PDT)
From: theWebDood <thewebdood@yahoo.com>
Subject: RE:
To: "Amacker, Matthew" <mamacker@amazon.com>

No worries mate.
 
Hey, I was thinking about mobile.  
 
I think that to have the broadest coverage (pun intended), there should be two basic modalities developed for interfacing with Amazon.com through a mobile phone.
 
The first would be, as I think you mentioned, a lightweight version of Amazon.com designed and coded specifically for mobile phone web browsers.  It would be sleak and slim and have only the minimum features required for customers to easily check price and availability on a specific book, to do simple searches, and to be able to select a book and add it to their wishlist or complete checkout right there in the mobile web page.  Call this one "mobile.amazon.com"
 
The second, which you may not have considered, is an SMS-based interface that lets users quickly check prices, do simple searches, add a book to their cart and to (possibly) check out by sending a text message to 26296 (AMAZN).  
 
For example:
 
p lord fouls bane   - query for the price of "Lord Fouls Bane"
 
When query results come back they are identified as 1st, 2nd, 3rd, etc.
 
example:
"Lord Foul's Bane", by Stephen R. Donaldson, 1978.  Choices are:
  1st) Hardback, NEW, $42.95
  2nd) Paperback, used   $8.25
  3rd) Hardback, used $12.95
 
Using that information, a user could potentially reply with:
 
buy 2nd item
 
An SMS dialog may continue where we ask for their account number, etc. 
 
There are limitations, to be sure, but the experience is such that a user can find and buy a book through Amazon.com entirely through text messaging using his or her cell phone.  Call this variant "Amazon SMS"
 
- - -
Anyway, that's a brain dump of my thought stream on mobile at the moment for Amazon.
 
shannon norrell
 
 
 
Only a We support only a very few "verbs address.
 
maybe to direct that an email be sent  by sending a text message s and availability and, perhaps, to do a more aprices on books SMS interface
 

"Amacker, Matthew" <mamacker@amazon.com> wrote:
Hi Shannon,
 
    Bennett went on vacation.  So you might have sent him a note just after he headed out - so it was never passed on to the secondary.  We are very interested in getting you in here to talk to some more folks.
 
    Bennett gets back on Monday which is probably when he will respond to your note and we can get things rolling again.
 
Sorry for the delays.
 
-Matt


From: theWebDood [mailto:thewebdood@yahoo.com]
Sent: Thursday, May 31, 2007 12:00 PM
To: Amacker, Matthew
Subject: RE:

Matt:
 
I agree.  I think that we would along famously and have a lot of fun putting out some cool tech together.
 
I got an email from Bennett last week regarding scheduling an interview but things seem to have stalled or otherwise fallen into a black hole.
 
Do you know what is up?
 
-shannon
650-200-5044

"Amacker, Matthew" <mamacker@amazon.com> wrote:
Thanks for the links!
 
You should have already heard from Bennett so I hope to see you in the offices sometime soon!
 
Please let me know if you need more information about this group or the company - I think we could have a lot of fun.
 
I hope your allergies leave you alone for a bit.
 
Sincerely,
  Matt


From: theWebDood [mailto:thewebdood@yahoo.com]
Sent: Tuesday, May 22, 2007 3:24 PM
To: Amacker, Matthew
Subject: RE:

Matt:
 
Thanks for the call.  You seem like a cool guy.
 
Sorry my brain is cloudy with the allergy meds.  That site I was trying to remember is called "AListApart.com."  As we get older and more experienced as web devs, it becomes harder to find sites that actually teach us or talk about topics we are not already familiar with.  A ranomd example I just pulled up is: http://www.alistapart.com/articles/crossbrowserscripting
 
Another site I frequent is jibbering.com.  You have probably already read his famous article on closures
 
Anyhow, I think I am going home to bed. 
My head feels like it has been stuffed with cotton balls.
 
TTYL
 
shannon


"Amacker, Matthew" <mamacker@amazon.com> wrote:
Sounds good.  I'll give you a call at 2PM at 650 200 5044.
 
If for some reason I miss you please feel free to give me a call back at: 530 400 7823
 
Thanks,
  Matt


From: theWebDood [mailto:thewebdood@yahoo.com]
Sent: Monday, May 21, 2007 2:59 PM
To: Amacker, Matthew
Subject: Re:

Sure, call me sometime tomorrow.  You should definitely put me on the OSX Widgets and Vista Gadgets.  Not sure if there are many people out there who have developed both for major production distribution.  You should see some of the ones I did that weren't released.
 
-shannon
 
ps - great job with the flyouts on the A9 search box on Amazon site.  I see you did not use scrollbars and instead used Previous and Next links at the bottom.  I feel your pain.  Scrollbars are incredibly difficult to produce uysing DHTML alone; particularly cross-browser versions.  I think I may have tackled this issue, but only after much agony and bloodshed.  the reality is that < > is better so you don't have to pull down as much data for a search (since they will probably click on something from the first page anyway), it's just that UI is kind of clunky.

"Amacker, Matthew" <mamacker@amazon.com> wrote:
Hello Shannon,
        You have a great resume.  I'd like to talk to you about it and give you a better picture of the position I'm trying to fill.
        I'm available anytime tomorrow for a phone call and there are spots available on Wednesday.  Is: 650 200 5044 the best number?
        I'm glad you liked my posting.  I hope this finds you well.
Sincerely,
  Matt @ a9.com
P.S.  To give you an early taste.  My group's tasks:
            A9 Websearch on Amazon: Look at the upper right hand corner of Amazon.com for the A9 search box.
            A9.com: All UI and backend support for the A9.com site is handled by this group.
            Clickriver: All text ads on Amazon are this group.
            Mobile: Client that runs on mobile devices - not yet started.
            Desktops: OSX and Vista widgets that are soon to be released.
            Greasemonkey and bookmarklets: coming soon that will expand the reach of all A9.com properties.


Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more.


You snooze, you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.


Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.


Got a little couch potato?
Check out fun summer activities for kids.


Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.

Friday, June 1, 2007

getSimilarityScore() - uses Levenshtein Distance between two strings

I came up with this while working for Microsoft developing the Vista
Weather gadget. It was to be used to handle mis-spelings and to
otherwise find strings that were as close as possible to what had been
typed in.

This is useful code that is good to have around. It is a Perfect
Example of what I am trying to accomplish with this blog - - an archive
of Shannon Norrell cool webdood code. I write so much of it that lots
of little gems like this fall through the cracks. Half the time I don't
even remember that I wrote something, let alone recall how it was
written.

Enjoy.

-shannon norrell

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>getSimilarityScore</title>
<script language="javascript" type="text/javascript">
String.prototype.getSimilarityScore = function(c){
// Uses Levenshtein Distance between two strings algorithm
var s, that=c, l = (s = this.split("")).length, t = (c =
c.split("")).length, i, j, m, n, dis, maxLen, retVal=.95;
if(!(l || t)) {
dis = Math.max(l, t);
} else {
for(var a = [], i = l + 1; i; a[--i] = [i]);
for(i = t + 1; a[0][--i] = i;);
for(i = -1, m = s.length; ++i < m;)
for(j = -1, n = c.length; ++j < n;)
a[(i *= 1) + 1][(j *= 1) + 1] = Math.min(a[i][j + 1] +
1, a[i + 1][j] + 1, a[i][j] + (s[i] != c[j]));
dis = a[l][t];
}
maxLen = Math.max( this.length, that.length );
if (maxLen > 0) {
retVal = (1 - dis/maxLen);
}
return retVal;
};

var foo="Newcastle,wa";
alert( foo.getSimilarityScore('castel') );

</script>
</head>
<body>

</body>
</html>

My Conclusion on Best Practice HTML for eMail Marketing Campaigns

I have been asked to come up with a new twist on the banner ad - one with a real HTML text input box that a user can type his/her phone number into and a button that, once clicked, will call a SIP softswitch that will in turn ring both the advertiser's number and the customer's.

This was all well and good until I was asked if I could provide the same functionality as the banner ad, only as something that can be emailed.

Having vehemently avoided all advertising-related WebDev work for the past 12+ years, I assumed this would be an easy task and we could just send out the same HTML+CSS+Javascript that I had already coded up. Well, I was wrong.

Here are my conclusions as to the best practices for writing HTML for email campaings, such that it has the largest reach and covers the largest number of users' email clients:

  1. Create your own container DIV into which all content for your email exists. Don't count on the BODY tag existing or having any particular settings.

  2. Avoid designs that require positioning (ie no position:absolute; top:20px; left:20px; etc)

  3. Do not use background images - neither CSS (background-image) or HTML-based (bgImage).

  4. Use IMAGE tags, however, not to convey anything important

  5. Use ALT tags on every image.

  6. Always add HEIGHT and WIDTH to every image

  7. Design for images being turned off. Over 50% of today's email clientys have images turned off.

  8. Add a tag at the top of your email. "Having trouble reading this email? click here.

  9. Use in-line styles. Do not make use of the <style> tag.

  10. Message window should be 570px or less wide

  11. Design for the preview pane - make sure most of the message gets acrossin the top 300px of the email. This is the approximate height of the horizontal preview pane in most email clients.



I will try to post what I end up with as the final markup when I get finished with it.



- Shannon Norrell

Too much information? Some brand-new Data Visualization techniques that might help us sift through it

I stumbled across an interesting new Data Visualization technique that may prove particularly useful as we all must discover new ways of consuming, the vast quantities of data that swirl around us.

Though not particularly useful for my current research, (a genetic algorithm that learns keyword and keyword phrase relevancy to information requests over time), I felt that this was just too useful to forget about as I powered ahead..

sparklines
sparklines are tiny, word-like diagrams or graphs of data that are so small as to be meaningfully used as a sentence within a paragraph of text.

I didn't get it at first either, but what caught my eye was a small section of bar graphs representing the current google adsense activity:


This is powerful in that it conveys a lot of information about data in a small space and can also be realtime and dynamic. I could see diagrams of this sort as cells in a spreadsheet or as simply another column of data in a report.


Here is another Data Visualization technique that, frankly, I don't really get at the moment. instinct tells me I should make a note of it as well in light of the above-mentioned:

elastic lists
elastic lists enhance "facet browsing" as proposed by The Flamenco Search Interface Project that visualize the relative proportions (weights) of metadata values by size and that visualize the "unusualness" of a metadata weight by brightness as a user "drills down" though a large dataset, mining for answers or creating ad-hoc metadata report filters

Here is an interesting interactive demonstration of Elastic Lists


-shannon norrell