Monday, December 11, 2006

In IE, when trying to load a flash file on a page, the images get cut off after the first load using cross-domain resources.

 

My webpage is at: http://www.me.rentals.com

The flash file it references is on http://image.dev.rentals.com

 

I’ve provided a crossdomain.xml file in my root directory to allow the flash from a different sub-domain communication with the hosting domain. 

<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*.rentals.com"/>
<allow-access-from domain="image.me.rentals.com"/>
</cross-domain-policy>

I then specified the “base” atrtribute to tell the flash file where to load its resources from.  If you don’t, it’ll try to load relative to the hosting page (not what I’d expect).

 

<param name="base" value="image.me.rentals.com/flash" />

 

When I load the page up for the first time, everything is fine.

When I refresh the page or return to the page and the resources are served from browser cache, the image cuts off.  I finally identified that the behavior only occurs when the sub-domains have more then one non-matching token.  In other words, www.me.rentals.com works fine with image.me.rentals.com.  They both match xxx.me.rentals.com.

 

Whether I specify wild cards or explicit urls has no curative effect.

 

In production, the respective urls will be www.rentals.com and image.rentals.com.  I’ve verified this to work correctly.  The bug only bites me in the dev environment.  What a royal PAIN in the arse…

Image is supposed to look like this:

Flash image is supposed to look like this:

 

but instead gets cut off after loading from browser cache

Web
12/11/2006 8:50:59 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Saturday, August 19, 2006

I'm taking the week off next week.  Today I was writing a spider to crawl a website and inspect the pages.  I wanted to finish this week with some analysis on my new website and then let the data gel for the rest of the week.  Unfortunately, a "Service Unavailable" event interfered with my plans.  I guess I'll blog my psuedo-failure and move on to vacation.

The spider process starts at a given url and generates a request, retrieving the response from the site.  It then uses a regex to find all the href's, creates valid urls from each of those links, and queues each of the links for crawling.  Then it de-queues each of the links and crawls it if it hasn't already retrieved that page.  The whole thing repeats for each page sleeping for 1 full second in between requests, and stops when either the queue reaches zero links or the number of pages requested exceeds the maximum threshold.  At this time it is a single-threaded, simple app that closes its connections explicitly and makes requests very conservatively.  At least I thought so.  Does that description sound like it should crash a production website? 

I ran it against a local test site several times.  Then I hit http://www.openmicmadness.com.  I then ran it against the beta rentals site.  Everything went fine, I discovered several things about the site that I wasn't aware of, and I wanted to see more.  So I bumped the max threshold to 2000 pages and let it run for a few minutes against beta Rentals.  I didn't think much of it as it can only request 1 page per second.  Unfortuntately, the beta site is now showing "Service Unavailable".  I've performed several load tests in the dev environment on the rentals site.  While I was able to load it to the point of incredibly slow response, I never witnessed a complete meltdown.  I suspect that its only hosted on one server in production and something went kah-blewy.  Since I am not given any access to tools in production, I can't diagnose the problem and since its not a production site but rather a beta, I can't justify escalating the failure.  

OK, I just ran the thing against several local website applications and my blog.  None of them even hiccupped.  I think something definitely crashed on that server but I don't think it was anything special that I did.  I just happened to be the user(s) that got the error. 

I think I'll follow Google's example and extend the spider to crawl just one level per session.  Rather then crawl the queued links, I'll serialize them to a data store and then load that back up to kick off a future session.  I'll also extend the error response to store the context of server errors, 404's and bad links. 

Another realization I had during a crawl was how easy and useful it would be to set certain criteria to search for and then retrieve that content locally for later inspection.  For example, find all mp3's on a band site and store them in a folder.  Or you might want to scrape email addresses off of a website.  My initial purpose was to inspect pages for richness of content and compliance to html standards as well as accessibility compliance.  I've wanted to write a spider for various reasons for a very long time.  I even modified the spider example found here, once upon a time, but lost that project when nAnt deleted my C: drive.  I'm pleased to be back in the crawling game, the possibilities are endless!

C# | Web
8/19/2006 7:48:59 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback

Atlanta apartments

Atlanta Houses for Rent

