Like me, you might really like Firefox. Generally speaking, it does a really good job. However, after turning on your computer (I’m talking Windows only), the first time you run Firefox it seems to take a long time to load up. Subsequent loads are okay, but that first one is the slow one. I recently came across a pretty nifty utility called Process Lasso by Bitsum Technologies. I can’t remember why I downloaded it . . . probably because someone recommended it as a way to speed up Windows Vista a bit. I’ve noticed a significant improvement in load times for Firefox since I installed it a couple of days ago. That was a nice side effect. So, if your Firefox loads slow, try this utility (free for home use). It may speed up more than just Firefox. It works on pretty much all flavors of Windows, including XP x64 and Vista x64. Enjoy!
Does your Firefox load slow? Try this.
Posted by Joe on May 26, 2009
Posted in Tools & Utilities | 1 Comment »
Slick way of handling browser-specific CSS issues
Posted by Joe on May 14, 2009
Every web developer eventually comes across a major headache in cross-browser functionality. My most recent one was with the alignment of text that follows a radio button. Vertically aligning that text with text that comes before a radio button is a bit of a pain. The easiest way to handle this is to use a table and set the valign attribute to middle, like so:
<table>
<tr>
<td valign="middle">Select:</td>
<td valign="middle">
<input type="radio" name="fruit" />Apple
<input type="radio" name="fruit" />Orange
</tr>
</tr>
</table>
In this example, depending on your browser, you might see the text “Apple” and “Orange” sit lower than the “Select:” text. In Safari and Opera, this renders just fine. In IE, the text is 2 pixels lower and in Firefox, the text is 1 pixel lower. If we design for IE, then Firefox will be 1 pixel above, and Safari and Opera will be off. This is a case where browser-specific CSS is necessary, but you wouldn’t necessarily want to create a whole new stylesheet for it. Enter CSS Browser Selector by Rafael Lima. This nifty little piece of javascript lets you use browser-specific classes in your existing stylesheet. In this case, the solution was simple. First, we change the HTML a bit to put the text following the radio buttons in a label with a class named radio.
<input type="radio" name="fruit" /><label class="radio">Apple</label> <input type="radio" name="fruit" /><label class="radio">Orange</label>
Then, we reference the small javascript file in our HTML header:
<script type="text/javascript" src="css_browser_selector.js"></script>
Finally, we add the browser-specific CSS to our stylesheet:
.ie label.radio {
position: relative;
font-weight: normal;
top: -2px;
}
.gecko label.radio {
position: relative;
font-weight: normal;
top: -1px;
}
label.radio {
font-weight: normal;
}
Yep, it’s that easy. Now, IE and Firefox (gecko) render properly. Safari, Opera and other browsers just fall through to the last label.radio.
Posted in CSS | Tagged: CSS | Leave a Comment »
E Text Editor
Posted by Joe on May 7, 2009
If you haven’t checked out the E text editor for Windows, you might want to. This is one powerful editor. I’ve been using the trial version for a little while and have just scratched the surface of some of the cool features. Just this morning, I watched the screencast on the home page and found out there was a very cool feature that will no doubt save me some time. I can use the CTRL key to select multiple words, and change them all at the same time. Imagine changing a variable name in just a small section of code. Just highlight each one using the CTRL key and start typing. I love it! It also supports snippets, which are nothing new, but are very cool anyway. E taglines itself as “The power of TextMate on Windows.” I’ve never used TextMate, so this is a new introduction for me, and I like it. It’s hard to impress me with a text editor because I am a huge vi fan. I used it for a long time on Unix, and in my current job, I use it all the time on various Linux servers. I carried that use over to Windows with gvim. It’s powerful, to be sure. So, for me to even discuss another text editor is a big deal. The trial version of E is time limited to 30 days and the purchase price is $34.95. When my trial is up, I’ll be purchasing this one for sure.
Posted in Tools & Utilities | Leave a Comment »
Multitenant SQL Server Architecture
Posted by Joe on May 6, 2009
We have a very large database where I work that is architected as a multitenant database. This is great since all we have to do is add a new customer record, and the rest takes care of itself. Because of the proprietary nature of our platform, I can’t put the table schemas up here for you to look at. However, I am looking for advice or techniques you may have used to solve a particular problem.
When customers import their data, imports go fairly slow. We give customers standard fields to import data into, but then they also have the option of importing custom fields. The table that holds custom fields allows one record per customer/user/field. Each record is tied to the user, and the user data is stored in another table. If a customer has 10 custom fields defined and they upload 50,000 users with all 10 field values, this is a total of 500,000 custom data records. The import process has to first see if the custom data exists. If so, it updates that record. If not, it inserts a new record. As you can imagine with this process, the more custom fields a customer has, the slower the import process becomes. Each custom field has to be tied to the user before it gets updated or inserted. The user may or may not exist, so we have to first insert or update the user, get the user id, and use that for each custom data record. That means no bulk loading because we first need the user id. Think of it as a master-detail relationship. The table that holds users is the master. The table that holds custom data is the detail.
I’m curious to know what you’ve done, or would try to do with a scenario like this to make it super fast.
Posted in SQL Server | Leave a Comment »
Poderosa – A Viable PuTTY Replacement
Posted by Joe on April 4, 2009
I’m a long-time PuTTY user, but one of the annoyances is that it does not save passwords. I understand the reasoning behind why, but the creators of PuTTY took the stance of never going to add that as a feature. I found a decent replacement that does have password saving capabilities, and that is Poderosa. Poderosa is an open-source, free SSH tool with tabs, split window panes, and yes, password saving capabilities. It’s written in C# and built on the .NET 2.0 platform. A lot of people don’t like that fact, but .NET is so standard on Windows nowadays that it’s really no big deal.
I searched for quite awhile for how to have the passwords saved. Nothing I tried worked, so having the source code was useful. I ran the system through my Visual Studio debugger and found out exactly how the passwords are read in from the XML-based shortcut file. There is a configuration setting inside Poderosa that is turned off by default. Click on the “Tools” menu, then “Detailed preferences editor…”. Find the setting named “org.poderosa.protocols.ReadSerializedPasswords” and change it to “true”. Then, in the shortcut file (these have the extension “.gts”) in the second element, next to the “account” attribute, create a new attribute named “passphrase” and add your password there. Here’s what it might look like.
<?xml version="1.0" encoding="Windows-1252"?> <poderosa-shortcut version="4.0"> <Poderosa.Terminal.TerminalSettings encoding="iso-8859-1" caption="Remove Server Name Goes Here" /> <Poderosa.Protocols.SSHLoginParameter destination="127.0.0.1" account="joe" passphrase="myTotallyUnsecurePassword" /> </poderosa-shortcut>
Obviously, you would have the destination equal the IP address of the remote server.
Now, before you go all nuts about clear text passwords, let me just say that I agree with you 100% that passwords in clear text are a bad, bad, bad idea. Since I have the source code, I will be working on a way to have passwords saved in a different, more secured fashion, but for the moment, this meets my needs. Perhaps it will meet your needs, too.
Posted in Tools & Utilities | Tagged: Tools | 1 Comment »
Autogrow stopped working again
Posted by Joe on April 4, 2009
Back in December, we had a client who ran a defrag while SQL Server was running. This caused the main database to run out of filegroups space in the ‘PRIMARY’ filegroup. Well, it happened again this week. This time, though, a defrag was not the culprit. We’re still trying to determine what causes this from time to time. Here’s the error in the event log:
MODIFY FILE encountered operating system error 1450(Insufficient system resources exist to complete the requested service.) while attempting to expand the physical file
The solution? Stop all SQL services. Make a physical copy of the database’s MDF file. Change the name of the original MDF file to something else. Rename the copied MDF file to the same name as the original MDF file. Restart SQL services.
Original research showed that this was probably a highly fragmented data file that caused this error, but I don’t know if that’s the case here. Making a copy definitely wrote the physical bits to another area of the disk. For this to happen twice in a three month period is highly suspicious. I’m thinking there’s a drive issue, but system checks didn’t show anything. The investigation continues . . .
Posted in SQL Server | Tagged: SQL Server | Leave a Comment »
Turn off SQL Server before defragmenting your hard drive
Posted by Joe on December 15, 2008
Had a fun time this morning with a client’s machine where they defragmented the hard drive on the server over the weekend. One would expect this to be pretty benign. An interesting side effect occurred that I can’t yet explain. The main database ran out of filegroups space in the ‘PRIMARY’ filegroup. The database was set to autogrow, but it wouldn’t autogrow. A manual grow yielded this message:
MODIFY FILE encountered operating system error 1450(Insufficient system resources exist to complete the requested service.) while attempting to expand the physical file
Most references to operating system error 1450 yielded results pertaining to a backup. That wasn’t the case here. After quite a bit of searching for information, I came across a blog by Imran Shaikh that basically said this can result from a highly fragmented data file. That was indeed the case with this data file. We turned off SQL Server, ran a defrag again, and turned SQL Server back on. The data file was once again autogrowing.
I don’t have a real thorough understanding of what happened. My suspicion is that while the original defrag occurred, it couldn’t defrag the database file because it was in use. That may have boxed in the data file so it couldn’t autogrow any more. It’s a bit strange if that’s the case because I would have expected the file to grow elsewhere on the disk, but it didn’t. So, lesson learned: if you’re going to defragment your server’s hard drive, turn off SQL Server.
Posted in SQL Server | Tagged: SQL Server | Leave a Comment »
Database Madness – Day 3
Posted by Joe on December 13, 2008
- SQL Server Profiler is your friend. Understanding what the numbers mean and how to use them can quickly show up most problems.
- One high CPU utilizing query can have a cascading effect on the system. In this case, the query optimization engine decided that many of the indexes in these smaller tables were useless since queries were taking so long, and defaulted back to a clustered index scan on the primary key instead of using the index. Once the problem was resolved, the optimization engine started using the indexes again.
- In the future, one of my first checks will be disk I/O. We had a lot of disk thrashing and a large disk queue length.
Posted in SQL Server | Tagged: SQL Server | Leave a Comment »
Database Madness – Day 2
Posted by Joe on December 13, 2008
Posted in SQL Server | Tagged: SQL Server | Leave a Comment »
Database Madness – Day 1
Posted by Joe on December 13, 2008
Posted in SQL Server | Tagged: SQL Server | Leave a Comment »
