Hi

    Today we’ve released Squiggle 2.0 final.
    The only thing added after beta is a emoticon button in the chat window; rest are all bug fixes.

    In future versions following features are expected:
    1) Chat History/Log
    2) Auto update feature (Notify you whenever there is an update to squiggle)
    3) An option to send message to all contacts (Maybe a broadcast window)

    Today I was bored so I decided to write code to generate permutations with LINQ.
    According to the article at mathsisfun there are two types of permutations

    1) With repetitions

    2) Without repetitions

    The code for generating permutations with repetitions can be as follows

            static IEnumerable<string> Permutations(int n, params char[] chars)
            {
                if (n > 1)
                    return from a in chars
                           from b in Permutations(n-1, chars)
                           select a+b;
                else
                    return chars.Select(c=>c.ToString());
            }
    

    The code for generating permutations without repetitions can be as follows

            static IEnumerable<string> Permutations(int n, params char[] chars)
            {
                if (n > chars.Length)
                    throw new ArgumentException("chars can not be less than n", "chars");
    
                if (n > 1)
                    return from a in chars
                           from b in Permutations(n-1, chars.Where(c=>c!=a).ToArray())
                           select a+b;
                else
                    return chars.Select(c=>c.ToString());
            }
    

    Note the check on chars length and n in the second version. This is necessary because you cant generate permutations of length 10 without repetitions using only 4 chars.

    That permutation lock picture in the article reminds me of a object oriented hit counter I wrote (which is maybe inappropriately named ‘mechanical clock’).

    The code for hit counter is as follows

        class Clock<T>
        {
            Ring<T> firstRing;
            List<Ring<T>> rings = new List<Ring<T>>();
    
            public Clock(int length, params T[] digits)
            {
                if (digits.Length == 0)
                    throw new ArgumentException("You must provide one or more digits", "digits");
    
                IVisitable<T> left = new NullVisitable<T>();
                for (int i = 0; i < length; i++)
                {
                    var nums = new Digit<T>[digits.Length];
                    for (int j = 0; j < nums.Length; j++)
                        nums[j] = new Digit<T>(digits[j]);
                    var ring = new Ring<T>(nums);
                    ring.Left = left;
                    left = ring;
                    rings.Add(ring);
                }
                this.firstRing = rings.Last();
            }
    
            public IEnumerable<T> GetValue()
            {
                for (int i = 0; i < rings.Count; i++)
                    yield return rings[i].Value;
            }
    
            public void Tick()
            {
                firstRing.Visit();
            }
        }
    

    Every time a clock ticks or a hit occurs on a hit counter, the right most ring moves by one step.
    When the ring reaches its last digit, it turns the ring on its left by one step (just like a clock’s needle work).

        class Ring<T> : IVisitable<T>
        {
            IList<IVisitable<T>> digits;
            int currentNumber;
    
            public Ring(params IVisitable<T>[] digits)
            {
                this.digits = digits.ToList();
            }
    
            public T Value
            {
                get { return digits[currentNumber].Value; }
            }
    
            public IVisitable<T> Left
            {
                get { return digits[0].Left; }
                set { digits[0].Left = value; }
            }
    
            public void Visit()
            {
                currentNumber = (currentNumber + 1) % digits.Count;
                digits[currentNumber].Visit();
            }
        }
    

    Ring as seen on a hit counter/car mileage tracker/permutation lock, is a set of digits

        class Digit<T> : IVisitable<T>
        {
            public T Value { get; set; }
            public IVisitable<T> Left { get; set; }
    
            public Digit(T value)
            {
                Value = value;
                Left = new NullVisitable<T>();
            }
    
            public void Visit()
            {
                Left.Visit();
            }
        }
    

    IVisitable interface represents the behavior of being able to change a value, maybe it should have been named ITurnable that has Turn() instead of visit.
    Null Visitable class represents a static value

        class NullVisitable<T> : IVisitable<T>
        {
            public T Value { get; private set; }
            public IVisitable<T> Left { get; set; }
            public void Visit() { }
        }
    

    This is how you would use the clock

                   var clock = new Clock(5, 0, 1);
                    for (int i = 0; i < 5; i++)
                    {
                        Console.WriteLine(clock.GetValue().AsString());
                        clock.Tick();
                    }
    

    AsString is an extension method which is as follows

           public static string AsString(this IEnumerable<T> items)
            {
                string output = items.Aggregate(new StringBuilder(), (a, x) => a.Append(x)).ToString();
                return output;
            }
    

    The net effect of calling tick repeatedly on the clock is of generating permutations with repetitions. This can be modified to generate permutations without repetitions which is left as an exercise for you.

    We’ve just announced the beta release of Squiggle LAN messenger 2.0

    This new version includes group chat, emoticons and several bug fixes.

    http://squiggle.codeplex.com/releases/view/48760

    Try it out and send your valuable feed back at info [at] overroot [dot] com

    Squiggle Lan Messenger v1.6 has been released.

    Following are the new features:

    • Select font color, type for messages
    • Send buzz (nudge) in conversation
    • Menus for better usability in main and chat window
    • Save conversation in rtf or text format
    • Search contact list
    • Sort contact list
    • Better, stable and more reliable underlying communication framework
    • Machine name is shown in contact tooltip
    • Timestamp is shown against messages

    Grab your copy at http://squiggle.codeplex.com

    After release of v1.5 of Squiggle Lan messenger, we’re working on the following features

    • Better usability (Menu’s on main and chat window)
    • Specifying font size, color and name for messages
    • Search contact list
    • Sort contact list by status or name
    • See machine name in User Information tooltip in Contact List

    Features that we’ll also work on, but we haven’t decided the release for are as follows:

    • Group chat
    • Emoticons

    If you have any ideas or suggestions please feel free to post them on our codeplex page http://squiggle.codeplex.com

    Since the release of Squiggle 1.0, we’ve received plenty of feedback and feature requests. Newer version has one of the most demanding features “File Transfer”. Squiggle can now help you exchange documents with your colleagues.

    You can download the latest version of Squiggle from http://squiggle.codeplex.com/

    Overroot is pleased to announce the release of yet another product “Squiggle”. Squiggle is a free LAN messenger designed for instant messaging within small and medium offices. Squiggle, having a simple and intuitive user interface, is an easy to use LAN chat solution for your LAN or a private network. It is based on peer-to-peer technology and requires no dedicated server or an internet connection.

    You can download Squiggle from http://squiggle.codeplex.com/

    Following are the key features of Squiggle. 

    • Server-less LAN chat.
    • System tray notifications for online users.
    • Taskbar notification for new messages.
    • Set a display message.

    If you have any suggestions, comments or you’re willing to participate in this open source project, then please send us an email at info [at] overroot [dot] com

    SharePoint quite often performs slow because of the fact that every bit of information served by SharePoint is saved in a database including images, documents, list data, dynamic pages, e.t.c.

    There are different ways of improving performance some of which are mentioned on Chris O’Brien’s blog. We know that SharePoint is a ASP.NET application and there are many established techniques for improving performance of a ASP.NET website or any website in general, that can be applied to SharePoint as well.

    The ones I’m going to talk about are those which do not require any programming.

    • Minify and combine Javascript and CSS
      This reduces the no. of request a browser makes for retrieving and rendering a page. When we combine multiple javascript files and minify the final file, we’re effectively reducing ‘N’ no. of requests to one and the downloaded payload is also smaller in size. Add client side  caching to this and same client won’t even request the same set of javascript files on any subsequent pages.

      NCachePoint and Aptimize provide this in their SharePoint performance accelerator products.

    • CSS Sprites (Combine Images)
      Combine images into a single image and use CSS sprite technique to render different portions of that image on the page. This also helps in reducing the no. of trips a browser makes to the server. This technique can also take advantage of client side caching.

      NCachePoint and Aptimize provide this in their SharePoint performance accelerator products.

    • Session Caching
      Saving sessions in database allows you to share the session among multiple servers in your farm but the database becomes the bottle neck for the SharePoint farm. To get around this you can save your sessions in a distributed cache which can allow you to get rid of sticky routing and still not be dependent on a single machine to serve the sessions.

      NCachePoint allows you to cache your sessions in a distributed cache that comes free with it.

    • List Caching
      SharePoint makes heavy use of list data which is stored in database. Database is optimized to store relational data then why is the performance of lists not optimal?
      In SharePoint all  list data is stored in a single table called AllUserData. This table has a long list of columns  that can save every perceivable type of data in each column of a list entry.

      Since a user can  define any type of list with any no. of columns of any type, querying this table becomes difficult and hence quite inefficient.

      One way to get around this is to cache the output of lists and serve the cached output each time list is retrieved.

      NCachePoint provides the list caching feature.

    • ViewState Caching
      With so many web parts loaded on a single SharePoint page, we get many ASP.NET controls loaded at the same time all of which have to save some state that needs to be preserved across postbacks. Typically viewstate is saved in the page that is rendered to the browser and it goes back and forth between post backs (User clicks and interaction with the controls).

      You can use a 3rd party solution to cache view state in a distributed cache and
      prevent this payload from traveling between the server and client for effectively reducing the request size and quicker response time.

      NCachePoint provides viewstate caching for SharePoint

    • Externalize the BLOBs to RBS or EBS
      All documents that are uploaded in SharePoint, are saved in database as BLOBs. This makes your SharePoint database grow abnormally large and bloated. Sql Server is optimized for relational data not BLOB data and hence saving blobs in database has a severe performance hit. If you externalize the blobs to EBS (External BLOB storage) or RBS (Remote Blob
      Storage), you’ll not only see performance gain but also you can use a cheaper storage
      to save the BLOBs and hence save yourself from storage cost.

      EBS was an interface provided with WSS/MOSS 2007 where as RBS is an interface provided by Sql Server 2008. EBS is supported both in SharePoint 2007 and SharePoint 2010 where as RBS can only be used with SharePoint 2010 and Sql Server 2008.

      NCachePoint, AvePoint, StoragePoint all provide EBS and RBS for SharePoint for BLOB externalization.

    If you buy an off the shelf solution for increasing SharePoint performance you can
    save yourself from the cost of development and maintenance of any custom solution
    which could potentially be error prone if not done right.

    Alachisoft has recently released NCachePoint 2.0 (BETA) which has all the above mentioned features and is available at http://www.alachisoft.com/ncachepoint/index.html

    Their product sits in front of a distributed cache which saves all your content so the lookup of any resource is amazingly fast and helps a lot in improving performance of SharePoint farm. The good news is that they have a free edition called NCachePoint Express which can be used on WSS 2007 and SharePoint Foundation 2010 (WSS 2010).

    I’m glad to announce that what started as a side project, has now been adapted by Overroot i.e. Stack Overflow Client.

    Version 1.0 has been released which periodically checks the active questions list and shows you popup from system tray.

    Screen shot of StackOverflow desktop client

    StackOverflow notifier popup

    Your feedback will help us a great deal so if you want a feature or report a bug please do so on http://stackoverflowclient.codeplex.com

    There have been updates in the client since I last blogged about the SO client. Since the first version received some attention I thought there might be people who are just interested in downloading the client instead of building one so I quickly added some features, cleaned it up and upload the binaries on http://stackoverflowclient.codeplex.com

    In order to turn that sample into a working client I had to add another class called StackOverflowNotifier.

        class StackOverflowNotifier
        {
            event EventHandler LoggedIn;
            int PollInterval { get; set; }
            event EventHandler QuestionsReceived;
            event EventHandler RequestLogin;
            void Start();
            void Stop();
        }
    

    As you can see the class polls the stackoverflow active questions page periodically and downloads all the questions. The Start method, starts the timer that raises its ‘Tick’ event after regular intervals.
    It was important to use the System.Windows.Forms.Timer timer because it raises the tick events on the UI thread and you can not interact with the WebBrowser control from a non UI thread.

    The default polling interval is 2 minute as of now and when the questions are downloaded you are notified in system tray via a popup only if there are any questions received with ‘Interesting’ attribute set to true.
    Though the latest list of questions is updated in the list view so you can click on the tray icon to view the current list of questions.

    I found a very nice Tray notification control for WPF at http://www.hardcodet.net/projects/wpf-notifyicon which I used in the project. I used the FancyBaloon user control shipped in its samples and modified it so that it can be bound to a collection view so I can put the next/previous buttons and allow user to navigate through questions from the same popup instead of showing 10 different popups.

    The above mentioned minor re-factoring helped clean up the code in the MainWindow. I also fixed a couple of bugs and added a trace listener that shows popup on the tray if the client barfs on exception while parsing the html.

    Thats pretty much it. Go get your copy of the latest version and start answering some questions on SO