Updated Text Clips for Programmers Notepad 2 (C#). ASP.NET Snippets and Miscellaneous Snippets (properties) added.
Tags: Web Developer Blog, PN2
<code>
void csharp {}
<?php echo ?>
SELECT code FROM SQL
<asp:net runat="server" />
function javascript() {}
$(jquery)
</code>
<tools>
<freeware /><opensource />
</tools>
Updated Text Clips for Programmers Notepad 2 (C#). ASP.NET Snippets and Miscellaneous Snippets (properties) added.
Tags: Web Developer Blog, PN2
Programmers Notepad 2 has a very useful tools feature. The configuration is kept in the %APPDATA%\Echo Software\PN2 folder as UserTools.xml
The format is fairly simple. Here is my UserTools.xml file:
<schemetools>
<global>
<tool command="C:\Program Files\Scintilla Text Editor\SciTE.exe" flags="40" folder="" index="0" name="SciTE" params=""%d%f"" parsepattern="" shortcut="0"></tool>
<tool command="C:\Program Files\FileZilla\FileZilla.exe" flags="40" folder="%d" index="1" name="FileZilla" params="" parsepattern="" shortcut="0"></tool>
<tool command="explorer.exe" flags="40" folder="" index="2" name="Windows Explorer" params="%d" parsepattern="" shortcut="0"></tool>
<tool command="cmd" flags="40" folder="" index="3" name="Command Prompt" params="/k cd %d" parsepattern="" shortcut="0"></tool>
<tool command="mmc" flags="40" folder="" index="4" name="IIS" params="C:\WINNT\System32\Inetsrv\iis.msc" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="33" folder="%d" index="5" name="svn add" params="add "%f"" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="33" folder="%d" index="6" name="svn add (all in folder)" params="add *" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="97" folder="%d" index="7" name="svn commit" params="commit "%f" --message "%?"" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="33" folder="%d" index="8" name="svn commit (folder)" params="commit --message "%?"" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="33" folder="%d" index="9" name="svn commit (folder, non-recursive)" params="commit --non-recursive --message "%?"" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="33" folder="%d" index="10" name="svn diff" params="diff "%f"" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="33" folder="%d" index="11" name="svn info" params="info "%f"" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="33" folder="%d" index="12" name="svn status" params="status "%f"" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="33" folder="%d" index="13" name="svn status (folder)" params="status" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="33" folder="%d" index="14" name="svn status (folder, non-recursive)" params="status --non-recursive" parsepattern="" shortcut="0"></tool>
<tool command="svn" flags="35" folder="%d" index="15" name="svn update" params="update "%f"" parsepattern="" shortcut="0"></tool>
</global>
<scheme name="csharp">
<tool command="C:\Program Files\SharpDevelop\bin\SharpDevelop.exe" flags="41" folder="" index="0" name="SharpDevelop" params=""%d%f"" parsepattern="" shortcut="0"></tool>
</scheme>
<scheme name="web">
<tool command="tidy" flags="1569" folder="" index="0" name="Tidy" params="-i -asxhtml -wrap 230 --indent-spaces 4 -q" parsepattern="" shortcut="0"></tool>
</scheme>
<scheme name="xml">
<tool command="tidy" flags="1569" folder="" index="0" name="Tidy" params="-i -xml -wrap 230 --indent-spaces 4 -q" parsepattern="" shortcut="0"></tool>
</scheme>
</schemetools>
As you can see, the root tag is '<schemetools>'. There is one '<global>' tag under this with tools common to all files. There are also several '<scheme>' tags with tools for each scheme.
Under '<global>' and '<scheme>' you can have '<tool>', with the following attributes:
You cannot use a modifier on its own. You can combine modifiers with numbers, letters or function keys. You can have only one number, letter, or function key in a shortcut (so no F1 + A).
For example, CTRL + ALT + Numpad * = 512 + 1024 + 106 = 1642
The Opera browser is now available without banner ads. Has fairly good standards support and is a very small download, also very fast at loading and displaying web pages. Now if only it had an extensions mechanism like Firefox. A three way battle between Firefox, IE and Opera (which was only really two way before as Opera had ads).
Tags: Web Developer Blog, Opera
Edit (30 Sep 2005): ASP.NET Snippets and Miscellaneous Snippets (properties) added.
More Text Clips for Programmers Notepad 2. Useful for when working with C#.
Create a file in the clips sub directory of the Programmers Notepad directory, with the extension .clips (i.e. csclips.clips) and paste in the following code:
<?xml version="1.0"?>
<clips name="C# Clips">
<clip name="------ Exception handling ------"></clip>
<clip name="throw"><![CDATA[throw(new |Exception());]]></clip>
<clip name="try-catch"><![CDATA[try
{
|
}
catch(Exception e)
{
}]]></clip>
<clip name="try-finally"><![CDATA[try
{
|
}
finally
{
}]]></clip>
<clip name="try-catch-finally"><![CDATA[try
{
|
}
catch(Exception e)
{
}
finally
{
}]]></clip>
<clip name="------ Iteration ------"></clip>
<clip name="do"><![CDATA[do
{
}
while(|);]]></clip>
<clip name="for"><![CDATA[for (int i = 0; i <= |; i++)
{
}]]></clip>
<clip name="foreach"><![CDATA[foreach (int i in |)
{
}]]></clip>
<clip name="while"><![CDATA[while(|)
{
}]]></clip>
<clip name="------ Reference type declaration ------"></clip>
<clip name="class"><![CDATA[public class |
{
}]]></clip>
<clip name="delegate"><![CDATA[delegate void |();]]></clip>
<clip name="delegate (event handling)"><![CDATA[public delegate void |ChangedEventHandler();
public event ChangedEventHandler Changed;
protected virtual void OnChanged()
{
if (Changed != null)
{
Changed();
}
}]]></clip>
<clip name="interface"><![CDATA[public interface I|
{
}]]></clip>
<clip name="------ Selection ------"></clip>
<clip name="?:"><![CDATA[| = (bar == baz) ? footrue : foofalse]]></clip>
<clip name="if"><![CDATA[if(|)
{
}]]></clip>
<clip name="if-else"><![CDATA[if(|)
{
}
else
{
}]]></clip>
<clip name="if-else if"><![CDATA[if(|)
{
}
else if()
{
}]]></clip>
<clip name="switch case"><![CDATA[switch(|)
{
case 1:
break;
default:
break;
}]]></clip>
<clip name="------ Documentation Comments ------"></clip>
<clip name="/// "><![CDATA[///|]]></clip>
<clip name="<c> (inline code)"><![CDATA[<c>|</c>]]></clip>
<clip name="<code> (multiline code)"><![CDATA[/// <code>
/// |
/// </code>]]></clip>
<clip name="<example> (method example)"><![CDATA[/// <example>
/// |
/// </example>]]></clip>
<clip name="<example> (method example, includes <code>)"><![CDATA[/// <example>
/// <code>
/// |
/// </code>
/// </example>]]></clip>
<clip name="<exception>"><![CDATA[/// <exception cref="System.Exception">Thrown when... |.</exception>]]></clip>
<clip name="<include>"><![CDATA[//// <include file='|.xml' path='MyDocs/MyMembers[@name="test"]/*' />]]></clip>
<clip name="<list> (bullet, with items)"><![CDATA[/// <list type="bullet">
/// <listheader>
/// <term>List Header</term>
/// <description>|.</description>
/// </listheader>
/// <item>
/// <term>Term 1</term>
/// <description>Item 1.</description>
/// </item>
/// <item>
/// <term>Term 2</term>
/// <description>Item 2.</description>
/// </item>
/// </list>]]></clip>
<clip name="<list> (number, with items)"><![CDATA[/// <list type="number">
/// <listheader>
/// <term>List Header</term>
/// <description>|.</description>
/// </listheader>
/// <item>
/// <term>Term 1</term>
/// <description>Item 1.</description>
/// </item>
/// <item>
/// <term>Term 2</term>
/// <description>Item 2.</description>
/// </item>
/// </list>]]></clip>
<clip name="<list> (table, with items)"><![CDATA[/// <list type="table">
/// <listheader>
/// <term>List Header</term>
/// <description>|.</description>
/// </listheader>
/// <item>
/// <term>Term 1</term>
/// <description>Item 1.</description>
/// </item>
/// <item>
/// <term>Term 2</term>
/// <description>Item 2.</description>
/// </item>
/// </list>]]></clip>
<clip name="<list> (bullet, without items)"><![CDATA[/// <list type="bullet">
/// |
/// </list>]]></clip>
<clip name="<list> (number, without items)"><![CDATA[/// <list type="number">
/// |
/// </list>]]></clip>
<clip name="<list> (table, without items)"><![CDATA[/// <list type="table">
/// |
/// </list>]]></clip>
<clip name="<list> - <item>"><![CDATA[/// <item>
/// <term>List Header</term>
/// <description>|.</description>
/// </item>]]></clip>
<clip name="<list> - <listheader>"><![CDATA[/// <listheader>
/// <term>List Header</term>
/// <description>|.</description>
/// </listheader>]]></clip>
<clip name="<para> (paragraph)"><![CDATA[/// <para>
/// |
/// </para>]]></clip>
<clip name="<param> (parameter)"><![CDATA[/// <param name='|'>Description.</param>]]></clip>
<clip name="<paramref> (parameter reference)"><![CDATA[<paramref name="|"/>]]></clip>
<clip name="<permission>"><![CDATA[/// <permission cref="System.Security.PermissionSet">|.</permission>]]></clip>
<clip name="<remarks>"><![CDATA[/// <remarks>
/// |
/// </remarks>]]></clip>
<clip name="<returns>"><![CDATA[/// <returns>
/// |
/// </returns>]]></clip>
<clip name="<see>"><![CDATA[<see cref="|"/>]]></clip>
<clip name="<seealso>"><![CDATA[<seealso cref="|"/>]]></clip>
<clip name="<summary>"><![CDATA[/// <summary>
/// |
/// </summary>]]></clip>
<clip name="<value>"><![CDATA[/// <value>|.</value>]]></clip>
<clip name="------ ASP.NET Snippets ------"></clip>
<clip name="Page CodeBehind"><![CDATA[using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace MyNamespace
{
public class MyPage : Page
{
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.LoadPage);
}
#endregion
private void LoadPage(object sender, EventArgs e)
{
|
}
}
}]]></clip>
<clip name="UserControl CodeBehind"><![CDATA[using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace MyNamespace
{
public class MyControl : UserControl
{
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.LoadUserControl);
}
#endregion
private void LoadUserControl(object sender, EventArgs e)
{
|
}
}
}]]></clip>
<clip name="WebHandler"><![CDATA[<%@ WebHandler Language="C#" Class="MyNamespace.MyHandler" %>
using System;
using System.IO;
using System.Web;
namespace MyNamespace
{
public class MyHandler: IHttpHandler
{
public bool IsReusable
{
get
{
return true;
}
}
public void ProcessRequest(HttpContext ctx)
{
ctx.Response.ContentType = "text/plain";
ctx.Response.Write("|");
ctx.Response.End();
}
}
}]]></clip>
<clip name="------ Miscellaneous Snippets ------"></clip>
<clip name="Property (bool)"><![CDATA[private bool |myBool;
public bool MyBool
{
get
{
return myBool;
}
set
{
myBool = value;
}
}]]></clip>
<clip name="Property (DateTime)"><![CDATA[private DateTime |myDate;
public DateTime MyDate
{
get
{
return myDate;
}
set
{
myDate = value;
}
}]]></clip>
<clip name="Property (decimal)"><![CDATA[private decimal |myDecimal;
public decimal MyDecimal
{
get
{
return myDecimal;
}
set
{
myDecimal = value;
}
}]]></clip>
<clip name="Property (double)"><![CDATA[private double |myDouble;
public double MyDouble
{
get
{
return myDouble;
}
set
{
myDouble = value;
}
}]]></clip>
<clip name="Property (float)"><![CDATA[private float |myFloat;
public float MyFloat
{
get
{
return myFloat;
}
set
{
myFloat = value;
}
}]]></clip>
<clip name="Property (int)"><![CDATA[private int |myInt;
public int MyInt
{
get
{
return myInt;
}
set
{
myInt = value;
}
}]]></clip>
<clip name="Property (long)"><![CDATA[private long |myLong;
public long MyLong
{
get
{
return myLong;
}
set
{
myLong = value;
}
}]]></clip>
<clip name="Property (short)"><![CDATA[private short |myShort;
public short MyShort
{
get
{
return myShort;
}
set
{
myShort = value;
}
}]]></clip>
<clip name="Property (string)"><![CDATA[private string |myString;
public string MyString
{
get
{
return myString;
}
set
{
myString = value;
}
}]]></clip>
</clips>
Tags: Notepad Alternative, Programmers Notepad, PN2, CSharp
Search weblogs with Google Blog Search. If a site has an RSS feed and 'pings' a site (like Weblogs.com) when it is updated, it should become searchable through this. In some ways better than Google Search as it is likely to be more up to date and have less spam. You can have your results as an Atom or RSS feed. No ads (yet).
Passing Tamper-Proof QueryString Parameters and Creating Expiring Web Pages cover how you can improve the security of your web application. While the example code is in VB.NET, the idea can be applied to any web programming language (PHP, Perl, VBScript etc). Basically you pass a hash (of the parameters plus a 'secret salt' (a custom string added to the start/finish)) only known to those that need to connect to the page (often just pages on the same website, but maybe used by other sites), along with the parameters and the current time and date.
Tags: Web Developer Blog, ASP.NET
7nights - Web Standards Are Your Responsibility. It may be a challenge to get an uncompliant site recoded to standards, but will save time in maintenance in the future (if you pages are semantically well done), plus the pages will work as expected (except perhaps a few CSS quirks) in any browser that is compliant with the standard. Standards can also be a selling point for an application - a bigger market can be targetted than if you coded just for the dominant browser (i.e. Internet Explorer). Plus there is no guarantee that your site will work in the future (if IE lost its dominant market share).
Tags: Web Developer Blog, Web Standards
Runasspc allows limited account users to run programs with admin rights. Better than runas as it saves the credentials encrypted in a file and you decide which programs can be run as admin, no need to give out the password.
Tags: Web Developer Blog, Runasspc
Standards-schmandards is a site about developing accessible web pages. Despite its name, standards are important to its authors. It is the home of FANGS, a screen reader emulator for Firefox.
Tags: Web Developer Blog, Web Standards
Looks like many pages will not be broken when the CSS in IE7 is improved. So by implemented hacks that use child selectors and the * html hack to work round IE, the * html will be ignored while the child selector processed (like what other browsers do).
"We've already started talking about a few of the CSS changes that are going to be available in IE 7 when we release, but there are a few hanging points that we haven't talked about yet or haven't covered completely. There are 3 specific items I'd like to talk about:Improving the CSS 2.1 strict parser for IE 7
- Using the root node wild card selector for IE only rules (* HTML) [strict mode only fix]
- Multi-class selectors as defined by CSS 2.1 (.floral.pastel) [strict mode only fix]
- Pseudo-element parsing sometimes flags rules as invalid (P:first-letter{ color: red; }) [strict/quirks mode fix]"
Tags: Web Developer Blog, CSS, IE7

This work is licenced under a Creative Commons Licence.