<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>FoxPro Ramblings</title>
        <link>http://foxproramblings.l0s3r.net/Default.aspx</link>
        <description>The daily ramblings of a seasoned Foxpro Developer</description>
        <language>en-US</language>
        <copyright>Michial Thompson</copyright>
        <generator>Subtext Version 2.1.2.2</generator>
        <image>
            <title>FoxPro Ramblings</title>
            <url>http://foxproramblings.l0s3r.net/images/RSS2Image.gif</url>
            <link>http://foxproramblings.l0s3r.net/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>ASP.Net Development Crash Course</title>
            <link>http://foxproramblings.l0s3r.net/archive/2007/02/03/ASP.Net-Development-Crash-Course.aspx</link>
            <description>&lt;p&gt;I should probably be writing articles titled an ASP.Net Crash Course for Developers right now, the past 10 days or so I have been involved in dealing with an ASP.Net Application written by someone else, as well as two ASP.Net application which I am developing as well.&lt;/p&gt;
&lt;p&gt;The application written by someone else is the product of another failed outsourcing project, I was asked to initially do a code review of this mess, as well as now I am having to re-write a large majority of it.  When are companies going to realize that just because they call themselves programmers, and are cheaper than the people sitting down the hall doesn't mean that they even understand the concept of doing business in the United States?  (This is a real pet peeve of mine, and I'll save this rant for another post.)&lt;/p&gt;
&lt;p&gt;Anyway, so now the re-write of the outsource mess is project number one, and Project Number two is a Web Interface into my Business's Software that enables all the same functionality as the FoxPro App.&lt;/p&gt;
&lt;p&gt;Now here's the kicker, My experience to date in ASP.Net is to use it for developing Web Services to move functionality requiring major processor horsepower from the desktop application to the Server.  And my experience for Web Development in General is limited to HTML 3.0 and ASP using VB-Script.  So for the past 10 days I have been struggling with Visual Studio 2005's UI for developing Web Forms, and struggling to create a general enough Application Framework that going forward I won't be forced to re-write.&lt;/p&gt;
&lt;p&gt;Now my programming past includes c and c++, and I've been doing Web Services in c# for about a year now, so I'm no real stranger to the languages, and HTML 3.0 is more than sufficient to get good looking Web Forms.  So what's the big deal here?  Well I've never been a big fan of buzz words, and with .Net Microsoft changed all the names for things, so doing searches for information is where the real challenge is.&lt;/p&gt;
&lt;p&gt;BUT there is light at the end of this tunnel for me, I finally got over the Sand Dune yesterday, and now I've gotten all the major aspects of developing these applications figured out.  The last two major obstacles for me were the Page.Master files, and User Controls.&lt;/p&gt;
&lt;p&gt;The last application framework that I developed was in 1999-2000, and it was FoxPro based.  It's designed around using SQL Server and FoxPro.  That project's original goal was to separate the Presentation Layer from the Business Rules, and everything from the Data Layer.  When the applications were small, it worked very well, but when the applications started to grow in complexity, they began mixing the three layers together to tightly that it's no longer possible to replace one layer without affecting all three.&lt;/p&gt;
&lt;p&gt;In the .Net arena I don't plan to make that mistake again, this time I know most of the major pitfalls, and I chronicled the history of my FoxPro framework well enough that I think I know the major problems that required me to bring the layers more tightly together, so this time I think I can do a better job at separating them.&lt;/p&gt;&lt;img src="http://foxproramblings.l0s3r.net/aggbug/130.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2007/02/03/ASP.Net-Development-Crash-Course.aspx</guid>
            <pubDate>Sat, 03 Feb 2007 10:14:38 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/130.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2007/02/03/ASP.Net-Development-Crash-Course.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/130.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/130.aspx</trackback:ping>
        </item>
        <item>
            <title>Microsoft Vista...</title>
            <link>http://foxproramblings.l0s3r.net/archive/2007/01/29/Microsoft-Vista.aspx</link>
            <description>Well tomorrow is the day I have been waiting for, Microsoft Vista is due on the shelves tomorrow.  I'm planning to go buy my copy at lunch so that I can get home with it and thing about installing.&lt;br /&gt;
&lt;br /&gt;
I've still not gotten a direct answer about the features that I need, so I still don't know what version I will be getting yet.  I've been trying to find out if the Home Premium has a local IIS and the Remote Desktop client so that I can still do my web development and access the servers, if it does then that's the version I am buying.&lt;br /&gt;
&lt;br /&gt;
If not then I will be buying the Ultimate Version, these features are absolute requirements, even more important to me than the ability to simply run....  I'll keep a running blog on here about what I think of Vista.&lt;img src="http://foxproramblings.l0s3r.net/aggbug/123.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2007/01/29/Microsoft-Vista.aspx</guid>
            <pubDate>Mon, 29 Jan 2007 21:04:43 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/123.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2007/01/29/Microsoft-Vista.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/123.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/123.aspx</trackback:ping>
        </item>
        <item>
            <title>Accessing VFP Tables Across Network w/ .Net</title>
            <link>http://foxproramblings.l0s3r.net/archive/2007/01/11/Accessing-VFP-Tables-Across-Network-w-.Net.aspx</link>
            <description>I run into an interesting issue this week that I needed to resolve, and I have to admit it was fun and interesting.  We were developing a Web Service for a Third Party interface to FoxPro free tables.  Initially we were going to do this by developing a VFP Web Service, but we found out that the Soap Toolkit is being dropped by Microsoft, and that to make it work on the server we would need to enable something that we didn't want to enable to make it work.&lt;br /&gt;
