Speed up FireFox and Internet Explorer

by Mike Stephens 17. December 2006 20:14
The default settings for Firefox and Internet Explorer are set pretty low so that they don't overwhelm older / slower computers.
Here are a couple things you can do to speed them up a lot.

Firefox:

Open Firefox, for the url type "about:config" and press enter.
This will open up a screen with lots of settings.
In the Filter box, type in "network.http",  this will shorten the list.
Find the key "network.http.pipelining" and set it to "true"
Find the key "network.http.piplining.maxrequests" and set it to 30. 
The default setting of 4 only allows 4 requests at a time, by setting it to 30 your browser can do much more work.
Press the "Show All" button on the upper right to show all the keys again.
In the Filter box, type in "nglayout.initialpaint.delay" and set it to 0.
If it does not exist just right click and select the New Integer and type in the name above.
This setting tells Firefox not to wait after receiving data to start rendering it.  The default setting in Firefox is 750ms.
So Firefox waits nearly a second after getting the data from the internet before displaying it.

Internet Explorer:

Go to your Start prompt and select "Run".
Type in "regedit" and press "Ok".
You will see a bunch of folders.
Navigate through the folders to "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Right click and insert a new DWORD key with the name "MaxConnections Per1_0Server" and a Decimal value of 10.
Right click and insert a new DWORD key with the name "MaxConnections PerServer" and a Decimal value of 10.

There you go,  much faster browsers,  enjoy

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

General | Software Development

Net Neutrality Commercial

by Mike Stephens 16. December 2006 18:36
The telecommunication companies have been running some ads on TV lately that are flat out lies.   The first time I saw one I couldn't believe it,  how can they blatantly like to consumers like that?

For those who don't know what Net Neutrality is,  It is the telcos trying to get a slice of the pie that they don't own, nor should they, thats why they broke up ma' Bell all those years ago,  same thing is happening here, just with the internet instead of phone lines.  Basically every company out there that has a website pays money to their internet service provider for the bandwidth that is used to serve the website to web surfers.   Every consumer pays a monthly bill to their internet service provider that allows a certain amount of bandwidth to view websites.  What is going on is that the telecos realize that for years they have been adding surcharges, and equipment charges, and all sorts of stuff to penny pinch the consumer. They have now realized they want to do this with the internet.   Even though the companies and the consumers have already paid for the cost for equipment, bandwidth, etc to their service providers, they want to now charge for the specific kind of traffic that is traveling over their lines.  Remember,  YOU and the COMPANIES have already paid for the cost for traffic to travel over these lines.  So you use company A for your internet, the place you want to go to uses company B for their internet.  If company A does not have an agreement in place with company B to allow traffic to cross lines you can't see anything that uses company B for internet service.  Basically each company would charge other companies for any traffic that doesn't originate from their own service.  Thus allowing the telcos to charge once for you to connect to the internet, the companies that have websites to connect to the internet and  then charging everyone one again for a second time to actually putting traffic on it. Its like paying to drive on a toll road but you can only drive on the toll road if you buy all the gas for your car at the toll booth which they sell, even though the gas you bought down the road works just fine.  Pretty stupid huh?

Here is a youtube video that sums up what I explained before.  It would be great if this were made into a commercial that would be shown on nationally syndicated TV to let people who aren't tech oriented know what the companies are really trying to do, and show people how desperate the phone companies are.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

General | Software Development

Notorious "Access is denied" error for ASP.Net applications

by Mike Stephens 15. December 2006 20:07
So I have always had a problem occasionally with the "Access is Denied" error.  Usually cleaning out the bin folder bouncing the development server and restarting Visual Studio would fix this. (I made a nice little batch script)  I ran across a case where it wouldn't fix the problem.

After some searching I found out what is causing the problem.   Its the Indexing service locking the temporary ASP.Net files. 
Just go into your services console (Start->right click my computer->select manage-> click Services)  and locate the Indexing service and switch the startup type to manual and stop the currently running service.

Microsoft ticket is here

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

