Ian Beckett

RSS feed

    Recent comments

    Authors

    Outlook Social Networking Plugin

    EDIT: With Office 2010, almost all of the best Xobni features have been integrated with Outlook!!!

    http://www.xobni.com/

    This is a cool plugin for Outlook that I heard about from friend at work. It's not new, but it's new to me :)

    Word of warning: it doesn't really work with Office 2010 (yet)...

    Xobni demo video
    A tour of Xobni, a social networking and search plugin for Microsoft Outlook

     


    Posted by ibeckett on Tuesday, July 28, 2009 2:46 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    RegEx Text Scrape C# Function

    I wrote the following code to make RegExing easier in C#.  The function takes two parameters, Text and Pattern.  Text is a string target that you want to scrape, and Pattern is the RegEx expression to match.

    The actual code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Collections;
    using System.Text.RegularExpressions;

    namespace Scraper
    {
        static class ScrapeText
        {
            static public ArrayList Scrape(string Pattern, string Text)
            {
                ArrayList MatchedValues = new ArrayList();
                Regex r;
                Match m;
                r = new Regex(Pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
              
                string foundVal;
                for (m = r.Match(Text); m.Success; m = m.NextMatch())
                {
                    foundVal = m.Groups[0].ToString();
                    MatchedValues.Add(foundVal);
                }

                return MatchedValues;
            }
        }
    }



    Using ScrapeText:

    ArrayList ScrapedList = ScrapeText .Scrape(@"(?s)<li>.*?</li>", "<ul><li>a</li><li>b</li><li>c</li></ul>");

    In this example, I pass "(?s)<li>.*?</li>" as the RegEx expression - this will match any string beginning with "<li>" and ending with "</li>" in the HTML text source.

    For the text to search, I pass a dummy HTML snippet: 
     <ul>
      <li>a</li>
      <li>b</li>
      <li>c</li>
     </ul>

    The output is an ArrayList containing a list item for each RegEx match.  In this example it would be an array list containing the values "a","b", and "c".  In this example it would be an array list containing the values "<li>a</li>","<li>b</li>", and "<li>c</li>".  Once I have this Array List I can scrub and transform the values however I want.   In this example I might strip out the HTML list elements to isolate the alphabetical values.


    Posted by ibeckett on Thursday, July 16, 2009 5:46 PM
    Permalink | Comments (1) | Post RSSRSS comment feed

    Return identity key value after insert into a MS SQL Server database

    When you want to immediately return the identity value (often the primary key) after doing an insert, add the below to your sproc:

    declare @newid int
    INSERT INTO ... VALUES (...)
    SELECT @newid = @@IDENTITY
    return @newid 


    Categories: SQL 2005 | SQL 2008 | T-SQL
    Posted by ibeckett on Tuesday, July 14, 2009 5:21 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    how to differentiate between SATA and PATA drives

    Just look at the connectors to differentiate between SATA and PATA


    Categories: hardware
    Posted by ibeckett on Saturday, July 11, 2009 5:19 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    System Requirements for Windows Server 2008

    Windows Server 2008 System Requirements

    To use Windows Server 2008 you need:

    Processor
    • Minimum: 1GHz (x86 processor) or 1.4GHz (x64 processor)
    • Recommended: 2GHz or faster
    Note: An Intel Itanium 2 processor is required for Windows Server 2008 for Itanium-Based Systems

    Memory
    • Minimum: 512MB RAM
    • Recommended: 2GB RAM or greater
    • Maximum (32-bit systems): 4GB (Standard) or 64GB (Enterprise and Datacenter)
    • Maximum (64-bit systems): 32GB (Standard) or 2TB (Enterprise, Datacenter and Itanium-Based Systems)

    Available Disk Space
    • Minimum: 10GB
    • Recommended: 40GB or greater
    Note: Computers with more than 16GB of RAM will require more disk space for paging, hibernation, and dump files

    Drive
    DVD-ROM drive

    Display and Peripherals
    • Super VGA (800 x 600) or higher-resolution monitor
    • Keyboard
    • Microsoft Mouse or compatible pointing device

    source: msdn.microsoft.com


    Posted by ibeckett on Friday, July 10, 2009 3:52 PM
    Permalink | Comments (0) | Post RSSRSS comment feed