in

ASP.NET Weblogs

Phil Scott's WebLog

Quite exciting this computer magic
  • Bug or Not?

    Hmmm, I forget how the box model is supposed to do things in CSS, but this seems a little off to me.  What I had was a div tag with a width of 500px.  Within that I have a nested div with a margin of 25px.  I WAS trying to avoid having to do a box model hack to make sure things look OK in IE 5.x. 

    So everything is hunky dory until I take this layout and put it into a masterpage in VS2005.  I drop the ContentPlaceHolder and suddenly my 500px div is 550px large.  It seems VS2005 is trying to figure out how wide to make the ContentPlaceHolder "container," and forgetting about the margins (or padding (or borders)).  This also happens when you have a panel or anything else set to a width of 100%.  So it is just pushing it wider.  And since I'm using floats to do the layout, in VS2005 it is pushing my sidebar down because it is too wide to fit into the container.  IE 6.0 and Firefox seem to be getting this "right," but honestly I'm not too sure when Firefox is immulating bugs in IE or when IE is in compliance mode anymore.

    I'm leaning towards bug.  If anyone is curious, here's the fancy code that is screwing stuff up:

            <div style="width: 500px">
                <div style="padding: 25px; background-color: Orange; border: solid 1px black">
                    <asp:Panel runat="server" ID="test" style="width:100%">
                        jyeretjetjetj</asp:Panel>
                </div>
            </div>
            <div style="width: 500px; border: solid 1px black">
                another 500px div
            </div>


    Take out the panel and just put normal text (or even just a div with width=100%) and it displays fine.

    So, bug or not?
  • Funny places you see ASP.NET

    Even though ASP.NET has been out for quite some time, it still tickles me to see sites with an aspx extension.  I recently checked out one of my favorite bar's site, O'Shea's Irish Pub here in Louisville, and was surprised to see it was running ASP.NET on Windows 2003. 

    I know a lot of people are running ASP.NET, but it just doesnt' seem to have the penetration on the smaller sites.  Maybe now that more and more people are getting a hold of it, we'll start seeing more sites using it just because it is just that easy to put together a nice, easy to maintain site.

  • Want to get rid of spyware? Install this ActiveX control when prompted!

    I'm sure you've seen the new Anti-Spyware tool from Microsoft, so I'll spare you the elevator pitch.

    What I want to know is what brainiac decided that to install the thing you might want to either install an ActiveX control, or download an EXE file an execute it to continue? Um, isn't this crap the reason 99.9999% spyware gets installed?  Shouldn't that type of behavior be discouraged?  I was hoping that when I clicked next I'd get a screen saying "YOU FOOL!  You could have just installed something that is reporting your bank password to some crazy guy in Canada!  Don't do that crap, and maybe you wouldn't need to install this tool, moron."  But no, it actually popped up a file for me to execute (I'm running Firefox, I assume it would be an ActiveX control for IE).  FANtastic. 

     Thankfully, you can skip that step and just download the thing.  The irony of this product just gets deeper and deeper. 
  • Ben Lowery's HttpCompressionModule and Excluding Paths

    We've had a lot of success using Ben Lowery's HttpCompression module in regards to cutting down our bandwidth on text intensive pages.  The only problem we've had with using the compression module has been with existing pages that were using Response.Flush (it would throw up the "Server cannot append header after HTTP headers have been sent" exception) .  Well, no problem, right?  Ben's excellent module supports the ability to exclude paths in web.config.  And this solution works great on our test machines.  The problem was that when we went live, everything broke in regards to excluding paths.  It would start throwing the "Server cannot append header after HTTP headers have been sent" all over again.

    After sitting down and tracking down what we thought could be causing the exception, it really came down to our live site being in the root of the web, and during testing it would be in a subfolder of some sort.  Digging into the code we found the root of the evil:

    string realPath = app.Request.Path.Remove(0, app.Request.ApplicationPath.Length+1);
    if(settings.IsExcludedPath(realPath)){
       // skip if the file path excludes compression
       return;
    }

    Opps, Request.ApplicationPath is going to be "\" in the root folder, but it would be something like "SubFolder" on our test machines. Darren Neimke has a good write up on the subject.  Anyways, ripping out ApplicationPath.Length + 1 characters isn't going to work in our case. So a quick update and the problem was solved:

    string realPath = app.Request.Path;
    // if the length is only one character then we are at the root of the web and applicationPath
    // has returned "\"  Otherwise, rip out the ApplicationPath
    if (app.Request.ApplicationPath.Length > 1)
        realPath = realPath.Remove(0, app.Request.ApplicationPath.Length+1);
    else
        realPath = realPath.Remove(0,1);

    if(settings.IsExcludedPath(realPath)){
       // skip if the file path excludes compression
       return;
    }

    Hopefully this helps those of you that have seen this exception popup. Oh, and a special shout out to Ben for making a great module, and including the source too.

  • Firefox 1.0 Released

    Firefox 1.0 has been released today.  Good times.  Right now the link is being hammered, but some peeps at slashdot have posted mirrors.  Btw, here's the default homepage when you install Firefox - hosted on google.com.  Interesting...

    Personally, I've been using the moox builds of mozilla, which are the official Firefox builds, but compiled with  optimization flags that hopefully optimize the builds for your particular processor (e.g. the M3 build contain code optimized for SSE2 and the M2 build is optimized for SSE).  I feel it's a little snappier than the regular release and I've been quite happy with it.  The only downfall is that it doesn't include the snazzy installer that you get with the official releases.  Moox already has compiled the optimized Firefox 1.0 bits and posted them on his site.

  • High Five to the MSDN Folks

    I just accidently went to MSDN in IE, and wow!  I say accidently because normally I'm running Firefox and MSDN used to be all jacked up in non-IE browsers.  So, I just got in the habit of using IE for MSDN.  But, my habit slipped and I hit the MSDN page in Firefox.  I had to actually checked to see what browser I was using because I was so surprised to see the MSDN logo, and the bullet points not do crazy stuff.  Good times, good times.

    So, I salute you MSDN team and whoever had the guts to say "you know, maybe our website should look OK in something other than IE." 

  • Hactoring in Real Life

    If you haven't checked out the Metasploit Framework yet, check it out.  If you haven't heard of the thing, it's basically a tool for testing exploit code.  But it comes with a bunch of exploits and payloads set up and ready to be ran against machines.  I'm far from a hax0r, but I was able to open up a VNC connection to some random machine in my classroom that hadn't been patched in the last few weeks.  Very impressive.

    It's almost like watching actors on TV hacking.  Of course, I'm not advocating using this tool for evil.  But ignoring the thing would be down right silly.  Plus, an up to date copy with the latest exploits sure would make testing things out a lot easier for security type folks.  But for people like myself, it definitely makes you check to see that windows update is set to run automatically

  • wmdmlog.exe is dirty, dirty spyware

    I rarely use IE anymore except to go to my banks site, because I guess their site developers are idiots and can't manage to create a simple four page site that works in Firefox. Anyways, while I'm on their site, I decided to browse on over to some other banks to see how friendly they were to Firefox. I'll repeat that because I think it bares repeating: I'm thinking of switching banks because my bank requires IE. Anyways, I accidently searched for 5/3 (actually, +5/3) in google from IE. When I load the page it briefly displays 5/3 bank at the top, but quickly a "IntelliMover Business Edition 3.5 - 5-Pack - Dell" pops up, along with "Jurlique - 3.5 Hour Relaxation Retreat." Not good times. So I run Spy Boy. I run Adaware. Nothing. Nada. Zilch. So I start going through my processes and BHOs. Nothing out of the ordinary in the processes, but I run across wmdmlog in my process list. I do a search on the ol' web, and I learn that wmdmlog is a support file for Media Player. Let me rephrase that, wmdmlog.dll is a support file for Media Player. Time to die wmdmlog.exe. Sure, enough, problem solved.

    What's amazing is that in a given week I probably spend all of 30 minutes in IE, I have a Computer Science degree and am a Microsoft Certified Solutions Developer. I'm not supposed to get his. But somewhere in the past few days, something got loaded up. I guess I can install the XP SP RC, but should I do that on my mom's machine? Probably not.

    Anyways, since there are only two results for wmdmlog.exe in google right now, hopefully this post will help other people fight the good fight against the asshats of the spyware world.

  • What came next? Flamethrowers, of course

    A couple weeks ago I thought I had a novel idea with spam poetry. Zero comments and zero referrals later, I felt like an idiot. But I noticed a couple of people finding me by searching for "What came next? Flamethrowers, of course." Not knowing why someone would be searching "flamethrowers of course," I hit up google. I found not only my spam poetry post as the source, but also uncovered The Register's Spam Poetry Contest. The first article from The Register was written two days after mine bringing up a contest for Spam Poetry. The coincidence doesn't end there, by god. Their follow up article from a couple of days ago ended with "What came next? Flamethrowers, of course."

    Now, I'm not seeking fame or fortune and the ladies that come with it, but Lester Haines, if I inspired you a little props would give me a nice little ego boost. And maybe one of those t-shirts you mentioned for the winner :)

  • Spam or New Age Poetry?

    I've been getting a big kick out of reading the text that's been accompany my spam to get around bayesian filters. I've found some of them oddly poetic, so I thought I'd share my poem I received about Vietnamese Girls. Perhaps I could write a book full of them. Maybe even get a grant.

    moms and no dad.
    See also How Cells Work.
    A six-year-old boy is With WiFi equipment,
    you can access the Internet from your laptop of Manhattan.
    The Bronx is controlled environment.
    What came next?
    Flamethrowers, of course.
    good old Mr. Irrelevant and the rest of the draft extravaganza
    lines without interfering with voice service.
    Find out how DSL uses purr.
    Mufflers use some cool technology to dim the roar of an engine.
    country.
    An urban center (like New York City)
    When humans discovered fire, they learned to cook their food in a planes.
    See also How Cell Phones Work.

    Senator Chuck Hagel

More Posts « Previous page - Next page »