Easy way to generate XML Documents with SQL Server: XML Explicit

by Mike Stephens 15. December 2006 00:03
On a project a few weeks ago a coworker introduced me to a very easy way to generate XML documents.  We were going to use it for a flat file to be distributed with a locally run application but the first thing that jumped to mind for me was AJAX applications.   I remember my first experience with writing an AJAX application and thinking their had to be a better way that looping through data that was returned to me.   Of course this was before you could store XML natively with SQL Server 2005. On to the show I suppose. 

The command I would like to introduce is the SQL command "XML Explicit".  At first glance many of the samples I saw seemed very complicated and it took me quite a few tries of experimentation to fully understand everything that was going on. Another reason why it can seem intimidating is that many people in the software world have become very comfortable with ORM tools and therefore their SQL skills get pretty rusty.  I have to admit that I was one of these people, my SQL skills were average but if you put something pretty complicated in front of me it would take me a bit to grasp it.   But since with my new employer I was thrust right into SQL world,  no fluffy ORM tools to help me now.

So lets say you have SQL database with a table for employees, departments, positions, etc. and you want put them into a nice flat file with all their information and who works for who. 
Employees
id name position reports_to skills
1 Tom Manager 1 Good with money
2 Brian Developer 5 C++, C, MFC, C#, VB.Net, Java, HTML, XML
3 Sharon Accountant 2 Good with money
4 Dave Developer 5 C#, VB.Net, Java, HTML, XML
5 Jim Manager 1 Tech oriented
6 Bob CEO 0 Good at running companies
7 Ron Manager 1 Creative marketing ideas


So we want to see an XML file that looks something like this:

<employees>
    <employee id="1" name="Bob" position="CEO">
       <skills>Good at running companies</skills>
        <employee id="2" name="Tom" position="Manager">
                <skills>Good with money</skills>
                <employee id="6" name="Sharon" position="Accountant">
                        <skills>Good with money</skills>
                </employee>
        </employee>
        <employee id="3" name="Jim" position="Manager">
                <skills>Tech oriented</skills>
                <employee id="7" name="Dave" position="Developer">
                       <skills>C#, VB.Net, Java, HTML, XML</skills>
                </employee>
                <employee id="8" name="Brian" position="Developer">
                      <skills>C++, C, MFC, C#, VB.Net, Java, HTML, XML</skills>
                </employee>
        </employee>
        <employee id="4" name="Ron" position="Manager">
                <skills>Creative marketing ideas</skills>
        </employee>
    </employee>
</employees>

Now on to the fun,  we are going to make this file using the XMLExplicit command. One of the links that helped me while I was learning how to use this was this article over at TopXML.com

To sum up the command it relies on making a "select" for each layer of your XML file and then unions all the different layers together.  There are two required tags that will have to be used, "tag" and "parent".  As you can probably imagine, they are used to define how the layers of your XML file are to be stacked. Here is a sample of the select for the root node, I will explain it below.

select
    top 1
    1 as tag,
    null as parent,
    null as [employees!1],
    null as [employee!2!id],
    null as [employee!2!name],,
    null as [employee!2!position],
    null as [employee!2!skills!element],
    null as [employee!3!id],
    null as [employee!3!name],
    null as [employee!3!position],
    null as [employee!3!skills!element]
from
    employees


Now this looks pretty scary at first glance but lets break it apart.   First lets look at defining how our XML document will work.
We will have 4 layers from outer most to  the inner most.  To define our root node we have this command [employees!1] where "employees" is the name of the element, "!" is a seperator, and "1" is the level of the node.  1 indicates that it is the outer most node.  Now to define each employee for the second list we use several commands [employee!2!id] represents part of the second layer.  "employee" is the tag name, "2" is the layer for it to be in, and "id" is the name of the attribute on the "employee" element to fill in.  We have several like this to define each of the attributes we want on the element.  To place a "skills" element within the employee element we use the notation "[employee!2!skills!element] where "employee" is the element name, 2 is the layer, "skills" is the name of the element within the employee element, and finally  "element" to indicate that it is an element instead of an attribute.

