.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Pattern Finding - Newbie Quesion

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :

Hi, I have only just started on the subject of Data Mining and I am not familiar with how and what it can do yet, but one thing I do know is im stuggling to work out how to do one particular task.

I have a 64k line dataset, no unique data, its something like:

Person, Transaction, Date (YYYYMM)
Ashley, DB02, 200912
Ashley, ST22, 200911
David, ST22, 200911
Ashley, SM12, 200912
Steve, SM14, 200911
Steve, DB02, 200911
David, DB02, 200912
David, SE38, 200911
Steve, ST22, 200912

I am interested in finding patterns which would link people via the Transactions they perform. For  example:

If Ashley, David and Steve always run DB02 and ST22 they would be grouped as a pattern, even if they also run other Transactions which are different from one another I would expect to find this pattern of similarity.

Thanks in advance for any assistance,


View Complete Post

More Related Resource Links

Difficult REGEX pattern match [For newbie]


I was hoping someone with far more experience with regular expressions, particularly in .NET, could help me come up with a pattern. I have a program that will be reading in sql files and creating a deployment manifest based on the files. I need to match the file names to first, validate that they match a predetermined pattern. Then, extract certain parts of the file name for metadata in the manifest. The file nameing pattern is like the following:


So, for example, I may have a file named MyProj_sp_GetCustomers_By_ID_2.sql. I need to first do a match on the name to verify that it ends in a number between 1 and 9999. I will then have to assume that the file was named properly (this is a new naming sceme and numbers were not allowed in the proc names previously). the next step will be to extract the Project, ProcName, and Version to properties.

All-in-all this seems relatively simple. However, my sticking point is the proc name. It can be any length and contain 0 or any number of underscores. How do I create a regex that essentially "says" the following:

 - Project name is everything up to the firt underscore.
 - Version is a numeric value between 1 - 9999 that comes after the last underscore and before the file extension.
 - The procedure is everything in-betwe

Matching C# methods with a pattern finding the Public, Private, etc modifiers and balancing the curl


Hello all,

For a large conversion project, we need to match certain key words within C# methods and remove the entire method if found. I know .Net has a feature that allows balanced matching on the curly braces, but I am not sure how to implement it.

In a two step process, you could match the modifiers Public, Private, etc and their balanced curly braces to identify the methods and then remove those that contained the key words. In a one step process, I think you could use a positive lookahead for the key words as well.

Could someone help me with the pattern that has the balanced curly brace logic with the modifiers to identify the methods? Thanks in advance for any ideas and/or suggestions.


Have a great day!

Dialogs and ViewModel - Using Tasks as a Pattern

The ViewModel/MVVM pattern continues to gain popularity, with a blog post showing up every so often, and with tweets and retweets popping up even more often :-). At the same time, there are some interesting topics beyond the core pattern that continue to fuel experimentation. A big one amongst those is how should applications use dialogs when using the view model pattern.

The crux of the problem is the desire to keep the view model independent of UI concerns, and ensure it can be tested in a standalone manner, but that often comes to odds when you want the view model to launch a dialog, and/or do some work after the dialog is closed.

Prototype Design Pattern in C#. Vb.NET

Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype

Adapter Design Pattern in C#, VB.NET

Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.

Singleton Design Pattern in C#, Vb.NET

Ensure a class has only one instance and provide a global point of access to it.

The Decorator Pattern & Extension Methods

The decorator pattern provides a formal way to add new functionality to an existing type, without sub-classing. First question: What is wrong with classical inheritance? In and of itself, nothing is wrong with the good old Is-A relationship. It is very common to derive a new class from an existing base class in order to override a few virtual members, and add a pinch of new functionality.

Implementing Continuous Scrolling UI Pattern in ASP.NET

When you have numerous records to show, we have to resort to Paging. There is a better alternative to display voluminous data (especially read only data) while providing a better user experience & also making efficient use of server bandwidth - the Continuous Scrolling or Infinite Scrolling UI Pattern. Read on to know more about how to implement Continuous Scrolling UI Pattern in ASP.NET with a GridView.

Factory Pattern in asp.net

The job of the Factory design pattern is to create concrete sub classes. You can see the Factory design pattern used throughout the .NET Framework.

The essence of the Factory Pattern is to "Define an interface for creating an object, but let the subclasses decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses." Factory methods encapsulate the creation of objects. This can be useful if the creation process is very complex, for example if it depends on settings in configuration files or on user input.

Singleton Design Pattern in Asp.net using C#

When we want to make a only one instance of a class and also making sure that there is a global access point to that object then the design pattern we user is called Singleton. The pattern ensures that the class is instantiated only once and that all requests are directed to that one and only object.

The Factory Design Pattern

Software architects generally think in terms of high-level abstractions rather than low-level programming details. Representing a system in terms of high-level abstractions promotes understanding of the system and reduces its perceived complexity. One such set of abstractions is software design patterns. They have been successfully applied in the past to simplify and solve recurring problems in software design.

Abstract Factory Design Pattern (Sample in C# and VB .NET)

An abstract factory provides an interface for creating families of related objects without specifying their concrete classes. Sometimes one wants to construct an instance of one of a suite of classes, deciding between the classes at the time of instantiation. In order to avoid duplicating the decision making everywhere an instance is created, we need a mechanism for creating instances of related classes without necessarily knowing which will be instantiated.

Prototype Pattern-Creational Patterns in C#

The Prototype Pattern approaches the creation of the objects that our client will use by cloning instances from prototypes as required. This achieves the general aim of decoupling the client from the objects that it will use, but also adds some advantages unique to the Prototype pattern.

Abstract Factory Pattern-Creational Patterns

The Factory pattern allowed us to decouple our client from an object which it uses. The Abstract Factory pattern extends this idea to manage separate families of objects.

A runtime selection, or configuration option, in our client could decide which family of objects is to be used. The Abstract Factory pattern allows us to write generic code to instantiate and use the family objects regardless of which family is chosen at runtime. The pattern also helps us enforce a rule where objects from just the chosen family are used uniformly by the client.

Singleton Pattern-Creational Patterns

The Singleton pattern is a specialist creational pattern as it's primary focus is to facilitate a single shared instance of our object rather than to decouple our client from the object's implementation as with the other creational patterns.

The Decorator Pattern & Extension Methods

Numerous design patterns exist in the software world today, and ultimately nothing is preventing you from making your own (if people buy into it or not is another question). Furthermore, there is no 'master list' of patterns that all developers agree upon. While this is true, if you pick up any book on the subject, you will find a set of very common patterns most programmers agree are very useful. Many of these patterns were first formalized in the seminal book on the subject, Design Patterns: Elements of Reusable Object-Oriented Software (aka, the Gang of Four [GOF] book; not to be confused with the UK punk band of the same name).

Design Patterns - Using the State Pattern in C#

What is the State Pattern?

The State Pattern is a behavioral pattern that can be used to alter the behavior of an object at run time. As the state of an object changes, the functionality of the object can change drastically. This change of behavior is hidden from the Client and the Client interfaces with a wrapper object known as the Context. The State Pattern is a dynamic version of the Strategy Pattern.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend