Archive for the 'Technology' Category

Searching for files in Visual Studio - Find was stopped in progress

This morning, when I tried to search for some files in Visual Studio using the ‘Find’ (Ctrl + F) dialog, I kept getting the following message for any kind of strings I searched on:

No files were found to look in. Find was stopped in progress.

Even searching for the string “a” returned the same message. Searching online I found out that a number of people had ran into this problem.

The solution: Press Ctrl + Scroll Lock (or Ctrl + Break) and retry your search.

I still haven’t found out how to regenerate the problem and why pressing Ctrl + Scroll Lock solved it in the first place.

Wordpress permalinks and password protected sub directories

Recently I changed the permalink structure on this blog. I updated the .htaccess file in the root directory with the following:

DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /index.php/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

After that change, suddenly all my password protected sub directories begin to return 404 errors. I tried playing around with different RewriteRules, RewriteCond to see if that would solve the problem, but nothing seemed to work.

Finally, I came across this post. It seems like Apache goes through the following stages when a password protected wordpress sub directory is requested:

  1. User requests www.exampleblog.com/subdir.
  2. subdir is password protected, so it sends back a 401 response to ask the user for a username/password.
  3. The .htaccess file sitting under the root directory processes the response. RewriteRules comes into play and rewrites the URL to www.exampleblog.com

How to resolve this problem?

  1. Create a dummy html file and put it under the root directory. The file doesn’t need to have any content. Let’s say the file is called onerror.html.
  2. Towards the top of the root directory’s .htaccess file, add this line:

    ErrorDocument 401 /onerror.html

Why does it work? Because once the subdir sends the 401 response, the ErrorDocument directive tells apache to serve the onerrror.html file to the client. The client however won’t display the file because it sees the 401 response in the header and asks the user for the username/password.

Plasma vs LCD - Quick comparison

Looking for a quick rundown on how Plasma and LCD televisions compare against each other? Here you go:

[TABLE=2]

Overall, in features that really matter (black levels, viewing angles, color, cost) Plasma seems to have an advantage over LCD, for now at least.

Source

Generating DataSet from an XML Schema in Visual Studio 2005

Microsoft loves keeping people on their toes. In Visual Studio 2003, you could generate a DataSet from an XML Schema by just right clicking on the file and clicking Generate DataSet. In Visual Studio 2005, that option is no longer there. Now, in order to generate the DataSet, a user would:

  1. Bring up the properties window for the schema by right clicking on the schema (xsd) file and clicking Properties (or select the file and hit F4)
  2. In the Custom Tools property add MSDataSetGenerator
  3. XSD Properties

  4. Right click on the schema file and click Run Custom Tool
  5. Run custom tool

  6. The new DataSet will be added to the toolbox