Now using the tag and parent sections we will define how each layer of the XML file will be organized.  The example below will show the outer most list of employees

select

    2 as tag,
    1 as parent,
    null as [employees!1],
    e.id as [employee!2!id],
    e.name as [employee!2!name],
    e.position as [employee!2!position],
    e.skills as [employee!2!skills!element],
    null as [employee!3!id],
    null as [employee!3!name],
    null as [employee!3!position],
    null as [employee!3!skills!element],
    null as [employee!4!id],
    null as [employee!4!name],
    null as [employee!4!position],
    null as [employee!4!skills!element]
from
    employees e
where
    e.reports_to is NULL


As you can see the second layer looks much like the one above.  Now the tag is set to "2" so that we will fill in the 2nd layer of the XML.  The parent tag is set to "1" to point back to the "employees" element we did a select for before. Each of the layer 2 attributes are now set to the value of the query. This will grab "Bob" the CEO element and put it in the XML doc.   In order to get our top layer node we say "where e.reports_to is null"  to get the "Bob" record and everything else will percolate down from the upper most layer.  The most important thing to remember when doing this is to keep your queries the same.   It is fine to do joins with additional tables but you must be absolutely certain that the same data is queried each time.  Now we need to select the employees for Bob and here is how we do it.

select

    3 as tag,
    2 as parent,
    null as [employees!1],
    e.id as [employee!2!id],
    null as [employee!2!name],
    null as [employee!2!position],
    null as [employee!2!skills!element],
    ee.id as [employee!3!id],
    ee.name as [employee!3!name],
    ee.position as [employee!3!position],
    ee.skills as [employee!3!skills!element],
    null as [employee!4!id],
    null as [employee!4!name],
    null as [employee!4!position],
    null as [employee!4!skills!element]
from
    employees e
inner join
    employees ee
on
    ee.reports_to = e.id
where
    e.reports_to is null


Again,  Nearly the same as above, with a few changes,  the tag and parent values are now set to reflect the 3rd layer, and it is below the second layer. If you notice now for the [employee!2!id] we have id there instead of null.   Now were looking for the "Jim" and "Ron" records.  So do do that we will query for the same data from before but do a another join for the "reports_to" is the value of the id on the node above it. Using this method you can easily and simply create XML documents from SQL server with no heavy lifting required. 

To put this all together you would now do a "UNION ALL" for each of your layers to combine them all together.  The last thing we have to do is define an ORDER BY clause.  This clause will sort the order that each layer is displayed.  It is very important that the elements that you ORDER BY are included in the results of all the selects.   So in this instance it would be the "id" of each employee.

ORDER BY
    [employee!2!id], [employee!3!id],[employee!4!id]
for xml explicit, type

Now some trouble shooting tips.  You are going to run into an error saying that "Tag # is not open".  Its just gonna happen, so here are the things to check for.  First,  Make sure that data exists at all layers that a sublayer exists for.  Second,  Verify that any of the ORDER BY clauses are included in all the queries.  If one of them does not exist it will throw this error. 

I hope you learned something from this and let me know if there are any questions or comments.  Here is a copy of the query in total.

SET NOCOUNT ON;
select
    top 1

    1 as tag,
    null as parent,
    null as [employees!1],
    null as [employee!2!id],
    null as [employee!2!name],
    null as [employee!2!position],
    null as [employee!2!skills!element],
    null as [employee!3!id],
    null as [employee!3!name],
    null as [employee!3!position],
    null as [employee!3!skills!element],
    null as [employee!4!id],
    null as [employee!4!name],
    null as [employee!4!position],
    null as [employee!4!skills!element]
from
    employees


UNION ALL

select

    2 as tag,
    1 as parent,
    null as [employees!1],
    e.id as [employee!2!id],
    e.name as [employee!2!name],
    e.position as [employee!2!position],
    e.skills as [employee!2!skills!element],
    null as [employee!3!id],
    null as [employee!3!name],
    null as [employee!3!position],
    null as [employee!3!skills!element],
    null as [employee!4!id],
    null as [employee!4!name],
    null as [employee!4!position],
    null as [employee!4!skills!element]