&lt;br /&gt;
Anyway, as I started writing the c# Web Service everything was going well, I was able to access the data that was local, and the Web Service was working perfect.  Then when I got ready to deeply it to the Development Test platform, things broke.  The reason they broke was that the VFP Tables were stored on a different server than where the Web Service was running, and ADO could not access the tables on the mapped drives from IIS.&lt;br /&gt;
&lt;br /&gt;
Then as I got further into this, I was finally able to get my Web Service to Impersonate a user other than the IIS user, and that got me connected to the server, but then things failed when I tried doing a select on the data.  So back to doing research, and I finally found a website where someone had posted that he had paid Microsoft $200 to get the answer and he was waiting for a response back.  Someone made the comment that $200 is a lot of money to spend only to find out you have to add "BackgroundFetch=No" to the connect string for the tables.  I got a laugh out of that comment, but amazing it solved my problem right off!!!&lt;br /&gt;
&lt;br /&gt;
So in a nutshell, the Web Service is working, and everyone is happy with what I finally accomplished!!!&lt;br /&gt;
&lt;br /&gt;
No on to the details for making this work:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="FONT-WEIGHT: bold"&gt;Impersonating a user from an ASP.NET c# program:&lt;/span&gt;&lt;br /&gt;
Here is a link to Microsoft's website where I found the code: &lt;a target="_blank" href="http://support.microsoft.com/kb/306158"&gt;support.microsoft.com/kb/306158&lt;/a&gt; This turned out to work almost flawless for me.  I copied their code into my ASMX file, and changed the user name, domain and password and bang I was instantly impersonating the user I wanted.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="FONT-WEIGHT: bold"&gt;Connect String I used to connect to the tables:&lt;/span&gt;&lt;br /&gt;
  &lt;span style="COLOR: rgb(51,102,255)"&gt;string&lt;/span&gt; cConnectionString1 = "&lt;span style="COLOR: rgb(255,0,0)"&gt;Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=\\\\UNCPath\\DiretoryPath\\;BackgroundFetch=No;Exclusive=No&lt;/span&gt;";&lt;br /&gt;
&lt;br /&gt;
&lt;span style="FONT-WEIGHT: bold"&gt;Comments:&lt;/span&gt;&lt;br /&gt;
If you don't know how to use this code you may want to spend a little time doing some reading, for now I don't have a lot of time to write an article on programming, but I will eventually get around to doing this.&lt;img src="http://foxproramblings.l0s3r.net/aggbug/36.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2007/01/11/Accessing-VFP-Tables-Across-Network-w-.Net.aspx</guid>
            <pubDate>Thu, 11 Jan 2007 17:09:18 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/36.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2007/01/11/Accessing-VFP-Tables-Across-Network-w-.Net.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/36.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/36.aspx</trackback:ping>
        </item>
        <item>
            <title>c# and FoxPro Tables ODBC</title>
            <link>http://foxproramblings.l0s3r.net/archive/2007/01/08/29.aspx</link>
            <description>Well I run into an interesting problem today using c# to create a Web Service that accesses FoxPro Tables.  After getting everything in place, and getting the ASPX file to compile I started getting an ODBC error.  Turns out that when you install FoxPro it doesn't necessarily install the actual FoxPro ODBC Drivers, so you get an error when trying to call the open() method.&lt;br /&gt;
&lt;br /&gt;
I will say this, the more I work with .net the more I am liking being forced back to the Case Sensitive and Structured programming arena.  I didn't realize just how lazy my development had gotten.  Its amazing how much I curse C# for forcing me to type my variables the same every time.....&lt;br /&gt;
&lt;br /&gt;
One more thing, for a Web Server that allows someone to search data, it would be nice to put checks in to see if it even found anything...  .Net is picky about trying to access datasets that don't have anything in them....&lt;img src="http://foxproramblings.l0s3r.net/aggbug/29.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2007/01/08/29.aspx</guid>
            <pubDate>Mon, 08 Jan 2007 22:11:09 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/29.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2007/01/08/29.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/29.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/29.aspx</trackback:ping>
        </item>
        <item>
            <title>Ever feel like a total idiot programming?</title>
            <link>http://foxproramblings.l0s3r.net/archive/2007/01/08/28.aspx</link>
            <description>The past few days I have not really been able to post much because I have been going through a FoxPro App screen by screen removing an Image Object, and 3 ShapeObjects...  The app only has 934 Form Objects, and you will probably never guess why I was doing all this work....&lt;br /&gt;
&lt;br /&gt;
First off let me sat this application took me close to 6 years to develop to the point that it's currently at, I initially started off developing it with the plain old Grey on Grey w/ Black text look, but after getting tired of a friend badgering me about how it looked like every other FoxPro App I went in and added a background, and several shapes to create a consistent but colorful look.  Well the app has been live for the past 2 years, and people have made some comments about the colors, so this past week I got the hair to make a change to the colors.&lt;br /&gt;
&lt;br /&gt;
So I decided, instead of me controlling the colors I would give the users control by implementing Skins, since I developed the framework as an object oriented structure, it should be pretty easy, just create a table, add some fields for the various values such as font, colors etc..&lt;br /&gt;
&lt;br /&gt;
I then went onto the images, well this turned into a nightmare.  I found out that I had 4 different ways that I had put the images on the forms.  NOT one of the four was to put these images on the base classes.  I have probably 300 forms that had them as objects on the main form, then I had probably 3 other parent forms that had these images on them.  To make a long story short, I had to chase down where these images were.&lt;br /&gt;
&lt;br /&gt;
So anyway, as I got into this project I ended up opening each form, and then deleting or at least trying to delete each image and move to the next.&lt;br /&gt;
&lt;br /&gt;
Adding the new image was easy, I used the form property Picture which is what I should have used in the first place.  My idiot self created an 800x600 jpg that I then put on every form, instead of creating a 1x600 image that would be tiled across the screen....  needless to say when I got through all this I had reduced the EXE size by nearly 750k or more, and the screens actually performed a hair faster.&lt;br /&gt;
&lt;br /&gt;
So mark one more up on the bonehead tally....  BUT I will say this way also makes developing the screens a little easier too....&lt;img src="http://foxproramblings.l0s3r.net/aggbug/28.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2007/01/08/28.aspx</guid>
            <pubDate>Mon, 08 Jan 2007 21:14:35 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/28.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2007/01/08/28.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/28.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/28.aspx</trackback:ping>
        </item>
        <item>
            <title>New site ...</title>
            <link>http://foxproramblings.l0s3r.net/archive/2007/01/05/10.aspx</link>
            <description>&lt;p&gt;I know it's not the best thing to move your blog to a new site like this, but Google's Blogger could not do all the things that I wanted it to do so I started looking for a different one.  I found this blog software, and so far it seems to do everything I want it to do.&lt;/p&gt;
