I was reading a question today on StackOverFlow that was asking for advice on how to build a load-testing program for a website. At the end of the question is the following parenthetical remark (preempting the obvious answers pointing the questioner at any number of applications available for purchase that do exactly what they need):
We have a budget for programmer time but no budget for buying software, so it wouldn’t matter how money we’d save to buy a COTS product.
This strikes me as a pretty stupid corporate policy that in the end will result in the company spending more than they need to in order to reinvent the wheel. What is they would save 1,000 programmer hours by spending $1,000 on one piece of software. It is not too far fetched. In today’s programming world, the most capable development teams are those that know how and when to leverage expertise from outside of their immediate circle (and outside of the company payroll, when necessary). I realize that from an accounting perspective, one could claim that payroll is a fixed, budgeted cost, and since the developers have to be paid anyway, why shouldn’t they do everything in house? But every hour spent on developing something in-house that could be bought elsewhere for less money than the cost of the salaries being spent is another hour that the company could have used to use its employees for increasing its own revenues and profitability. Oh well, their loss.
I have been using and enjoying Google Chrome for the past couple of days. So as I am setting up my new computer, I am installing Chrome there as well. While doing this, I would like to bring over my saved browsing history and bookmarks so that I don’t have to build it from scratch on the new machine. The only problem is that while Chrome makes it very easy to import existing settings from Firefox, it does not display any visible option to export current settings.
After a bit of digging, I found the location where Chrome stored user data:
- On XP – C:\Documents and Settings\<User Name>\Local Settings\Application Data\Google\Chrome\User Data
- On Vista – C:\Users\<User Name>\AppData\Local\Google\Chrome\User Data
The User Data folder contains three files: Local State, Safe Browsing and Safe Browsing Filter, along with a folder called Default. Default in turn contains your browser cache, plugin data, and all of your cookies and history data. To move my profile over to my new computer, I copied all of the files and folders under User Data on my XP machine, and moved them into the User Data on my new Vista machine (all of the files were nearly 100mb after only four days of use, which will give you some kind of idea about the amount of indexing going on in the background). When I next started Chrome on my Vista machine, it was identical to the app on my XP machine, down to most popular sites, history and cookies. I even started writing this post on my XP machine, and then continued it on my Vista machine without having to log in again into my WordPress admin.
In the end this was pretty easy to do. Though the ease of profile transfer could in turn make it easy for someone to steal someone else’s identity – after all, the cookies file (presumably a sqllite db or something similar) was only 256KB, and merely dropping it in the new User Data allowed a complete transfer of identity (perhaps a good security feature would be to allow the \User Data\Default\Cookies file to work only on the originally installed instance).
I just downloaded Google Chrome and am going to try using it for some of my day-to-day web browsing over the next few days. Here are my initial reactions:
- Fast. Very fast, and small memory footprint.
- Each tab is a different process. This will make it very easy to any single tab that is using lots of memory, without having to close the browser (unlike in FF).
- Tab positioning over the address bar (as oppossed to underneath in FF) seems more natural.
- No header or footer bars. Do we really need to waste vertical screen space just to tell me the name of the program and reserve space for status messages? Nope. Here there is no header bar (functions like close/minimize are squeezed to the right side of the tab area), and status messages and urls in links appear in a temporary popup box fixed to the bottom left corner of the browser window, when necessary. Seems like a very good use of screen space.
- Address bar has the domain name of the site appear in regular type, with the rest of the url appearing in a lighter type. It highlights the domain, which very quickly highlights where you are.
- Real warnings for potentially problematic domains. In IE and FF, you just get a small red box in your address bar. In Chrome, when you go to a page that is potentially troublesome (example: loads resources from a domain associated with malware) you have to go through a confirmation screen before loading the site. Seems like a much better way of implementing this than the halfway solution in IE and FF that everyone will tend to ignore.
- In-page search is slick and improves on FF’s implementation. You now see all occurences of the search term highlighted on the page at once, while maintaining the ability to enumerate through the bunch.
- Non-existent bookmarking. I like my delicious add-on and bookmarks toolbar in Firefox as well as my different bookmarklets (Note in Google Reader, delicious, Seed Newsvine). It gives me easy access to the pages that I use frequently (I know that they are stored in the Chrome history, but often just clicking on my bookmark link is more efficient than going to remember the title or url, typing it into the address bar and sorting through the results to find the one that I want). I take it back. Ctrl-B attaches a bookmark bar to the bottom of the address bar.
- No page titles. Since there is no header bar, the page title is squeezed into the tab for that browser window, which in almost all cases is too small to see the page title.
- Clicking my mouse scroll bar doesn’t bring up the scroll pointer like it does in almost every other application.
- I like having the search box separated from the address bar like it is in FF.
- No FF add-ons. No Firebug, Greasemonkey, Adblock, FireFTP or IE Tab).
- No built-in support for RSS. I would at least have expected them to include an auto-subscribe to Google Reader.
This is what I can come up with after using Chrome for 3 hours. So I like it better than IE7 (haven’t tried 8 beta yet), though it does not beat out FF3 (yet).
I have a Windows Forms application that is ready for distribution. One of the last steps is getting code-signing working. We purchased a Code Signing certificate from Thawte. This resulted in a PVK (private key) and an SPC (certificate) file being delivered. Then the question arose of how to go about using them.
Referring to the documentation for SignTool.exe, there did not seem to be a way to sign the code using the PVK and SPC files via the command line. Though this was possible using the GUI program (accessible using the -signwizard command line option), in order to get this integrated with my build process, I needed a way to initiate the code signing fully from the command line.
The solution turned out to be the following:
1) Convert the PVK and SPC files to a PFX file (Personal Information Exchange file – this encapsulates the info found in the PVK and SPC files). This is done using the pvk2pfx.exe executable (which had been included as part of the .Net SDK, and was found in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin on my computer). I used the following syntax to do this (Pass1 is the original password for the PVK file, Pass2 is the new password for the pfx file. Ref):
pvk2pfx.exe -pvk mykey.pvk -pi Pass1 -spc mycert.spc -pfx newpfxfile.pfx -po Pass2 -f
After this ran, I now had a PFX file called newpfxfile.pfx ready to be used.
2) Use SignTool and the PFX file to sign my code. Now that I had a PFX file, I was able to sign my code (and timestamp it) using the following command line syntax:
signtool.exe sign /f newpfxfile.pfx /p Pass2 /d "AppDescription" /du "AppURL" /t http://timestamp.verisign.com/scripts/timstamp.dll LocationOfCode
Seems simple, but it took quite a lot of research to get this process right. Hopefully the info can help save someone else some time.
I have a Windows Forms app that has a very long and complicated initialization process. As the release is approaching, today was my day to try and shoft things around in the init, get it loading faster. So on recommendation from a few sources, I downloaded a profiler – Jet Brains dotTrace. Install and first profile went well. However, as I started to make more changes and run more profiles, I noticed that there were no improvements in initialization time. If anything, things were getting worse. Task Manager helped pinpoint the culprit:
If the numbers are too small, that is 1,241,596 KB. Yikes. Compare that with the second and third-place contestants, FireFox 3 at 174,584 KB, Visual Studio 2005 at 144,940 KB.
This is what happened after I closed the profiler (see if you can guess when that happened):
And I thought that Firefox 2 was using a lot of memory. I know that these programs are complicated, but I find it hard to comprehend how a program is supposed to help you track the memory usage of the applications that you are debugging when it ends up gobbling down over 1.2GB of RAM all by itself and making the computer basically unusable.
I was in need of an Ajax-style animated gif that could be used to indicate that something is going on in the background or loading. I have seen them on hundreds of sites, but I don’t feel comfortable just copying someone else’s image to use for myself.
After a bit of searching, I found this site: AjaxLoad.Info. This is a nice, simple site that generates 37 different “loading” animated gifs, allowing you to customize the style, foreground and background colors, and transparency. Definitely a good site to know about.