from
    employees e
where
    e.reports_to is NULL

UNION ALL

select

    3 as tag,
    2 as parent,
    null as [employees!1],
    e.id as [employee!2!id],
    null as [employee!2!name],
    null as [employee!2!position],
    null as [employee!2!skills!element],
    ee.id as [employee!3!id],
    ee.name as [employee!3!name],
    ee.position as [employee!3!position],
    ee.skills as [employee!3!skills!element],
    null as [employee!4!id],
    null as [employee!4!name],
    null as [employee!4!position],
    null as [employee!4!skills!element]
from
    employees e
inner join
    employees ee
on
    ee.reports_to = e.id
where
    e.reports_to is null

UNION ALL

select

    4 as tag,
    3 as parent,
    null as [employees!1],
    e.id as [employee!2!id],
    null as [employee!2!name],
    null as [employee!2!position],
    null as [employee!2!skills!element],
    ee.id as [employee!3!id],
    null as [employee!3!name],
    null as [employee!3!position],
    null as [employee!3!skills!element],
    eee.id as [employee!4!id],
    eee.name as [employee!4!name],
    eee.position as [employee!4!position],
    eee.skills as [employee!4!skills!element]
from
    employees e
inner join
    employees ee
on
    ee.reports_to = e.id
inner join
    employees eee
on
    eee.reports_to = ee.id
where
    e.reports_to is null

ORDER BY
    [employee!2!id], [employee!3!id],[employee!4!id]
for xml explicit, type


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

Bypass all of the menus for customer service

by Mike Stephens 14. December 2006 10:50
A cool website that has tons of tips to bypass the computer menus and get straight to a customer service represenative.
GetHuman.com

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

General

Practices for sending HTML emails to various email providers

by Mike Stephens 13. December 2006 19:17
I was recently asked to write some code that would generate multi-part plain text / HTML emails for distribution. I knew there would be some issues between the major providers, Outlook, Outlook 2007, Gmail, Yahoo, Hotmail but I had no clue as I came to find out. The standard method I've used for generating some basic templates was to just mark it up in a html file and use that as a template and replace the key fields as went along and attach a css style element for each individual customer.   Thank you Gmail and Outlook 2007 for completely eliminating the <style> tag, making my life a pain.

So my next instinct was to google for a solution because someone has found their way around all this before, right?  After a bunch of reading pretty much the only way to format stuff in gmail was to use tables and to apply a very limited subset of formatting options to the <td> tag. Yahoo and Hotmail and Outlook 2003 seem to fully render my emails as expected.

Right now my current plan is to aim for using a rich text editor for the clients to use to apply inline styles to the specific message.  I have not yet tested this but this is the behavior that is claimed. If they do not want to use this rich text client they should be able to paste the contents of a Word doc that has been saved as an HTML type into the source of the editor and get the markup in that fashion.  In the future I might allow an upload of an HTML doc, stripping the "bad" tags of course and allowing them to use that.

Here is a list of useful links that have helped me immensely while researching this. 

xavierfrenette.com has a great article on all the different services and techniques
campaignmonitor.com has some more tips for users based upon the tips from the link above
sitepoint.com has a  good article by Tim Slavin
mailchimp.com has some more good tips and even samples to download
reachcustomersonline.com has some good basic tips and lots of links to other tips

The other big one you should know about is that Microsoft Office 2007 has changed their rendering engine from previous versions.  They have changed it from using an IE rendering engine to one based upon Word 2007.  This eliminates most everything that Gmail does.  They have a couple articles to inform you of the new standards and a validation tool you can download and install on Visual Studio 2005, Expression Web Designer or Dreamweaver. The validation tool works well but the only complaint that I have is that it requires you manually edit some registry entries.  If they require me to run an msi to use the validator they should at least modify the registry for me since its dirt simple to do.

Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 1 of 2)
Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 2 of 2)
2007 Office System Tool:  Outlook HTML and CSS Validator