&lt;p&gt;Anyway, I have been sitting on this domain for about a year or so now, wanting to actually do something with it.  When I got it I had planned to use it more as a joke, and was going to just mess around making things up, but I never got around to doing anything with it.&lt;/p&gt;
&lt;p&gt;When I found this software, I got the idea that I could put this domain to use, and have a little fun at the same time.  So here we are, I've spent the past several days working on getting this setup, and moving my old blog, and next comes a little development and I should be up and running.&lt;/p&gt;
&lt;p&gt;By the way, if your interested in having your blog hosted here, email me at &lt;a href="mailto:michialt@gmail.com?subject=Interest%20in%20hosting%20a%20blog"&gt;michialt@gmail.com&lt;/a&gt;, and I'll set it up for free.  If you happen to be a good web developer let me know, I could use some help getting an intro page set up for the site.&lt;/p&gt;&lt;img src="http://foxproramblings.l0s3r.net/aggbug/10.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2007/01/05/10.aspx</guid>
            <pubDate>Fri, 05 Jan 2007 12:15:07 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/10.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2007/01/05/10.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/10.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/10.aspx</trackback:ping>
        </item>
        <item>
            <title>Brief timeout to discuss the Playstation 3</title>
            <link>http://foxproramblings.l0s3r.net/archive/2006/12/27/9.aspx</link>
            <description>&lt;div&gt;I have had a &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)"&gt;Playstation&lt;/font&gt; 3 since shortly after they were released, but have not been able to take advantage of the Hi-Definition because the component cable had been on back order. Well finally I received a component cable last night, and got to see the system working in full 1080p resolution. &lt;br /&gt;
&lt;br /&gt;
All I have to say is WOW. The picture from the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)"&gt;Blu&lt;/font&gt;-Ray movies are amazing. I watched a couple different movies last night and was shocked at the color contrast, and the sharpness of the picture. Even greater than from the Cable &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)"&gt;broadcasts&lt;/font&gt; that I watch in Hi-Def. &lt;br /&gt;
&lt;br /&gt;
One of the amazing things about the PS3 that I have noticed so far though is how well thought out it seems to be. I'm sure many &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)"&gt;gamers&lt;/font&gt; would disagree with me, and I by far am no &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_4" onclick="BLOG_clickHandler(this)"&gt;gamer&lt;/font&gt;. In fact I rarely play games. I purchased the PS3 as a cheap &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_5" onclick="BLOG_clickHandler(this)"&gt;Blu&lt;/font&gt;-Ray player that supported Digital Audio, the rest was just &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_6" onclick="BLOG_clickHandler(this)"&gt;gravy&lt;/font&gt;. &lt;br /&gt;
&lt;br /&gt;
The PS3 comes with an Internet Browser, something I figured would be a piece of crap that was intended to work mostly with their web server/pages just so you could buy things. I've been playing with it a little the past few days in standard resolution and the text is a little fuzzy, and there isn't much real-estate for development, but it was able to handle every web page I threw at it from my servers, and even did well on &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_7" onclick="BLOG_clickHandler(this)"&gt;google&lt;/font&gt;, &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_8" onclick="BLOG_clickHandler(this)"&gt;gmail&lt;/font&gt;, and a number of other sites I hit. &lt;br /&gt;
&lt;br /&gt;
I did notice a few java errors, and one thing it could not seem to process is the Windows Security &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_9" onclick="BLOG_clickHandler(this)"&gt;login&lt;/font&gt; that pops up when a &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_10" onclick="BLOG_clickHandler(this)"&gt;IIS&lt;/font&gt; does not have rights to a directory. But overall I would say it did a good job. &lt;br /&gt;
&lt;br /&gt;
Now last night I got to play in Hi-Def 1080p, and the text was a little better but still not perfect, but that may be because of the projector I am using. It does a good job for my laptop too, but the text on the laptop is still a little fuzzy. &lt;br /&gt;
&lt;br /&gt;
Overall I would say that the web browser that they used for the PS3 is acceptable, especially for a game system attached to your TV. My web development is kept strictly to Web Applications though, and I like to minimize the amount of java I use so keep that in mind when reading that statement. &lt;br /&gt;
&lt;br /&gt;
Other aspects of the PS3 that are impressive is that you are able to install Linux on it, and have a fully functional computer right there on your TV, you can use a &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_11" onclick="BLOG_clickHandler(this)"&gt;USB&lt;/font&gt; keyboard, and I assume mouse too. I wonder if a &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_12" onclick="BLOG_clickHandler(this)"&gt;Blue tooth&lt;/font&gt; keyboard/mouse would pair up with it. My next keyboard is going to be &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_13" onclick="BLOG_clickHandler(this)"&gt;blue tooth&lt;/font&gt; so we'll find out in a few months. &lt;br /&gt;
&lt;br /&gt;
I bought the 60gig version so I got the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_14" onclick="BLOG_clickHandler(this)"&gt;wi&lt;/font&gt;-&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_15" onclick="BLOG_clickHandler(this)"&gt;fi&lt;/font&gt; and &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_16" onclick="BLOG_clickHandler(this)"&gt;Ethernet&lt;/font&gt; networking, and the memory card slots and I as for the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_17" onclick="BLOG_clickHandler(this)"&gt;wi&lt;/font&gt;-&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_18" onclick="BLOG_clickHandler(this)"&gt;fi&lt;/font&gt;, it wasn't too bad to get setup, took me longer to type the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_19" onclick="BLOG_clickHandler(this)"&gt;WEP&lt;/font&gt; code than anything else. I use a 26byte &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_20" onclick="BLOG_clickHandler(this)"&gt;wep&lt;/font&gt; code, and it took me probably 10 minutes to use the cellphone like keypad and game controller to type the code. I will say this though, with a little network game play and having to use that controller to type I've gotten better, probably take me 3-5 minutes to type the 26 &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_21" onclick="BLOG_clickHandler(this)"&gt;chr&lt;/font&gt; code now. :) &lt;br /&gt;
&lt;br /&gt;
As far as the game play and game graphics, all I can say is that I was impressed with the old &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_22" onclick="BLOG_clickHandler(this)"&gt;EGA&lt;/font&gt; video graphics, so I'll leave that to the serious gamers to review. The PS3 gets a thumbs up from me though.&lt;/div&gt;&lt;img src="http://foxproramblings.l0s3r.net/aggbug/9.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2006/12/27/9.aspx</guid>
            <pubDate>Thu, 28 Dec 2006 01:00:00 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/9.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2006/12/27/9.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/9.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/9.aspx</trackback:ping>
        </item>
        <item>
            <title>What to use Visual Foxpro for (and not to use it for).</title>
            <link>http://foxproramblings.l0s3r.net/archive/2006/12/26/7.aspx</link>
            <description>&lt;div&gt;Earlier I said that there were a a number of packages available for using Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; with a Web Server, and I told you that I felt that they were all outdated and not necessary. Well today we will talk about what you should consider using Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; for, and what not to use it for in a web page. &lt;br /&gt;
