Thursday, February 23, 2006

I blogged before about a great text editor named pspad.  This editor is great for heavy lifting and it's full of features.  Those features come at a price and that price is start up time.  When I just want a quick no frills editor notepad is king.  However, I've come across metapad and it seems to be a great notepad replacement.

It's number one feature?  Hyperlinking in plain text files.  I have been using Outlook notes as a catchall note storage for sites, user names etc b/c of the hyperlinking that built into the Outlook notes.  Now I can put my links in a plain text file and enjoy hyperlinked freedom.  It also compares favorably to the popular Notepad2 but the hyperlinking feature makes metapad the king.

Don't forget to get the registry files so you can make it the default editor for html, reg, txt and the text viewer for Internet Explorer's view source command.

Thursday, February 23, 2006 9:20:36 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

I've decided to attempt a paperless revolution. 

I'm going to scan most of my paper doc's and store them on my pc and then shred the originals.  Of course I will keep the originals where necessary.  I then plan on archiving to CD or even DVD on a regular basis and storing a copy off site, maybe in my desk at work.

The Equipment:

HP Officejet 6210 All-in-One

This seems to be working ok but I still need to figure out how to scan multiple documents and then split the scan into multiple files.

The Files:

Searchable PDF's created with the OCR features of the HP 6210 and the HP Director software. 

The System:

Sort the files into folders as appropriate and use Google desktop to search for relevant information.  This is the big benefit.  I can search through all of the text of my documents with the power of Google.

Thursday, February 23, 2006 7:49:05 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

Here's how:

http://www.imilly.com/tools.htm#ole

Download and follow the included directions. 

One thing you may need to change is the location of the firefox executable in the InFirefox.htm and InFirefoxPage.htm files. 

Why would I do this?:

Until IE 7 comes out of beta, IE is missing the great developer features that firefox has.  So this is a nice shortcut to open pages in firefox and use the web developer tools.

Firefox already has an extension that let's you open a file in IE and I use this extension instead of this hack.

 |  | 
Thursday, February 23, 2006 11:23:14 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Thursday, February 16, 2006

Here's another area where the documentation that comes with Visual Studio 2005 and the suff online as MSDN make a simple topic complicated.

To add a connection string to the App.Config:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

   <connectionStrings>

      <add name="aConnectionString"

      connectionString="Data Source=localhost;Initial Catalog=Northwind;Integrated Security=True"

      providerName="System.Data.SqlClient"/>

   </connectionStrings>

</configuration>

 

To retrieve it in your program:

 

1. Add a reference to System.Configuration (no this is not automagically included).

 

2. Add a using statement:

   

   using System.Configuration;

   

   Optionally add another using statement for the sqlclient:

 

   using System.Data.SqlClient;

 

3. Use this code to grab the connection string:

 

   string cnString = ConfigurationManager.ConnectionStrings["aConnectionString"].ConnectionString;
   SqlConnection cn = new SqlConnection(cnString);

Note:  You can also add the connection string information to the connectionStrings section of the machine.config.  This is handy if you have a machine that runs many automated script type programs.

Thursday, February 16, 2006 2:31:44 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Wednesday, February 15, 2006

I came across this page with some useful code samples:

http://www.personalmicrocosms.com/html/dotnettips.html

I used the XML pretty printing one today.  Of course most of the material is stuff you can figure out rather quickly but I would rather work on solving other problems.

Wednesday, February 15, 2006 11:05:22 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Tuesday, February 14, 2006

This seems to be an under documented feature of ASP.NET 2.0.

You can easily embed resources (text files, images, etc) in you assemblies.  This is very handy for server control deployment.  However the documentation for this is somewhat lacking.

Here goes:

At the top of your class add an attribute to allow an embedded attribute:

[assembly: WebResource("MyProject.ResourcesFolder.JavascriptFolder.AutoCompleteTextBox2.js", "text/javascript")]

(This can also go in the AssemblyInfo.cs)

One big gotcha here is the fact that the first argument is the default namespace + folder location + the actual name of the file to embed.

So if my default namespace is "MyProject" and the file is located in /Resources/Javascript and named AutoCompleteTextBox2.js then the resource will be embedded correctly. 

Then to make sure that the javascript link is embedded in the page:

protected override void OnPreRender(EventArgs e)
{
    this.Page.ClientScript.RegisterClientScriptResource(

       typeof(MyType), 

       "MyProject.ResourcesFolder.JavascriptFolder.AutoCompleteTextBox2.js");

    base.OnPreRender(e);
}

You need to place this in the PreRender event handler for the code to be placed correctly in the page.

Finally, make sure your resource is compiled into your assembly.  By Changing the build action on EACH resource that you want to include.  Check out the image below.  the date_control.js file is now an embedded resource and can be accessed using the methods listed above.


Tuesday, February 14, 2006 3:42:04 PM (Central Standard Time, UTC-06:00)  #    Comments [0]