VI global search and replace

29 06 2007

In case you need to search and replace text globally within vi, here’s the command to do so:

:1,$s/old/new

vi is a free software screen-oriented text editor computer program written by Bill Joy in 1976 for an early BSD release.

Peace!  \m/



Outlook 2007 IMAP auto purge option

28 06 2007

Just in case you encounter problems permanently deleting e-mails in Outlook 2007 on an IMAP server, make sure you have the Purge items when switching folders while online option checked (see screenshot below).

What happened was when I tried deleting e-mails, the e-mails would just have a strikethrough line, but would still be present in the inbox; the Purge Deleted Messages button/action (normally under the Edit menu), which should permanently delete the e-mails didn’t do anything.

So keep that in mind. =0)



Top 10 Development Mistakes

28 06 2007

I found this list in the Redmond Developer News newsletter, and believe it’s worth mentioning/posting here…because as we all know, there are far too many software development projects that end in abject failure (whether a simple internal app or a massive commercial system).

Here are the top 10 that made the list:

1.  Never committing to project success (that is, the target user

community needs to be on board with the application).

2.  Freezing the schedule and budget before the project is understood

well enough.

3.  Overscoping the solution.

4.  Circumventing the app dev organization altogether.

5.  Underestimating the complexity of the problem.

6.  Being stingy with subject-matter experts (SMEs).

7.  Choosing the wrong project leadership.

8.  Distrusting the managers to whom tasks have been delegated.

9.  Jumping into the “D” of “R&D” without enough “R.”

10.  Suppressing bad news.



Bind an XMLDataSource to a GridView control

27 06 2007

On one of my ASP.NET 2.0 projects, I had to use an XML file as the data source for a GridView control. The problem was that I had never used this method before. But after doing some research, I found it to be very similar (and straightforward) to binding to a database - with the exception of the need to use XPath.

So…without further adieu, here are the steps and code. Enjoy!

1. Create an XML file that contains your data, like below (taken from Microsoft’s website to save a lot of typing). Save it as books.xml.

<?xml version="1.0"?>
<catalog>
  <book id="bk101">
    <author>Gambardella, Matthew</author>
    <title>XML Developer's Guide</title>
    <genre>Computer</genre>
    <price>44.95</price>
    <publish_date>2000-10-01</publish_date>
    <description>
      An in-depth look at creating applications
      with XML.
    </description>
  </book>
  <book id="bk102">
    <author>Ralls, Kim</author>
    <title>Midnight Rain</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2000-12-16</publish_date>
    <description>
      A former architect battles corporate zombies,
      an evil sorceress, and her own childhood to become queen
      of the world.
    </description>
  </book>
</catalog>

2. Add a GridView control to your .aspx page and rename it to gdvBooks.
3. Drag an XmlDataSource control to your form, rename it xdsBooks, and assign your XML file (books.xml) in the control’s DataFile property.
4. Next, change to Source view and input the code below.

<asp:GridView ID="gdvServerVersions" runat="server"         
    AutoGenerateColumns="False" DataKeyNames="id"         
    DataSourceID="xdsServerVersions" EmptyDataText="No data available.">                
    <Columns>
        <asp:BoundField HeaderText="Book ID" DataField="id" 
            SortExpression="id" />
        <asp:TemplateField HeaderText="Author">
            <ItemTemplate>
                <%# XPath("author") %>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Title">
            <ItemTemplate>
                <%# XPath("title") %>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Genre">
            <ItemTemplate>
                <%# XPath("genre") %>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Price">
            <ItemTemplate>
                <%# XPath("price") %>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Publish Date">
            <ItemTemplate>
                <%# XPath("publish_date") %>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Description">
            <ItemTemplate>
                <%# XPath("description")%>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView> 

5. That’s it! Simply navigate to your newly created page and see the results.


				


A comprehensive router password database

22 06 2007

If you like (or are required) to help/assist people with their wireless router needs, you’ve probably had the need to reset and reconfigure them many, many times.  The problem, however, is that most of time time you don’t have the admin username and password to do so; you ask them if they have their user manual laying around somewhere, or just google it, right?

Well then…to make your life a lot easier, here’s a great site that you can take advantage of.

Take care!