&lt;br /&gt;
Here is where you will learn why. Most of the packages on the market basically replace HTML with some extension that then calls a &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)"&gt;prg&lt;/font&gt; to create the HTML that is sent to the client. This is about the most inefficient use of resources that I have ever seen on a web server. &lt;br /&gt;
&lt;br /&gt;
Microsoft has done some great things with &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_4" onclick="BLOG_clickHandler(this)"&gt;IIS&lt;/font&gt;, and every new release seems to improve on the previous. It's a shame that both the good and the bad get improved upon, but that's for another blog. &lt;br /&gt;
&lt;br /&gt;
&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_5" onclick="BLOG_clickHandler(this)"&gt;IIS&lt;/font&gt; supports scripting through ASP (Active Server Pages). ASP supports a number of languages such as &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_6" onclick="BLOG_clickHandler(this)"&gt;VBScript&lt;/font&gt;, C# etc. With these scripting languages you are able to embed them directly into your HTML, and the server will process the code in line as it sends the HTML to the client to be viewed. &lt;br /&gt;
&lt;br /&gt;
What makes this better than the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_7" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; method is that current each of the programs for &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_8" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; that are on the market that I have worked with have required a "&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_9" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; Control Panel" to be running. Basically this is a &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_10" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; program that runs either as a service, or as a desktop program that sits and waits for a web hit, when it received the hit from the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_11" onclick="BLOG_clickHandler(this)"&gt;isapi&lt;/font&gt; &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_12" onclick="BLOG_clickHandler(this)"&gt;dll&lt;/font&gt;, it then processes a &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_13" onclick="BLOG_clickHandler(this)"&gt;PRG&lt;/font&gt; that creates HTML and sends it back to the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_14" onclick="BLOG_clickHandler(this)"&gt;isapi&lt;/font&gt; which then sends it to the client. &lt;br /&gt;
&lt;br /&gt;
There are several problems, first each control panel can only run a single hit at a time, yes you can have several control panels running, but each one can process only one hit at a time. The next problem is that &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_15" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; is not optimized or coded to take advantages of &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_16" onclick="BLOG_clickHandler(this)"&gt;multi&lt;/font&gt;-processor machines. So now you have to do some fancy configuration to tell each control panel what processor you want it to run on, and it's stuck on that processor. &lt;br /&gt;
&lt;br /&gt;
Next, when there are no hits, the server's memory resources are still being consumed, as well as processor cycles are being consumed while these processes wait for the next hit. &lt;br /&gt;
&lt;br /&gt;
And last off, if you happen to cause a fatal error in one of your &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_17" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; programs, its possible to shut down the entire panel and shut down you web site. Granted most of them have very good recovery methods, but its not a sure thing. &lt;br /&gt;
&lt;br /&gt;
With all that said, they do have one absolutely positive feature about them. They all take the incoming string from a user's post from a web form and parse it into an easy to work with variable set. This is one thing that I have to say is the single most useful thing about them. The other thing that's good is that they make it possible to link &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_18" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; functions to various buttons and links on the web site, but this is actually less impressive. &lt;br /&gt;
&lt;br /&gt;
What I am going to be showing you through this series of blog entries is how to combine HTML, and ASP scripting with &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_19" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_20" onclick="BLOG_clickHandler(this)"&gt;DLL's&lt;/font&gt; to accomplish all the same things that the other packages accomplish, and still preserve the resources of your server so that you are able to handle a much larger traffic load. &lt;br /&gt;
&lt;br /&gt;
If you are getting skittish about merging multiple languages into your development process, don't worry. The scripting languages are minimal, and easy to use. I reserve the scripting to strictly formatting the HTML, and some basic data calls. Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_21" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; will still handle any of the complex work, and all the business rules. And we may introduce some javascript into the mix just to make things interesting, but for the most part I will be avoiding it as well. &lt;br /&gt;
&lt;br /&gt;
So how do you determine what goes into &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_22" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt;, and what goes in to HTML/Scripting? This is easy, if it relates to formatting the page it goes into HTML, if it relates to the business rules or the data it goes into &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_23" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt;. Well not entirely, but we will discuss those as we approach them. &lt;br /&gt;
&lt;br /&gt;
First off, all through these blogs I will assume that you are an experienced programmer, and have a good understanding of Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_24" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt;, and it's tools. I won't be discussing how to create a table, I will just tell you to create one. I won't be discussing how to format a &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_25" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Select command, I will tell you what fields it needs, and what conditions to put in the where clause. &lt;br /&gt;
&lt;br /&gt;
When it comes to the ASP Scripting, I will for the most part be using real code, but frequently I rely on &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_26" onclick="BLOG_clickHandler(this)"&gt;suedo&lt;/font&gt; code to get my point across with examples, I'll try to differentiate the two. There are a number of sites out there that go into detail to teach you these languages, and I don't want to waste keystrokes talking about the details of the language. (Yes I know I waste a lot of keystrokes on other things, but it's my rambling blog so I can type what I want :)) ) &lt;br /&gt;
&lt;br /&gt;
Every book you read uses different types of examples for their programming project, we will be no different here. I've been trying to figure out what would be a good project that has REAL business practices, but that won't take a lot of development. I'm also trying to figure out what features I need in one of my projects that would fit into this as well. I'll get back to this because I need to do some thinking about it. &lt;br /&gt;
&lt;br /&gt;
&lt;font style="COLOR: rgb(51,102,255)"&gt;&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_27" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server vs Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_28" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt;&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
Let's take a &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_29" onclick="BLOG_clickHandler(this)"&gt;vew&lt;/font&gt; minutes and talk about Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_30" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; vs &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_31" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server. Age old debate right? Well perhaps I can put the debate to rest for you, or at least give you something to debate &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_32" onclick="BLOG_clickHandler(this)"&gt;untill&lt;/font&gt; I give up and say "whatever" like a teenager too. &lt;br /&gt;
&lt;br /&gt;
Now that Microsoft is releasing a free version of &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_33" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Sever (&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_34" onclick="BLOG_clickHandler(this)"&gt;MSDE&lt;/font&gt;, or now &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_35" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server Express), there is no reason not to at least consider using &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_36" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server. And keep this in mind as well, Microsoft has optimized &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_37" onclick="BLOG_clickHandler(this)"&gt;IIS&lt;/font&gt; to work very well with &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_38" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server. Basically what they are doing is saying, "here's this awesome tool, and we are not going to give you an excuse not to use it." &lt;br /&gt;
&lt;br /&gt;
I'm a 25+ year veteran &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_39" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; Developer and even I have been converted. &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_40" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server is all the great things from Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_41" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; and none of the bad. They have optimized the code and the indexing so that it's both efficient and fast. But for me they have made two major things possible, the first is to be able to backup the system reliably with users still working. The second is that they have almost completely eliminated data and index corruption on reliable hardware. These two features alone should have you re-considering your thoughts of &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_42" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server. &lt;br /&gt;
&lt;br /&gt;
Now, for performance; every &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_43" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; developer I know is convinced &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_44" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; can outperform &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_45" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server hands down, and in about 10 minutes I can convince them they are absolutely wrong in all but the most basic of applications. &lt;br /&gt;
&lt;br /&gt;
For those of you convinced that &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_46" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; can outperform &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_47" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server, set up this environment: &lt;br /&gt;
&lt;br /&gt;
&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_48" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server running on a web server accessed by a &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_49" onclick="BLOG_clickHandler(this)"&gt;DSL&lt;/font&gt; connection &lt;br /&gt;
Now house your data on your local network &lt;br /&gt;
&lt;br /&gt;
Create 3 tables in both places, one for names, one for address history, and one for order history. &lt;br /&gt;
&lt;br /&gt;
Put 10k names, with at least 5 Addresses, and 15 orders each, so you address history will have 50k records, and you order history will have 150k records. Put all the applicable indexes on the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_50" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; side. Now run the following select on both servers: &lt;br /&gt;
&lt;br /&gt;
&lt;font style="FONT-STYLE: italic"&gt;select names, address, &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_51" onclick="BLOG_clickHandler(this)"&gt;orderhistory&lt;/font&gt;&lt;/font&gt; &lt;br /&gt;
&lt;font style="FONT-STYLE: italic"&gt;where &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_52" onclick="BLOG_clickHandler(this)"&gt;orderhistory&lt;/font&gt; links to address&lt;/font&gt; &lt;br /&gt;
&lt;font style="FONT-STYLE: italic"&gt;and address to customer&lt;/font&gt; &lt;br /&gt;
&lt;font style="FONT-STYLE: italic"&gt;and &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_53" onclick="BLOG_clickHandler(this)"&gt;orderdate&lt;/font&gt; between 1/1/2006 and 2/1/2006&lt;/font&gt; &lt;br /&gt;
&lt;font style="FONT-STYLE: italic"&gt;order by &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_54" onclick="BLOG_clickHandler(this)"&gt;customername&lt;/font&gt; and &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_55" onclick="BLOG_clickHandler(this)"&gt;orderdate&lt;/font&gt;&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
Assuming that you have populated the tables with the same data, and it's relatively random, you should receive a fair amount of data back. &lt;br /&gt;
&lt;br /&gt;
What you will see is that the data you receive back over the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_56" onclick="BLOG_clickHandler(this)"&gt;DSL&lt;/font&gt;, and the data you get across the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_57" onclick="BLOG_clickHandler(this)"&gt;lan&lt;/font&gt; will take close to the same amount of time to access. Here is the reason why, Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_58" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; uses indexes VERY VERY well, but it still has to load those indexes across the LAN which takes time. If you have any number of indexes the compound index files can get to be quite large, and often the index is actually more data than the actual query will return. &lt;br /&gt;
&lt;br /&gt;
Now once &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_59" onclick="BLOG_clickHandler(this)"&gt;VFP&lt;/font&gt; finds the records it needs to load, it STILL needs to pull that data across the LAN from the tables as well. Now in contrast, with &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_60" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server you simply send the server a question "I want all the records that meat this criteria from these tables, and ordered in this order?" and it replies OK, here are ONLY those records you asked for. So when you look at the amount of traffic on the wire you find its substantially less. When you look at workstation resources you also find substantially less processor time too getting more work from you workstation. &lt;br /&gt;
&lt;br /&gt;
Now here's where this makes a huge difference, Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_61" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; does a good job at caching indexes for the next time you access the data, BUT remember what I said about the Web being Stateless? Guess what, after that web page was built from that data, the table was closed, so the next request will need to do it all over again. &lt;br /&gt;
&lt;br /&gt;
With &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_62" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server, that's not the case, &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_63" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; server cached as much of that data as it could, and now the next person that requests that data will have the data in memory making their query actually run slightly faster. &lt;br /&gt;
&lt;br /&gt;
The other day I mentioned that Thor contained 8 gig of memory, of that 8 gig I have told &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_64" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server to use up to a maximum of 6 gig for it's self leaving 2 gig for &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_65" onclick="BLOG_clickHandler(this)"&gt;IIS&lt;/font&gt; and the operating system. My customer's data all combined is just of 50gig. &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_66" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server runs just over 2.5 gig on average of memory used. What this says is that during the course of time, the users keep using the same 2.5 gig worth of data, and rarely hit older data. &lt;br /&gt;
&lt;br /&gt;
Well this is true, my customers key in maybe 2-3 records per user per day, and over the course of a week, they will access those same records a dozen times each while accessing historical data maybe 2 or 3 times a week. As the records age they are accessed less and less. &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_67" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server realizes that and keeps only the newest information in memory for each customer. &lt;br /&gt;
&lt;br /&gt;
&lt;font style="COLOR: rgb(51,102,255)"&gt;Now what has Microsoft done with &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_68" onclick="BLOG_clickHandler(this)"&gt;IIS&lt;/font&gt; that impacts this?&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
In &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_69" onclick="BLOG_clickHandler(this)"&gt;IIS&lt;/font&gt; Microsoft has what is called Connection Pooling. What this basically does is simple, once a user has connected to &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_70" onclick="BLOG_clickHandler(this)"&gt;SQL&lt;/font&gt; Server and gotten their data and closed the connection, &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_71" onclick="BLOG_clickHandler(this)"&gt;IIS&lt;/font&gt; keeps that connection open for a period of time waiting for the next user that tries to connect using the same connect string which gets them to the same database/server. &lt;br /&gt;
&lt;br /&gt;
If someone tries to connect before the pool is flushed of that connection, it re-uses the same connection from earlier making the connection instantaneous rather than having to go through the connect handshake again. &lt;br /&gt;
&lt;br /&gt;
This process kicks ass when it comes to a web site that takes a large volume of hits per day such as Thor does. Just for your reference, Thor takes almost 35 thousand hits per hour, about 70% of those hits access the database server for at least part of the data. That's 840 thousand hits in a 24 hour period, or 588 thousand data queries per 24 hours. &lt;br /&gt;
&lt;br /&gt;
Just so you know, I was working on a project written using one of the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_72" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; Interface applications, and that company had 4 servers, and less than 10 gigs of data, and they could barely process 100k hits per day, and I was amazed until I started seeing where their bottle necks were. &lt;br /&gt;
&lt;br /&gt;
Stay tuned, next I might finally get into what our project will be, and how to go about designing and laying out the system.&lt;/div&gt;&lt;img src="http://foxproramblings.l0s3r.net/aggbug/7.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2006/12/26/7.aspx</guid>
            <pubDate>Wed, 27 Dec 2006 01:00:00 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/7.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2006/12/26/7.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/7.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/7.aspx</trackback:ping>
        </item>
        <item>
            <title>Our project unveiled!!!</title>
            <link>http://foxproramblings.l0s3r.net/archive/2006/12/26/8.aspx</link>
            <description>&lt;div&gt;I've decided what our project should be. BUT, let me give a little background first (how else could I make this post longer than it needs to be). &lt;br /&gt;