Its been a work in progress for about 4 months.  Yep, that's all.  Granted, there's some piggy backing on top of ApartmentGuide logic and there is no back-end content administration system (its entirely driven by a windows service that retrieves xml data feeds to create searchable Apartment listing data) but 4 months ain't bad.  In a few weeks you'll see some bad ass mapping functionality.  This site, however, is completely different from what we've done before.  Its designed for the user who sends leads, not the client who pays for them. 

So have a look at my new Houses and Apartments for Rent site.  (google, looky here, please.  we're hoping you like us).

The quick and dirty is that it was designed to be very intuitive and highly searchable.  We have embraced the Google gods as more the a search indexer and truly a driver of technological advancement.  Consistent navigation and content (no matter who you are) is important to bots so it is a core principle in the site design.  We' ve peppered in some slick ajax and then, despite me resistance, dumped some flash on the home page.  I'm very proud.

COMMENTS WELCOME!

.Net | Web
8/19/2006 1:14:37 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Tuesday, August 15, 2006

A bookmark is describes a static place in the world.  Its a place you wish to label for revisit.  Its somewhere you wish to come back because its properties still serve you some value.  I created a bookmark today that I should have been creating all along.  I bookmarked a Google search that had more results then I had time or energy to read. 

Then it occurred to me that my url was actually a search instruction to the google machine and this bookmark was, in fact, a macro.  Gives me an interesting idea for automated testing...

Web
8/15/2006 12:01:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Friday, March 10, 2006

First I will point out that I've been tellin' this cat to blog for a year now!  I've tried to enlighten him on the potential Google-Juice that an active blogger can generate.  However, like any organic farmer will proclaim, "sometimes you just have to figure things out for yourself the hard way."

Slim is an SEO Guru who handles all of our Search Engine Optimization initiatives.  He has managed to create a culture where designing for both index-ability and usability are key concerns.  We've tried to trick the Google bots, gotten slapped, tried again, got smacked again...  Finally, everyone looks to him to tell us how to structure our sites so that people using the internet can find us without purchasing the traffic click by click.  Novel idea, eh?

3/10/2006 5:34:16 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Thursday, December 22, 2005

I used to get an awful lot of traffic from google searches.  Then I stopped blogging.  It was just a period of being terribly busy and having no time to really stay current.  Google has dropped me from their index almost entirely.  That's really not a problem for me, I have no revenue tied to this site and traffic is merely a novelty.  In fact, I didn't think I had any readers but it looks like Michael was hangin'  on!  (thanks for the support man)

Point being, the content didn't change and the posts are still there.  However, google stopped seeing updates.  I was not making contributions and therefore the index value fell of the edge of the world.  It makes sense to me the sites with frequent update are valued as they are likely including new information.  Even if that information is all jibberish, its fresh.  If other sites link in, then its authoritive. If it just sits stagnant, what value is it?  There is a perception that content at a url should never change if your intention is to increase page rank.  If you are talking about the content material and topic, yes.  If you are talking about the actual text... in a word: no!  This is, of course, my opinion based on personal experience.  One of my best friends is our SEO optimization specialist and he has been very successful with helping us show up appropriately on the search engines.  We are in slight disagreement about this point. 

I suppose I am merely pontificating on something that is always a restricitve consideration when developing dynamic websites.  You have to respect url consistency and the meaningfulness of url paths. Url paths are supposed to be meaningful.  Are they supposed to be static? 

The core thing to ensure is that a path that was reachable is still reachable and has the same meaning.  If you let a path fail in a 404, you have lost at least one visitor.  Its like writing directions to a restaurant ona billboard and then moving the restaurant.  Or, its like having your yoga schedule posted online and leaving a note on the door, "classes cancelled today."  No, I'll never let you live that one down.  Butyou might as well have left a note on the door that said, "404 - yoga teacher not found."

So now I have made my point.  Its not a good one or even an important one.  Its just an observation.  The path that you lead your visitors down should be the path you intend them to follow always.  If you realize you made a mistake and must move or change the location of their destination, make sure the signs are clear and the journey is simple.  Try to lead down the right path the first time and you won't have a problem later on.

/Blabbering/useless-observations/Meaningful-Urls/Cheap-shots-at-slim/default.aspx

Web
12/22/2005 7:25:11 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Wednesday, July 13, 2005
A simple utility that you are free to use and share to encode and decode text using HTMLENcoding and UrlEncoding. Written as a windows forms executable using .net
.Net | C# | Web | Xml
7/13/2005 7:20:08 PM (GMT Standard Time, UTC+00:00)  #    Comments [2]  |  Trackback Utility.HTMLEncoder.zip (17.16 KB)
Monday, July 11, 2005

In a previous post, and one that gets googled alot, I talked about trapping the enter key on an entire form.  When I endeavored to use my own code, I wondered why I did it the way I did.  I don't actually remember why I used a one second buffer to store the enter key press and cancel the form-post.  Basically, that approach is something you can add to a webform and forget about it. 

I was about to use it on a page I'm authoring and lo-and-behold, the developer ahead of me has abstrated out the web form class and removed my access to the form itself.  I have niether access to the html portion of the <form> tag nor access to the form element (or control) from the code behind.  So I modified the fuction to provide the following capability:

    • trap the enter key from the onKeyPress event of an element and return false when it was the enter key
    • provide the id of an alternate element to click() if the enter key was pressed

note: I debated on whether I should return false when the enter key matched.  This allows me to say onKeyPress="return trapEnterKeyPress('someElementId');" and the call to the function is pretty straight forward.  The truth is I wanted to return true when the enter key was pressed but then the call is onKeyPress="return !trapEnterKeyPress('someElementId');".  That ! is easy to miss and other developers might wonder why it doesn't work.  Splitting hairs are we?  yes!

here is the function

         //enter key trap function - traps the enter key.  
         //
If an element id is provided, it will call click on that element if available.  
         //
returns false if the enter key was trapped as source of event

        function trapEnterKeyPress(sElementIdToClick){

          //is it the enter key?

          var bIsEnterKey = (event.keyCode.toString() == '13');

          if(bIsEnterKey){

               //is there an alternative element to click instead?

               if(sElementIdToClick.length>0){

                 //make sure it exists and is clickable

                 var oEl=document.getElementById(sElementIdToClick);

                 if(oEl) if(oEl.click) oEl.click();

               }     

          }

          //return true if all clear (see note in article)

          return !bIsEnterKey;

        }

 

here's the control declaration in asp.net

 

<input type="Text" id="Zip" name="Zip" value="<%#_sZip%>"

         onKeyPress="return trapEnterKeyPress('<%#button1.ClientId%>');">

 

which renders in regular html as:

 

<input type="Text" id="Zip" name="Zip" value="30306"

         onKeyPress="return trapEnterKeyPress('_ctl0_button1');">

 

 

 

if an alternate element id is not specified or is not a clickable element, the enter key is just trapped, forcing some other method of submission
C# | Web
7/11/2005 8:48:22 PM (GMT Standard Time, UTC+00:00)  #    Comments [1]  |  Trackback
Wednesday, April 20, 2005

I was certain I'd registered for several years but then I guess its been several years.  It looks like VitaminZRecords.com was down for 3 days.  Its back up again.  I was upset with my host for not informing me.  They did, however, send an email to the address they had on record.  It just so happens that address is no longer active (due to massive spam).  So I have to leat Flare Hosting off the hook and still generally feel they are a great web host. 

Since I couldn't access my GoDaddy account because I registered my vitaminzrecords email address with them, I had to pay more than 3 times the going price to renew my domain.  Bummer.  Lesson learned?  Don't let your domain expire.

Web
4/20/2005 2:56:19 PM (GMT Standard Time, UTC+00:00)  #    Comments [1]  |  Trackback
Wednesday, April 06, 2005

I started out this post like this:

This is far from the defacto-standards pundit but it is a really good example of how painful Divs and css really are.

http://archivist.incutio.com/viewlist/css-discuss/46142

"...Sorry -- floats only displace inline content, so the background color of
adjacent blocks is going to run under the float.  The only way to keep
this from happening is to give the static content a big enough margin
for the float to sit in, but apparently you can't do this because you
don't know the width of the float."

Alright!!!  Someone finally said it!  "YOU CAN'T DO THAT!"

...and so on.

If you are working with static content and thus know how big your containers need to be, it is trivial to create a layout using divs that can format that content any way your heart desires.  However, throw in an unknown data source and expect the contents of a container to include everything from three short words to a specially formatted combination of images and text, the whole thing goes absolutely nuts.

Common problem: I want to make a container with content click-able.  I want the container to stretch to the size of the inner content and paint a border around it.  No problem,  display: inline.  Well, I actually need it to live all alone on that line.  Then set  position: relative; display: inline; and add a div after the content with clear:left;.

Let's say you have a common navigation element on which you assign "onclick"  and you want it to only be as big as the content it contains.  However, you want a group of them to appear vertically stacked on the page and control the layout properties via your css stylesheet.

There are a few considerations.  First, when you clear in IE, the width of the element does not realize it now has more room.  You will have to set white-space:nowrap;  That is the only thing that I haven't resolved yet. The rest are as follows: IE might start to vary from the standard box model. Google "Box Model Hack" to find answers to these problems. If content follows one of your clickable items, you need an element that will clear the row. It's in the example.

 <style>
.LayoutColumn{
    width:47%;
    float:left;
    position:relative;
    margin:5px;
    background-color:#f3f3f3;
    border:1px solid #c3c3c3;
}

.NavItem{
    
    position:relative;
    float:left;
    clear:left;
    white-space:nowrap;
    
    background-color:#804040;
    color:white;
    border:red 1px solid;
}

.LineClearer{
    clear:both;
}
</style>
<div class="LayoutColumn">
            A column to ensure you can do this crazy stuff inside a container
</div>
<div class="LayoutColumn">
    
            <div class="NavItem" onclick="alert(this.innerHTML)">Yessir, this actaully did the trick.</div>
            <div class="NavItem" onclick="alert(this.innerHTML)">oh yeah!</div>
            <div class="NavItem" onclick="alert(this.innerHTML)">What the ...?</div>
            <div class="LineClearer"><!--clears the row--></div>
            Content following the items
</div>

A column to ensure you can do this crazy stuff inside a container
Content following the items

 

 

Web
4/6/2005 7:51:45 PM (GMT Standard Time, UTC+00:00)  #    Comments [1]  |  Trackback
Tuesday, March 22, 2005

I have tried very hard tp adopt the industry recommendation to trash my tables and use divs.  I have studied and experimented with float, positioning, margins, dimension and, more recently, _css hacks.  I've made a concerted effort to use point units and em (relative) units for font size declarations.

In return I have had more display defects, more inconsistencies between browsers and more work to do just to make things look right. 

For example.  I have elements set to float acroos the available width that contain text.  the text is set to 12 pt.  Ooops, on Firefox, 12 pt is too big, so I used the ie hack _font-size to set IE to 12pt and others to 10pt.  OK.  Then, I got a new workstation with excellent reolution and bumped up my screen resolution.  I'm old so I cannot see the text well so I bumped my system fonts up to large.  This is perfect for me, provides maximum realestate without having to squint to see my email.

Oops!  Now my elements described above wrap because the text causes them to exceed their available width.  I am in the process of changing all those font-size declarations to pixels.  There, done.  Not w3c recommended but then w3c recommendation didn't work for me, did it?  I also have some floated elements inside containers that should work pretty consistently.  However, they are getting bumped here and there by discrepencies between browsers, platforms, font-size, image size, etc.  If I had use tables instead of margin, this wouldn't be an issue.  by definition, things will line up.  Guess what I have to do for my next maintenance release?  Convert my divs to table so they don't float funny. 

I think the spec for float is fatally flawed.  I merely want the ability to line things up in a row and let them stretch appropriately to the available screen.  Float doesn't really do this very well. 

Perhaps I will learn a "trick" along the way and find divs more useful for layout.  For now, I like them for containment.  If I have a block of text that is can be treated as a block, I love a div.  If I need to stretch something across the screen in two columns, tables. 

Web
3/22/2005 9:42:22 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback

Theme design by Jelle Druyts

Pick a theme: