mhinze.com archive

this is an archive of the old blog, ended 6/16/08




    Archive for April, 2007

    web annotation: vast quantities of spam vectors

    Friday, April 13th, 2007

    apologies in advance for a cryptic [edi/tu]torial.

    web page annotation allows users to comment on web resources.  it stores the comment on some other server.  it's like user generated meta data. other people access the comments from a browser extension or greasemonkey script. 

    this is a growing trend.

    i saw a neat intro screencast for shiftspace.

    then scrolled down to see "recent shifts" on the shiftspace homepage:

    no surprise or anything.

    it's just that "nobody goes there anymore because it's too crowded"

    technology, people, money, automated attention theft … repeat.

    (spam is one thing but corporate espionage is wholly different)

    it's not even about marketing anymore. lies.

    web 2.0 is one massive spam vector.

    er, linkbuilding opportunity.

     

    related: delicious spam

    links for 2007-04-13

    Friday, April 13th, 2007

    links for 2007-04-12

    Thursday, April 12th, 2007

    sharepoint 2003: portal listings in code

    Thursday, April 12th, 2007

    seems simple enough huh?  well i am learning as i go on this 2003 object model stuff and couldn't find anything on this easily. so maybe this will help someone.

    code to get a portal listing, portal listings

    using Microsoft.SharePoint.Portal;
    using Microsoft.SharePoint.Portal.SiteData;
     

    Area area = AreaManager.GetArea(PortalContext.Current, new Guid(areaGuid));
    foreach (AreaListing listing in area.Listings)
    {
        // do stuff
    }
     
     
    Technorati tags: , ,

    links for 2007-04-11

    Wednesday, April 11th, 2007

    fortworthology

    Wednesday, April 11th, 2007

    if you live in Fort Worth, Texas (and I do) then you should read Fort Worthology

    Kevin keeps posting amazing images of new architecture and building plans

    like the new Fort Worth Museum of Science and History and the plans for a new Hemphill

    but he doesn't over-do it like most bloggers.  an unsolicited and enthusiastic recommendation.

    i first found Kevin when his images kept showing up in my Flickr feed for the "fort worth" tag. (another interesting feed, if you don't mind wading through some random images) and i was delighted to find him blogging.

     

    links for 2007-04-10

    Tuesday, April 10th, 2007

    links for 2007-04-09

    Monday, April 9th, 2007

    links for 2007-04-07

    Saturday, April 7th, 2007
    • Linking to a web page is very easy, both in simple HTML and in ASP.NET. Linking to a page that really exists, passing the right parameters, and parsing these parameters, is a bit different.

    sharepoint 2003 OM code to sort Link List items

    Friday, April 6th, 2007

    weekending in east texas

    and ive had just about enough of the internets and asp.net and sharepoint and seo and all that for a few days.

     

    so thank you for keeping up with me here and have a very happy Easter.  see you next week.

     

    by the way, i wrote a little class yesterday.  might be useful if you want to sort or order the SPListItems in a "Links" List in sharepoint 2003. 

    yes that's a float - a float not an int!  =)

     

        #region SPListItemOrderer : IComparer
        public class SPListItemOrderer : IComparer
        {
            public int Compare(object x, object y)
            {
                SPListItem sx;
                SPListItem sy;
    
                if (x is SPListItem)
                {
                    sx = x as SPListItem;
                }
                else throw new ArgumentException("Object is not of type SPListItem");
    
                if (y is SPListItem)
                {
                    sy = y as SPListItem;
                }
                else throw new ArgumentException("Object is not of type SPListItem");
    
                if (sx["Order"] != null || sy["Order"] != null)
                    return float.Parse(sx["Order"].ToString()).CompareTo(float.Parse(sy["Order"].ToString()));
                else throw new ArgumentException("SPListItem does not have an order field");
            }
        }
        #endregion

     

     

    gah, oh ok, ok.. here's the usage:

     

     
    // get an array from the collection so we can sort it
    ArrayList items = new ArrayList();
    foreach (SPListItem item in theList.Items)
    {
        items.Add(item);
    }
    SPListItem[] sortableItems = (SPListItem[]) items.ToArray(typeof(SPListItem));
    try
    {
        Array.Sort(sortableItems, new SPListItemOrderer());
    } catch { /* do not sort */ }

     

    just in case you want to do something like this ( by the way that inumerating the fields code was a pain!):

     
    foreach (SPListItem si in sortableItems)
    {
        try
        {
            // debugging stuff here
            //foreach (SPField f in si.Fields)
            //{
            //    try
            //    {
            //        strOut += string.Format("<!– {0} : {1} –>\n", f.Title, si[f.Title].ToString());
            //    }
            //    catch { }
            //}
    
            // the URL item has two fields, comma separated
            string itemurl = System.Web.HttpUtility.UrlPathEncode(si["URL"].ToString().Split(',')[0].Trim());
            string itemname = si["URL"].ToString().TrimStart(itemurl.ToCharArray()).TrimStart(',').Trim();
            strOut += string.Format("<tr><td><a href=\"{0}\">{1}</a></td></tr>\n", itemurl, itemname);
        }
        catch { /* do not create markup for this link */ }
    }

     

     

    Technorati tags: , ,
    © 2007 mhinze.com