&lt;br /&gt;
One of the things that I used to enjoy as a teenager was to play Role Playing games such as Dungeons and Dragons. Eventually I got heavily into the computer games like &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)"&gt;Zork&lt;/font&gt;. Then as the graphics capabilities of computers improved it seemed like the computer games left the old Text Adventures behind. &lt;br /&gt;
&lt;br /&gt;
Back in the BBS days there was also a short fad where someone would start a story by writing a paragraph or two, and then leave it open for others to participate by doing the same thing. I also used to enjoy participating in those as well, but the frustration was that inevitably someone would start killing off the story because they got bored. &lt;br /&gt;
&lt;br /&gt;
Anyway, I've always had this dream of developing a computer based Text Adventure Game that would be infinite in size and scope. I have a number of years dreaming of doing this, but have never taken the time to actually develop it. &lt;br /&gt;
&lt;br /&gt;
Well with the Internet, the concept of my text adventure game might be able to be developed. And if I combine the Text Adventure with the community story project. I might actually see my game come to &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)"&gt;fruition&lt;/font&gt;. &lt;br /&gt;
&lt;br /&gt;
So how does this even remotely apply to Business Applications? It's Simple, in an Adventure Game you will have a series of links that will lead to various content, and that content will link to other content etc. &lt;br /&gt;
&lt;br /&gt;
You also have a series of calculations what will need to be performed with every click/link, and these calculations will determine the the outcome or the output that the user sees. &lt;br /&gt;
&lt;br /&gt;
As well you will have the Security features, Data storage updating and retrieving, and you will have a set of Business Rules that apply as well.&lt;/div&gt;&lt;img src="http://foxproramblings.l0s3r.net/aggbug/8.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2006/12/26/8.aspx</guid>
            <pubDate>Wed, 27 Dec 2006 01:00:00 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/8.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2006/12/26/8.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/8.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/8.aspx</trackback:ping>
        </item>
        <item>
            <title>Visual Foxpro Web Sites</title>
            <link>http://foxproramblings.l0s3r.net/archive/2006/12/25/6.aspx</link>
            <description>&lt;div&gt;There are a few products out there that are used for interfacing Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; and Web pages together to give your views dynamic content. Just a couple of these products are Web Connect, and &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)"&gt;FoxWeb&lt;/font&gt;. It's my opinion that both products are outdated and no longer necessary. &lt;br /&gt;