I will give an update if I find a better solution.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

Need to see how to do something in Javascript?

by Mike Stephens 13. December 2006 15:17
I just saw that Google has released their Google Web Toolkit available open source.
I have only browsed everything this tool kit can do in the past but now that it is open source I went in and viewed many of their functions.   Bound to be a good resource for how to do things.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

A Take On Working From Home

by Mike Stephens 13. December 2006 09:40
Over at the Web Worker Daily there is an article that largely sums up many practices that I find it takes to work at home. 
Much like the author I get the same question repeatedly asked, "How do you work at home, I would be so distracted?"  Just like the author I typically find myself not having that problem, but the exact opposite one.   When do I stop working or it'll only take a few more minutes that turn into hours.  Working at home definitely blurs the line on my time and company time and I have to admit, its been one of the hardest things to nail down about working from home.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

Pet Penguins, Oh My

by Mike Stephens 12. December 2006 16:09
One of my friends sent me this link and encouraged me to check it out.
Summary,   Story of a guy who wanted a pet penguin and put a pool in his living room.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

General

Christmas List

by Mike Stephens 11. December 2006 11:11
Since several people asked, here is my list on Amazon.
My Amazon.com Wish List

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

General

Page Large Datasets with SQL Server

by Mike Stephens 10. December 2006 13:34
I recently came across a problem where I was going to be using huge datasets.  Potentially 100k+ records that would be displayed in a data grid.   Since the built in paging in the Asp.Net Data Grid sucks so bad I was going to come up with a different method that would use sql to do all my work.    I ran across an article on 4GuysFromRolla and worked from there.  Its a great solution and extremely fast.

Basically all you do is to declare a new table in your stored procedure,  add an identity column, and a column that will link to the primary key of your dataset you want to return. Now you can do a select on your dataset with your order by clause to sort your data and insert each record in your other table based on your row count to get for the page size and the last record index. On the code end of things you just have to keep track of the last index you retrieved and the size of the page you want returned.
CREATE  PROCEDURE [dbo].[usp_PageResults_NAI] 
(
@startRowIndex int,
@maximumRows int
)
AS

DECLARE @first_id int, @startRow int

-- A check can be added to make sure @startRowIndex isn't > count(1)
-- from employees before doing any actual work unless it is guaranteed
-- the caller won't do that

-- Get the first employeeID for our page of records
SET ROWCOUNT @startRowIndex
SELECT @first_id = employeeID FROM employees ORDER BY employeeid

-- Now, set the row count to MaximumRows and get
-- all records >= @first_id
SET ROWCOUNT @maximumRows

SELECT e.*, d.name as DepartmentName
FROM employees e
INNER JOIN Departments D ON
e.DepartmentID = d.DepartmentID
WHERE employeeid >= @first_id
ORDER BY e.EmployeeID

SET ROWCOUNT 0

GO

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

Viking Orbiters on Mars

by Mike Stephens 5. December 2006 16:14
Nasa just published a bunch of pictures that show the Viking landers still on Mars. 
Pretty cool to find them after this long, a pictures of Spirit and Opportunity too.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Science

Cooking for Engineers

by Mike Stephens 5. December 2006 09:42

I ran across this on Digg this morning and I have to say its a pretty good idea.  I've pulled recipes off the net quite a few times and not understood all the terminology and such.   Finally a site that I can use,  with pictures. 

Cooking For Engineers

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

General

IE6 and IE7 side by side testing

by Mike Stephens 1. December 2006 16:09
Microsoft just released a Virtual PC image of XP and IE 6 so that web developers can continue to test with IE 6. 
Its a pre-activated version of Windows XP that is time bombed for April 1st 2007.

I guess you could always just take an extra key from your MSDN subscription and run it that way too and just not upgrade to IE 7.

Download here

Update:  I recently came across this site at Tredsoft that also allows for testing different browser versions side by side.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

My name is Mike Stephens and I am a Software Developer in Milwaukee, WI but origionally from Texas

Tag cloud

    Page List