Software Engineering : This category relates to interesting computer related stuff that I am researching or reading about. Most of it is in the area of .NET technologies which is the focus of most of my computer related time at the moment.
Updated: 9/21/2004; 3:35:01 PM.

 








Subscribe to "Software Engineering" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

Subscribe To
Mark's Weblog

 
 

Tuesday, July 15, 2003

More on the NedStatBasic Web Counters
Google Search It

I started using the NedStatBasic web counters almost a week ago now.  One of the problems, however, was that each time I went to my own weblog to check that it was posting correctly I incremented the stats.

To avoid this problem I needed to change the script not to run if I hit the web page.  To do this I created a web page that would assign a cookie to me.  The code was as follows:

<HTML>
    <
BODY
        onload="document.cookie = 'IsWebLogAuthor = true; expires=Fri, 01-Jan-2010 00:00:01 GMT';">
    </
BODY>
</
HTML>

After hitting this page I had a cookie assigned.  Not that an expiration date is required to make sure that the cookie survives across sessions.

Next, I added a postStatistics(id, options) function to my #homeTemplate.txt page within Radio as follows:

<!-- BEGIN_CUSTOM_EDIT -->
<script>
    function postStatistics(id, options)
    {
      var isAuthor;
      var nameValue;
      var cookieArray = document.cookie.split(";");  
      for(var i=0; i<cookieArray.length; i++)
      {
          nameValue = cookieArray[i].split("=");
          if(nameValue.length==2 &&
              nameValue[0]=="IsWebLogAuthor" && nameValue[1]=="true")
          {
              isAuthor=true;
              break;
          }
      }
  
  if(!isAuthor)
  {
      nedstatbasic(id, options);
  }
  
}
</script>
<!-- END_CUSTOM_EDIT -->

Finally, in the NedStatBasic HTML source code I changed

<script language="JavaScript" type="text/javascript" >
<!--
    nedstatbasic("<my id>", 0);
// -->
</script>

to

 <script language="JavaScript" type="text/javascript" >
 <!--
     postStatistics("<my id>", 0);
 // -->
 </script>

There was also a <noscript> block but since my browser has scripting enabled this HTML never appears so I didn't need to worry about it.

One thing that puzzled me somewhat about this was the fact that the document.cookie was stored across documents on this site.  In other words, setting the cookie on one page made it available to another page event though the cookie was a document property.  Interesting.

I would like to thank Palani Thangaraj for help with this.


3:38:04 PM   []    comment []

The ObjectSpaces MSN group discusses the Microsoft ObjectSpaces SDK (Technology Preview).  This technology is designed to provide object to relational mapping tool.  For those considering other options, there is a recent post listing other .NET technologies (both open source and cost based) targeting the same space.  The API documentation for ObjectSpaces is available here but you need to be a member of the group to view it.
3:21:11 PM   []    comment []

New Features of IIS 6.0's FTP Server
Google Search It

Tim Huckaby provided a great summary of the new FTP features in Windows 2003.  I have encountered the issues with deploying an FTP server on IIS 5.0 and hence I was excited that restricting users to specific directories was supported in IIS 6.0.  Unfortunately, as I described here, I was not able to get FTP configured with user isolation.  I ended up having to go with the traditional method supported by IIS 5.0.


2:03:31 PM   []    comment []

© Copyright 2004 Mark Michaelis.



 


July 2003
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Jun   Aug


Recent Posts