&lt;br /&gt;
While products such as these do make some aspects of dynamic web content easier, they are in no way efficient, and they more often than not are a waste of your Web Server's resources. Today's blog is going to explain how to use Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; on a Web Server, and minimize the amount of resources that are wasted. &lt;br /&gt;
&lt;br /&gt;
For this blog, I will be referencing my production server Thor. Thor is a Dual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)"&gt;Zeon&lt;/font&gt; 2.4&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_4" onclick="BLOG_clickHandler(this)"&gt;ghz&lt;/font&gt; server with 8 gig of ram, and 8 300 gig hard drives which are mirrored in pairs giving me 1.2 gig of overall storage. Thor is housed in a data center where I have &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_5" onclick="BLOG_clickHandler(this)"&gt;burstable&lt;/font&gt; bandwidth up to a full 100&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_6" onclick="BLOG_clickHandler(this)"&gt;mbps&lt;/font&gt;. &lt;br /&gt;
&lt;br /&gt;
First off lets talk about the four basic resources that you are working with on your web server, and how important each one is to the overall product. &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#3366ff"&gt;Bandwidth (&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_7" onclick="BLOG_clickHandler(this)"&gt;burstable&lt;/font&gt; to 100&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_8" onclick="BLOG_clickHandler(this)"&gt;mbps&lt;/font&gt;):&lt;/font&gt; &lt;br /&gt;
Your bandwidth is the amount of data you can move across your network at any given time. Its often measures in Megabits per second or &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_9" onclick="BLOG_clickHandler(this)"&gt;mbps&lt;/font&gt;. In cases of smaller networks, it could also be measured in Kilobits er Second or &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_10" onclick="BLOG_clickHandler(this)"&gt;kbps&lt;/font&gt;. &lt;br /&gt;
&lt;br /&gt;
Most commercial Internet connections will be synchronous (same speed both directions.) There are way too many options to discuss here. I the case of Thor I chose to Co-Locate at a local Data Center, and I have an allotted bandwidth, and if I should go over that amount I am billed for that addition bandwidth. What this means is that my bandwidth is calculated for an entire month, and the averaged out over that time frame, and if it exceeds the allotted amount I am billed extra. &lt;br /&gt;
&lt;br /&gt;
My servers also have access to "&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_11" onclick="BLOG_clickHandler(this)"&gt;Burstable&lt;/font&gt; Bandwidth" of 100&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_12" onclick="BLOG_clickHandler(this)"&gt;mbps&lt;/font&gt;. What this means is that if my server what hit by an unusually large number of hits, it would not max out until reaching 100&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_13" onclick="BLOG_clickHandler(this)"&gt;mbps&lt;/font&gt;. &lt;br /&gt;
&lt;br /&gt;
On the average server, this is typically your bottleneck, and in most cases if you have excess bandwidth, and you are suffering poor performance, you are having problems somewhere else in the system. &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#3366ff"&gt;Memory (8 gigs)&lt;/font&gt; &lt;br /&gt;
You cannot go wrong with more memory, the more memory your system has the better overall it will operate, just remember to make sure you are running an operating system, and software that can use all the memory you give it. For instance Windows 2003 Server Standard Edition can only access the first 4 Gig of memory. Anything over 4 gig is a waste. I personally wouldn't recommend Standard Edition for any Web Server, and ESPECIALLY not one that's going to be running Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_14" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; for dynamic content. &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#3366ff"&gt;Processor (Dual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_15" onclick="BLOG_clickHandler(this)"&gt;Zeon&lt;/font&gt; 2.4&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_16" onclick="BLOG_clickHandler(this)"&gt;ghz&lt;/font&gt;)&lt;/font&gt; &lt;br /&gt;
This is where the real magic is performed on your server. You would think that the faster the processors the faster the server is, but this isn't the case. The only time that your processor utilization should climb on a server is during backups, or in the event that you are running a complex mathematical process. &lt;br /&gt;
&lt;br /&gt;
For a typical website that serves data driven dynamic content, I would rarely expect your processor to reach more than 15-20% utilization, and even then only for short bursts during the peak hours. &lt;br /&gt;
&lt;br /&gt;
In most cases a single processor with middle of the road speed would do fine. I personally recommend dual processors for servers that are going to run anything other that &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_17" onclick="BLOG_clickHandler(this)"&gt;IIS&lt;/font&gt; and &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_18" onclick="BLOG_clickHandler(this)"&gt;VBScript&lt;/font&gt;. So adding Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_19" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; to the mix, you simply add a processor too. &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#3366ff"&gt;Hard Drive I/O. &lt;/font&gt;&lt;br /&gt;
Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_20" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; has enjoyed the reputation for having the fastest data access of any desktop Database system for years. The reason for this is because it uses a combination of memory and Hard drive IO to get that reputation. Visual &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_21" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; loses its speed and reputation when it comes to accessing it's data across a network, and becomes impossible across a wide area network. &lt;br /&gt;
&lt;br /&gt;
If your data is going to be housed on your server's local drives expect to see your hard drives getting a workout. Make sure you are running the highest quality hard drives you can get. If your data is not going to reside on the local drives of the Web Server I would highly recommend against using &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_22" onclick="BLOG_clickHandler(this)"&gt;Foxpro's&lt;/font&gt; Local Tables. &lt;br /&gt;
&lt;br /&gt;
Don't Skimp on your hard drives, go with the FASTEST, most reliables drives you can get, and replace them frequently to keep them reliable. &lt;br /&gt;
&lt;br /&gt;
On Thor, I replace two hard drives ever three months giving me a total of one year's use on the oldest drive in the system. With hot swappable mirrored sets, it's easy to do this, you just remove on drive in the pair, plug in the new one and tell the system to rebuild the mirror and your done. &lt;br /&gt;
&lt;br /&gt;
I then move the drives I pulled out of the system to my backup server, and from that server to the off site server and eventually if they survive long enough they end up on a shelf in my office as temporary spares. &lt;br /&gt;
&lt;br /&gt;
Trust me the expense of doing this pays off in spades with system reliability. You would be surprised to hear that I have had only one drive failure in the first year of operation, one in 12-18 months and three failures in the 18-24 month range. And these are high quality server drives from a reputable manufacturer. &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#3366ff"&gt;How a web page is accessed.&lt;/font&gt; &lt;br /&gt;
If you are new to accessing data with a web server, you are in for a surprise. Web Servers open and close data tables every time a page is served to the user. They do not remember what the user typed, or what was even sent to the user. &lt;br /&gt;
&lt;br /&gt;
This means that you will be taking a whole different approach to laying out your applications. &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_23" onclick="BLOG_clickHandler(this)"&gt;Traditionaly&lt;/font&gt; &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_24" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; programmers have opened the tables at the &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_25" onclick="BLOG_clickHandler(this)"&gt;beggining&lt;/font&gt; of the application and then closed them when the user quit the application. Or a variant on this of opening the tables when the user needed access to them, then closing them at the end of the need for the tables. &lt;br /&gt;
&lt;br /&gt;
Rarely if ever did we open a table, get the data from the table, and then immediately close the table before we allowed the user to do their work. Forcing the user to endure the process time for opening a table, getting the data, closing it, only to open the same data, save the user changes, and then close it again... You wouldn't consider that at all on a desktop application. &lt;br /&gt;
&lt;br /&gt;
Well guess what, that's exactly what you will be doing with web content. To make matters worse, once you send the web page to the user, you will forget you ever sent that page/data to the user. Then when they return the replacement data your program will start off all fresh. &lt;br /&gt;
&lt;br /&gt;
This is because a Web Server operates in a mode called "Stateless." What this means is that every transaction to the server is a complete transaction, and does not rely on anything else. Sounds fun right? Well actually it is, not too much really changes between the way you currently work and the way you will need to be working with data. &lt;br /&gt;
&lt;br /&gt;
There are only two real areas that you will need to change about how you access your data. The first is that you will no longer have the record in the table current when the user saves, so you will need to work out some form of pointer to the record. For &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_26" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; Tables you can usually get away with using &lt;em&gt;&lt;font color="#3366ff"&gt;&lt;font class="blsp-spelling-error" id="SPELLING_ERROR_27" onclick="BLOG_clickHandler(this)"&gt;recno&lt;/font&gt;()&lt;/font&gt;&lt;/em&gt;. The other area is record locking. This is the area that becomes a real pain when working with data via the web. &lt;br /&gt;
&lt;br /&gt;
Record Pointers can be as simple as the record number, or they can be a series of fields that make a record unique, or they can be a single field. &lt;br /&gt;
&lt;br /&gt;
I don't like using record numbers because they have a tendency to change over time, especially if you do any data maintenance such as packing tables to remove deleted records. They work because they only have to be accurate during the scope for which the user is editing the records. &lt;br /&gt;
&lt;br /&gt;
Using a combination of fields or any field that a user keys in or changes is dangerous. If a user happens to change one of these fields then the link back to the original data is lost. &lt;br /&gt;
&lt;br /&gt;
I prefer to use a "Primary Key" field, what this is is a numeric field that is auto incremented, and kept unique. I never renumber these fields or reset counter for zapped tables so I end up with a number that is 100% unique for the life of the data. Works perfect for linking to records. And coincidentally it also works beautiful for foreign keys in other tables too... &lt;br /&gt;
&lt;br /&gt;
&lt;font color="#3366ff"&gt;Record Locking in a Stateless Environment:&lt;/font&gt; &lt;br /&gt;
Most books I have read have basically said that there is no &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_28" onclick="BLOG_clickHandler(this)"&gt;such&lt;/font&gt; thing as record locking in a stateless environment, and they are partially correct. You could not ever use &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_29" onclick="BLOG_clickHandler(this)"&gt;Foxpro's&lt;/font&gt; Record locking, the reason is that by the time the user has posted their changes back to the server the previous session would have already closed the tables which releases the locks. &lt;br /&gt;
&lt;br /&gt;
Record locking is a complex thing when it comes to stateless because you have no way of even knowing if the user is going to post changes back or not, so basically you have a few choices, none of which are elegant. &lt;br /&gt;
&lt;br /&gt;
1) Last Save Wins &lt;br /&gt;
What this means is that the last person to save a record gets to keep their changes, so in the case of two people editing the same record the last one wins. &lt;br /&gt;
&lt;br /&gt;
2) First Save Wins &lt;br /&gt;
This is similar to Last Save, but instead it stores a timestamp with the save, and if the timestamp from your source record is earlier than the one in the table your saves are not saved. This one is better in my opinion because it gives you an option to &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_30"&gt;pragmatically&lt;/font&gt; move on to a conflict resolution option where you display the data saved while you were editing, and the data you changed and give the user the chance to make the &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_31"&gt;decision&lt;/font&gt; about what is saved. &lt;br /&gt;
&lt;br /&gt;
3) Create your own record locking flags &lt;br /&gt;
This is the option I actually use in most cases. The way that I implemented this is to create a table "&lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_32"&gt;Record Locks&lt;/font&gt;" and in this table, I have &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_33" onclick="BLOG_clickHandler(this)"&gt;TableName&lt;/font&gt;, &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_34" onclick="BLOG_clickHandler(this)"&gt;RecordID&lt;/font&gt;, &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_35" onclick="BLOG_clickHandler(this)"&gt;SessionID&lt;/font&gt;, &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_36" onclick="BLOG_clickHandler(this)"&gt;DateTimeStamp&lt;/font&gt;. When a user clicks to edit a record I insert a record(s) into this table for the data they chose to edit. Then I delete that record when they save. &lt;br /&gt;
&lt;br /&gt;
With this option, you need to offer a way for locks to automatically be released, or your in for a lot of calls asking you to release such and such record &lt;font class="blsp-spelling-corrected" id="SPELLING_ERROR_37"&gt;because&lt;/font&gt; its in use by someone. So first you need to determine a period of time that a lock can remain active. Then simply remove the locks after that period of time. &lt;br /&gt;
&lt;br /&gt;
I make several choices to make this work, first off when a user logs off the system correctly I automatically remove all their locks. Second when their session expires (we'll talk about this later) I delete the locks, and last off, I allow a lock to remain in affect for 1 hour, after one hour it's automatically removed. &lt;br /&gt;
&lt;br /&gt;
Stick around, tomorrow we will get into exactly what to use &lt;font class="blsp-spelling-error" id="SPELLING_ERROR_38" onclick="BLOG_clickHandler(this)"&gt;Foxpro&lt;/font&gt; for and what not to use it for when developing web pages. &lt;br /&gt;
&lt;br /&gt;
Merry Christmas to everyone, and hope you stop back tomorrow.&lt;/div&gt;&lt;img src="http://foxproramblings.l0s3r.net/aggbug/6.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michial Thompson</dc:creator>
            <guid>http://foxproramblings.l0s3r.net/archive/2006/12/25/6.aspx</guid>
            <pubDate>Tue, 26 Dec 2006 01:00:00 GMT</pubDate>
            <wfw:comment>http://foxproramblings.l0s3r.net/comments/6.aspx</wfw:comment>
            <comments>http://foxproramblings.l0s3r.net/archive/2006/12/25/6.aspx#feedback</comments>
            <wfw:commentRss>http://foxproramblings.l0s3r.net/comments/commentRss/6.aspx</wfw:commentRss>
            <trackback:ping>http://foxproramblings.l0s3r.net/services/trackbacks/6.aspx</trackback:ping>
        </item>
    </channel>
</rss>